Much ado about scripting, Linux & Eclipse: card subject to change

2008-01-29

HOWTO: Bluetooth for Linux

Connecting a Thinkpad T60p to a Sony DR-BT30Q Headset

A month or so ago, I scored a Sony Wireless Stereo Headset (DR-BT30Q) with my accumulated Aeroplan miles. Then, when they arrived, I discovered to my dismay that while my SonyEricsson W810i supports Bluetooth 2.0, is DOES NOT support A2DP (Advanced Audio Distribution Profile) or AVRCP (Audio Video Remote Control Profile). So, while I can use 'em to answer the phone, I can't use them to listen to music on my Walkman-branded MP3-playing phone. Last I checked, SE had no intention of publishing updated firmware or any other way of installing these profiles onto existing phones. Way to go, SE.

Anyway, tonight, in a burst of insomnia, I decided to try to install the BlueZ stack on my Thinkpad and try to get these things working. To my pleasant surprise, it worked! Here's the process:

  1. Install bluez & utils
    apt-get install bluez bluez-utils bluez-firmware bluez-hcidump bluetooth bluez-audio kdebluetooth python-bluez
  2. Install a bluez-friendly audio player, like audacious.
    apt-get install audacious
  3. Install Thinkpad button support.
    apt-get install tpb
  4. (Re)start the bluetooth radio -- I tried /etc/init.d/bluetooth restart but it was Fn-F5 that actually turned on the radio. (This is why I needed tpb.)
  5. I ran a2dp.sh a few times, but it never managed to find my device's MAC address.
  6. I then tried to play with hcitool and dbus-send to manually connect to the headset, but that failed miserably. I did however, find the headset's MAC address.
  7. I manually added my device's bluetooth address into ~/.asoundrc, but that also didn't help.
  8. I noticed that the ~/.a2dp/a2dp.py script (created in step 5) was missing the MAC address, so I added it by hand.
  9. I started up K-Menu > System > Settings > kbluetooth and played around with that a little -- no luck.
  10. I started up audacious (and configured it to use bluetooth).
  11. I loaded up the latest episode of Real Synthetic Audio and started it playing.
  12. NOW, finally, I was prompted to authenticate my bluetooth radio with the headset. I entered the standard code, 0000, and voom -- wireless audio! Now all I need is a spiritual awakening, I suppose. :D

0 comments: