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.
That's really cool! I want to play around with getting this to play music directly from the internet somehow. I tried XBMC at first but I didn't like how much input it needed to get going and how flaky the results were.
You're right that the headphone port is (still) pretty crappy. I've got the model B 512MB revision and I still hear a lot of static.
Tried it, but when I got my Pi it wouldn't install - something about having a different version of the OS/firmware. Might have to try that again though
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.
If you already have the ingredients to do this, then it may be a cheaper solution.
My RaspberryPi has been a few things since I bought it (a print server, a file server, a web server) but I never really settled on anything and for the past couple of months it has sat in a drawer.
I've now just re-purposed it as an Airplay speaker in less than an hour for no extra cost.
I will probably purchase a smaller USB WiFi dongle (@£8.99 on Amazon) but even including the cost of the Raspberry Pi (~£34 total), that's less than half the cost of an Airport Express (£80).
Hacking ones own solution has benefits: control over the technology, freedom from proprietary interests, ability to enhance the behavior, configuration and customization, integration with other technologies, knowledge of how to build other things later..., etc
Oh, and if I get bored, I can always reuse the hardware for something else.
Probably the same reason why I garden instead of buying from the grocery store, or why I grind my own meat for my burgers. Sometimes, if you want it done right, you have to do it yourself.
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.
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.
"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.
For brewing the beer it should be fine. Be careful with the fish though you'll want quicker responses so you'll probably not want it doing all of the other things at once. I've thought about using an Avr or a pic for that before so that it can be much more responsive as a paid controller.
Any chance of a few links to look into the various things you've done with the RPi? Thinking of getting one in the new year and some of those projects sound really interesting.
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.
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.
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...
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.
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.
You could get a small little Bluetooth A2DP reciever and stream over bluetooth: http://www.amazon.com/Belkin-F8Z492TTP-Bluetooth-Music-Recei...
There's also ways to stream from Android to Airplay receivers - just search for Airstream in the play store.
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.
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.
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!
You could try doing it with pulseaudio. It's nice because then you can stream everything that plays on a specific machine. Everything that's required is that the program has pulseaudio support which most music playing programs should have. I'm not sure how well it works with multiple destination though.
I know this is possible with Linux. At my previous job one of the developers used to pipe his music stream to the broadcast address on our LAN. I don't remember much about the exact protocols involved, but I'm sure it's possible. Even better, do multicast, since broadcast is out in IPv6.
Airplay doesn't really do this. The sound is often slightly out of sync but it's enough to be really irritating if you can hear two of them. The best solution I know of for perfectly synchronized wireless sound is Sonos (quite expensive, but I love it)
i used to use logitech/squeeze, but recently switched (it's dying, as far as i can tell, and certainly wouldn't run on the latest opensuse) to audioengine D2 - http://audioengineusa.com/Store/Audioengine-D2
it's more expensive (i think), and less flexible than the logitech solution, but it's also (much) simpler, (much) more reliable, and better sounding (imho - i did some comparison tests and the DAC sounds similar to a decent "budget audiophile" DAC I own, and, incidentally, significantly better than the audioengine D1).
the D2 sender plugs into your computer and works just like a USB soundcard. each D2 receiver (you can have up to 3) receives wifi from the sender and outputs either digital or good quality analogue. the data transmits as 24/96 (ie decent quality) and there's a volume control on the sender that adjusts the output after the DAC (so you don't lose resolution).
then i just use whatever player i want (currently mpd, so i can have network and web clients - i am thinking of buying a small tablet to control the web client).
tldr - the D2 is a "done right" hardware solution, that sounds good, but it's not particularly cheap.
ps if anyone wants to buy my (discontinued and unsupported) logitech hardware for a nominal amount i think i still have it. a duet and a boom. but i'm in chile, so i imagine shipping costs elsewhere are significant.
pps i have not used sonos, but i heard that there's some limit about the number of tracks or amount of metadata they can handle. if you have a lot of music i would check before buying anything. as far as i know, the sonos is more like logitech - it's a "system" that manages your music, while the D2 is more like a wireless soundcard (or wireless wire, with optional DAC). i prefer the latter because it means i can play around with other "audiophile" hardware on the audio end, and other software on the computer end, but that's just my taste.
I read about Sonos a couple of times, but never understood what it is about. Now I did it again. Same result. I dont get it.
When I buy the Play:5 - what do I get? Where will I put my mp3s? Can they stay on my Linux box? Do I have to transfer them to a special device? It looks like Sonos uses its own wireless transfer mechanism. Why do I have to connect it to my router?
You get one Play:5 device. I would guess you need several of those to equip different rooms.
> Where will I put my mp3s? Can they stay on my Linux box?
Your mp3s can reside on any machine as long as they are reachable via CIFS/SMB protocol.
> Do I have to transfer them to a special device?
No. You only need a so called "Sonos Controller"- a small piece of software available for Windows/Mac/iOS/Android - where you actually manage your Sonos network: define your SMB share folders, create your playlists, search, stuff like that...
> It looks like Sonos uses its own wireless transfer mechanism. Why do I have to connect it to my router?
Yes Sonos does not really use 802.11 as we know it. It uses its own protocol called SonosNET (a kind of Spanning Tree Protocol) to create a wireless mesh network. So at least one Sonos device must be connected to a wired network to act as a wireless AP to allow other Sonos devices to connect to the network and use standard internet services (DHCP, DNS, etc...).
Honestly, it sounds overly complicated and I still dont understand the basic principle.
Why not just put a music player program on my computer that streams the song into my existing network and have speakers that connect to the network and play it?
You say "You get one Play:5 device". So what is that? Why cant I just buy "speakers" that play whats send to them over the network?
You say "CIFS/SMB". Well, I could make my files available that way. But somehow it feels wrong. Will the song that is played then be streamed to some central device and from there to the speakers? Seems like twice as much streaming as necessary.
You say "Windows/Mac/iOS/Android". So I would have to bring one of my tablets into the game. ANOTHER machine in the mix.
You say "at least one Sonos device must be connected to a wired network" and I still dont understand why. I would understand it if you said "to access your files". Even thought I would prefer it to just swallow an usb stick so I dont have to fiddle with my existing IT. But you say "to act as a wireless AP to allow other Sonos devices to connect to the network and use standard internet services" and I wonder why do they have to? I want the "other devices" just to be speakers and play music.
You get that for free if your network is good. In college, we'd wire up half a dozen rooms to the same icecast server. The server itself could not participate, but there was no lag between the clients (all on the same network switch).
Thanks for bringing this up. I'd messed up the instructions for that bit and placed the sudo command in the wrong place.Updated it now. For anyone stuck this is the updated instructions work:
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!
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?
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.
I use this setup in my living room. I don't think you could hope for more for the money. That little amp is powerful and can even run on AA batteries (8 of them).
Am i right in thinking that all usb speakers have their own sound card on board?
I have a pair of logitech z120 I want to try out with this (and then maybe hook it all up to a battery to make it completely wireless) but i've left them at uni and can't try it out yet.
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 ).
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.