Bluetooth Headset
1. Build
First download the source btsco-0.5.tgz
tar zxf btsco-0.5.tgz
./configure
make
make install
Compile and install the kernel module. This installs snd-bt-sco.ko in /lib/modules/{kernel_version}/extra/.
cd kernel
make
make install
depmod -e
2. Setup
Load the bluetooth sound module:
modprobe snd-bt-sco
Scan to get the MAC address of headset:
hcitool scan
Connect to the headset:
hcitool cc $HEADSET_MAC_ADDRESS
Start btsco:
btsco -v $HEADSET_MAC_ADDRESS
Automatic startup of btsco
Load the snd-bt-sco module (didn’t work when I put it in modprobe.conf, so I put in rc.local):
echo ‘modprobe snd-bt-sco’ >> /etc/rc.d/rc.local
Then, create a script, btsco.sh, containing:
btsco -v $HEADSET_MAC_ADDRESS > /tmp/btsco.log 2>&1
which you can put in your desktop startup session:
System–>Preferences–>More Preferences–>Sessions
Once the Sessions window comes up, select “Startup Programs”, and “Add” ~/bin/btsco.sh to it.
3. Automating pin feed
Add the following line in the options {} section of /etc/bluetooth/hcid.conf
pin_helper /etc/bluetooth/pin-helper;
Next create executable /etc/bluetooth/pin-helper, with contents:
#!/bin/sh
echo -n “PIN:” ‘cat /etc/bluetooth/pin’
and the file /etc/bluetooth/pin with the your headsets default pin (my headset’s default is 0000), with contents:
0000
NOTE: pin_helper seems to be of no use, it throws the following error in /var/log/messages:
Unknown option ‘pin_helper’ line 26
4. Automatic binding
Modify the file /etc/bluetooth/rfcomm.conf. This is my rfcomm.conf:
rfcomm0 {
# Automatically bind the device at startup
bind yes;# Bluetooth address of the device
device HEADSET_MAC_ADDRESS;# RFCOMM channel for the connection
channel 1;# Description of the connection
comment “iTech Clip IIe”;
}
5. Misc
List your bluetooth dongle:
hcitool dev