

Show HN: Hacking a Raspberry Pi into a wireless airplay speaker - jordn
http://jordanburgess.com/post/38986434391/raspberry-pi-airplay

======
joelhaasnoot
Did this hack myself a month or two ago - I go the XBMC route (openElec) on
the Pi with Airfoil for Windows to stream Spotify. That combination is finicky
- sometimes requires one or two connects. When spotify releases a libspotify
compiled for the right ARM architecture (something about floating point?) I'm
going to run <http://www.mopidy.com/>

The disadvantage of the headphone port of the Raspberry Pi is that it used to
put out absolutely awful sound, but that may have improved. Using shairport
also has bugs - the audio output from the script sometimes has pops and after
about 10 or 20 minutes will randomly disconnect.

~~~
mkaufmann
A tip to avoid the headphone port: Either use the HDMI port or try a usb
soundcard <http://elinux.org/RPi_VerifiedPeripherals#USB_Sound_Cards>

~~~
joelhaasnoot
Yeah, should've clarified that - XBMC comes up on HDMI now and audio is routed
through my TV to play music.

------
davidblurton
Why would you do this rather than buy an Airport Express? The cost of the
Raspberry Pi, wifi adapter and a basic USB soundcard add up to as much as the
real thing, but you spend hours configuring software and end up with a flakey
solution. It's great that you _can_ do this, but why not save time and money
by buying the real thing? You also get bit perfect optical output and a pretty
decent wireless router.

~~~
ryguytilidie
Came here to say just this. I never understand these like "money saving hacks"
that cost very close to what an actual, legitimate product intended for this
purpose would cost, with a ton of work, and less reliability.

~~~
hyperbovine
Well, it's not called "Hacker" News for nothing. CNet is over there.

Anyways, apart from AirPlay (AirPort Express), my RPi is performing XBMC /
media center capabilities (Apple TV), streaming network backup (Time Capsule),
motion-activated security camera, software-defined radio and X10 home
automation. I will shortly be interfacing the GPIO to an SSR and thermocouple
so I can use it as a PID for beer brewing and smoking fish. For $35 and 2w of
power, that's pretty good.

~~~
ryguytilidie
"Well, it's not called "Hacker" News for nothing. CNet is over there."

Cool diss, hope it made you feel better about yourself I guess? Anyway, I
simply pointed out that the author framed this as a cost saving tool when it
really isn't. Say its a fun hack and I have no problem, but to call this thing
a moneysaving hack when it doesnt save a whole lot of money and produces a
lower quality device. But hey, your one line diss sounds better so why bother
with logic.

------
gpmcadam
A note for those attempting to use Ethernet to Airplay mirror:

Your router _must_ allow multicasting between WLAN and Ethernet clients,
otherwise your Pi won't show up to iDevices connected via WiFi.

