How To Use Apple’s AirTunes in Ubuntu

Apple airport express   How To Use Apples AirTunes in UbuntuI’m a Ubuntu guy at heart, but the team over at bicycle-based IT company¬†iSupportU, my home away from MakeUseOf,¬†includes a couple of real Mac types. As such, a recent company memo stated that music can now reach our stereo over something called “AirTunes.”

First, I grumbled about the typical Apple naming scheme, then I wondered if it was possible to use such a thing from Ubuntu, then I heard my fellow Linux user ask the same question out loud.


Then, and only then, did I begin Googling for more information. What I found was useful, and with typical, super-helpful Ubuntu-forumites to boot, but I think there’s a gap in the Internet here that needs to be filled. Let’s fill it then, shall we? This guide is written using Ubuntu 10.04, but may apply to other Linux distributions as well.

Step 1: Install Necessary Software

To begin, you need to install two packages: “pulseaudio-module-raop paprefs” and “paprefs”. The first package allows Ubuntu to use the remote audio output protocol (raop); the second, configure Ubuntu to enable it. To install the packages, simply open the command line and type this command:

sudo apt-get install pulseaudio-module-raop paprefs

If the command line scares you simply click here to install the packages.

Non-Ubuntu people, your mileage may vary here in terms of the package names. Sorry about that!

Step 2: Enable AirTunes Detection

Now that you’ve installed what needs installing, you need to open the program “paprefs”. Do this from the command line, or click “Alt” and “F2″ and type “paprefs” there. Don’t worry; you’re most of the way, and everything will be GUI-full from here on out. Here’s what the window should look like:

Airtunes ubuntu configure   How To Use Apples AirTunes in Ubuntu

Simply click the “Make Discoverable Apple AirTunes sound devices available locally” checkbox and you’ve enabled it.

Step 3: Switch to AirTunes

Now that AirTunes detection is enabled all you need to do is switch your speakers from your local computer to your remote one. Click the “Volume” icon in your tray, then click “Preferences”, as seen here:

airtunes ubuntu volume   How To Use Apples AirTunes in Ubuntu

Click the “Output” tab and you should see your Apple AirTunes device listed here, like this:

airtunes ubuntu select   How To Use Apples AirTunes in Ubuntu

If you don’t see such an option, don’t panic. Simply restart Pulseaudio (if you know how) or reboot your computer. It should show up for sure now.

Quirks

Of course, this entire process being a little bit of a hack, there are a few quirks to be noted. For example, I noticed a six-second delay. This isn’t a big deal if you’re listening to music, but don’t plan on using this from watching movies.

The second problem I’ve noted is that, while switching back to my computer’s speakers is as easy as re-opening the output selection, this apparently doesn’t log me off on the server-side. This means that, if one of my Apple-using collegues decides to reconnect to AirTunes after I’m done using it, they see a message about someone already being logged onto the device. This is frustrating, but nothing that a reboot of the Airport Express can’t fix.

If I find a fix to either of these problems you can expect to find it in the comments below, but please also feel free to share if you have any of your own.

Conclusion

I was happy to find a way to stream my music to the AirTunes device at work, and hope this guide is useful to at least a few other people. If it does, please leave me a note in the comments below. Also leave me a note if you’ve found a way to decrease lag or log off without restarting the AirPort.

Finally, as I cannot use every Linux distribution simultaniously, please let me know how these steps work on other systems such as Fedora or SUSE. It’s always good to know!

Photo credit: Jared C. Benedict

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

28 Comments -

Fran Cisco

no thanks, i rather not support apple

jhpot

It’s not about supporting them; it’s about being able to use when of their products when the need arises. I’d never pay for such a device, but it’s nice to be able to use it when I’m around them…from my choice of operating system.

latteisforwimps

You don’t have to be a fan boy to have an airport express. I have one in my bag to go wireless whenever there is an ethernet connection, its a really useful piece of kit if you travel around a lot. Being able to use the music streaming will be a nice bonus.

Matt

I’m a Mac tech at work, and run Ubuntu on a homebuilt PC. As a consequence, I’ve been trying to do this for YEARS with my two sets of remote speakers. I think paprefs is the missing link I always needed – thanks! This is awesome!

jackhynes

Thanks for the great instructable. I managed to get them to work on Ubuntu Dapper then it broke and I never fixed it.

It works great on 10.10.

jackhynes

Thanks for the great instructable. I managed to get them to work on Ubuntu Dapper then it broke and I never fixed it.

It works great on 10.10.

Dpmaddalena

Solved the “Apple users can’t log on after I have” problem and a bonus problem. I noticed the same problem with trying to logon via iTunes after an Ubuntu session, and also that Conky was showing that my upstream traffic didn’t drop even after I switched my output to ‘internal’ in the volume prefs output tab. Somehow Pulse is continuing to send data to AirTunes, even though I have switched it and my ears confirm that music is coming through my internal card and not AirTunes.

The fix is to open the paprefs window again and deselect the “Make discoverable Apple Airtunes …” feature. When I did that the upstream traffic meter showed an instant drop and when I reconnected to airtunes from iTunes on my macbook, all was rosy. Still a bug, but this fix is way easier than rebooting AirTunes!

Dpmaddalena

