Motorola headset HS801 and GNU/Linux

I'm entering the bluetooth world, just bought a usb-bluetooth dongle (lsusb: Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle) and a headset Motorola HS801.

I could set it up to work with GNU/Linux, but it was not that easy, so here follows the instructions:

  1. You will need an ALSA kernel module called snd-bt-sco, it's not in kernel tree yet and most distros doesn't ship it, so get it from here: http://bluetooth-alsa.sourceforge.net/ I'm using version 0.41 without glitches. Gentoo users could use ebuilds from bug report #91558.
  2. Load the ALSA-Bluetooth module: modprobe snd-bt-sco.
  3. If you want to use Skype or other applications that doesn't support ALSA, just OSS, use the OSS emulation layer, with /etc/modules.d/alsa:
    alias snd-card-1 snd-bt-sco
    alias sound-slot-1 snd-card-1
    
    alias sound-service-1-0 snd-mixer-oss
    alias sound-service-1-1 snd-seq-oss
    alias sound-service-1-3 snd-pcm-oss
    alias sound-service-1-8 snd-seq-oss
    alias sound-service-1-12 snd-pcm-oss
    
    # Set this to the correct number of cards.
    options snd cards_limit=2
    I also use aoss with some applications, so I have in /etc/asound.conf:
    pcm.dsp1 {
    type plug
    slave.pcm "snd_headset"
    }
    
    ctl.dsp1 {
    type plug
    slave.pcm "snd_headset"
    }
    
    ctl.mixer1 {
    type plug
    slave.pcm "snd_headset"
    }
  4. Then pair your device with your computer, I have set up /etc/bluetooth/hcid.conf with:
    options {
    autoinit yes;
    security auto;
    pairing multi;
    pin_helper /usr/lib/kdebluetooth/kbluepin;
    }
    Then KDE will prompt me with a nice GUI to enter device's PIN.
  5. Manual test before continue: discover your device hardware address using hcitool scan and then run the btsco daemon manually: btsco -v $HWADDR, then play some sound to it using ALSA play: aplay -d plughw:Headset /path/to/sound.wav, if it doesn't work, then you need to check previous steps!
  6. If everyting was right, then you could use some tool to automatically start btsco. I use KDE bluetooth daemon (kbluetoothd): Right-click the systray icon and choose Configuration/Configure Services..., then Device Discovery, add a new job called Headset and enable it, then choose Listed devices only and Add device, choose pooling times about 30 seconds and click Configure, enter this script there.

You can use this wiki as base, it's a Gentoo-wiki, but it's well written and you can understand the concepts and use it in other distros: http://gentoo-wiki.com/HOWTO_use_a_bluetooth_headset