If this is a problem for you (as it was for me) your only solution is
attaching a WiFi adapter to your Pi. The consensus for best support, lowest
power and tiny footprint is Edimax EW-7811UN
(<http://www.amazon.co.uk/gp/product/B003MTTJOY>).

I just grabbed an old Linksys WUSB54GS that I had laying around and it played
nicely with the Raspberry Pi with little to not effort.

~~~
christiangenco
That's <http://www.amazon.com/dp/B005CLMJLU> for our friends on the other side
of the pond.

------
rodh
What a coincidence. I did the exact same thing yesterday, following the
instructions here: [http://trouch.com/2012/08/03/airpi-airplay-audio-with-
raspbe...](http://trouch.com/2012/08/03/airpi-airplay-audio-with-raspberry/).
You _really_ need a USB soundcard for this to be usable though, unfortunately.

~~~
josteink
What about HDMI audio output? For those of us who already have a decent,
digital A/V receiver?

~~~
a_bonobo
I have XBMC with graphics + sound running over HDMI to my TV, no issues with
sound at all.

------
IgorPartola
This looks like a neat hack. I might attempt something similar at some point.

Somewhat relevant, since many people here are talking about using a USB sound
card: I have heard good things [1] about using this hub/dock combo with a
Raspberry Pi [2]. Might be overkill for this project but it would give you an
all-in-one connection dock for more multi-purpose projects.

[1] [http://www.trilug.org/pipermail/trilug/Week-of-
Mon-20120903/...](http://www.trilug.org/pipermail/trilug/Week-of-
Mon-20120903/066831.html) [2]
<http://www.microbarn.com/details.aspx?rid=102750>

------
bede
Cool hack. There's real demand for a reasonably priced Airport Express
alternative, but it's a shame that the RasPi's DAC isn't up to scratch for
HiFi use.

You suggest we follow you on Twitter, yet protect your tweets...

~~~
jordn
Bugger, i forgot the 'b' on the url. Thanks for telling me, I wouldn't have
caught that otherwise. I'm <http://twitter.com/jordnb>

And I agree. I expect someone could kickstart a little electronics add on to
do exactly that - a reasonable wireless DAC to airplay to. But thoughts on it
would be that with all the required components still I'd be difficult to
undercut Apple's airport express still.

------
7ewis
There is a problem with the instructions though; when you get to the:

'Installing Perl Net-SDP'

Section, and type in the third line of code, after git clone, you get this
error message: <http://pastebin.com/MSrqYYKq>

Saying to Contact the author, because there are files missing.

I have contacted the author, and Jordan too.

Does anyone know how to get around this?

~~~
Maxious
The missing files aren't stopping you, it's the last line "mkdir _build:
Permission denied".

To get around it I just ran the build as root ;)

~~~
7ewis
Ah yeah, thank you!

I have everything 'working' now, although it's quite glitchy, making loads of
static sounds. After a few restarts etc. it is playing okay now, I don't want
stop playing it incase it doesn't work again!

------
wiradikusuma
Looks cool! Anyone know any of this for Android? At least for Samsung Note. I
want to try to wirelessly stream audio from my Note to my Logitech Z2300.

~~~
joelhaasnoot
You could get a small little Bluetooth A2DP reciever and stream over
bluetooth: [http://www.amazon.com/Belkin-F8Z492TTP-Bluetooth-Music-
Recei...](http://www.amazon.com/Belkin-F8Z492TTP-Bluetooth-Music-
Receiver/dp/B0047T79VS/ref=sr_1_1?ie=UTF8&qid=1356719725&sr=8-1&keywords=a2dp+receiver)
There's also ways to stream from Android to Airplay receivers - just search
for Airstream in the play store.

------
itry
Is there a way to stream music from a Linux machine to multiple destinations?

Currently I have a notebook with Mint connected to my stereo system for all my
music needs. It works nice.

I would love to have the music play in multiple rooms simultaneously. Is it
possible? Money is not an issue. I could buy whatever equipment is needed. But
I did not hear about any solution yet.

~~~
patja
I'm not certain it will work but you might look into the Logitech Media Server
<http://www.mysqueezebox.com/download> with SoftSqueeze clients
<http://softsqueeze.sourceforge.net/>

While intended for use with Squeezebox hardware clients, I suspect you could
get an all-software linux client-based synchronized setup working with it. The
Squeezebox software is all known for being hackable.

There is some concern about Logitech killing off the Squeezebox ecosystem, but
the source for much (all?) of this is available and the community remains
active.

~~~
itry
Wow, I never heard about squeezebox. Sounds very good! I only want the server
to be my linux box. The clients can be whatever. I will probably try both:
build my own clients with softsqueeze and order some squeezebox radios as
clients and see what happens. Nice! Thanks!

------
FigBug
I hadn't realized the Airplay keys had been cracked. Last time I looked for
something like this they hadn't. I've already bought an extra airport express,
but I kinda just want to build this for fun. I'm seeing lots of complaints
about the PIs dac. How bad is it?

~~~
rossoldfield
> I'm seeing lots of complaints about the PIs dac. How bad is it?

It doesn't really have a DAC at all - it has two PWM peripherals and a filter
wired up to the audio jack to generate stereo audio.

------
tnorthcutt
Does anyone know of a good standalone speaker that this hack could be paired
with to make an airplay speaker for smallish spaces? E.g. not a home's main
living area where you'd want to use a higher powered stereo system, but
perhaps a bedroom or office.

~~~
JohnHaltt
Personally, I'd recommend these. Incredible bang for your buck.
[http://www.parts-
express.com/pe/showdetl.cfm?partnumber=300-...](http://www.parts-
express.com/pe/showdetl.cfm?partnumber=300-652)

You'll need an amp. [http://www.parts-
express.com/pe/showdetl.cfm?partnumber=300-...](http://www.parts-
express.com/pe/showdetl.cfm?partnumber=300-380)

To run from the headphone port you'd just use a simple male 3.5mm male to
RCA(red/white) male.

I imagine the headphone port quality is terrible and the post mentions it.
Apparently this is a cheap USB compatible option
[http://www.meritline.com/usb-sound-adapter-channel-volume-
co...](http://www.meritline.com/usb-sound-adapter-channel-volume-control-mute-
switch---p-60824.aspx)

This entire setup should run you well under $100 and sound great.

~~~
craigforster
I run this exact setup in my home office and it's great.

I've been wanting to try the Topping amps; this one with an integrated USB DAC
looks interesting: [http://www.parts-
express.com/pe/showdetl.cfm?partnumber=310-...](http://www.parts-
express.com/pe/showdetl.cfm?partnumber=310-312)

------
davestheraves
Awesome, Going to try this with my Pi.

I presume that it'll work with the HDMI out into my AV receiver well without
the distortion from lack of on-board DAC?

~~~
higrow
hdmi works too and has a much better audio quality than the headphone jacket.
There are occasional interferences but this could also be caused by shairport
or the network connection ( my guess is network ).

~~~
davestheraves
Better over hardwire than WiFi? Or just the how the Pi handles the info on-
board?

~~~
higrow
sorry for the confusion, the problems were load related as a process in the bg
was running wild. Runs pretty smooth over both ethernet & wlan now.

------
garagemc2
Nice, a low cost a version of the airport express is exactly what the market
needs. I wonder why no company has done it so far?

~~~
bvdbijl
I assume it's because Apple wants to license it, which costs money and they
might not allow it

------
rctneil
Just trying this now but when I try to run perl Build.PL. I get Build: command
not found

Any ideas?

------
RaSoJo
High time i bought the Pi i guess...

