With the advent of the new Raspberry Pi model 2, the more cycle-consuming applications now have a briljant performance.
Building on the work of others I have now configured a narrow-casting intranet in-house music system, with the Model 2 as the server and 4 model 1’s as the clients, using MPD, MPC and Icecast on the Server Pi and Volumio on the client Pi’s. This allows me to play the same music from my NAS music server simultaneously throughout the house. See attached file for picture of configuration.
bind_to_address “192.168.x.xxx” #your raspberry ip address
comment the following line:
user “mpd”
Configure MPD
sudo nano /etc/mpd.conf
audio_output {
type “shout”
name “Icecast”
host "192.168.x.xxx” # your raspberry ip address
port “8000”
mount “/mnt/music” # or whatever your NAS is mounted to, see further on.
password “hackme” # set to your password
quality “10”
format “44100:16:2”
encoding “ogg”
}
Comment all lines in alsa output
Restart MPD to load these changes
sudo /etc/init.d/mpd restart
Icecast2 will start up by default, or can be restarted with:
sudo /etc/init.d/icecast2 restart
Make playlist for Volumio in your text editor with the name Icecast.pls:
Icecast.pls
[playlist]
numberofentries=1
File1=http://192.168.x.xxx:8000/mnt/music # IP address of your Raspberry Pi
Title1=Icecast
Copy playlist to your Webradio folder in Volumio
Start Volumio on your Raspberry Pi client and choose Webradio / Icecast.
Repeat this on all your Raspberry Pi’s and you will have a Multi-Room Audio System, playing the same music throughout your house.
MPD Server Management
Raspberry Pi: mpc
Windows: Auremo
Android: DroidMPD
Issues
Uncontrolled shutdown of Icecast MPD Server can block the music folder on the NAS music server:
Correct with:
sudo chmod g+w /mnt/music # or whatever the name of your mount is.
Or, if that is not compliant with your setup, you can also:
sudo chmod -R 744 /mnt/music
Yes, synchronization is important and can only be achieved by configuring your time servers as closely as possible to your physical location. So, for instance, if you are living in France, Google for NTP servers in France and then configure your ntp.conf file to reflect that, like:
sudo nano /etc/ntp.conf
and then: add your local timeservers.
Closer is better.
I have good results with that. The synchronization in my situaton is near perfect.
Thanks Wim?
Based on your idea, I took a similar approach, but added it as an additional audio_out to mpd.conf in an existing volumio setup.
Next to 2 PIs, there also a Squeezebox Boom in the network, but it cannot handle a quality “10” OGG stream.
As I really want to keep the highest possible quality for the PIs, I’m going to try if if a second audio-out with a lesser quality will solve this for the SB.
My ODROID-X2 should be powerful enough to do several different outputs as the CPU is not hitting 50% yet with playing local and streaming to the PIs.
Very interesting and just what I need. Please can you clarify why the NAS is shown connected to both the Intranet Router and Pi-2 server?
I have recently acquired my first PI-2 and have had some difficulty in getting audio from my NAS. Maybe your answer will help me. Certainly you have inspired me to buy a second Pi-2 and follow the same route - Thanks
the nas is connected to the intranet router in order to enable the individual raspberry/volumio players to pull music directly from the nas, enabling each raspberry to play the music of its own choice. the connection to the pi2 mpd sever however, is to play the music from the icecast narrowcast system, in fact acting as my personal in- house radio, playing from the nas playlists. this mode enables all raspberries to play the same music synchronized through the whole house
@wim, thanks very much for the diagram! Helps to explain so much. Aside from playing mp3 files throughout the house, how options are available for playing podcasts? How do you add new podcasts, view available episodes, etc…?
I’ve always liked stitcher for podcasts. I wish I could use that as the podcast interface but pipe it through the whole house audio.
Hi all,
I’m aware that this thread is rather old already. Still, I wanted to thank you for this great post. I tried the proposed set up with three raspi2 and 3 running volumio2 and I have to say it works like a charm. While I type this all three raspis are playing the same song in the kitchen, the living room and the living room extension. To my surprise all three are perfectly in sync. Once again thank you for this post!
All the best
A very happy Multiroomer
I’m looking for a similar solution. Running the Icecast server on my main Volumio setup and if needed/wanted stream it to a second one. Thus, my question, are you able to do two audio_outputs on your Pi2? Can it play local sound, and simultaneous stream to a second pi? If so, what config did you use and how do you choose to use both on the Pi2?
Hi Ruud,
this has been ditched ages ago as I only used it as a proof of concept (and got rid of all my PIs), otherwise I could have shown you the mpd configuration.
With Volumio 2 this is going to be tricky, as the mpd configuration file is handled by volumio.
Anything you add or change is potentially lost when Volumio decides to rewrite the config.
I’m waiting with multiroom until I move house. By then snapcast should be implemented in Volumio (so I hope) .
Still, the icecast approach is a nice one, but difficult to tell if the receivers are really in sync when the rooms are further apart (as in my case).
-Gé-
Hi guys,
today i tried out to configure the server with icecast, mpd and mpc.
I followd the introduction on a new installed jessi rasbian RPi 3 and cant get the following points from 12.
If i want to update mpc ("mpc update) i already get: “error: Connection refused”
I am a newbe on linux an RPi and googled this point but didn’t get any answer.
Sorry, not an answer to the last question, but I guess most people on here are thinking in terms of snapcast for multiroom, synced play. Indeed, it is planned to be included in Volumio at some point. If you are interested in trying this, then you may wish to have a look at Saiyato’s Snapcast alpha plugin on Github.
I just created the first working package, configuration should work and you can en- or disable the server and/or client.
Switching between streams is problematic (e.g. you can patch your startconnect for spotify-web, but switching between spotify-web and mpd will take a few seconds). Since the topology in the first post didn’t include Spotify I suspect this is not a problem.
If you want to switch between local and remote play, just edit the volumio-host in the plugin setting, it will automatically restart the snapcast daemon; effectively changing the source.
Even neater would be to add a streaming button next to play… Or something like that, oh well, maybe in the future.
If you have any questions just ask, if you are experiencing issues I must encourage you to update the github page and log an issue. That way thing won’t get lost, I’m prone to unintended forgetfulness lately.