Using Bluetooth Headset With Skype In 64 Bit Ubuntu

Using Bluetooth Headset With Skype In 64 Bit Ubuntu

First I'll say I'm nowhere near an expert on bluetooth with Ubuntu - or even bluetooth for that matter. What I've done is mash together a lot of different things until I found what worked for me. Your mileage my vary, but this is how I got my Plantronics bluetooth cellphone headset working with Skype in 64 bit Ubuntu Intrepid.

Please note - the bluetooth stack changed between Hardy (8.04) and Intrepid (8.10). This is for Intrepid.

Setup the bluetooth environment

First, of course, you must get bluetooth working and paired with your bluetooth headset. That part is actually pretty easy.

Make sure you have the following packages. I think bluez-alsa is the one that may not be installed by default, but go ahead and check them all:

sudo apt-get install bluetooth bluez bluez-gnome bluez-alsa bluez-gstreamer libbluetooth3
Once it's all installed, create a file called .asoundrc in your home directory and place the following text inside it:
pcm.Headset {
  type bluetooth
  profile "voice"
}

I saw several HOWTO's that talked about loading modules or otherwise affecting the audio drivers, but I found that with Intrepid, none of that was necessary.

Pairing your headset

I found that if you'd tried to pair your device before or otherwise went through an upgrade, it may be a good idea to remove all associations. BE ADVISED: this will remove ALL bluetooth pairings from your computer, so if your keyboard or mouse uses BT, don't do this next step!

sudo rm -R /var/lib/bluetooth/*
Now, reboot and attempt to pair your device. One of two ways may work - you may simply trigger a pairing on the headset and a pop-up will automatically appear on your desktop offering to pair it. If that doesn't happen, right click on the bluetooth icon in the tray and pick setup new device. You can probably figure out the rest of the pairing from there. Test with ALSA Once your headset is paired, let's make sure it's working through ALSA properly. Run the following. After a few seconds, you should hear whatever you say echoed back in your ear:
arecord -D Headset -f S16_LE | aplay -D Headset -f S16_LE

Hit CTRL-C to cancel the recording. If however you get Input/Output errors, try restarting the bluetooth service:

sudo /etc/init.d/bluetooth restart
Unfortunately I found that every time I turn off the headset, I have to restart the bluetooth service before it works again. If you haven't made it this far, I honestly don't know what could be wrong - but feel free to discuss it in the comments with each other - someone may have a clue. For me, things worked at this point - I think. The problem is that I tried a LOT of different things before getting this far, and it's possible I've left out a step I did without realizing it. Install missing libraries Now, I'm going to assume you already have Skype working on your 64 bit system using the static build of Skype for 64 bit Ubuntu installs. I'll also assume that you already figured out that it's not working with your bluetooth headset. If you run Skype from a command line you should see:
Cannot open shared library /usr/lib32/alsa-lib/libasound_module_pcm_bluetooth.so

This is because Skype is looking for the 32 bit libraries.

The easiest way to install what you need is the same trick used for Tweetdeck. Download the GetLibs package and install it.

After getlibs is installed, run the following:

getlibs -p bluez
getlibs -p bluez-alsa

You may find you need to reboot one last time. Now in Skype set your audio source and output to "Headset" and run a test echo call. If all has gone well you should be up and running!

Posted by Tony on Mar 20, 2009 |