I'm trying to get two bluetooth speakers connected via the native bluetooth controller. The first one connects and plays audio just fine. The second one never connects.
Since I've searched and found some others are having an issue getting a single speaker working, allow me to explain the steps I took to achieve this:
Factory install raspbian jessie onto the raspberry pi 3. Run raspi-config in terminal and expand the filesystem, then reboot. Install pulseaudio bluetooth support via the following command.
sudo apt-get install pulseaudio-module-bluetooth
You may want to update apt-get first using the command:
sudo apt-get update
Restart the system. Once it reboots we will enter the bluetooth administration tool using the following command:
bluetoothctl
This will enter a bluetooth administration console. From here we can scan for our speaker and pair it. Pulseaudio must be running for this to work, but it will start by default after you install the packages above. From the bluetooth console run the following command:
scan on
After a bit you should see your speaker(s) listed. To pair and connect, issue the following commands:
trust 00:02:3C:45:05:E7
pair 00:02:3C:45:05:E7
connect 00:02:3C:45:05:E7
You may not need to issue the trust and pair commands, but several searches showed attempting those commands should any issues arise in pairing. If it still doesn't work make sure the pulseaudio daemon is running, and pulseaudio-module-bluetooth is installed.
After you are connected to the speaker you can exit by simply typing exit
in the bluetooth console.
Now you can get your pulseaudio sinks by issuing the command:
pactl list sinks
You should see the speaker listed. You can use this information to configure other applications to route their audio through it. Also, if you install the graphical interface for pulseaudio then you can easily manage the devices for your main desktop, and route the audio from the graphical inteface to the bluetooth speaker. You install it via this command:
sudo apt-get install pavucontrol
You should see the option to manage pulse audio settings afterwards in the main raspbian menu on the desktop.
Now that we have gotten this far, my problem is I cannot connect to a second speaker when the first is connected. I am getting the following error:
Attempting to connect to 00:02:3C:45:05:E7
[CHG] Device 00:02:3C:45:05:E7 Connected: yes
Failed to connect: org.bluez.Error.Failed
[CHG] Device 00:02:3C:45:05:E7 Connected: no
A look into the system logs provide a little insight, but I haven't found much info on how to fix this error besides downgrading bluez which is a very undesirable fix.
bluetoothd[670]: Unable to select SEP
So that's where I am right now. I'm unsure if the raspberry pi 3 onboard bluetooth interface can support multiple connections to speakers. Any help or nudge in the right direction would be greatly appreciated.