Hacking a Raspberry Pi into a wireless airplay speaker #piday #raspberrypi @Raspberry_Pi
Handy overview for how to fake airplay speakers using a Raspberry Pi. While the latest state of this project is probably better for an installation audio project than an ideal way to listen to your music, the leap from these instructions to one using an outboard USB DAC is not far — and I look forward to trying this out in my apartment!.
I’ve had mine for a few months now but I hadn’t got around to using it yet. So I’ve now decided to try to make something that I’ve wanted for a while: a product to bring my good but dated speaker system into the 21st century by enabling wireless streaming of music to it.
A possible way to do this would be to buy an Airport Express or an Apple TV and connect the audio out to the stereo. But then I would feel like overpaying for features like video streaming or wireless routing that wouldn’t be used. Besides, those products cost around £80. Airplay enabled speakers cost £200 at the low end. This raspberry pi creation should easily come in under £30.
How to fake airplay compataility
To get a Raspberry Pi looking like an airplay receiver I made use of Shairport. This opensource software was created by James Laird after literally tearing open an airport express, dumping the ROM and reverse engineering out the private cryptographic key that airplay uses to identity of legitimate apple products. The github repo has the Perl source code that can be compiled for simple audio receiving only. For this project we essentially need to get this code running on a networked raspberry pi.
I’ll condense this down to the bare instructions for a working outcome. On the way here I had attempted many other ways to do it. I flirted with XBMC, creating a reasonably ok Apple TV-like system in the process. But frequent crashes caused me to divert my attention to this simpler, audio-only solution.
As a word of warning, one of the common pitfalls I encountered was with the very narrow acceptable power range of the RPi. The computer is powered by usb cable and any additional loads such as a wifi adapter or a budget usb keyboard can strain this power supply past it’s limits. I had several instances of odd performance or non-responsiveness due to this….
Adafruit has had paid day off for voting for our team for years, if you need help getting that going for your organization, let us know – we can share how and why we did this as well as the good results. Here are some resources for voting by mail, voting in person, and some NY resources for our NY based teams as well. If there are additional resources to add, please let us know – adafruit.com/vote
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.
Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !
"This opensource software was created by James Laird after literally tearing open an airport express, dumping the ROM and reverse engineering out the private cryptographic key that airplay uses to identity of legitimate apple products."
This sounds scary. At the very least it sounds like it’s bordering on violating the DCMA. While I love DIY, and hacking things to make them do something they shouldn’t, I don’t think we should advocate breaking the law here.
If it doesn’t violate and DCMA laws then I will get off my soap box. The reverse engineering part is particular scary since there is specific verbiage in the act to criminalize reverse engineering of protected ip.