⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmipci.txt

📁 优龙2410linux2.6.8内核源代码
💻 TXT
字号:
              Brief Notes on C-Media 8738/8338 Driver              =======================================                   Takashi Iwai <tiwai@suse.de>Front/Rear Multi-channel Playback---------------------------------CM8x38 chip can use ADC as the second DAC so that two different stereochannels can be used for front/rear playbacks.  Since there are twoDACs, both streams are handled independently unlike the 4/6ch multi-channel playbacks in the section below.As default, ALSA driver assigns the first PCM device (i.e. hw:0,0 forcard#0) for front and 4/6ch playbacks, while the second PCM device(hw:0,1) is assigned to the second DAC for rear playback.There are slight difference between two DACs.- The first DAC supports U8 and S16LE formats, while the second DAC  supports only S16LE.- The seconde DAC supports only two channel stereo.Please note that the CM8x38 DAC doesn't support continuous playbackrate but only fixed rates: 5512, 8000, 11025, 16000, 22050, 32000,44100 and 48000 Hz.The rear output can be heard only when "Four Channel Mode" switch isdisabled.  Otherwise no signal will be routed to the rear speakers.As default it's turned on.*** WARNING ***When "Four Channel Mode" switch is off, the output from rear speakerswill be FULL VOLUME regardless of Master and PCM volumes.This might damage your audio equipment.  Please disconnect speakersbefore your turn off this switch.*** WARNING ***[ Well.. I once got the output with correct volume (i.e. same with the  front one) and was so excited.  It was even with "Four Channel" bit  on and "double DAC" mode.  Actually I could hear separate 4 channels  from front and rear speakers!  But.. after reboot, all was gone.  It's a very pity that I didn't save the register dump at that  time..  Maybe there is an unknown register to achieve this... ]If your card has an extra output jack for the rear output, the rearplayback should be routed there as default.  If not, there is acontrol switch in the driver "Line-In As Rear", which you can changevia alsamixer or somewhat else.  When this switch is on, line-in jackis used as rear output.There are two more controls regarding to the rear output.The "Exchange DAC" switch is used to exchange front and rear playbackroutes, i.e. the 2nd DAC is output from front output.4/6 Multi-Channel Playback--------------------------The recent CM8738 chips support for the 4/6 multi-channel playbackfunction.  This is useful especially for AC3 decoding.When the multi-channel is supported, the driver name has a suffix"-MC" such like "CMI8738-MC6".  You can check this name from/proc/asound/cards.When the 4/6-ch output is enabled, the second DAC accepts up to 6 (or4) channels.  While the dual DAC supports two different rates orformats, the 4/6-ch playback supports only the same condition for allchannels.  Since the multi-channel playback mode uses both DACs, youcannot operate with full-duplex.The 4.0 and 5.1 modes are defined as the pcm "surround40" and "surround51"in alsa-lib.  For example, you can play a WAV file with 6 channels like	% aplay -Dsurround51 sixchannels.wavFor programmin the 4/6 channel playback, you need to specify the PCMchannels as you like and set the format S16LE.  For example, for playbackwith 4 channels,	snd_pcm_hw_params_set_access(pcm, hw, SND_PCM_ACCESS_RW_INTERLEAVED);	    // or mmap if you like	snd_pcm_hw_params_set_format(pcm, hw, SND_PCM_FORMAT_S16_LE);	snd_pcm_hw_params_set_channels(pcm, hw, 4);and use the interleaved 4 channel data.There are some control switchs affecting to the speaker connections:"Line-In As Rear"	- As mentioned above, the line-in jack is used	for the rear (3th and 4th channels) output."Line-In As Bass"	- The line-in jack is used for the bass (5th	and 6th channels) output."Mic As Center/LFE"	- The mic jack is used for the bass output.	If this switch is on, you cannot use a microphone as a capture	source, of course.Digital I/O-----------The CM8x38 provides the excellent SPDIF capability with very chipprice (yes, that's the reason I bought the card :)The SPDIF playback and capture are done via the third PCM device(hw:0,2).  Usually this is assigned to the PCM device "spdif".The available rates are 44100 and 48000 Hz.For playback with aplay, you can run like below:	% aplay -Dhw:0,2 foo.wavor	% aplay -Dspdif foo.wav24bit format is also supported experimentally.The playback and capture over SPDIF use normal DAC and ADC,respectively, so you cannot playback both analog and digital streamssimultaneously.To enable SPDIF output, you need to turn on "IEC958 Output Switch"control via mixer or alsactl.  Then you'll see the red light on fromthe card so you know that's working obviously :)The SPDIF input is always enabled, so you can hear SPDIF input datafrom line-out with "IEC958 In Monitor" switch at any time (seebelow).You can play via SPDIF even with the first device (hw:0,0),but SPDIF is enabled only when the proper format (S16LE), sample rate(441100 or 48000) and channels (2) are used.  Otherwise it's turnedoff.  (Also don't forget to turn on "IEC958 Output Switch", too.)Additionally there are relevant control switches:"IEC958 Mix Analog" - Mix analog PCM playback and FM-OPL/3 streams and	output through SPDIF.  This switch appears only on old chip	models (CM8738 033 and 037).	Note: without this control you can output PCM to SPDIF.	This is "mixing" of streams, so e.g. it's not for AC3 output	(see the next section)."IEC958 In Select"  - Select SPDIF input, the internal CD-in (false)	and the external input (true)."IEC958 Loop"       - SPDIF input data is loop back into SPDIF	output (aka bypass)"IEC958 Copyright"  - Set the copyright bit."IEC958 5V"         - Select 0.5V (coax) or 5V (optical) interface.	On some cards this doesn't work and you need to change the	configuration with hardware dip-switch."IEC958 In Monitor" - SPDIF input is routed to DAC."IEC958 In Phase Inverse" - Set SPDIF input format as inverse.	[FIXME: this doesn't work on all chips..]"IEC958 In Valid"   - Set input validity flag detection.Note: When "PCM Playback Switch" is on, you'll hear the digital outputstream through analog line-out.The AC3 (RAW DIGITAL) OUTPUT----------------------------The driver supports raw digital (typically AC3) i/o over SPDIF.  Thiscan be toggled via IEC958 playback control, but usually you need toaccess it via alsa-lib.  See alsa-lib documents for more details.On the raw digital mode, the "PCM Playback Switch" is automaticallyturned off so that non-audio data is heard from the analog line-out.Similarly the following switches are off: "IEC958 Mix Analog" and"IEC958 Loop".  The switches are resumed after closing the SPDIF PCMdevice automatically to the previous state.On the model 033, AC3 is implemented by the software conversion inthe alsa-lib.  If you need to bypass the software conversion of IEC958subframes, pass the "soft_ac3=0" module option.  This doesn't matteron the newer models.ANALOG MIXER INTERFACE----------------------The mixer interface on CM8x38 is similar to SB16.There are Master, PCM, Synth, CD, Line, Mic and PC Speaker playbackvolumes.  Synth, CD, Line and Mic have playback and capture switches,too, as well as SB16.In addition to the standard SB mixer, CM8x38 provides more functions.- PCM playback switch- PCM capture switch (to capture the data sent to DAC)- Mic Boost switch- Mic capture volume- Aux playback volume/switch and capture switch- 3D control switchMIDI CONTROLLER---------------The MPU401-UART interface is enabled as default only for the first(CMIPCI) card.  You need to set module option "midi_port" properlyfor the 2nd (CMIPCI) card.There is _no_ hardware wavetable function on this chip (except forOPL3 synth below).What's said as MIDI synth on Windows is a software synthesizeremulation.  On Linux use TiMidity or other softsynth program forplaying MIDI music.FM OPL/3 Synth--------------The FM OPL/3 is also enabled as default only for the first card.Set "fm_port" module option for more cards.The output quality of FM OPL/3 is, however, very weird.I don't know why..Joystick and Modem------------------The joystick and modem should be available by enabling the controlswitch "Joystick" and "Modem" respectively.  But I myself have nevertested them yet.Debugging Information---------------------The registers are shown in /proc/asound/cardX/cmipci.  If you have anyproblem (especially unexpected behavior of mixer), please attach theoutput of this proc file together with the bug report.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -