Feed on Posts or Comments 06 January 2009

audio & linux Ralf on 13 Nov 2005 09:36 pm

Using amaroK with an Airport Express

Back when I first looked at JustePort and raop_play, the Apple Lossless encoding was missing. Having stumbled across the reverse-engineered ALAC decoder again this weekend I decided to have another look how difficult it is to make my Airport Express play nicely with Linux.

Oh joy! JustePort 0.2 and raop_play from version 0.4 on already have an ALAC encoder built in. Yay! So I cobbled together an ebuild for my desktop box (an AOpen EA65 II) and pondered my next move. Obviously I was going to need a decent audio player on my system, having been spoiled by iTunes. Being mostly desktop environment agnostic, I had two choices here: rythmbox and amaroK. Flipping a coin, amaroK it was. Fortunately amaroK can be built with gstreamer support, which enabled the following crude hack:

gstreamer provides an output sink called tcpclientsink which can be made to connect to an arbitrary host and port. By default it connects to localhost:4953 and sends all of it output data there (44100Hz, 16-bit stereo in my case). For each song played in amaroK, however, a new connection is opened. raop_play by default calls external programs to decode mp3, aac and ogg files. These output the decoded data to stdout.

So I placed the following minimalistic glue scripts in my $HOME/bin/ape-hack directory:

mpg321:
#!/bin/sh
socat -s TCP4-LISTEN:4953,fork -

ape-gstreamer:
#!/bin/sh
PATH=$HOME/bin/ape-hack:$PATH \
exec raop_play <airport express ip> dummy.mp3

Socat is a nifty little universal connector; if you think of netcat as your typical Swiss Army Knife, socat is the Victorinox CyberTool with a built-in kitchen sink. After having configured gstreamer using gconf-editor (system->gstreamer->0.8->default->audiosink) I was set to go.

All of the above of course ain’t pretty, but amaroK now plays tunes on my APE. Regrettably the transition between songs isn’t smooth yet… I guess somebody has to write a gst-apesink soon :) Of course, nothing of the above is really Linux specific.

One Response to “Using amaroK with an Airport Express”

  1. on 24 Mar 2006 at 12:38 pm 1.I Have A Special Plan For This World said …

    amaroK and the Airport Express

    The Situation

    After testing for a while, I have finally managed to get amaroK
    working with Apple ’s Airport Express under Linux.
    For those who don’t know: The Airport Express is a WLAN access point that allows iTunes
    to stream audio to…

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply

You must be logged in to post a comment.