Monthly Archives: February 2012

Setup Ubuntu as bluetooth speakers (stream music from Android/Iphone)

This post shows you how to configure bluetooth to accept audio, then configure pulse to pipe the received audio through to your speakers. This then allows you to pair your Android devices to your computer and push your music at it.

edit /etc/bluetooth/audio.conf and add the following to the GENERAL section. Then restart bluetooth

sudo /etc/init.d/bluetooth restart

Using the bluez tools either through the command line or the gnome applets pair computer with the mobile device.

Install d-feet

sudo apt-get install d-feet

Open d-feet, org.bluez -> expand the device that you paired with (you should be able to identify it by the mac address)
Select org.bluez.AudioSource
double-click Connect()
You may have to now 'Accept' on your phone.

In terminal:

pacmd list-sources | less

Take a note of the name of the source, eg: bluez_source.00_23_76_77_D5_C8

pacmd list-sinks | less

Take a note of the name of your default sink, eg: alsa_output.pci-0000_00_1b.0.analog-stereo

Connecting my tablet

pactl load-module module-loopback source=bluez_source.00_1D_FE_86_13_AD sink=alsa_output.pci-0000_00_1b.0.analog-stereo

Connecting my Phone

pactl load-module module-loopback source=bluez_source.00_23_76_77_D5_C8 sink=alsa_output.pci-0000_00_1b.0.iec958-stereo

This works great with ubuntu 11.10 as its uses pulseaudio v1.0. I experienced problems with ubuntu 10.10 as it uses pulseaudio 0.9.2 which seems to have a few bugs. This was solved by downloading the source for pulseaudio v1.0 and compiling it.

To do.
The process of connecting the bluetooth source to your default sink i'm sure can be automated.

When done to unload the module again:

MY_VAR=`pacmd list-modules | grep -B 2 bluez_source | grep index| cut -d : -f 2`; pactl unload-module $MY_VAR