Friday, June 06, 2008

Bluetooth Headsets with Hardy

I used the Bluez Wiki page to help get my bluetooth headset working with ubuntu. It basically uses the new default pulseaudio to divert the sound to your headset. I don't know if it matters, but it's a Samsung headset. Also, I know some people have had problems with skype which this post does not address.

To get it working, do the following:
1. Install the following package using synaptic: padevchooser
2. Type the following into a terminal to get your headset's mac address and then write it down:
sudo hcitool scan
3. Install Blueman using the instructions at the Blueman website. This is the only way I could bond / pair / connect my headset to my computer without getting an obex error. As long as Blueman shows a lock next to your headset, it should be good. I believe the problem occurs because the default ubuntu/gnome bluetooth app is trying to browse the headset for files.
4. Next use the following command to edit (or create if it doesn't already exist) the asound.conf file (note that "nano" can be replaced for "gedit" if you like):
sudo nano /etc/asound.conf
Add the following to the file as stated on the Bluez wiki page:
pcm.bluetooth {
type bluetooth
device 00:11:22:33:44:55
}
and save the new file
*Note that "xx.xx.xx.xx.xx.xx" should be replaced by the mac address you found in step 2.
6. Run the PulseAudio Device Chooser found in Sound & Video and will then show up in the tray.
7. Under preferences, choose to start on login. Also, check what you like under "configure local sound server."
8. Restart your computer.
9. In a terminal type:
pactl load-module module-alsa-sink device=bluetooth
This command has to be run each time you start your computer. I have not found a way to automate it without getting an error message somewhere. Therefore, I just made a launcher using the above command to speed things up.
Also, although I have not tested it, the following command should work to get a bluetooth microphone working:
pactl load-module module-alsa-source device=bluetooth

You should now be able to choose your bluetooth headset in the pulse device chooser under "default sink." If this doesn't work, try using the volume control option in the pulse device chooser, right click on the stream that is playing, and choose the bluetooth headset.

The Bluez wiki page also gives ways to send audo to the headset for only specific programs. (I found exaile can be set up using the rhythmbox instructions). Also, if this doesn't work for you, please check this thread at ubuntu forums for a slightly different approach.

No comments: