Setting up PulseAudio with Bluetooth

Before I get round to setting up Forked-DAAPD on my Pi, I’ll need to get Bluetooth audio working.

First we’ll install PulseAudio and the Bluetooth Module

1
sudo apt-get install pulseaudio pulseaudio-module-bluetooth

Grant many permissions to pulseaudio and audio by adding the root and pi users to the following groups

1
2
3
4
5
6
sudo adduser pi pulse
sudo adduser pi pulse-access
sudo adduser pi audio
sudo adduser root pulse
sudo adduser root pulse-access
sudo adduser root audio
Next we’ll need to amend the system.pa file that PulseAudio uses for configuration.
1
sudo nano /etc/pulse/system.pa

Add the following lines at the bottom of the file

1
2
3
4
###Enable Bluetooth
.ifexists module-bluetooth-discover.so
  load-module module-bluetooth-discover
.endif

Now get PulseAudio running as┬ásystem. Don’t worry if the first command says “Failed to kill daemon” as it just means PulseAudio wasn’t running already. Eventually we’ll set this to run at startup.

1
2
pulseaudio -k
sudo pulseaudio --system
At this point PulseAudio is running in your current session, which renders this terminal session unable to do anything else, so open up another connection and login so we can connect the Bluetooth Speaker
1
2
3
4
5
6
7
8
9
bluetoothctl
power on
agent on
scan on
**Note MAC address of BT Speaker**
pair 00:00:00:00:00:00
**Type Pin**
trust 00:00:00:00:00:00
connect 00:00:00:00:00:00

You should now be connected to your bluetooth speaker so we can configure Forked-DAAPD

Add a Comment

Your email address will not be published. Required fields are marked *