···11- Brief Notes on C-Media 8338/8738/8768/8770 Driver22- =================================================11+=================================================22+Brief Notes on C-Media 8338/8738/8768/8770 Driver33+=================================================3444- Takashi Iwai <tiwai@suse.de>55+Takashi Iwai <tiwai@suse.de>566778Front/Rear Multi-channel Playback···3130disabled. Otherwise no signal will be routed to the rear speakers.3231As default it's turned on.33323434-*** WARNING ***3535-When "Four Channel Mode" switch is off, the output from rear speakers3636-will be FULL VOLUME regardless of Master and PCM volumes.3737-This might damage your audio equipment. Please disconnect speakers3838-before your turn off this switch.3939-*** WARNING ***3333+.. WARNING::3434+ When "Four Channel Mode" switch is off, the output from rear speakers3535+ will be FULL VOLUME regardless of Master and PCM volumes [#]_.3636+ This might damage your audio equipment. Please disconnect speakers3737+ before your turn off this switch.40384141-[ Well.. I once got the output with correct volume (i.e. same with the3939+4040+.. [#]4141+ Well.. I once got the output with correct volume (i.e. same with the4242 front one) and was so excited. It was even with "Four Channel" bit4343 on and "double DAC" mode. Actually I could hear separate 4 channels4444 from front and rear speakers! But.. after reboot, all was gone.4545 It's a very pity that I didn't save the register dump at that4646- time.. Maybe there is an unknown register to achieve this... ]4646+ time.. Maybe there is an unknown register to achieve this...47474848If your card has an extra output jack for the rear output, the rear4949playback should be routed there as default. If not, there is a···75737674The 4.0 and 5.1 modes are defined as the pcm "surround40" and "surround51"7775in alsa-lib. For example, you can play a WAV file with 6 channels like7676+::78777978 % aplay -Dsurround51 sixchannels.wav80798180For programming the 4/6 channel playback, you need to specify the PCM8281channels as you like and set the format S16LE. For example, for playback8382with 4 channels,8383+::84848585 snd_pcm_hw_params_set_access(pcm, hw, SND_PCM_ACCESS_RW_INTERLEAVED);8686 // or mmap if you like···93899490There are some control switches affecting to the speaker connections:95919696-"Line-In Mode" - an enum control to change the behavior of line-in9292+Line-In Mode9393+ an enum control to change the behavior of line-in9794 jack. Either "Line-In", "Rear Output" or "Bass Output" can9895 be selected. The last item is available only with model 0399996 or newer. 10097 When "Rear Output" is chosen, the surround channels 3 and 410198 are output to line-in jack.102102-"Mic-In Mode" - an enum control to change the behavior of mic-in9999+Mic-In Mode100100+ an enum control to change the behavior of mic-in103101 jack. Either "Mic-In" or "Center/LFE Output" can be104102 selected. 105103 When "Center/LFE Output" is chosen, the center and bass···117111(hw:0,2). Usually this is assigned to the PCM device "spdif".118112The available rates are 44100 and 48000 Hz.119113For playback with aplay, you can run like below:114114+::120115121116 % aplay -Dhw:0,2 foo.wav122117123118or119119+120120+::124121125122 % aplay -Dspdif foo.wav126123···149140150141Additionally there are relevant control switches:151142152152-"IEC958 Mix Analog" - Mix analog PCM playback and FM-OPL/3 streams and143143+IEC958 Mix Analog144144+ Mix analog PCM playback and FM-OPL/3 streams and153145 output through SPDIF. This switch appears only on old chip154146 models (CM8738 033 and 037).147147+155148 Note: without this control you can output PCM to SPDIF.156149 This is "mixing" of streams, so e.g. it's not for AC3 output157150 (see the next section).158151159159-"IEC958 In Select" - Select SPDIF input, the internal CD-in (false)152152+IEC958 In Select153153+ Select SPDIF input, the internal CD-in (false)160154 and the external input (true).161155162162-"IEC958 Loop" - SPDIF input data is loop back into SPDIF156156+IEC958 Loop157157+ SPDIF input data is loop back into SPDIF163158 output (aka bypass)164159165165-"IEC958 Copyright" - Set the copyright bit.160160+IEC958 Copyright161161+ Set the copyright bit.166162167167-"IEC958 5V" - Select 0.5V (coax) or 5V (optical) interface.163163+IEC958 5V164164+ Select 0.5V (coax) or 5V (optical) interface.168165 On some cards this doesn't work and you need to change the169166 configuration with hardware dip-switch.170167171171-"IEC958 In Monitor" - SPDIF input is routed to DAC.168168+IEC958 In Monitor169169+ SPDIF input is routed to DAC.172170173173-"IEC958 In Phase Inverse" - Set SPDIF input format as inverse.171171+IEC958 In Phase Inverse172172+ Set SPDIF input format as inverse.174173 [FIXME: this doesn't work on all chips..]175174176176-"IEC958 In Valid" - Set input validity flag detection.175175+IEC958 In Valid176176+ Set input validity flag detection.177177178178Note: When "PCM Playback Switch" is on, you'll hear the digital output179179stream through analog line-out.···235217With CMI8738 and newer chips, the MIDI interface is enabled by default236218and the driver automatically chooses a port address.237219238238-There is _no_ hardware wavetable function on this chip (except for220220+There is *no* hardware wavetable function on this chip (except for239221OPL3 synth below).240222What's said as MIDI synth on Windows is a software synthesizer241223emulation. On Linux use TiMidity or other softsynth program for