Raspberry Pi - Multi-zoning Audio Pi System

This project came along as a replacement for my aging Xlobby multi-zoning system. Also with planning on moving into a new home, I didn't feel that I wanted to run speaker wire all over the house, pop holes in my ceilings and mounting speakers. I found that the rest of the family were not really taking advantage of this wonderful setup anyways. So I started to look at other solutions. Since I've been using a Raspberry Pi in my mobile SqueezePlug system, and it ran a Logitech Squeezebox Server backend and Squeezelite front end...it started to peak my interest.

The Squeezebox system, when fully used, could distribute audio to individual clients, which of course was important, but it could sync all clients together to play the same music to all zones. This was a key point, and I wanted to find out if this could be done on the Raspberry Pi. During my research, I found multiple software setups, and tried the following list:

a) Volumio

b) piCorePlayer

c) SqueezePlug

Before I fully understood Logitech's Squeezebox system, I had thought of using multiple Pi's, and if this could be done. I found a project called Volumio, which is a dedicated audio player running on a Music Player Deamon (MPD). Controlling the system is done via web browser. This setup caught my eye as a user of the software created an Android app for controlling multiple Volumio Pi's called sound@home.

I currently have 2 Raspberry Pi modules, and decided to try Volumio out on them, and use sound@home to control them. Volumio installed very easily, and I had one Pi setup very quickly. I tried sound@home on my cell phone, but the resolution wasn't correct and icons were on top of each other. I then tried it on my tablet. Though the icons were more spread out, the GUI just looked rather primitive. Least to say, a good valid attempt by the developer, and I'm sure that over time the GUI will improve, but I just didn't like it at this time.

I also found out that Volumio and sound@home currently was not able to sync multiple Pi's together, which was a major deterrent.

So that's when I started to look at a Squeezebox solution, as I had read that it was very capable of syncing multiple clients. At this point, I already knew that SqueezePlug had Squeezelite, so I installed this on a Pi (replacing Volumio). I also have Softsqueeze, which is a Windows Squeeze client, installed on my compter...so I just needed the Logitech LMS setup somehow....I then discovered that someone had developed a LMS plugin for the UnRAID server. I got that setup, and had Softsqueeze and Squeezelite playing music. Now came the test. In the LMS web interface, you can command players to sync, to which I did. Though the two players started to play the same music, there was latency between the two players. One was about a half second leading the other in playback. I figured the issue was Softsqueeze as this has always been a concern on Windows systems realized back in the Xlobby zoning days. So onto further developments....

I decided at this time to bring the second Pi into the fray (at the time it was configured for the LightshowPi project). Upon further research, I decided I would try out piCorePlayer. Primarily because it ran on a very striped down Linux distro called Tiny Linux so there was very little overhead. It also loaded the OS and all configure files into the Pi's RAM, which in theory should be faster than running off the SD card. Not to mention this would protect the setup if the power was disconnected.

Each Pi was loaded with piCorePlayer, and they were quickly up and running. In the web configuration, I gave both unique names.

I also installed the Logitech Squeezebox controller app on my phone, my wife's phone, and my tablet, to control each piCorePlayer. So I was up and running, the app was able to find, connect and control each player. I had different music playing to each Pi without issue (other than the poor audio from the Pi board...boy do I need a dedicated DAC for this...but that's an entirely different issue). I then went into the Squeezebox controller setup to configure sync playback...the moment of truth. Well, the same music started to playback from both Pi's with very little latency between them...not enough to bother the listener. Now the question is; how many Pi's loaded with piCorePlayer could be synced together? Well another question, could Airplay/Shairport be installed on the piCorePlayer platform to allow streaming from Apple devices?

The first question is up in the air still, but it doesn't matter as the piCorePlayer doesn't support Airplay at this time. I tried to install it independently but since the typical setup would be to install everything on the SD card, and piCorePlayer loads everything into RAM, there is no easy way to do this without writing the code myself...which isn't going to happen anytime soon.

Well, Volumio is said to support Airplay, and I found out that Squeezelite could also be installed independently. Back to Volumio I went. Installed it on both Pi's, installed instructions on installing Squeezelite, and I had them playing (in sync to boot) in about a half hour. I was able to control them with the Android app. I also installed the same Apples version of the app on my kid's iPod Touch's. I then tried Airplay. No go. Neither Volumio could be seen on the iPod Touch. This was due to both using the same name...which I did change in the /etc/hosts file, /etc/hostname file and /etc/init.d/shairport file, but wasn't recognized for some reason.

Now I was scratching my head a little. I then realized that good ol'SqueezePlug could do Airplay via Shairport, and I would just run Squeezelite on it without a Squeezebox server, since I was running it from the UnRAID server. So loaded both Pi's with the SqueezePlug software (Squeezelite player, and Shairport), tested each Squeezelite setup, and again had near perfect sync between the Pi's. But again, neither could be seen by the iPod via Airplay. I then discovered this site which explains how to setup an independent Shairport. The thing that caught my attention was to load/install a version of Shairport that is recognized by iOS 6...which the iPod Touch's both are running. I followed that tutorial, and in the end, the iPod Touch can see both Pi setups in the Airplay list.

I'm now testing the SqueezePlug/Shairport setup more intensely now. As I mentioned at the top of the page, my family are planning on moving into a new home, where I was going to setup multiple Pi's in a zoning setup. The zones would consist of the following:

1) Theater Room - Pi would be connected to the home theater receiver and music playback to the system speakers

2) Games Room - Pi would be connected to my NAD integrated amp, and playback via stereo speakers

3) Living Room - Pi would be connected direct to the TV. Maybe eventually I may pickup a dedicated amp/speakers for this setup

4) Master Bedroom - Pi would be connected to a stereo receiver

5) Outside - Pi would be connected to the BSG amps pulled from my old Xlobby music system setup. Amps would be bridged to outdoor speakers.

So the test is now to expand the amount of Pi's and verify sync playback can still be achieved. I also want to explore using proper DAC's instead of the Pi's audio out.

I was further experimenting with SqueezePlug to try and take out some unwanted noise and pops, and performing some updates. Along the way, I guess I screwed one installation up as when I played music through that Pi, it played really slow, and there was alot of noise (the opposite of what I was trying to achieve). I then decided to go back to Volumio. The problem with Volumio was that I couldn't get Airplay to work right with multiple Volumio Pi's. I went everywhere I could think of to set the name properly including editing hosts, hostname.sh, squeezelite, shairport. But the AirPlay names would never change. I then found this post which explained that Volumio uses a setting in the /var/www/command/player_wrk.php file for AirPlay naming. Changed the name as indicated, rebooted each Pi, and now I have a both recognized in the AirPlay settings of iTunes and on the individual Apple devices. So I may as well stick with Volumio, as if the players are used as individual devices, MPD sounds great, and Volumio individually has a pretty decent, yet plain interface. I have already verified that Squeezelite plays back fine, both individually and in a sync situation, and now I have AirPlay working too. Again I still have to verify what happens when I add more Pi's to the mix. Can all of them stay in decent sync with each other? That's the next test.

A fellow co-worker of mine was able to lend me three additional Raspberry Pi boards to allow me to test a full out multi-zoning setup. After installing Volumio/Squeezelite and configuring each one for a particular zone, I was up and running. All five zones were recognized in my Android's Squeezebox Controller app, and I quickly synced them all together so they were playing the same music. The test was successful. All five stayed in perfect sync to each other (or near perfect that you couldn't tell from room to room). I even tested Airplay by using iTunes and playing back to all zones at the same time...again in perfect sync. So this test was very successful, and I'm happy for that, BUT...

Now the only thing that I have to figure out is I'm getting constant noise from the all the Pi's 3.5mm audio out port. I have all 5 Pi's connected to the same USB hub to power them. The hub's A/C is connected to the same receptacle as the amplifiers. The noise is a constant static buzz/hiss. I'm going to try some external DAC units that connect to the USB or even the i2c port and see if that takes care of the noise issue. I noticed during experimentation that I didn't have this noise issue when the HDMI was connected instead of the analog audio port. I also experimented by powering the Pi with my tablet power puck, instead of being plugged into the USB hub. This too drastically reduced the noise. So I will have to look for decent power plugs to use in my final setup.

Now as I complete these initial tests, my DIY mulit-zoning configuration will consist of the following with each Pi loaded with Volumio/Squeezelite/Airplay:

a) use remote (Android or Apple) Logitechs Squeezebox control to setup streaming playback of local media and internet radio

b) use the same setup as a) to sync playback to multiple zones

c) use an Android control like BubbleUPnP, or computer browser to setup local streaming playback to individual zones via Volumio

d) use iTunes or other Apple products to stream music to individual zones via AirPlay

e) use the same setup as d) to sync playback to multiple zones via iTunes Airplay

From here on, please resort to this page for details of the actual install and setup of the system once we've moved into our new house.