This article will describe why i created a new software called HydraPlay. HydraPlay is a user interface for a multiroom audio setup which consists of Raspberry Pis, Mopidy instances, Pulseaudio and Snapcast.
Why another UI for Mopidy?
Lets start with the Hardware Setup.
I used 3 Raspberry Pi’s for my initial setup. One of the Pi’s as server the others as audio clients. I have ceiling speakers installed at the ground floor of my house, so the wiring is centralised at the basement. That is the point where i installed the Raspberry Pi’s in a self printed mini rack found on Thingiverse.
For amplification of the audio signal i used Pimoronis phat beat.You can also use normal active speakers connected to the Raspberry Pis audio jack. I am using this HAT because, as i mentioned before, i am using passive wall/ceiling speakers. My solution is quite good for ambient music and listening to radio stations on Tune-In. For the Party mode i am planing to have a wireless Raspberry Pi Zero connected to my Teufel 5.1 surround system.
Finally everything is hooked up on some self build rails rails.
Server Side Software Setup
I started with a clean Raspbian installation on a Raspberry Pi 3B+. I strictly recommend to use a Raspberry Pi 3B+ or the new Raspberry Pi 4 Model B here, because there will run a lot of services in parallel on the system. Every steam is represented by a Mopidy instance.
The Software Setup consists of Pulseaudio which will provide the audio sinks for the Snapcast Server. Snapcast Server is the Heartbeat of the project. It provides all the multiroom audio magic behind the scenes. I use multiple mopidy instances as audio stream provider. Each stream provider can provide audio from multiple audio sources, like spotify, tunein or local stored mp3s. There are a lot of plugins available to extend mopidy in a way that it can provide other possible sources.
You can find detailed installation Instructions on GitHub. Hopefully I will be able to create a bash script or even better a running docker configuration to make the basic setup easier for Linux newbies.
Client Side Software Setup
The software setup on the client side is straight forward. Just install a plain minimal Raspbian on the Raspberry Pi. If you are using the Pimoroni pHAT beat, like on the picture above, you need to install the pHat beat drivers. Simply follow the instructions on the „Getting Started“ Guide on the Pimoroni Blog.
Finally you need to install the Snapclient on the Client side Raspberry pi. Thats all. If all components are hooked up the setup should be able to run.
Testing the Setup
Now you are able to connect to the player by pointing your Browser to the local IP address of your Snapcast Server and the port of the running HydraPlay daemon. (e.g. https://192.168.1.10:8080).
You should the the User Interface of HydraPlay, which shows as many audio players as clients are configured. If you click on the cover icon of a player, the media library will open. You are able to select a stream (source) to play on the selected player. Use the search to browse the library.
HydraPlay only support Tune-In by now. But it should be simple to integrate the Mopidy Spotify Plugin. I am using HydraPlay for a couple of month now and I can say that the basic setup is doing a good job.
I will do further development when I have the time or I need new features on HydraPlay. But if you are a programmer and you want to contribute to the project feel free to contact me on GitHub or leave just a comment here.
UPDATE: Spotify works out of the box, only the cover art work is not working, because the data structure in Mopidy differs from the one of TuneIn. There is already a branch where i am working on a Spotify integration on GitHub.