Bluetooth Headset in Debian

I found this useful post in the Debian Official Forum @ link and thought it would be good saving a copy here; so, let's paste:

Here is the idea: you have a laptop (or desktop with bluetooth stick) that has bluetooth device and a bluetooth handsfree (or headset). How to use the handsfree with skype or other programs?

Requirements:

  • Debian squeeze at least for up-to date kernel, bluez and blueman (the latter is recommended, not required).
  • pulseaudio + pulseaudio-module-bluetooth + pavucontrol (the latter is not required, but can be handy) packages:

     sudo aptitude install pulseaudio pulseaudio-module-bluetooth pavucontrol
    
  • blueman - recommended, because i found it easy to use, straightforward and transparent - the default bluetooth manager would be suffice, but that is not anywhere near blueman in usability:

     sudo aptitude install blueman
    
  • a file, named .asoundrc (~/.asoundrc), in your home folder that contains the following (create it with your editor of choice, no root access required):

     pcm.!default plug:pulse
     pcm.pulse {
       type pulse
    }
    

Ok, you now have the ingredients. A gdm restart (login+logout in the graphical shell) will apply the ALSA and PulseAudio changes.

Note: You will have 2 volume controls, one for ALSA, other for PulseAudio - leave them both, because you might want to set volumes separately for programs who use ALSA and PulseAudio respectively.

Pair your bluetooth device with your computer. Right-click on the PulseAudio volume control from the system tray, select sound preferences and set the in/out sound to your bluetooth device (if its there, it will probably work). Now any sound played through the PulseAudio server will be routed to the bluetooth device - Skype for example will select the pulseaudio server by default. Also all ALSA sounds are routed by default through the pulse plug to pulseaudio.

Now all PulseAudio aware programs can be used with the bluetooth headset. But what about ALSA? Some programs dont have pulseaudio plugins per se - this is where the .asoundrc file comesinto play - the two sections added have the following meaning:

pcm.!default plug:pulse

  • defines the "pulse" plugin as default route (meaning that the "default" ALSA device will be routed to the pulseaudio server)

pcm.pulse { type pulse }

  • this section defines the "pulse" plugin as the pulseaudio server.

Caveats: Some programs might not like this setup for example older games, Wine etc. Java audio, OSS programs might bypass the ALSA sound system, so they will play through speakers (preloading alsa-oss might help here). You might comment out the first line in .asoundrc if you dont want to route all ALSA sound through PulseAudio - the pulse plugin will be available and can be selected from programs thathave advanced ALSA device support. Also this leads to sound device grabbing conflicts betweel ALSA and PulseAudio and you might experience sound cutting off sometimes. It is recommended to either route everything through PulseAudio if you want sound to work.


 

I personally used this method with a cheap nilox bluetooth dongle and a pair of Motorola "Motorokr" S305 headset:

This headset is, in my opinion, a very good one; pros include:

  • Lightweightness
  • Discrete comfort
  • Loud and clear sound
  • No background noise

Small contraries maybe the lifetime of battery, about 5 hours of play in "Advanced Audio Distribution" profile, balanced by the small time of recharge, about 1 hour; by the way it's not likely you're gonna use the headset for more than a couple of hours consecutively. Let's say you could listen to twenty hours in a day with four pauses of an hour each. Another little disadvantage maybe the lack of a true bass experience: honestly i've always used wireless devices and what i can say is that i never got such feature for good; on the other side, if you're really passionate with music or your job is part of it, a wired device would be preferable.

This headset is also featuring an embedded microphone, thus making it possibile to take phone calls using a bluetooth enabled cellphone, smartphone, tablet.. you name it, or SIP and related pc softwares like skype.

Skype is not available in Debian as it is not free software and i am not a great fan of it, but i tested it under Windows Seven, using the "Voice and Earphone Gateway" profile available with the software i am running and it works just fine.