Raspberry Pi – Whole-house sound system

To welcome the 2016 Let's put a post that I like… In this document we will see how to set up an audio system for our homes! With some Raspberrys scattered around the house we can have a piped music or a multiroom system of the cheapest! We will be able to listen to any song from our multimedia server or music from our mobile, as well as Spotify or whatever we are interested in! We can send the audio indistinctly, to one Raspberry or multiple, as we are interested!

 

raspberry_airplay_00-bujarra

I'll tell you a little about the steps, Ideas and what can be assembled, then everyone can go as far as they want. First of all, Be clear about the concepts, we will need a Raspberry Pi for each place where we want to put a speaker, Obviously we connect a speaker to the jack of the 3.5 mini-jack″ of the Pi. The Pi, You know that we have it from 5€, The speakers will depend on each one what you need (20€ minimum each). To each Raspberry we will install shairport-sync which is a software that will emulate AirPlay on Linux through which we can send audio from any iPhone or iPad, obviously remember that Pi's need a network, so either in each room we will have a network socket or we put a mini USB dongle of these Wifi and that's it!

So far so good, now, if we are going to use iTunes to send the music from our iPhone/iPad/Mac/Windows to the Pi there is no problem since this will allow us multiple AirPlay devices playing simultaneously, but, if we want to listen to Spotify (The free) on multiple AirPlay speakers, This defaults to 'capped’ (Well, With the Premium Account you unlock, you know 10€/month…). So to skip this, we need to add (that will come in handy) a central element to this approach, I'll tell you: If we add a computer that we use as a music repository, we can install iTunes on it & Spotify, and if we also install a paid software called Airfoil by Rogue Amoeba (for about 25€, There is a trial that gives us 10 minutes free to try), with this software we will be able to divert all the sound from the system to AirPlay speakers (and manage it remotely from the iPhone/iPad to control volumes, Switch off/connect speakers…). If you have a computer where you can install Windows/Mac and use it as a central control panel, there is no problem, I didn't have it and I bought one of these new Intel sticks that is a miniWindows (4 Atom cores, 2Gb RAM, 32Gb of internal SD disk, Wifi…) that for this function I have enough and more than enough, for about 140€, there are cheaper ones, eh! So in this equipment I will have my music stored and thanks to the fact that iTunes and Spotify can be managed remotely, Windows is at boot, will launch these apps and with the iPad/iPhone I will be able to handle both iTunes (Share at home) like Spotify!

After this intro, We start with the steps! The Raspberry as we see we will use them as a satellite speaker, these Raspberry's will have Raspbian installed and updated as well as configured the network!

First, We install the requirements:

[SourceCode]Sudo apt-get install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev mono-complete
sudo apt-get install avahi-daemon libavahi-client-dev
Sudo apt-get install libssl-dev[/SourceCode]

Download and install Airfoil Speakers for Linux for the Raspberry Pi Rogue Amoreba, Running:

[SourceCode]wget https://rogueamoeba.com/airfoil/download/AirfoilSpeakersRaspberryPi.tgz
tar zxfv AirfoilSpeakersRaspberryPi.tgz
CD Airfoilspeakers/
make install[/SourceCode]

We tried running it with:

[SourceCode]/usr/bin/airfoilspeakers[/SourceCode]

 

Well, that's it! All that's left is to make it boot at startup when you restart the Raspberry, We easily do it with 'cron', We run 'crontab -e’ and we add:

[SourceCode]@reboot sudo /usr/bin/airfoilspeakers[/SourceCode]

 

We save the file, We restart if we want to try it and that's it!

 


raspberry_airplay_01-bujarra

With this we will already have a Raspberry ready to be able to send audio from AirPlay! If we want, as I said before, to send Spotify audio to several Raspberry by default, we will not be able to, So we'll use a machine with Windows or Mac where we will install Rogue Amoeba Airfoil. Once the software is installed, that has no mystery, we will select the output of the 'System Audio’ from the combo so that all the audio in the system is redirected to the speakers that we have.

 

raspberry_airplay_02-Bujarra

As we will see there is an app in the Apple Store to manage this app remotely from our iPhon/iPad, in case we want to put a speaker more/less or increase/lower the volume!

 

raspberry_airplay_03-bujarra

As I said before, to that Windows that is 'central', We will have to put him in the starting 3 Apps (iTunes, Spotify & Airfoil) when always starting automatically by putting them on the Start, in addition to doing autologon if necessary. To be able to control the iTunes you have locally, we must enable 'Home Sharing'.

 

raspberry_airplay_04-bujarra

When you open iTunes on an iPhone/iPad, it will detect the shared library that we have on the network or with the same Apple account, We connect!

 

raspberry_airplay_05-Bujarra

Once connected to iTunes, this would be what we would see from the iPad/iPhone, a marvel for remote management of iTunes!!!

 

raspberry_airplay_06-Bujarra

And for Spotify even easier, when you have it open on the computer and when you open Spotify also on the iPad/iPhone it will detect it and allow you to manage it remotely!!!

 

Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!