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.
Here is how I did it:
Raspberry Pi model 2 with Raspbian
sudo apt-get install mpd mpc icecast2
Change in /etc/mpd.conf:
sudo nano /etc/mpd.conf
bind_to_address “192.168.x.xxx” #your raspberry ip address
comment the following line:
- Configure MPD
sudo nano /etc/mpd.conf
host "192.168.x.xxx” # your raspberry ip address
mount “/mnt/music” # or whatever your NAS is mounted to, see further on.
password “hackme” # set to your password
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
sudo chmod g+w /var/lib/mpd/music/ /var/lib/mpd/playlists/
sudo chgrp audio /var/lib/mpd/music/ /var/lib/mpd/playlists/
Create directory ‘music’ in directory ‘mnt’
sudo mkdir /mnt/music #or whatever name you prefer
sudo chmod g+w /mnt/music
//192.168.x.xxx/share/music /mnt/music cifs username=name,password=password,iocharset=utf8,sec=ntlm
adapt to the ip of your NAS and your username and password
Control mount with:
sudo mount -a
Make symbolic link:
ln -s /mnt/music music
mpc ls | mpc add
mpc repeat on
mpc random on
mpc crossfade 2
On Raspberry Pi ONE: in order to run smoothly adapt the following (overclocking always at your own risk). This is not necessary on a Raspberry Pi TWO.
sudo nano /boot/config.txt
- Make playlist for Volumio in your text editor with the name Icecast.pls:
File1=http://192.168.x.xxx:8000/mnt/music # IP address of your Raspberry Pi
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
Uncontrolled shutdown of Icecast MPD Server can block the music folder on the NAS music server:
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