What is this?

This is an ongoing effort to make it possible to stream musics from PulseAudio to recent AirPlay-capable devices (e.g. Apple TV, AV receivers).

Apparently there are two versions in AirPlay protocol. The older version (version 1) only uses TCP for audio streaming. Version 1 is supported by PulseAudio, in a form of raop module. (RAOP stands for Remote Audio Output Protocol, a protocol underneath AirPlay.) However the newer version 2, which uses UDP as well, is not supported by PulseAudio (as of v4.0). Probably most AirPlay devices today support version 2, which makes it impossible for PulseAudio users to play their music over AirPlay.

Brief history

There have been a few efforts to address this issue. First Christophe Fergeau started a project to support raop2. Later Martin Blanchard continued to enhance Fergeau's work. My work is actually based on Blanchard's work, meaning that it is also based on Fergeau's efforts.

Here are the several differences from Blanchard's work.

Then recently Colin Leroy rebased my & Martin's latest patches on PulseAudio 5.0.

See the commit history for details.


Main branch is now hf/raop2-v3-v7.0 (10/14/2015)

Rebased on master (PA 7.0) as of today.

Main branch is now hf/raop2-v2-5.99.1 (11/24/2014)

Rebased on PA 6.0RC1, with several additional patches.

Main branch is now hf/raop2-v2 (10/13/2014)

This branch is based on cl/raop2-v2, but contains some additional patches.

Main branch is now cl/raop2-v2 (10/12/2014)

I've pushed cl/raop2-v2 branch and made it default. This is identical to Colin's raop2-v2 branch. Also, I've added a tip to enable local audio devices on the latest branch. See the "Configuration file for local devices" section below.

Main branch is now raop2-for-merge2 (1/28/2014)

I have switched to raop2-for-merge2 branch.

Main branch switched again (9/13/2013)

I have switched to raop2-for-merge1 branch. Patch sequence was rebased against the latest master of PulseAudio. This patch set corresponds to the patches which I submitted to pulseaudio-discuss mailing list.

Main branch switched (9/5/2013)

I have switched to raop2-for-merge branch. This branch provides both TCP and UDP protocol implementations.

If you clone the repository now, you will get the latest branch by default. If you already cloned my old v4.0+raop branch, the following commands should allow you to switch to the latest branch:

$ cd pulseaudio-raop2
$ git fetch origin
$ git checkout -b raop2-for-merge origin/raop2-for-merge

Current status (as of 10/12/2014)

Known issues

As of 10/14/2013


How to try

Since I'm using Ubuntu 14.04, I'll give you an instruction in Ubuntu. Should be similar in Debian or other Debian/Ubuntu-based distros. For other systems, please send me a patch for this page if you figure out how.

0. Prerequisites

Install some packages:

sudo apt-get install build-essential paprefs git pulseaudio-module-raop intltool
sudo apt-get build-dep pulseaudio

(Thanks Stephan Henningsen for pointing out intltool!)

1. Retrieving the code

$ git clone https://github.com/hfujita/pulseaudio-raop2.git


$ git clone git@github.com:hfujita/pulseaudio-raop2.git # if you have github account and registered your key

Note: tarball or zip won't work because PulseAudio build system relies on git revision information.

2. Building the software

As written in pulseaudio-raop2/README

$ cd pulseaudio-raop2
$ ./autogen.sh
$ CFLAGS="-ggdb3 -O0" LDFLAGS="-ggdb3" ./configure  # See below
$ make

FYI, here is my command line for configure, taking some parameters from the Ubuntu PulseAudio package.

$ CFLAGS="-ggdb3 -O0" LDFLAGS="-ggdb3" ./configure --prefix=$HOME --enable-x11 --disable-hal-compat

3. Before running the new PulseAudio


PulseAudio should be configured so that it will discover AirPlay devices on the network.

$ paprefs &  # This is an X application

In the Network Access tab, turn on Make discoverable Apple AirTunes sound devices available locally, then close the application.


If you are using personal firewall (e.g. ufw or iptables), it should allow UDP packets to come in and go out between the AirPlay device. I can hardly tell which port should be opened, as ports are dynamically chosen.

Disabling autospawn

In your environment, it is likely that PulseAudio is already running. First you need to stop it. However, by default PulseAudio re-spawns automatically even if you stop it manually.

$ echo "autospawn=no" >> ~/.pulse/client.conf

This will disable autorespawning (thanks to this page). You may later remove this directive if you lose interest in PulseAudio experiments and want to go back to the original configuration.

Then, finally we are ready to kill the existing PulseAudio daemon.

$ pulseaudio -k

Ubuntu desktop users will see that the sound icon on the status bar changes.

Configuration file for local devices (for PA 5.0)

If you are currently using PA 4.0 or older version (this is most likely as PA 5.0 has not come out yet), you need to copy a configuration file in order to use local devices (internal speakers, headphones, HDMI, etc) other than AirPlay devices.

$ cp /usr/share/pulseaudio/alsa-mixer/profile-sets/extra-hdmi.conf \

Replace $PA_SRC_DIR with your pulseaudio working directory -- a directory to which you cloned the tree.

(Thanks Colin Leroy for this tip!)

4. Launching the new PulseAudio

$ ./src/pulseaudio -n -F src/default.pa -p $(pwd)/src/ --log-time=1 -vvvv 2>&1 | tee pulse.log

Actually, options after -p $(pwd)/src/ are optional (logging purpose), but definitely helpful for troubleshooting.

In the sound setting dialog, you'll see your AirPlay device as an output device. Select your device and start your favorite music.

Have fun!

When you are done, press Ctrl+C to kill the program. If the program hangs up and doesn't accept Ctrl+C, do

$ pkill -KILL pulseaudio

(5. Relaunching the original PulseAudio daemon)

After you finish the experiment, you can launch the original PulseAudio daemon by

$ pulseaudio -D

6. Updating the source tree

To get the latest patches from my repository, run:

$ cd pulseaudio-raop2
$ git pull

Tested music players

Works well

Rough sound

Tested device

Please send me a report if you have any experience with your device. Both positive/negative results are welcome.

Contact information

Please post a new issue at github (probably a github account is required). You can also e-mail me at Hajime Fujita crisp.fujita@nifty.com but for general questions/bug reports/feature request etc. github is strongly encouraged because the discussion is open to public, and I tend to lose track of e-mails. Also, this topic (raop2 support) is discussed at PulseAudio Bug 42804.

Related information

Other implementations

Some other raop2 implementations which allegedly work. (I've not actually tested though.)

Protocol information