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]


Posted

in

by

Comments

17 responses to “Weekend project: ShairPort menulet”

  1. Toby Adams Avatar

    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?

  2. Robert Avatar

    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!

  3. Lars Avatar
    Lars

    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!

  4. Robert Avatar

    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!

  5. Robert Avatar

    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.

  6. sean Avatar

    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!

  7. Robert Avatar

    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.

  8. Paul Cook Avatar

    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.

  9. sjobs Avatar
    sjobs

    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!

  10. Jon Mcdowall Avatar
    Jon Mcdowall

    Excellent work.
    Tell me Why when I start to streaming from my iOS device to the Shairport quits suddenly?

  11. Robert Avatar

    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.

  12. Aaron Avatar
    Aaron

    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.

  13. fish Avatar

    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.

  14. Peter Avatar
    Peter

    After a couple of hours of trying and failing to install from the shairport source I found this – brilliant work, thank you.

  15. Dmitry Avatar
    Dmitry

    Hi Robert,

    Thanks for this nice tool.
    Do you know if shairport can be run at startup with “Shairport on”?

  16. dingo Avatar
    dingo

    Shairport crashes against an iPod 4th gen with iOS 6. I’m on 10.6.8. Can I ask for an update? Your app is the best, simplest and free solution out there.

  17. Robert Avatar

    Please grab a crash report and post it to the ShairportMenu github page:
    https://github.com/rcarlsen/ShairPortMenu/issues

Leave a Reply