Snd-bt87x (alsa bt878 driver): Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== Preamble ==
The rumor is that snd-bt87x is the ALSA driver that replaces the legacy btaudio.
The rumor is that snd-bt87x is the ALSA driver that replaces the legacy btaudio. If you have arrived on this page, chances are your snd-bt87x-based device did not work out of the box. Hopefully, this page will assist you. If it does please return the favor by creating a page for your card.


Given the rapid development in the Linux kernel and v4l project, module options, driver features and functionality may change. The instructions below are very general to accommodate as many distros and kernel versions as possible. Therefore, it is incumbent upon you to know how to do a few things and how your distro implements them.
When setting up the driver, find and delete any defaults that may be present that would make getting the sound to work a challenge. For example, in Debian, there is a mapping stanza in /etc/modprobe.d/aliases that maps bttv devices to -2 to get them "out of the way" of the default sound card. Further research suggests the -2 has special meaning in ALSA. It is interpreted as, take the next device number available after any other device. In order to keep track of which sound device is the first,second, etc., it is advised to comment out stanzas with the -2 designation and define card0, card1, etch with index= kernel options.


== Required Skills ==

Figuring out if the card will work will require some familiarity with kernel options and permanently storing them, working on the command line in root (or sudo), and perusing dmesg to find the debugging data for snd-bt87x.
Functional sound is still a lottery because of the wide variety of card designs using the bttv framegrabber and the unknown number of actively maintained drivers from kernel version to kernel version. Mythtv has good information on what is supported with their application. In theory, this wiki is supposed to have better information, but there are many gaps. That's your chance to create a page for your card. Please take a few moments to contribute!


== Rough instructions to enable snd-bt87x audio ==
== Rough instructions to enable snd-bt87x audio ==
When setting up the driver, find and delete any defaults that may be present that would make getting the sound to work a challenge. For example, in Debian/Ubuntu, there is a mapping stanza in /etc/modprobe.d/aliases that maps bttv devices to -2. Research suggests the -2 has special meaning in ALSA. It is interpreted as, take the next device number available after any other device. In order to keep track of which sound device is the first, second, etc., it is advised to comment out stanzas with the -2 designation and define card0 (your primary sound card), card1 (probably your tv card), with "index=" kernel options for each driver.
'''1: Pre-installation Debugging'''


Before inserting the card, you need to make some kernel options load by default when the system boots. In Debian, that is accomplished by adding a text file to /etc/modprobe.d/. This can vary depending on your distro. Just know where and how you need to add the kernel options. Do not edit the files ALSA generates. Create new ones.


Before inserting the card, enable all debug options for the bttv, snd-bt87x, and bt878. If you have already inserted the card, add the kernel option to your system. You need to be sure your primary sound card is given an index=0 kernel option and the snd-bt87x is given an index value of 1 (or greater) and has the ''load_all'' option. ex. snd-bt87x index=1 id=bttv load_all appears in my /etc/modprobe.d/bttv file. The id= option is helpful to name your cards. Sound rate options may need to be set. Then make sure the module is loaded when booting. For Debian, I add snd-bt87x to /etc/modules.


'''1: Pre-installation & Hardware Notes'''
If your primary volume is not down low, then turn your audio waaaay down before shutting off your PC. It's possible for the sound capture to come on right away with TV capture volume on 11. (See Spinal Tap for the "It goes to 11" reference)

'''2: Hardware Configuration'''


If your card has internal connectors to send audio to an open plug on your sound card, then plug them in and note the name of the connector. (usually Aux) If it does not, you will need a patch cord running from the back of the tv card to your sound card's capture port.
If your card has internal connectors to send audio to an open plug on your sound card, then plug them in and note the name of the connector. (usually Aux) If it does not, you will need a patch cord running from the back of the tv card to your sound card's capture port.

If your primary volume is not down low, then turn your audio waaaay down before inserting your card. Successfully installing/configuring snd-bt87x, may lead to TV sound with the volume on 11. (See Spinal Tap for the "It goes to 11" reference) You are warned.

Before inserting the card in an available slot, you need to make snd-bt87x load by default when the system boots. This can vary depending on your distro. For Debian, I add snd-bt87x to /etc/modules in order to force loading. Don't reboot yet.

'''2: Enable all debug options for the bttv, snd-bt87x, and bt878.'''

In Debian, that is accomplished by adding a text file to /etc/modprobe.d/. If you have already inserted the card, add the kernel options to your system anyway. You need to be sure your primary sound card is given an index=0 kernel option and the snd-bt87x is given an index value of 1 (or greater) and has the ''load_all'' option. ex. ''options snd-bt87x index=1 id=bttv load_all'' appears in my /etc/modprobe.d/bttv file. The id= option is helpful to name your cards. Sound rate options may need to be set.


