Backstory
After a long break, I’ve finally gotten one part of my to-do list for my Raspberry Pi….automated bluetooth audio playing!
As always: there were issues. First, the support for this sucked. I was thankful to get a starting point from John Hamelink. He wrote a set of sweet scripts that automate a lot of this. However, they were written for Arch Linux, and required a bit of work syntactically to get it working for Debians Wheezy Release. My final code is here.
The Nitty Gritty (install steps)
First, install the normal packages (as seen here) and let the pi user able to control bluetooth devices:
1 2 |
|
Next, let’s make the bluetooth module compatible for audio streaming. Edit /etc/bluetooth/audio.conf and add this after [General]:
1
|
|
Next, we’ll let pulseaudio do the playback. Edit /etc/pulse/daemon.conf and uncomment:
1
|
|
We need some additional packages to make it compatible with my scripts. Qdbus allows you to send D-Bus messages to the bluez daemon, git-core is so you can clone my repo, and bluez-tools provides the bluetooth-agent which is one of the daemon pieces.
1
|
|
Now, we’re going to gain root, put my code in /root, and make a init.d file you can provide at startup.
1 2 3 4 5 6 7 |
|
Usage
After the reboot, you can now pair your device using ’1234′ (unless you modified the bluetoothPin file), and play yo’ music!
If for some reason it’s not connection, visit KMonkey711′s tutorial and follow the steps to connect and trust the device, and reboot the pi.
Acknowledgements
Thanks to:
johnhamelink
KMonkey711