drugo
Posts: 12
Joined: Sun Sep 22, 2019 9:02 pm

Connect 2 bluetooth speakers to a RPI4

Fri Jan 03, 2020 11:36 am

Hi,
is it possible to connect 2 speakers via Bluetooth to a RPI4 for listen the same audio stream for both the speakers?
I'd like to put the speakers in differents rooms and listen the same music....

Thanks.

fbe
Posts: 692
Joined: Thu Aug 17, 2017 9:08 pm

Re: Connect 2 bluetooth speakers to a RPI4

Fri Jan 03, 2020 9:18 pm

I'm using Raspbian Buster Lite (without desktop) and mpd on a Raspberry Pi3B.
3 different bluetooth speakers at the same time work. I guess it could be even more, but I have got 3 speakers only. The output has some offset, it sounds like an echo. But this should be no problem if they are in differerent rooms.
Alsamixer can control the volume for each speaker separately.

You may first make it work with one bluetooth speaker and a PC speaker set, if available, connected to the audio jack, to get an impression, before you buy a second bluetooth speaker.

drugo
Posts: 12
Joined: Sun Sep 22, 2019 9:02 pm

Re: Connect 2 bluetooth speakers to a RPI4

Sun Jan 05, 2020 1:43 pm

fbe wrote:
Fri Jan 03, 2020 9:18 pm
I'm using Raspbian Buster Lite (without desktop) and mpd on a Raspberry Pi3B.
3 different bluetooth speakers at the same time work. I guess it could be even more, but I have got 3 speakers only. The output has some offset, it sounds like an echo. But this should be no problem if they are in differerent rooms.
Alsamixer can control the volume for each speaker separately.

You may first make it work with one bluetooth speaker and a PC speaker set, if available, connected to the audio jack, to get an impression, before you buy a second bluetooth speaker.
Thank for your reply.
In which way do you connect your bluetotooth speakers to the rpi?

fbe
Posts: 692
Joined: Thu Aug 17, 2017 9:08 pm

Re: Connect 2 bluetooth speakers to a RPI4

Sun Jan 05, 2020 4:25 pm

I installed the bluealsa package and used bluetoothctl (sudo bluetoothctl) via ssh.

In Raspbian with Desktop this package is preinstalled. But it's impossible to use blutooth and analog speakers at the same time with the desktop app. If you select "Analog" the bluetooth speaker gets disconnected. I guess the same happens with the first bluetooth speaker if you connect a second speaker. I also noticed that my bluetooth speaker got disconnected with a certain delay when 'pi' logged out from the Desktop... So I decided to use Raspbian Lite.

After checking, that

Code: Select all

aplay -D bluealsa:DEV=00:42:79:91:2D:A7 /usr/share/sounds/alsa/Front_Center.wav
works, I could simply add a section to the /etc/mpd.conf

Code: Select all

audio_output {
        type            "alsa"
        name            "Bluetooth Speaker 1"
        device          "bluealsa:DEV=00:42:79:91:2D:A7"
}
...
for each speaker (of course with different name and the MAC-Address substituted).

I use bluetooth speakers with mpd only. So I don't even have to edit any alsaconf file.
My speakers automatically connect when I turn them on after my Raspberry Pi.
If the mpd is playing already when a speaker gets connected, I need to stop playing and then start playing again, otherwise the new speaker gets no output.
Sometimes (about once in a month) the root filesystem doesn't get unmounted cleanly if I reboot and I need to run e2fschk from a second Linux system (I use a second Raspbian Installation for that) to fix the root filesystem. All files in lost+found looked like /var/lib/mpd/state. It used to work more reliable with Raspbian Stretch. This issue is more likely related to the mpd version, that is used in Raspbian Buster than to Raspbian Buster itself.

drugo
Posts: 12
Joined: Sun Sep 22, 2019 9:02 pm

Re: Connect 2 bluetooth speakers to a RPI4

Sat Feb 01, 2020 1:48 pm

Many thanks again for the reply, I reply only today because now I have got the 2 BT speakers in my hands so I can do some tests.

Now I can play a sound from command line with both speakers but one by one with bluealsa like this

Code: Select all

aplay -D bluealsa:DEV=12:34:56:78:90:12 /usr/share/sounds/alsa/Front_Center.wav
Now I'd like to play the sound simultaneously from command line but I'm not able to do.

Do you know how can I do?

Thanks again.

firstamistur
Posts: 2
Joined: Sun Oct 02, 2016 7:48 am

Re: Connect 2 bluetooth speakers to a RPI4

Fri Aug 21, 2020 5:19 pm

Exactly what I was looking for !

I have a hifiberry DAC+ Pro on my rpi4 but I was looking for a way to connect also a bluetooth speaker to have music in our garden! :)
Now, I just have to choose the output in my mpd client.

Thanks a lot !

Yoann
fbe wrote:
Sun Jan 05, 2020 4:25 pm
I installed the bluealsa package and used bluetoothctl (sudo bluetoothctl) via ssh.

In Raspbian with Desktop this package is preinstalled. But it's impossible to use blutooth and analog speakers at the same time with the desktop app. If you select "Analog" the bluetooth speaker gets disconnected. I guess the same happens with the first bluetooth speaker if you connect a second speaker. I also noticed that my bluetooth speaker got disconnected with a certain delay when 'pi' logged out from the Desktop... So I decided to use Raspbian Lite.

After checking, that

Code: Select all

aplay -D bluealsa:DEV=00:42:79:91:2D:A7 /usr/share/sounds/alsa/Front_Center.wav
works, I could simply add a section to the /etc/mpd.conf

Code: Select all

audio_output {
        type            "alsa"
        name            "Bluetooth Speaker 1"
        device          "bluealsa:DEV=00:42:79:91:2D:A7"
}
...
for each speaker (of course with different name and the MAC-Address substituted).

I use bluetooth speakers with mpd only. So I don't even have to edit any alsaconf file.
My speakers automatically connect when I turn them on after my Raspberry Pi.
If the mpd is playing already when a speaker gets connected, I need to stop playing and then start playing again, otherwise the new speaker gets no output.
Sometimes (about once in a month) the root filesystem doesn't get unmounted cleanly if I reboot and I need to run e2fschk from a second Linux system (I use a second Raspbian Installation for that) to fix the root filesystem. All files in lost+found looked like /var/lib/mpd/state. It used to work more reliable with Raspbian Stretch. This issue is more likely related to the mpd version, that is used in Raspbian Buster than to Raspbian Buster itself.

LTolledo
Posts: 6657
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Connect 2 bluetooth speakers to a RPI4

Sat Aug 22, 2020 10:42 pm

the way I'd do this is to use two bluetooth transmitters connected to audio out from a DAC HAT or USB audio dongle.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “Media centres”