📄 sound-faq
字号:
bttv and sound mini howto=========================There are alot of different bt848/849/878/879 based boards available.Making video work often is not a big deal, because this is handledcompletely by the bt8xx chip, which is common on all boards. Butsound is handled in slightly different ways on each board.To handle the grabber boards correctly, there is a array tvcards[] inbttv-cards.c, which holds the informations required for each board.Sound will work only, if the correct entry is used (for video it oftenmakes no difference). The bttv driver prints a line to the kernellog, telling which card type is used. Like this one: bttv0: model: BT848(Hauppauge old) [autodetected]You should verify this is correct. If it isn't, you have to pass thecorrect board type as insmod argument, "insmod bttv card=2" forexample. The file CARDLIST has a list of valid arguments for card.If your card isn't listed there, you might check the source code fornew entries which are not listed yet. If there isn't one for yourcard, you can check if one of the existing entries does work for you(just trial and error...).Some boards have an extra processor for sound to do stereo decodingand other nice features. The msp34xx chips are used by Hauppauge forexample. If your board has one, you might have to load a helpermodule like msp3400.o to make sound work. If there isn't one for thechip used on your board: Bad luck. Start writing a new one. Well,you might want to check the video4linux mailing list archive first...Of course you need a correctly installed soundcard unless you have thespeakers connected directly to the grabber board. Hint: check themixer settings too. ALSA for example has everything muted by default.How sound works in detail=========================Still doesn't work? Looks like some driver hacking is required.Below is a do-it-yourself description for you.The bt8xx chips have 32 general purpose pins, and registers to controlthese pins. One register is the output enable register(BT848_GPIO_OUT_EN), it says which pins are actively driven by thebt848 chip. Another one is the data register (BT848_GPIO_DATA), whereyou can get/set the status if these pins. They can be used for inputand output.Most grabber board vendors use these pins to control an external chipwhich does the sound routing. But every board is a little different.These pins are also used by some companies to drive remote controlreceiver chips. Some boards use the i2c bus instead of the gpio pinsto connect the mux chip.As mentioned above, there is a array which holds the requiredinformations for each known board. You basically have to create a newline for your board. The important fields are these two:struct tvcard{ [ ... ] u32 gpiomask; u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */};gpiomask specifies which pins are used to control the audio mux chip.The corresponding bits in the output enable register(BT848_GPIO_OUT_EN) will be set as these pins must be driven by thebt848 chip.The audiomux[] array holds the data values for the different inputs(i.e. which pins must be high/low for tuner/mute/...). This will bewritten to the data register (BT848_GPIO_DATA) to switch the audiomux.What you have to do is figure out the correct values for gpiomask andthe audiomux array. If you have Windows and the drivers four yourcard installed, you might to check out if you can read these registersvalues used by the windows driver. A tool to do this is availablefrom ftp://telepresence.dmem.strath.ac.uk/pub/bt848/winutil, but itdoes'nt work with bt878 boards according to some reports I received.Another one with bt878 suport is available fromhttp://btwincap.sourceforge.net/Files/btspy2.00.zipYou might also dig around in the *.ini files of the Windows applications.You can have a look at the board to see which of the gpio pins areconnected at all and then start trial-and-error ...Starting with release 0.7.41 bttv has a number of insmod options tomake the gpio debugging easier:bttv_gpio=0/1 enable/disable gpio debug messagesgpiomask=n set the gpiomask valueaudiomux=i,j,... set the values of the audiomux arrayaudioall=a set the values of the audiomux array (one value for all array elements, useful to check out which effect the particular value has).The messages printed with bttv_gpio=1 look like this: bttv0: gpio: en=00000027, out=00000024 in=00ffffd8 [audio: off]en = output _en_able register (BT848_GPIO_OUT_EN)out = _out_put bits of the data register (BT848_GPIO_DATA), i.e. BT848_GPIO_DATA & BT848_GPIO_OUT_ENin = _in_put bits of the data register, i.e. BT848_GPIO_DATA & ~BT848_GPIO_OUT_ENOther elements of the tvcards array===================================If you are trying to make a new card work you might find it useful toknow what the other elements in the tvcards array are good for:video_inputs - # of video inputs the card hasaudio_inputs - historical cruft, not used any more.tuner - which input is the tunersvhs - which input is svhs (all others are labeled composite)muxsel - video mux, input->registervalue mappingpll - same as pll= insmod optiontuner_type - same as tuner= insmod option*_modulename - hint whenever some card needs this or that audio module loaded to work properly.has_radio - whenever this TV card has a radio tuner.no_msp34xx - "1" disables loading of msp3400.o moduleno_tda9875 - "1" disables loading of tda9875.o moduleneeds_tvaudio - set to "1" to load tvaudio.o moduleIf some config item is specified both from the tvcards array and asinsmod option, the insmod option takes precedence.Good luck, GerdPS: If you have a new working entry, mail it to me.--Gerd Knorr <kraxel@bytesex.org>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -