9 ms·
Show HN: Hacking a Raspberry Pi into a wireless airplay speaker
- IgorPartola 14y agoThis 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/066831.html http://www.trilug.org/pipermail/trilug/Week-of-Mon-20120903/... [2] http://www.microbarn.com/details.aspx?rid=102750 http://www.microbarn.com/details.aspx?rid=102750
- joelhaasnoot 14y agoDid 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/ 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.
- btgeekboy 14y agoHave you heard of despotify? As long as you have a premium account, it's a 3rd party library with a CLI interface that works well on the Pi.
- joelhaasnoot 14y agoTried 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
- jordn 14y agoThat'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.
- mkaufmann 14y agoA tip to avoid the headphone port: Either use the HDMI port or try a usb soundcard http://elinux.org/RPi_VerifiedPeripherals#USB_Sound_Cards http://elinux.org/RPi_VerifiedPeripherals#USB_Sound_Cards
- joelhaasnoot 14y agoYeah, should've clarified that - XBMC comes up on HDMI now and audio is routed through my TV to play music.
- deleted 14y ago[deleted]
- tnorthcutt 14y agoDoes 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.
- jordn 14y agoAm 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.
- rz2k 14y agoYes, the signal over USB is digital, and the speakers have a DAC and an amplifier.
- jpitz 14y agoLook at the Pro Audio USB Monitor space - Alesis and Samson have good sounding powered nearfield speakers that are cheap by audiophile standards. edit Samson not Samsung
- vosper 14y agoI have used M-Audio AV 40s, and have liked the results. They're compact, well built, and sound good. Amazon link, no affiliate: http://www.amazon.com/M-Audio-Studiophile-Powered-Monitor-Speakers/dp/B0051WAM64/ref=sr_1_2?ie=UTF8&qid=1356710907&sr=8-2&keywords=m+audio http://www.amazon.com/M-Audio-Studiophile-Powered-Monitor-Sp...
- morsch 14y agoAudioengine A2: http://audioengineusa.com/Store/Audioengine-A2 http://audioengineusa.com/Store/Audioengine-A2 Or A5+ for a bigger sound at a higher prize and in a bigger box.
- JohnHaltt 14y agoPersonally, I'd recommend these. Incredible bang for your buck. http://www.parts-express.com/pe/showdetl.cfm?partnumber=300-652 http://www.parts-express.com/pe/showdetl.cfm?partnumber=300-... You'll need an amp. http://www.parts-express.com/pe/showdetl.cfm?partnumber=300-380 http://www.parts-express.com/pe/showdetl.cfm?partnumber=300-... 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-control-mute-switch---p-60824.aspx http://www.meritline.com/usb-sound-adapter-channel-volume-co... This entire setup should run you well under $100 and sound great.
- bede 14y agoCool 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 14y agoBugger, i forgot the 'b' on the url. Thanks for telling me, I wouldn't have caught that otherwise. I'm http://twitter.com/jordnb 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.
- wiradikusuma 14y agoLooks 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 14y agoYou could get a small little Bluetooth A2DP reciever and stream over bluetooth: 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 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.
- josteink 14y agoI use doubletwist player with Airsync to play against AirPlay targets like this, if that's interesting to you. Costs a little money though.
- davestheraves 14y agoAwesome, 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 14y agohdmi 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 14y agoBetter over hardwire than WiFi? Or just the how the Pi handles the info on-board?
- higrow 14y agosorry 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.
- FigBug 14y agoI 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?
- kylec 14y agoI think they have been for a while. Rogue Amoeba has offered Airfoil with support for acting like an Airplay speaker for a while now.
- drivebyacct2 14y ago>How bad is it? Very bad. You won't be happy with it, I promise.
- rossoldfield 14y ago> 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.
- itry 14y agoIs 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.
- IgorPartola 14y agoI 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.
- itry 14y agoSynchronizing the clients is the hard part.
- IgorPartola 14y agoAh. Is that the magic that AirPlay takes care of? Interesting problem...
- toby 14y agoAirplay 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)
- itry 14y agoSqueezebox is not perfectly synchronized?
- patja 14y ago
- garagemc2 14y agoNice, 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 14y agoI assume it's because Apple wants to license it, which costs money and they might not allow it
- davidblurton 14y agoWhy 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.
- ap22213 14y agoHacking 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.
- ryguytilidie 14y agoCame 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 14y agoWell, 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.
- simcop2387 14y agoFor 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.
- gpmcadam 14y agoA 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 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 14y agoThat's http://www.amazon.com/dp/B005CLMJLU http://www.amazon.com/dp/B005CLMJLU for our friends on the other side of the pond.
- rodh 14y agoWhat a coincidence. I did the exact same thing yesterday, following the instructions here: http://trouch.com/2012/08/03/airpi-airplay-audio-with-raspberry/ http://trouch.com/2012/08/03/airpi-airplay-audio-with-raspbe.... You really need a USB soundcard for this to be usable though, unfortunately.
- rctneil 14y agoJust trying this now but when I try to run perl Build.PL. I get Build: command not found Any ideas?
- 7ewis 14y agoThere 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 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 14y agoThe 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 14y agoAh 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!
- jordn 14y agoThanks 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: pi@raspberrypi ~ $ git clone https://github.com/njh/perl-net-sdp.git perl-net-sdp pi@raspberrypi ~ $ cd perl-net-sdp pi@raspberrypi ~/perl-net-sdp $ perl Build.PL pi@raspberrypi ~/perl-net-sdp $ sudo ./Build pi@raspberrypi ~/perl-net-sdp $ sudo ./Build test pi@raspberrypi ~/perl-net-sdp $ sudo ./Build install pi@raspberrypi ~/perl-net-sdp $ cd ..
- RaSoJo 14y agoHigh time i bought the Pi i guess...