As I Googled around for tutorial on this, I found a lot of confusion.
Connecting to a speaker with Bluetooth is easy once you know how to do it, but the interface and the feedback you get along the way are truly confusing.
I can definitely save you some time with this one 😉
Here are the exact steps you can follow to connect your Raspberry Pi to a Bluetooth speaker.
How to connect to a Bluetooth speaker
Before you start, put your Bluetooth device into discovery mode so the Pi can find it.
Next, click on the Bluetooth icon in the start bar, and select the Add Device… option.
You’ll probably see a lot of devices listed. Scroll through until you find the speaker, click on it, and then click the Pair button.
In a moment, you will get confirmation from the Pi that the device has been succesfully paired.
Now here’s an important distinction: just because these devices have been paired via Bluetooth doesn’t mean that the Pi is sending the speaker audio yet. This takes another step.
Here’s the confusing part:
If you click on the Bluetooth icon and hover over the speaker name, you’ll see a Connect option.
But if you click Connect, you’ll get an error that reads, “Connection failed – Use the audio menu to connect to this device.”
Where’s the audio menu!?
It was right under my nose the whole time. All you have to do is right-click the Audio icon and you’ll see the audio menu where you can select your speaker as the output device.
Once you’ve done this, you can confirm the connection by clicking on the Bluetooth icon. The red “X” icon next to the speaker name should now be a green checkmark.
I haven’t tried this with older models, but it works just fine for the Rasperry Pi 4.
How to test the speakers
Obviously, the first thing you should do is open up Youtube and crank some lofi beats to study, chill, and Pi to.
If you already had Chromium open before connecting your speaker, the music may not play. Additionally, if you have any other applications open that have played audio, you might not get any sound from them. Restart any audio-capable applications that were already open before you connected to the Bluetooth speaker to get the audio working.
VLC comes included in Pi OS, so you can simply double-click the downloaded audio file and it will boot right up.
Can you do this via the command line?
I tried this out but had a lot of issues and abandoned it in favor of using the GUI.
First, Bluetooth needs to be turned on already. It should be on by default when you start your Pi, but if not, it needs to be enabled from the start bar. Terminal commands didn’t work for me to launch the Bluetooth service.
Once Bluetooth is turned on, this command works well to start the Bluetooth utility:
You can then run the
scan on command to find all discoverable devices and use
pair deviceid to pair with the speaker.
Someone posted a bunch of these commands on the RaspberryPi.org forums.
The real issue is that there isn’t a way through the command line to switch the audio output to a paired Bluetooth device. There are methods to switch between the analog options (HDMI and headphone jack), but there doesn’t seem to be a way to switch to a Bluetooth connected device for audio output.
And annoyingly, when I paired successfully to my speaker via the command line, I couldn’t find it in the audio menu through the GUI.
Now, just because I couldn’t get it to work doesn’t mean you can’t find a way, but it seems like more trouble than it’s worth to me. Especially since doing it through the GUI is so simple and easily done via a remote desktop even if you’re using a headless setup.
Connecting with Bluetooth opens up all sorts of possibilities. You can now play music or stream your favorite shows with high-quality Bluetooth speakers.
There’s nothing wrong with connecting to a speaker the old-fashioned way with a wired connection, but it’s nice being able to keep your Pi across the room and minimizing the number of cables on display.
If you’ve got any tips, questions, or feedback about connecting your Raspberry Pi to a Bluetooth speaker, please leave a comment below.