Friday, January 26, 2007

Linux Apple Airport Express Support

Well it's a little bit late, but this post is a reaction to three posts Stephan Kochen about streaming audio from the GStreamer framework tomade by an Apple Airport Express. (Post 1, Post 2, Post 3).

More than a month ago I was looking for a GStreamer sink that would stream audio player by the GStreamer framework to an Apple Airport Express.
I couldn't find anything, the only thing I found was JustePort by Jon Lech Johansen. And a certain Bash script.

I got it working more or less. What I did was create an ALSA sink, so it would write all data it received to a file (actually a FiFo). The Bash script I found would then be started and in a infinite loop keep reading data from the FiFo and pipe it to JustePort.
It worked, well I got sound on my speakers (which are connected to an amp. which is connected to the Apple Airport Express). The problems and/or limitations I experienced were:
  • A crash of the music player the first play you want to start playing a song with this construction. Restarting the music player and trying again always worked.
  • An irritating buzz when the FiFo was empty (the player was paused, or the gap in between songs).
  • The horrid construction and actions that need to be taken to get it working each time.
  • And of course the fact that all sound in Linux that was player over ALSA would be outputted to my speakers.
The best thing would indeed be a GStreamer sink plugin for this. So Stephan just to let you know, there are other people (even in your province) that are interested in this.
Now I am not a really great programmer on these kind of systems (too hardware oriented I'm afraid) but maybe I can help you in some way.

I think the best thing to do is to get something small to work first like detect if a Jack is plugged into the Airport's socket. And then from thereon continue implementing more complicated things.

Let me know if I can help you in any way, cause I have two of these babies at home, so I have a testbed.

5 comments:

Anonymous said...

Hah, that's a very cool/hacky solution. :)

I haven't looked at this in a week orso. But the jack status is simply a header sent during the session setup. Right now I'm already going through the entire session setup successfully. So I probably already get the jack status but ignore it. ;)

Thank you very much for the help offer! At the moment I'm afraid I don't really know how you could be of service. :)

As I said, the session setup works, but the actual streaming is broken for some reason. But I've never really tested the conversion steps that are performed on the stream (Apple Lossless encoding, and encryption). So I probably just need to test each of those separately to see what I'm doing wrong.

I'm not sure when I'll be able to look at it again. Hopefully soonish. :)

lgespee said...

Hey Stephan,

Cool you gave a reaction, much faster than mine.
About the Jack status, aha ok, I didn't know that.
The solution I had wasn't really a solution but it did what I wanted it to more or less.

Well if you have a session already, well maybe this is just a stupid thing to say (as I said I am not that much of a low-level programmer). But would it be possible to use JustePort to stream a short (2 second) sample to the Airport Express. And sniff that with Wireshark for example. Then capture the part that represents the sample.

Hmm, think that's not going to work since it's encrypted etc.

Well nevermind.

Just keep me updated ;).

Anonymous said...

Will do. ;)

Unknown said...

Hi,

Just to tell you that I've been working on a gstreamer RAOP sink (http://bugzilla.gnome.org/show_bug.cgi?id=542510). It works perfectly (simple implementation for now). It's under acceptation. I'll post a release candidate in a few weeks on the CSV bad plugins tree. Anyway, You may find a first implementation here http://bugzilla.gnome.org/attachment.cgi?id=114385&action=view
Have Fun.

GRemi

Anonymous said...

Guys keep working on it. I run itunes just to stream to airport express. Will try out your release candidate now.