Open Source Multi Room Speaker
I donβt like the overall user expiriance with Sonos. But like the way of listening to music. So I tried to get something open instead. I found the awesome snapcast and this is my setup.
server
- Multi Room GUI: snapcastr
- snapcast source/server
- one or more audio sources:
- (optional) Spotify Connect: librespot π
- (optional) WebPlayer: mopidy
- (optional) AirPlay audio sink: https://github.com/mikebrady/shairport-sync
- (optional) DLNA Renderer: gmediarender
- (optional) snapcast sink/client
client
- snapcast sink/client
- Amplifier Options:
- 70β¬ JustBoom Amp - 2 x 30 W RMS
- 54β¬ HiFiBerry Amp2 - 40W RMS
- 30β¬ JustBoom Amp Zero - 30W RMS π
- 20β¬ HiFiBerry MINIAMP - 6W max?
Hardware
I choose JustBoom as the HiFiBerry was to expensive in my opinion and I also felt kind of cheated by their β60 W outβ. I think Amp and Amp Zero are the same for mono?
In order to put the Amp to work you need:
- ~15β¬ Raspberry Pi (Zero WH seems to be the cheapest option)
- ~4β¬ SD Card (> 1 GB π )
- ~18β¬ powersupply that can give more than the peak of the amplifier (+ a little for the Pi)
- the actual speaker
I ended up with powersupplies from Mean Well (like this). Using these the standby consumption of a client (connected but not playing) seems to be below 0.1W π€©
So each client costs at least 67β¬ plus the speaker.
Bathroom - 100β¬
Small watherproof WiFi speaker
- 19β¬ IP66 cover
- 14β¬ IP65 speaker 40W RMS - does not sound totally awesome I guess
- 67β¬ Base
- 1β¬ muff
- 3β¬ connector cable
Kitchen and Diningroom - each from 97β¬
Not so small WiFi speaker
Bedroom - 6β¬
Utilized some old stuff.
- Old Pi 2B+
- Old PC speakers
- GPIO controlled power swith for the speakers
- 1β¬ Solid State Relais / Phototriac
- 5β¬ Power Cable
- Old charger
Livingroom - 0β¬
Existing Home Cinnema as WiFi speaker. The audio receiver must be switched to the correct HDMI port manually (for now).
- LivaX (any Pi would also work)
- Onkyo TX-SR252
Garden - 55β¬
Because why not :) Also used as a BT-Device, see below.
- Old ION - Audio Tailgater (50W)
- 50β¬ Base without Powersupply
Config
All easy.
Clients
Raspbian Lite. Install the snapcast client and edit the following files:
File | Why? |
---|---|
/boot/config.txt | Enable the amp |
/etc/asound.conf | Mono Sound |
/etc/networks/interfaces | WiFi |
/etc/wpa_sup | WiFi |
/etc/defaults/snapclient | Hostname, ALSA Device to use |
/etc/hostname | Hostname |
Enable the amp
/boot/config.txt
dtparam=audio=off
dtoverlay=justboom-dac
see https://support.hifiberry.com/hc/en-us/articles/205377651-Configuring-Linux-4-x-or-higher
Mono Sound
/etc/asound.conf
pcm.!default makemono
pcm.makemono {
type route
slave.pcm "hw:0"
ttable {
0.0 1 # in-channel 0, out-channel 0, 100% volume
1.0 1 # in-channel 1, out-channel 0, 100% volume
}
}
see https://superuser.com/questions/155522/force-downmix-to-mono-on-linux or https://www.justboom.co/tutorials/configure-justboom-amps-mono/
Bluetooth
You might also want to connect via Bluetooth. bt-speaker@3f49801 with BTtoggle.py works great.
It needs the following config.ini
for the justboom:
[bt_speaker]
connect_command = /etc/bt_speaker/hooks/connect
disconnect_command = /etc/bt_speaker/hooks/disconnect
[bluez]
device_path = /org/bluez/hci0
discoverable = yes
[alsa]
enabled = yes
mixer = Digital
id = 0
cardindex = 0
device = makemono
Server
snapcast
See their instructions.
librespot
git clone https://github.com/librespot-org/librespot
cd librespot/
cargo build --release --features "alsa-backend"
gmediarender
sudo apt install gmediarender
pacmd load-module module-pipe-sink file=/tmp/snapfifo sink_name=Snapcast rate=48000
pacmd update-sink-proplist Snapcast device.description=Snapcast
gmediarender --gstout-audiosink=pulsesink --gstout-audiodevice=Snapcast -f Snapcast -d
snapcastr
If you serve snapcastr with lighttpd. You could just run it in flask. But you donβt need to spend another port if you run a webserver anyway.
/etc/lighttpd/conf-enabled/10-fastcgi.conf
sudo pip3 install --system flask
sudo pip3 install --system flask-bootstrap
sudo pip3 install --system flask-nav
sudo pip3 install --system wtforms
sudo pip3 install --system snapcast