Btaudio (bt878): Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
No edit summary
Line 59: Line 59:


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.
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:

1. Control the ADC switching mux to determine which of the two analogue input lines will be sampled.
2. Control the ADC input gain (ie. the volume)
3. Control the digital low pass filter to set the decimation factor and, hence, the digital output frequency.
4. Control the digital audio packetizer input selection (the ADC or the external digital line in).
5. Set the digital audio packetizer output mode and characteristics for the PCI bus data transfer.

That's it. All of that functionality is contained within the BT87x silicon, and is identical on every card.

In every case the btaudio analogue device should produce output when you ask for it. That is most certainly my experience. I can foresee
exactly two different cases as two what this analogue output will be like:

1. 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.

2. 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.

In my experience, the greatest majority of cards fall into the first category. Most designs seem to hook up the tuner mono TV audio to the
BT87x STV pin. In some cases cards have multiple signal sources (a tuner and an external composite video and audio input pair, for
example). In these designs there will be an analogue switching IC between the two input sources and the BT87x. Usually the the audio
inputs bypass the switcher IC and the tuner is on the STV pin and the auxiliary audio is on the LINE pin. I have seen at least one card
where the switcher IC routes both audio and video, and with the audio output from the switch only going to the external audio out, so you
can use btaudio for the TV tuner, but not for the external audio input.

Digital audio input is only slightly different. Most analogue capture cards have nothing connected to the inputs and they don't work - if
you try and use the btaudio digital input you app will freeze and nothing will happen. Some cards might have NICAM stereo decoders or FM/FM stereo decoders on board and they might produce i2s output and be connected to the BT87x digital audio input line. I have never had one in my hands to speak authoritatively about such a design.

The long and short of this is that analog mono audio via btaudio should either "just work" or it won't work at all and there is essentially nothing you can do about it if it doesn't, although I would expect the latter case to be in the minority. Digital audio won't work in the majority of cases because there is no external digital audio source to drive it."

Since this is obviously a very different scenario than the one painted by Robert Kulagowski on the [http://www.mythtv.org/docs/mythtv-HOWTO-22.html#ss22.8 MythTV HowTo], it would be nice to know which one is correct.

Revision as of 00:56, 28 April 2005

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

Supported cards

For btaudio to work, 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.

These cards are known to work with btaudio (thanks in part to MythTV HowTo):

   * 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

This account is preliminary and may be incorrect.

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 cards that support the btaudio driver, the A/D 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). This would give the following 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:

1. Control the ADC switching mux to determine which of the two analogue input lines will be sampled. 2. Control the ADC input gain (ie. the volume) 3. Control the digital low pass filter to set the decimation factor and, hence, the digital output frequency. 4. Control the digital audio packetizer input selection (the ADC or the external digital line in). 5. Set the digital audio packetizer output mode and characteristics for the PCI bus data transfer.

That's it. All of that functionality is contained within the BT87x silicon, and is identical on every card.

In every case the btaudio analogue device should produce output when you ask for it. That is most certainly my experience. I can foresee exactly two different cases as two what this analogue output will be like:

1. 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.

2. 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.

In my experience, the greatest majority of cards fall into the first category. Most designs seem to hook up the tuner mono TV audio to the BT87x STV pin. In some cases cards have multiple signal sources (a tuner and an external composite video and audio input pair, for example). In these designs there will be an analogue switching IC between the two input sources and the BT87x. Usually the the audio inputs bypass the switcher IC and the tuner is on the STV pin and the auxiliary audio is on the LINE pin. I have seen at least one card where the switcher IC routes both audio and video, and with the audio output from the switch only going to the external audio out, so you can use btaudio for the TV tuner, but not for the external audio input.

Digital audio input is only slightly different. Most analogue capture cards have nothing connected to the inputs and they don't work - if you try and use the btaudio digital input you app will freeze and nothing will happen. Some cards might have NICAM stereo decoders or FM/FM stereo decoders on board and they might produce i2s output and be connected to the BT87x digital audio input line. I have never had one in my hands to speak authoritatively about such a design.

The long and short of this is that analog mono audio via btaudio should either "just work" or it won't work at all and there is essentially nothing you can do about it if it doesn't, although I would expect the latter case to be in the minority. Digital audio won't work in the majority of cases because there is no external digital audio source to drive it."

Since this is obviously a very different scenario than the one painted by Robert Kulagowski on the MythTV HowTo, it would be nice to know which one is correct.