Introduction: RaspbAIRy - the RaspberryPi-based Airplay Speaker
With the delivery of my second RaspberryPi I finally got the chance to start this long-planned project:
I wanted to replace my old bathroom radio with a more contemporary device by building a network-enabled speaker. Because I'm a user of several iDevices, the idea of making the speaker AirPlay-compatible became the basis of my further work.
After some googling I discovered James Laird's amazing shairport client for Linux. The initial installation on the RasPi worked like a charm, so I decided to take the project one step further by making it wireless. With a little help from Google again and some twiddling I finally got it to work and started writing this Instructable.
Have fun reading how it all went down and maybe build your own version of the raspbAIRy.
Step 1: Parts & Tools
- RaspberryPi
- Sound
White LED, 5mm
3,5 mm audio socket and cable
Cable with power plug
- Case
600 x 200 mm artificial leather
Wood glue
- Tools
Screwdriver and screws
Soldering iron and solder
Stapler
Other typical workshop equipment
Step 2: Electronics
- Stereo to Mono
- Input Switch
- Mono Amp and speaker
- Power Supply
Step 3: Installation
- Raspbian 'wheezy'
The following steps require some basic command line skills but if you stick to the linked tutorials you should be good.
- Shairport
- Install some packages and their dependencies, that shairport uses, via apt-get
- Get shairport and the perl module Net::sdp via git
- Install shairport as a service and make it run at startup
- Wifi
- Here is what I did (commands in italic):
- Updated apt-get
- $ sudo apt-get update
- Installed vim (personal preference)
- $ sudo apt-get install vim
- List USB devices to get infos on wifi dongle
- $ lsusb
- Installed Ralink-Firmware
- $ sudo apt-get install firmware-ralink
- Modified the interfaces config
- $ sudo vim /etc/network/interfaces
- auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "my_ssid"
wpa-psk "my_password"
- Reboot
- $ sudo reboot
- Checked that wifi is running
- $ ifconfig -a
- Installed all dependencies for shairport
- $ sudo apt-get install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils
- Installed Net::SDP for iOS6 support
- $ git clone https://github.com/njh/perl-net-sdp.git perl-net-sdp
- $ cd perl-net-sdp
- $ perl Build.PL
- $ sudo ./Build
- $ sudo ./Build test
- $ sudo ./Build install
- $ cd ..
- Got shairport from git
- $ sudo git clone https://github.com/albertz/shairport.git shairport
- Changed to shairport directory and compiled
- $ cd shairport/
- $ sudo make
- $ sudo make install
- Copied the init sample to startup folder and set rights
- $ sudo cp shairport.init.sample /etc/init.d/shairport
- $ cd /etc/init.d
- $ sudo chmod a+x shairport
- $ sudo update-rc.d shairport defaults
- Changed name of shairport client
- $ sudo vim shairport
- changed the following lines:
- NAME=ShairPort
DAEMON="/usr/local/bin/shairport.pl"
PIDFILE=/var/run/$NAME.pid
DAEMON_ARGS="-w $PIDFILE -a raspbAIRy"
- Set audio output to line
- $ amixer cset numid=3 1
- Started shairport
- $ sudo /etc/init.d/shairport start
Step 4: Case
- The case is a simple 200 x 200 x 210mm cube-shaped box made of 5mm MDF, with the side parts being mitered with a 45° angle.
- On the front I made cutouts for the speaker, the volume knob and the power LED. It was covered with light-grey speaker cloth and clipped on with wooden dowels.
- The back shows holes for the power chord, power switch, audio jack and input switch and is held in place by wood screws.
Step 5: Wiring
- All of the audio wiring was done according to Step 2. The RaspberryPi got its own 5V DC power supply with a soldered-on MicroUSB connector.
Step 6: Final Closeups
Step 7: Modifications and Future Plans
- Switching from Raspbian to ArchLinux to decrease boot time from ~35 to 6 seconds
- Adding an audio output socket and switch
- Adding bluetooth support for non-Airplay devices

Second Prize in the
A/V Contest

Finalist in the
Instructables Design Competition

Participated in the
UP! Contest
51 Comments
6 years ago
that box !!!!! lovely
8 years ago
Hi, can I ask you why a mono amp? Doesn't this kill the stero signal?
Reply 8 years ago
In principle, you're right. But I wanted to keep the build relatively small and at the same time have enough room for a 10cm speaker. This is why I chose the summing circuit, which sums both audio channels and inputs it to the amp.
8 years ago on Introduction
Can this be combined with a bluetooth capability? For when you are outside
8 years ago on Introduction
Hi!
Is there a possibility that this can stream HD Videos from any android or IOS device??? I would love to do this.
8 years ago on Introduction
Hi,
Do you need two power suplies? Or can you use a converter like this:
http://www.ebay.com/itm/Waterproof-DC-DC-Converter...
Reply 8 years ago on Introduction
I mean, can you use one wallwart?
9 years ago on Step 2
thank you for this tutorial, what is R and L ?
Reply 8 years ago on Introduction
Sorry for the late reply, R (right) and L (left) are the + voltage lines of the stereo audio signal.
Reply 8 years ago on Introduction
Thank you for replying
8 years ago on Introduction
I am sorry to say this inspite of detailed steps for building the project there is no information given regarding how to use the project /operate the project or what this airplay speaker is capable of like whether it produce any sound/ music? nothing clearly explained???
Reply 8 years ago on Introduction
Hey ramanar, I wasn't aware that this needed to be explicitly stated. This speaker provides Airplay (http://en.wikipedia.org/wiki/AirPlay) audio playback functionality. After booting you simply pair it with any given state-of-the-art Apple device for audio stream. Thus, the speaker is indeed capable of (re)producing the sound from your, let's say, iPhone or iPad.
9 years ago on Introduction
Something you may want to add: setting up your OS as read-only would allow you to safely turn it off quickly, without having to ssh and shutdown properly. Since you ensure there is never any write, there is no risk to shut it down during a write that leaves your SD card corrupted and your system unable to boot.
I followed this for Arch Linux, there are tutorials for Raspbian also if you search:
http://ruiabreu.org/2013-06-02-booting-raspberry-p...
I'm sure some people actually turn it off brutally without configuring it as read-only, but doing that you never know when you'll corrupt your SD card!
Reply 8 years ago on Introduction
Good thought. Thanks for the input :)
9 years ago on Introduction
I'm building that in an old radio I have laying around :)
How did you connect the 2 power blocs by cable, did you cut the pins that usually go to the wall outlet or something?
Reply 9 years ago on Introduction
Exactly. I simply sawed off the basis of the case including the pins, cut the wires behind and soldered extension wires on.
9 years ago on Step 6
Really cool project!
I have two Raspberry Pi's lying around (one is model A and the other B).
I bought the A by mistake and I think I can do something similar to your project with it, since it doesn't need the Ethernet port and only one USB port.
The main difference is that I want to make it compatible with android.
Reply 9 years ago on Introduction
"Compatible with Android" doesn't mean much, the real question is the application you want to use. Some Android application actually support output to Airplay, like DS Audio that I'm using to stream from my Synology NAS.
Or, maybe you want to make a generic blutooth speaker:
https://www.instructables.com/id/Turn-your-Raspberry-Pi-into-a-Portable-Bluetooth-A/
Reply 9 years ago on Introduction
i realized two similar project with both raspberrys Model A and Model B, both are working and the updated firmware makes the audio connector working good. usb is for the ethermax adapter. it is working fine.
9 years ago on Introduction
Hi, I really like this and plan on doing something similar but inside a vintage radio. Are you happy with the way it sounds? Is it loud enough? Thanks,