11.07.2015 Views

Configuring Linux for a Bluetooth stereo headset - Linux Magazine

Configuring Linux for a Bluetooth stereo headset - Linux Magazine

Configuring Linux for a Bluetooth stereo headset - Linux Magazine

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Bluetooth</strong> HeadsetsCOVER STORYHerbert Matern, Fotolia<strong>for</strong> mobile telephony typically supportjust the SCO profile, whereas <strong>stereo</strong><strong>headset</strong>s often support both. In our lab,I tested the BT620s <strong>stereo</strong> <strong>headset</strong> byJabra and the Wireless Headphones <strong>for</strong>PC by Logitech (Figure 1). The Jabra devicesupports both SCO and A2DP. TheLED flash sequence tells you whichmode the <strong>headset</strong> is working in. TheLogitech <strong>headset</strong> only supports A2DP. Infact, the Logitech <strong>headset</strong> is not officiallya <strong>Bluetooth</strong> device: Logitech sells it witha USB dongle as a normal wireless solution,although the set does have <strong>Bluetooth</strong>capabilities.This article will be concentrating on<strong>stereo</strong> output via the a2dpd daemon.If the approach that uses the A2DPdaemon does not work properly, youmight want to try the old method basedon the snd-bt-sco kernel module. Thissaid, I didn’t experience a single case inwhich snd-bt-sco worked but the A2DPdaemon didn’t.To create the snd-bt-sco.ko kernel module,download the CVS code <strong>for</strong> btscoand sbc, build and install as describedabove, then change directory to btsco/kernel and run the make command. Becomeroot, and copy the module to /lib/modules/Kernelversion/kernel/drivers/bluetooth. Typing uname -a gives youyour Kernelversion.If all of this works, you can load the moduleby typing modprobe snd-bt-sco.The next step is to associate with the<strong>Bluetooth</strong> <strong>headset</strong>. To do so, you need tomake sure the <strong>headset</strong> is in pairingmode. Enter the command line:btsco -r -v Bt-addressMaking sure to replace Bt-address withthe <strong>Bluetooth</strong> address <strong>for</strong> your <strong>headset</strong>.If you see the error messagebtsco v0.42Error: control open (hw:1): UNo such deviceError: Can't find device. Baileither your <strong>headset</strong> is not supported bythe module, or the kernel module mightnot be loaded. If everything works out,you should see the following message:You can refer to the box called “The OldMethod” <strong>for</strong> instructions on the morecomplicated setup <strong>for</strong> a SCO connection.This can be interesting if you would liketo use a <strong>headset</strong> <strong>for</strong> phoning (via Skype,<strong>for</strong> example).For the A2DP daemon, you need thesbc library and the <strong>Bluetooth</strong>-ALSA toolbtsco. See the box titled “DownloadingCode from CVS” <strong>for</strong> details.After unpacking or downloading thesource code, change to the sbc directoryand enter the following commands:The Old Methodbtsco v0.42Device is 1:0Voice setting: 0x0060RFCOMM channel 1 connectedUsing interface hci0Now, pop up a second console and enterthe following command to start the output:mpg123 --au - file.mp3 | Ua2play Bt-addressFor playback, you need to replace file.mp3 with the name of any MP3 file andBt-address with the <strong>Bluetooth</strong> address<strong>for</strong> your <strong>headset</strong>. If you then see themessagesListen thread runningread 2C00C0 2873 times / sec.read 30ABC0 1197 times / sec.read 3061C0 1198 times / sec.read 2FF0C0 1120 times / sec.read 3052C0 1154 times / sec.you can be sure that playback is running.The kernel module approach has a coupleof major disadvantages comparedwith the A2DP daemon. For example,to play a track, you need to enter commandsat the command line – playlistsare not supported – and whenever youupdate the kernel, you will need to installa new module. In addition, playback didnot work at all on the Logitech <strong>headset</strong>because it does not support SCO../bootstrap./configure --prefix=/usrmakesudo make installDepending on your distribution, you willneed to enter either the root password(SUSE, Fedora), or your user password(Ubuntu) to install with a sudo command.When you are done, change directoryto plugz and enter the same commandshere, adding the --sysconfdir=/etc option to the ./configure command:Downloading Code from CVSAfter logging in, you’re prompted to enter your password. Just press Enter.cvs -d:pserver:anonymous@sbc.cvs.source<strong>for</strong>ge.net:/cvsroot/sbc logincvs -d:pserver:anonymous@sbc.cvs.source<strong>for</strong>ge.net:/cvsroot/sbc co sbccvs -d:pserver:anonymous@bluetooth-alsa.cvs.source<strong>for</strong>ge.net:/cvsroot/bluetooth-alsa logincvs -d:pserver:anonymous@bluetooth-alsa.cvs.source<strong>for</strong>ge.net:/cvsroot/bluetooth-alsa co plugzW W W. L I N U X- M A G A Z I N E . C O MISSUE 80 JULY 200739

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!