Friday, February 23, 2007

Stereo Bluetooth Profile (A2DP) on Mac OS X Tiger

This post is now obsolete, please check out the new instructions which use Jack Audio, here.

Using the following instructions will allow full use of stereo bluetooth headphones on a mac without waiting for Leopard! Unfortunately The audio is delayed by nearly a second because this is such an indirect method.


  1. Install Darwin Ports (Install Guide)

    From http://darwinports.com/

  2. Install Soundflower

    http://www.cycling74.com/products/soundflower
    A restart is required.

  3. Set input and output sound devices to "Soundflower (2ch)"

  4. Install esd

    From a terminal window run:

    sudo port install pkgconfig audiofile esound

  5. Start esd for the first time (It should autostart afterwards):

    esd &


  6. Download bttest02.zip

    This is a GPL A2DP player by bkc based on a2player, available from www.emucamp.com/boukichi/btplay02.zip.

    Download Tim Hewett's modified version that works on both PPC and Intel from here.

    Extract the files and copy bttest and sbcenc to your local bin folder (e.g. /usr/local/bin).

  7. Create a shell script called in your local bin folder called a2dp.sh, replacing HEADSET with your bluetooth headset's device address.

    This address can be obtained in System Preferences -> Bluetooth - Devices, after pairing.

    Place these lines in the shell script:
    #!/bin/sh

    mkfifo /tmp/mixer

    ADDR=HEADSET

    esdrec | sbcenc -z 44 -s 4 -j - | bttest $ADDR -

    rm /tmp/mixer
  8. Run a2dp.sh

The resulting sound quality is at least as good as my Motorola V3x produces. Another thing to note is that if the headset goes out of range it does not reconnect properly.


If you try this with a headset other than the Motorola HT820, please post a comment about your experience. So far there have been some negative reports for Sony Ericsson headsets.

Thanks to bkc for the port! Also this hint was helpful, Create a wireless speaker setup without AirTunes.

Enjoy!

Update: New version of btplay.

Update 2: Added link to install guide.

Update 3: Tweaked instructions to include pkgconfig and starting esd (thanks jon) for the first time.

Update 4: Request for information on experiences with other headsets.

Update 5: Thanks to Tim Hewett this now works on PPC and the shell script has been improved. Confirmed working on Jabra BT320s. As always reports of success or otherwise are greatly appreciated!!