Overview | History | Future work | Download & build | Credits | Contact us
What we have working now is a scheme with two independent alsa-lib plugins and two independent daemons to run things. When you switch to the alsa-lib device that provides SCO (headset in the example configuration), you can do voice calls and two-way audio. When you switch to the device for a2dp (a2dpd in the example), you get one-way stereo to the headset.
Note: When asking for a password simply press Enter.
cvs -d:pserver:anonymous@sbc.cvs.sourceforge.net:/cvsroot/sbc login cvs -d:pserver:anonymous@sbc.cvs.sourceforge.net:/cvsroot/sbc co sbc cd sbc ./bootstrap ./configure --prefix=/usr make sudo make installinstall plugz:
cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa login cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa co plugz cd plugz ./bootstrap ./configure --prefix=/usr --sysconfdir=/etc make sudo make install
Discover the headset's address by doing a bluetooth scan. The headset may need to be in pairing mode for this address to appear:
hcitool scan
The address will look something like 00:14:CF:03:17:8C
cp alsa-plugins/a2dpd/sample.a2dprc ~/.a2dprc
edit ~/.a2dprc to contain the address of your headset on the address= line.
create ~/.asoundrc with simply:
pcm.a2dpd { type a2dpd }
and run a2dpd (it's not advised to run it as root). You'll have to arrange for this to be started up subsequently.
You can also have the SDP records for A2DP and AVRCP activated at boot time; this may allow you in some setups to have the headset initiate the connection to a2dpd to start up a stream.
sdptool add A2SRC sdptool add AVRTG
If this is a combo headset, turn off your phone first! (Otherwise, the headset will be complicating things by trying to connect to two devices at once)
Turn the headset on in pair mode and hit play in xmms. On the first connect, you should get a popup asking for the pin. Then audio should start.
If your set can do AVRCP, it will be set up to do track advance/pause/stop/play through xmms command-line control. To make AVRCP work with different clients, you'll need to customize ~/.a2dprc.
alsadev=a2dpd
For some reason the GUI will not allow you to set this device. Also set "Audio Desynchronization Compensation" in the gui to a value between -200 and -600, depending on your headset's latency, to improve audio/video sync.
There's a bit of delay between the picture and the voice but it's bearable for me.
The old method involves a kernel module and the btsco daemon. See below for the details for this method.
The preferred method uses an outstanding alsa plugin written by Fabien Chevalier instead and requires no kernel patches nor modules. The plugin was installed when you performed the plugz install above.
If you base your .asoundrc on the example alsa-plugins/asound.conf from the plugz cvs module, you can edit it to use your SCO headset address. Then change the alsa device in xmms to headset and run /usr/bin/headsetd. You should be able to use the headset at this point.
If you subsequently change your .asoundrc, you will have to restart xmms but you don't need to restart headsetd.
You will have to set your applications to use the alsa device headset similar to what we did above with a2dpd. Unfortunately some applications won't let you choose this device because they won't let you type in the name of the device and they don't use the extended alsa api for finding alsa plugin devices. At least in the case of vlc, you can edit its configuration directly to get around this.
BIG FAT WARNING: You will crash your box if you don't have a kernel patch applied. This is due to a bug in the kernel that is not yet fixed at the time of this writing. This patch is called the 'SCO flow control patch', and can be found in the patch/ directory of the plugz project or here. This patch should apply to any recent (2.6.18+) Linux kernel.
For the old kernel mod + btsco architecture, you need a kernel with the emu10k1 driver selected (this is one of the drivers that forces the inclusion of the implementation of "snd_hwdep_new"). Build the kernel module:
cd kernel make make install depmod -e make clean
modprobe snd_bt_sco
esdctl stop
hciconfig hci0 voice 0x0060
btsco bdaddress
aplay -B 1000000 -D plughw:Headset sound.wav
A2DP provides a way to send stereo high-quality audio to some of the newer headsets. On all the headsets I've seen so far, this is one-way audio, so if you were expecting to get something like a gaming headset (talking to other players, getting stereo sound back from the game), you should wait for the next generation of headsets to get 2-way A2DP.
This code is found only in the "btsco" package.
To test stereo audio without installing the alsa plugin, you can run:
mpg123 --au - file.mp3 | ./a2play 00:0D:3C:30:32:ADWhere you replace file.mp3 with a good mp3 file and bdaddr with the address of your headset. You can send live audio from line-in etc using a command like:
./a2play -s -d -r 44100 00:0D:3C:30:32:AD /dev/dspDon't be surprised to get a delay. It's probably under 500ms but not much under that.
The A2DP sink code receives a stream from another device. Run it with:
hciconfig hci0 class 0x200404 sdptool add A2SNK ./a2recvIt will try to bind to the bluetooth adapter and send audio out to /dev/dsp.