Show HN: Hacking a Raspberry Pi into a wireless airplay speaker
jordanburgess.com
jordanburgess.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.
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.
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).
On top of that, who doesn't like to tinker?
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.
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.
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.
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.
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/... [2] http://www.microbarn.com/details.aspx?rid=102750
You suggest we follow you on Twitter, yet protect your tweets...
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.
Costs a little money though.
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.
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.
more of my rambling - http://acooke.org/cute/AudioEngin0.html
also, see this previous HN thread - http://news.ycombinator.com/item?id=4736980
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.
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...).
Does that make sense?
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.
The Squeezebox thing makes more sense to me.
I can't imagine this being hard. Just generate a stream and play it on other computers, even VLC can do it.
'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?
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 ..To get around it I just ran the build as root ;)
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!
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.
Very bad. You won't be happy with it, I promise.
You'll need an amp. 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-co...
This entire setup should run you well under $100 and sound 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-...
Or A5+ for a bigger sound at a higher prize and in a bigger box.
Amazon link, no affiliate: http://www.amazon.com/M-Audio-Studiophile-Powered-Monitor-Sp...
edit Samson not Samsung
I presume that it'll work with the HDMI out into my AV receiver well without the distortion from lack of on-board DAC?
Any ideas?