Snd-bt87x

From MythTV Official Wiki
Jump to: navigation, search

Important.png Note: The correct title of this article is snd-bt87x. It appears incorrectly here due to technical restrictions.


What Is It?

snd-bt87x is a Linux kernel driver for the Advanced Linux Sound Architecture (ALSA). It allows you to capture digitized sound directly from a bt87x capture card, without hooking it to your sound card.

For more information of bt87x capture cards, see bttv.

For a more generic overview of TV audio-over-PCI, including other (non-bttv) analog cards, see PCI TV audio.

Installing the Module

To use the snd-bt87x driver, the driver module needs to be installed. To see if it is already installed on your system, type

# find /lib/modules/`uname -r` -name 'snd[-_]bt87x*'

If it returns a filename, the module is installed. If it doesn't, you will have to install it yourself. To do that, you will probably have to do one of the following:

  • install it from a package included with your Linux distribution
  • build it from the kernel source code included with your Linux distribution
  • build it from the ALSA source code (available at http://www.alsa-project.org)

Loading the Module

Once the module is installed, it needs to be loaded. To see if your Linux distribution has already loaded it, try

# lsmod | grep 'snd[-_]bt87x'

If it returns one or more lines, the module is already loaded. If not, you will need to load it yourself. To do that, try

# modprobe snd-bt87x

If it doesn't give you any errors, use the lsmod command above to confirm that it's loaded.

Making Sure the Module Recognized Your bt87x Card

Sometimes the driver doesn't recognize a bt87x card. To make sure that your card was recognized, try

# cat /proc/asound/cards

The output should have one or more lines that look something like

 1 [Bt878  ]: Bt87x - Brooktree Bt878

If it doesn't, you can reload the module using the load_all option, so it will recognize more cards. To do this, do

modprobe -r snd-bt87x; modprobe snd-bt87x load_all=1

Now, the 'cat' command above should show your card.

Making Your System Load the Module When it Boots

Different Linux distributions use different configuration files to load and configure modules. Here's what you need to do for some distributions.

  • Mandriva
    • 2007
      • echo "snd-bt87x" >>/etc/modules # load the module on boot
      • echo "options snd-bt87x load_all=1" >>/etc/modprobe.conf # OPTIONAL - if required for your bt87x card

Testing the Driver

Once the module is loaded, it creates one or more ALSA sound card instances, one for each bt87x card it found. To see these, type

# cat /proc/asound/cards

The number preceding the card you are interested in is the ALSA sound card number.

If your system uses udev or devfs, a corresponding device file might be created automatically. It will probably be named /dev/dsp for ALSA sound card zero, or /dev/dsp<ALSA_sound_card_number_here>.

If the device file has not been created, please refer to the documentation for your Linux distribution to determine how to create it.

Once you know the name of the device file, you can try it with:

# dd if=/dev/dsp1 of=/dev/dsp bs=1K count=33

Assuming that /dev/dsp is your default sound card, and /dev/dsp1 is your bt87x capture card, you should hear about 5 seconds of sound from your bt87x capture card. If you only hear static, don't worry, your capture card might not have the correct input selected or be tuned to a valid channel. If the sound you hear is noisy, it might be because the dd command is not meant for playing sound. It's just a very crude way to test that the driver is working. If you hear sound, it's probably working fine.

Using the Driver

To use the new ALSA sound card, just configure your application to use the device file as it's input.

For example, in MythTV, when configuring the capture card, just enter the device file where it says Audio device:.

  • Using in Fedora Core 6
   If using a Hauppauge WinTV DBX 401 w/radio try using /dev/adsp1 as your audio device for capture during setup.
   If you are fresh installing be aware that the sound may be very grainy and distorted.  Go to the Recording 
   Profiles and change the Audio Codec to Uncompressed.