'''3: Post Installation Testing'''
'''3: Post Installation Testing'''
Line 32: Line 37:
Play with the the master volume and capture volumes to get things right for you. Then remove the debug options you enabled at the beginning.
Play with the the master volume and capture volumes to get things right for you. Then remove the debug options you enabled at the beginning.


This page needs more information, formatting and editing assistance. Please contribute!
Note from page's inaugural author: this page needs better organization and clarification. Please contribute!

Revision as of 15:07, 27 June 2008

Preamble

The rumor is that snd-bt87x is the ALSA driver that replaces the legacy btaudio. If you have arrived on this page, chances are your snd-bt87x-based device did not work out of the box. Hopefully, this page will assist you. If it does please return the favor by creating a page for your card.

Given the rapid development in the Linux kernel and v4l project, module options, driver features and functionality may change. The instructions below are very general to accommodate as many distros and kernel versions as possible. Therefore, it is incumbent upon you to know how to do a few things and how your distro implements them.

Required Skills

Figuring out if the card will work will require some familiarity with kernel options and permanently storing them, working on the command line in root (or sudo), and perusing dmesg to find the debugging data for snd-bt87x.

Rough instructions to enable snd-bt87x audio

When setting up the driver, find and delete any defaults that may be present that would make getting the sound to work a challenge. For example, in Debian/Ubuntu, there is a mapping stanza in /etc/modprobe.d/aliases that maps bttv devices to -2. Research suggests the -2 has special meaning in ALSA. It is interpreted as, take the next device number available after any other device. In order to keep track of which sound device is the first, second, etc., it is advised to comment out stanzas with the -2 designation and define card0 (your primary sound card), card1 (probably your tv card), with "index=" kernel options for each driver.


1: Pre-installation & Hardware Notes

If your card has internal connectors to send audio to an open plug on your sound card, then plug them in and note the name of the connector. (usually Aux) If it does not, you will need a patch cord running from the back of the tv card to your sound card's capture port.

If your primary volume is not down low, then turn your audio waaaay down before inserting your card. Successfully installing/configuring snd-bt87x, may lead to TV sound with the volume on 11. (See Spinal Tap for the "It goes to 11" reference) You are warned.

Before inserting the card in an available slot, you need to make snd-bt87x load by default when the system boots. This can vary depending on your distro. For Debian, I add snd-bt87x to /etc/modules in order to force loading. Don't reboot yet.

2: Enable all debug options for the bttv, snd-bt87x, and bt878.

In Debian, that is accomplished by adding a text file to /etc/modprobe.d/. If you have already inserted the card, add the kernel options to your system anyway. You need to be sure your primary sound card is given an index=0 kernel option and the snd-bt87x is given an index value of 1 (or greater) and has the load_all option. ex. options snd-bt87x index=1 id=bttv load_all appears in my /etc/modprobe.d/bttv file. The id= option is helpful to name your cards. Sound rate options may need to be set.

3: Post Installation Testing

After booting, open a terminal and type "dmesg | grep bt" (no quotes) That will give you all of the output related to the tv card. Your kernel should have no problems finding the card and giving it device nodes. At minimum, /dev/video0 should be created. If dmesg does not at least detect the card, then chances are good the card does not have the bare minimum to function at all under Linux. Despite the ubiquity of bttv-based cards, it is still possible that your card is not supported.

Check to see what devices have been made available for alsa a couple of ways. Note, this doesn't mean the device works with all of the features advertised from the Windows world. It just means that ALSA/Linux detects the device. (Welcome to the fascinating world of device driver hacking!) In the console, arecord -l should show at least one capture interface. Depending on the amount of support, amixer -c 1 should give a list of some controls from the snd-bt87x device. The "-c 1" option is the index number set in the kernel options. You can also check /proc/asound for the device names you set with the kernel options in pre-configuration.


Post Installation Configuration

To see if audio actually works in some fashion, it is probably the case that capture will need to be enabled in alsamixer for the plug you connected your card's audio. In a terminal, type alsamixer and press F4. Move the cursor to the device that may be capturing the audio and press the space bar. If capture and output are working, then sound should come out quietly at first when you return to the main mixer gui and turn up the capture volume. If your card is really well supported, stereo audio may be available and you may even be able to use arecord to capture audio directly from the device.

Play with the the master volume and capture volumes to get things right for you. Then remove the debug options you enabled at the beginning.

Note from page's inaugural author: this page needs better organization and clarification. Please contribute!