Btaudio (bt878)
The btaudio kernel module allows you to get the audio from your tuner card directly over the PCI bus without using a patch cable to your sound card. This is useful if you would like to reserve your sound card for other functions, if you want to have multiple tuner cards in one computer, or if your sound card does not handle full-duplex.
Instructions
- Gerd Knorr's instructions (copied from the 2.6.12-rc2 kernel and lightly updated)
- MythTV wiki: setting up btaudio on an ATI TV Wonder card
- Failed attempt at getting the sound directly off a LifeView FlyVideo3000 bttv card
- Note that saa7133 cards unproblematically let you get the audio directly
Supported cards
For btaudio to work, according to Robert Kulagowski on the MythTV HowTo, you need a bttv tuner device with an MSP34xx chip. The chip also needs to be connected to the board in a certain way to work. According to David Martin (see technical section below), the MSP34xx chip is not required, which would open up for a much larger number of cards to work. Petr Vandrovec describes a case where the analog mode of btaudio works on his AverMedia TVCapture98 card if it is initialized by a Win98 driver (see [|details]. He notes the card does not have an MSP34xx chip, so this cannot be a btaudio requirement.
These cards are known to work with btaudio:
* ATI TV Wonder * Hauppauge WinTV-radio with dbx-TV stereo, model 401 * Hauppauge WinTV-Theater, model 495, 498 (Europe) * Hauppauge WinTV Express, models 751, 753 (but see note)
Note: Hauppauge model labels are often uninformative. For example, the box labeled model 753 may contain one of these:
* board #44804 rev #D183, auto card=10; tuner TCL2002MB-3 (hidden sticker), but has to be forced to tuner=41 (Phillips PAL-MK(FI1216MK) * board #44804 rev #D108, auto card=10; tuner FI1215MK5 (hidden sticker), autodetected as tuner=5.
The following cards do not work:
* Pinnacle Studio PCTV Pro (this has an MSP34xx, but it's not wired correctly to the BT878 chip) * ATI TV Wonder VE * Leadtek Winfast 2000 XP (PAL, UK and NTSC) * I/O Magic PC-PVR (no MSP34xx chip) * Avermedia AverTV Stereo (no MSP34xx chip)
The following cards have been reported to work, but have issues:
* Avermedia AVerTV Studio (no digital DSP output, "whiney noise" on analog)
The list of supported and unsupported cards is still a work in progress; please edit this page if you have new information.
Technical background
The bt878 and bt879 (the latter no longer in production) include a high-frequency Analog to Digital Converter, supporting both 8 and 16 bits audio at 448000 samples per second.
- Fusion 878A datasheet from Conexant
Juan Domenech Fernandez has written up his experiments with the "low frequency ADC that comes with the Bt878A chip" in two parts; these articles provide valuable technical detail about the hardware driven by btaudio:
- Analog to Digital Converter with 16 bits and 448000 Samples per second based in the Bt878A
- btaudio.c module modification to get 896000 Samples per second with the Bt878A ADC
The analog device created by the btaudio driver has three channels, called Line1, Line2, and Line3. The sound comes through on Line2 (cf. Instructions section above). The 878/879 audio A/D has two inputs - STV and LINE. One of the line inputs is an internal mux switch between STV and LINE. The other is a switch for a single stage 6dB preamp boost for the audio signal. On the datasheet, the relevant pins are 94, 98, and 100, and you need to inspect your card to see how the card manufacturer has used these pins:
http://www.domenech.org/bt878a-adc/conexant-fusion-878a-pin-out-bt878a-adc.png<tbody> The ADC audio stage runs a 1.792MHz clock with valid hardware decimation values between 4 and 15 (controlled by bits 8-11 of local register 0x10C, the so-called DA_SDR register). Juan uses these commands to test the device: sox -w -r 448000 -t ossdsp /dev/dsp1 -t .wav test.wav The dmesg results indicates which decimation values are used to downsample, yielding this table of valid hardware rates: 4: 448 kHz 5: 358.4 kHz 6: 298.67 kHz 7: 256 kHz 8: 224 kHz 9: 199.1 kHz 10: 179.2 kHz 11: 162.9 kHz 12: 149.3 kHz 13: 137.8 kHz 14: 128 kHz 15: 119.47 kHz The input gain control in the audio A/D has 15 gain settings, from 0.5 times (-6db) to 3 times (10db) - this is in addition to the 6dB switchable audio preamp boost. What gain setting you need depends on the magnitude of the input signal from the tuner. The audio A/D is designed with a nominal input signal of 0.5V RMS, but the tuner input could be wildly different. As for which cards are supported, David Martin writes, "Every BT878/879 card has an onboard audio ADC with two analogue inputs. The BT879 (a rare bird and now out of production AFAIK) also has a pair of FM/FM stereo inputs as well. There is also a digital audio packetizer and FIFO buffer for DMA audio transport across the PCI bus to the host PC. All of this is on the BT87x silicon - identical on every card - and accessible via the btaudio driver. As a result the btaudio driver is almost entirely card agnostic. It only does a few things, roughly something like:
- Control the ADC switching mux to determine which of the two analogue input lines will be sampled.
- Control the ADC input gain (ie. the volume)
- Control the digital low pass filter to set the decimation factor and, hence, the digital output frequency.
- Control the digital audio packetizer input selection (the ADC or the external digital line in).
- Set the digital audio packetizer output mode and characteristics for the PCI bus data transfer.
- If the designer of a given card has elected to connect the TV tuner analogue audio out to one of the two ADC analogue inputs (usually pin 100 on the BT87x), you will get the broadcast audio. The quality of the output can vary wildly from card to card (from good to unusably awful), but there will be output of the TV audio. Sometimes you can play around with sample frequencies and input gain settings and improve things. Sometimes you can't.
- If the designer of the given card elected not to connect the tuner analogue audio output to the BT87x audio ADC then you will get static or silence. Nothing short of a soldering iron will help you in this case.
Pin |
Signal |
Description |
100 |
STV I |
TV sound input from TV tuner. |
98 |
SFM I |
FM sound input from FM tuner. |
94 |
SML I |
MIC/line input. |