Sunday, November 16, 2008

Howto setting up bluetooth audio under Debian

This is a quick how to setting up bluetooth audio under Debian.

First off we need to install a couple packages:

# apt-get install bluez-utils bluez-gnome bluez-audio

Now we need to run ‘hcitool scan‘ to get the address of the bluetooth device. For example,

$ hcitool scan
Scanning ...
00:00:00:00:00:00 Nokia BH-501

Now to get the audio part to work:

Modify or create your ~/.asoundrc to contain

  1. pcm.bluetooth {
  2. type plug
  3. slave {
  4. pcm "bluetooth_hw"
  5. }
  6. }

  7. pcm.bluetooth_hw {
  8. type bluetooth
  9. device 00:11:22:33:44:55
  10. profile "auto"
  11. }

Where 00:11:22:33:44:55 is the bluetooth address of your headset that you got from ‘hcitool scan‘ output

Now to test the bluetooth headset audio is working with ‘arecord‘ and ‘aplay‘ for example,

$ arecord -Dplug:bluetooth -f S16_LE | aplay -Dplug:bluetooth -f S16_LE
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Aborted by signal Interrupt...
Aborted by signal Interrupt...

Finally configure your audio applications to use the alsa device ‘bluetooth’.

Example fro setting up Skype to use the bluetooth headset:
Right click on the Skype icon on the gnome-panel and go Options => Sound Devices and change the ‘Sound In’ and ‘Sound Out’ to ‘bluetooth’ and click apply.

No comments: