Piface

Piface

Sunday, March 2, 2014

Raspberry Pi Multi-room Audio Solved

Hi there-  I just spent a few hundred hours figuring out how to send my favorite Pandora stations to every room in my house simultaneously.  I tried every DIY solution that there was, and this is the final answer.  I will tell you what you need, and where to go to get the info.  This solution is under $500 for FOUR rooms, and may even be cheaper if you already have the things.

PLEASE NOTE:  NONE of this is my work. NONE.  I am standing on the shoulders of giants.  Please read to the end for credits.

This is actually much simpler than you would think:

SPEAKERS-
First, you need speakers in each room that have 1/8 jacks.  You can get male-male cables that will plug into the Raspberry Pis, so these do not need to be new speakers/ipod-ready.  ANY speakers will do.   We found a decent unit at Target for $30, but I challenge you to do better.  At Mallwart we found a 3 foot long speaker for under the TV that cost $70.  All you need is 4 powered speakers, on set for each room.  Old computer speakers would do fine.  You can always update this part later.

EST-  $200 if you don't already have the speakers

COMPUTERS-
You will need either 3 raspberry pi's and one old laptop, or 4 raspberry pi's (or one pi/computer for each room of your house).
I got the raspberry pi model B from Allied Electronics.  Individually, they were $40 with shipping and the Noobs OS 8GB SD Card.  The truth is, you only need a 4GB SD card for each, and you don't need Noobs/Raspbian, so you should shop around for the Pi's.
You will also need an Edimax Wifi dongle for each.  It looks like this:

http://www.amazon.com/Edimax-EW-7811Un-Wireless-Adapter-Wizard/dp/B003MTTJOY/ref=sr_1_1?ie=UTF8&qid=1393773311&sr=8-1&keywords=wifi+dongle+raspberry+pi

And you will need 3 microusb phone charger cables with wall-warts.  You may already have these around, or you can buy them for 5 bucks.  I got these because I thought I needed the extra juice at the time.  You should be cool with 1,000 mA:

http://www.amazon.com/Kootek-Raspberry-Supply-Charger-Adapter/dp/B00FIFYQMA/ref=sr_1_1?ie=UTF8&qid=1393773565&sr=8-1&keywords=raspberry+pi+power+supply


So, for me it was 3 pi's plus 3 wifi dongles plus 3 cables= $175 for the computers.  You could get this number down by getting JUST the model B pi's without the Noobs SD card, and buying a couple of your own cheaper 4 GB SD cards.

EST- $175 or maybe a schooch less... and dig up an old laptop that is Wifi ready to save on one room

SETUP GEAR-
You will need an HDMI cable, with an HDMI-ready TV.  You probably have SOME monitor somewhere that has an HDMI input.  If you don't, you should be able to use a yellow RCA jack from an old school TV, although I haven't tested this.

You will need a keyboard, but you will NOT need a mouse for this method.  You will also need an ethernet cable connected to your house internet.

And don't forget those male-to-male 1/8 audio cables if you need them to connect to your speakers.

_________________________________________________________________________________
HOW TO:
_________________________________________________________________________________
Conceptual Overview:  You will have a raspberry pi in each room, and a "server" computer in the main room.  The raspberry pi computers are slaves- all they do is relay the audio signal to the speakers in that room.  The server computer is a server, but is also a slave.  That means it is A) broadcasting to the raspberry pis, and B) playing the broadcast locally.  In this way, you avoid having to get a raspberry pi for the room that the server is in.
...That's the basic idea...

The System:  Thanks to Thomas, over  at http://www.squeezeplug.de, what we are actually doing is turning this grouping of computers into the Logitech Media Squeezebox setup.
The server computer is running as a Squeezebox, and the raspberry pis are running as Squeezelite slaves, which Thomas has dubbed "squeezeplugs".
All of this runs headless, so it consumes very little resourceas, and it can be controlled by a browser open on your local network, or by a multitude of Apps available for your phone or tablet.  ALL SOFTWARE FOR THIS IS FREE FREE FREE

What do I actually do?:

SERVER
First, get an old laptop from your mom, or your neighbor, or whatever.  The perfect candidate is an old and slow machine that you used to love but now you hate.  Put UBUNTU on it.  Ubuntu is an operating system.  It is open source, it is amazing, and it is fast.  It will breathe new life into your old computer.  Google it.