Solved the “Apple users can’t log on after I have” problem and a bonus problem. I noticed the same problem with trying to logon via iTunes after an Ubuntu session, and also that Conky was showing that my upstream traffic didn’t drop even after I switched my output to ‘internal’ in the volume prefs output tab. Somehow Pulse is continuing to send data to AirTunes, even though I have switched it and my ears confirm that music is coming through my internal card and not AirTunes.

The fix is to open the paprefs window again and deselect the “Make discoverable Apple Airtunes …” feature. When I did that the upstream traffic meter showed an instant drop and when I reconnected to airtunes from iTunes on my macbook, all was rosy. Still a bug, but this fix is way easier than rebooting AirTunes!

Guest

Maybe it’s also possible to kill that process? But I don’t know, have no Airtunes.

Takkat

Just stop and reboot PA with {pulseaudio -k} in a terminal ;-).

Maybe my little GUI makes connecting/disconnecting/killing of AirTunes easy for you too. It’s still in development at:

https://launchpad.net/stream2ip

Have fun, Tak

Takkat

PA and Avahi always try to keep connecting to an AEX (if they manage to find it) thus blocking the device for others. My app stream2ip enables connecting without Avahi. In addition, you have the option to disconnect. You’re welcome to test it, see launchpad for releases.

Wrex

Ubuntu is probably the closest thing to OSX as one would get without actually running OSX. The irony (Specifically “Fran Cisco”).

Klap-in

The “Apple users can’t log on after I have” problem is built in by the developer of roap code. It keeps streaming silence music to the AirTunes to keep the connection. The developer didn’t yet managed to disconnect en reconnect reliable more times to the AirTunes.

More about this: http://www.pulseaudio.org/ticket/496

Klap-in

The “Apple users can’t log on after I have” problem is built in by the developer of roap code. It keeps streaming silence music to the AirTunes to keep the connection. The developer didn’t yet managed to disconnect en reconnect reliable more times to the AirTunes.

More about this: http://www.pulseaudio.org/tick

Takkat

Just stop and reboot PA with {pulseaudio -k} in a terminal ;-).

Maybe my little GUI makes connecting/disconnecting/killing of AirTunes easy for you too. It’s still in development at:

https://launchpad.net/stream2i

Have fun, Tak

Dafrenchyman

Anyone get this to work properly? Thu music seems to play slower and cuts out several times a second (choppy).

jd

I have exactly the same issue with this setup – the audio is choppy with .5 second long silences for every second or so of music. Any ideas as to what might be causing this?

Takkat

Try other player.

Juan_in_Nippon

Works out of the box but the Airport stream drops after approximately 90 minutes of playing continuous music and then the sound output reverts back to the
computer’s internal speakers.

This is pretty consistent for me and another friend who has exactly the same issue running on 10.04 with the latest pulseaudio modules so this seems to be a bug or a corruption of the stack somehow.

The only way to get things back up and running is to log out and back in again and restart the whole AirPort setup process.

Any ideas?

Takkat

That worked for me: restart Avahi daemon, restart network, restart pulseaudio one or all – a real pain. Avahi and thus the AEX will not reconnect when WLAN was down. Maybe you’d be happy with stream2ip.

Juan_in_Nippon

Works out of the box but the Airport stream drops after approximately 90 minutes of playing continuous music and then the sound output reverts back to the
computer’s internal speakers.

This is pretty consistent for me and another friend who has exactly the same issue running on 10.04 with the latest pulseaudio modules so this seems to be a bug or a corruption of the stack somehow.

The only way to get things back up and running is to log out and back in again and restart the whole AirPort setup process.

Any ideas?

gbinal

Thank you kindly, this is perfect. This spirit of helping others stand on your shoulders is why I run linux/Ubuntu.

joelbrock

ummm. MakeUseOf, you have quickly risen to the top of the heap in the world of USEFUL, RELEVANT, and INTERESTING online content-creation. This is no small achievement mind you.
For me, this article solidifies your place in the the internet and in my heart. Thank you for knowing what gaps in my life need to be filled, often before i do.

NOTE: No luck with the hack on jolicloud, but perfection when run under straight-up ubuntu (tested on UNR 10.10b)

joelbrock

ummm. MakeUseOf, you have quickly risen to the top of the heap in the world of USEFUL, RELEVANT, and INTERESTING online content-creation. This is no small achievement mind you.
For me, this article solidifies your place in the the internet and in my heart. Thank you for knowing what gaps in my life need to be filled, often before i do.

NOTE: No luck with the hack on jolicloud, but perfection when run under straight-up ubuntu (tested on UNR 10.10b)

cwh

Keep an eye out for this: http://git.zx2c4.com/Airtunes2/about/
and perhaps the delayed timing of music will be a lot better if this is implemented.

cwh

Keep an eye out for this: http://git.zx2c4.com/Airtunes2
and perhaps the delayed timing of music will be a lot better if this is implemented.

ernest

You can also start paprefs in the Ubuntu “System” menu -> Preferences -> PulseAudio Preferences. That might be even less scary than alt-f2..

Kasati

thanks a lot, this saved our day! tried to make AirTunes work from Ubuntu last year, pretty frustrating experience. This worked like a charm!