Weekend project: ShairPort menulet
Update: New version built around a native Cocoa port of ShairPort, MacShairport: ShairPort-v0.2.1.zip)
Recently an open source emulator for AirPort Express / AirTunes was released by James Laird. I’ve been waiting for something like this for a long while to enable remote music playback on my media center from my laptop and iPhone. However, I lack the hardware skills to extract the necessary firmware from the AirPort Express ROM chip. Thanks to James for doing the work and putting out his perl script / c utility. It’s pretty simple to build and run, and the source includes a nice OS X launcher script, but I’m looking for a little GUI widget to easily control it lest someone ‘inadvertently’ decides to send audio to my computer.
I’ve been lately transitioning my iPhone-specific Cocoa knowledge to the desktop; this was a nice opportunity to wrap up the ShairPort scripts in an OS X menu bar widget. The source is available on Github, and you can get the bundled app below. This was made for my specific system, so YMMV.
ShairPortMenu: [download]

April 20th, 2011 at 2:18
Looks like your first off the bat with this one, looks like a great start! Do you think in future builds that the shairport source files might be included?
April 20th, 2011 at 7:23
Yes, I’m thinking about including the shairport repo as a git submodule. Building hairtunes could also be done by the Xcode project, maybe in a script or as a target dependency. Still have to have a way to install libao and the perl dependencies, though.
This was quick and dirty…but that’s some good advice. Thanks!
April 21st, 2011 at 15:06
Hmm… It doesn’t seem to work here – on neither of my machines.
Same problem, the app lanches, but whenever I turn the server on, it seems to be activated for a brief moment and then it goes gray again.
Tried with some different names, also both with and with password…
But great effort! The app looks exactly what I hope such an app would look like! :D
Mange tak!
April 21st, 2011 at 15:23
You probably have to ensure that shairport / hairtunes can run standalone. Specifically, there are two perl modules and a library described at the shairport github site.
In a future update, it would be nice to include that step, perhaps as an installer…but for now this is just a GUI wrapper.
Good luck!
April 23rd, 2011 at 3:08
Lars,
Try the updated version. You will still have to add the necessary perl modules described at https://github.com/albertz/shairport but the hairtunes bit should work.
May 5th, 2011 at 18:39
thanks so much for building this.. i can’t seem to get it to run on 10.7 though. do i need to have shairport installed as well? if this is the case, could you please write a tutorial for us dummies? =)
thanks!
May 5th, 2011 at 19:55
Running a pre-release OS and you’re looking for a tutorial “for dummies” :) ?
In brief, no you don’t need to install ShairPort separately, but you need to have the perl dependencies installed as described at the ShairPort github site. I included a compiled copy of libao, but it may not work (at least it didn’t on my work computer).
Thanks for the report; I’m thinking of changing to using the Cocoa port of ShairPort to eliminate the perl deps and all.
May 12th, 2011 at 2:22
A +1 thanks for some great work, and interest in a MacShairPort version of this menulet. Though MacShairPort also needs a little work to be completely reliable, but in the longer term it certainly makes sense as the foundation for your menulet.
May 16th, 2011 at 8:09
Thanks! That’s exactly what I have been looking for in the last few years!
It would be even better if you can bring this to iOS! I really want to use my old iPhone 3G and over armv6 iDevices as wireless IEMs!
May 24th, 2011 at 18:14
Excellent work.
Tell me Why when I start to streaming from my iOS device to the Shairport quits suddenly?
May 24th, 2011 at 21:59
Probably because it crashed, but it’s difficult to tell without the crash report. If you wanted to provide it, you could get it through the Console.app.
June 15th, 2011 at 19:43
Looks awesome but I just keep getting the following error when I start sharing:
“The operation couldn’t be completed. (MSShairportServer error -1.)”
I don’t think it is specific to your wrapper but an error of the ShairPort itself. I’m running 10.6.7.
August 8th, 2011 at 14:24
robert: this works fantastically, thanks!
everyone else: fyi, to get the binary to work, one must make sure to do these things:
1) use CPAN to install the perl module Crypt, and after that, Crypt::OpenSSL::RSA (explicitly).
2) install homebrew (if you don’t have it already)
3) install libao using homebrew — the homebrew-specific path to libao is hardcoded in the build’s copy of Shairport, is why you should use homebrew, specifically. yes.
October 2nd, 2011 at 11:00
After a couple of hours of trying and failing to install from the shairport source I found this – brilliant work, thank you.
January 26th, 2012 at 10:05
Hi Robert,
Thanks for this nice tool.
Do you know if shairport can be run at startup with “Shairport on”?