Once you have ubuntu set up, which actually should be as simple as getting the newly ubuntu-ed machine to connect to your wifi, download the Squeezebox software (FREE) from here:
http://www.mysqueezebox.com/

Check in-  You should now have a crappy old computer that has been restored with the linux-based Ubuntu, and which is connected to your wifi network, and which has the Mysqueezebox software downloaded to it.
NOTE:  You can do this without putting ubuntu on the machine, just use the windows version of the software.

THE RASPBERRY PI's
Open up your new raspberry pis.  Look how cute they are.
Now, you need to image a few 4 GB SD cards.
If... you got the Noobs SD card with the pi's, you can format those cards and use them.
If... you bought new 4GB SD cards, you just have to burn the image to them.

Here is the image:  http://www.squeezeplug.eu/?page_id=52
AT THE TOP OF THE PAGE

So, unzip/unpack it, and then burn it to the SD cards.

**if you need help with this step on Ubuntu, let me know at monkmandolins@gmail.com and I will talk you through it**

Check in-  You should now have your Server computer set up with your wifi, and with the Squeezebox software installed on it.  You should also have one SD card for each raspberry pi with the correct SqueezePLUG image burned to it.

SETTING UP THE PI'S

Put the SD card in the Pi.  Connect the pi to your HDMI device (or the RCA-capable TV).  Connect your wifi dongle in one usb port, and connect the keyboard to the other.  Connect the ethernet cable from the Pi to the router.  Plug in the power.
And....
Follow the directions.  Basically, here is the list:
Update the pi,
Expand the filesystem
Change the timezone
Change the keyboard layout if you are in the states (US, 104 generic)
Enable Wifi
Install and enable VNCServer (lets you access the Pi desktops remotely)

Once you have all of the basics setup, install the player Squeezelite.
Follow the directions, and that is ALL you have to do to the Pi.

Check in- You should now have a Server computer set up, and however many raspberry pi computers setup with the Squeezeplug image (thanks Thomas) and configured to be players with Squeezelite.

WHERE IS THE MUSIC?

This is a headless server.  That means it is always running in the background unless you interact with it through the website or a phone app.

Using the www.mysqueezebox.com website, log in and enable all of the devices you just made.  Just poke around to get things setup.  You can also add Pandora, etc., here if you have the PAID Pandora account.
Now, go to the webpage of your server:

 http:// (IP ADDRESS OF THE SERVER COMPUTER WITH NO PARENTHESIS):9000

Mine is http://192.168.0.10:9000

And you have control over all of the Pis.  Poke around on the Logitech Media Server page there to add your local music files, etc.  But for instant gratification, just choose a radiostation to play.

By this time, your Pi's should be in their individual rooms, connected to speakers, and plugged in.

So, you have music playing now (hopefully) through 3 other rooms.  But not in the room you are sitting in (Server Room).

(IF YOU ARE USING UBUNTU, YOU MUST NOW ADD THE SERVER TO YOUR AUDIO GROUP:
                    sudo adduser squeezeboxserver audio

AND THEN RESTART THE SERVER COMPUTER)

The last step is to go to the webpage for your server, and under Settings>Plugins go to Other 3rd Party Plugins at the bottom (may need to enable these at the very bottom) and select
LOCAL PLAYER

Once this is configured, your Server computer should show up as a player and you can have simultaneous output through all the things!

EXTRAS, ETC:
This is just the tip of the iceberg, but it does make a working setup.
There is more to do:

I wasn't able to get an external USB soundcard working, but the quality is still pretty good with the Raspberry Pis native 1/8 jack, for now...

There is a bunch of other stuff you can get for the raspberry pi, and do with it, etc.

There is a better app for your Android phone called Squeeze Commander.  It costs 5 bucks, but allows you to control the volume in all of the rooms at the same time.

If you have a rooted Android phone, there is a .99cent Tasker plugin that will allow you to incorporate the Squeezebox into your Tasker routines, so that you could, for example, turn the music on immediately when you enter your house.

ALL CREDIT GOES TO:

THOMAS- here:         http://www.squeezeplug.de/
Do me, him, and you a favor and make a small donation to him.
He just saved us about $1,000 bucks on great home audio!!!!!