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.
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.
- Fixed several bugs which prevented PulseAudio from playing music on Pioneer VSX-43.
- I did not intentionally include any device-specific codes but it is the only AirPlay device I currently have.
- Upgraded the codebase to PulseAudio 4.0 (previously around 2.99).
See the commit history for details.
I have switched to
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.
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
- Plays back music on Pioneer VSX-43 (AV receiver), Apple TV 3rd gen. and some other devices (see below for tested device list).
- Supposed to support both TCP an UDP protocols. However, TCP procotol is not tested at all because I don't own a device.
As of 10/14/2013
- Sound test (launched from the GNOME sound setting dialog) does not work (no sound heard).
- Works reasonably with VLC/Totem/Rhythmbox but when playing music from Flash player, quite rough sound is heard.
- There's a huge latency. Okay for music player but absolutely terrible for movies/voice chat.
- Volume calculation is wrong
- This is still not more than an experimental branch. It is totally unstable and may not work at all on some devices. Do not expect too much!
- This is totally my personal hobby. It is not supported by any company or organization. My contribution totally depends on my free time and motivation. Especially, my primary goal is to make it work on my Pioneer VSX-43, so I may not be interested in other devices.
- You don't have to be a C/systems programming expert to try it, but you probably have to be an expert of building software/configuring your system.
- As written in the license, there is absolutely no warranty. You should try this at your own risk.
Since I'm using Ubuntu 13.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.
Install some packages:
sudo apt-get install build-essential paprefs git pulseaudio-module-raop sudo apt-get build-dep pulseaudio
$ git clone https://github.com/hfujita/pulseaudio-raop2.git
$ git clone firstname.lastname@example.org:hfujita/pulseaudio-raop2.git # if you have github account and registered your key
You should be in the
Note: tarball or zip won't work because PulseAudio build system relies on git revision information.
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
PulseAudio should be configured so that it will discover AirPlay devices on the network.
$ paprefs & # This is an X application
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.
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.
$ ./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.
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
After you finish the experiment, you can launch the original PulseAudio daemon by
$ pulseaudio -D
To get the latest patches from my repository, run:
$ cd pulseaudio-raop2 $ git pull
- Amarok (thanks to Ewan Cochevelou)
- Adobe Flash player
Please send me a report if you have any experience with your device. Both positive/negative results are welcome.
- Pioneer VSX-43
- Apple TV 3rd generation
- Minx Air 200 (thanks to Matthias)
- shairport (thanks to Karl Stavestrand)
- Pioneer VSX-922 (thanks to Matthias)
- NOCS NS2 (Thanks to Kim Tore Jensen)
- Freebox Revolution Server (Thanks to Pierre Gaudillere)
- Sony CMT-G2BNIP
- Pioneer VSX-822 (Thanks to Martin Owens)
- Yamaha RX-A820 (Thanks to Patryk Zawadzki)
- JBL On Air (Thanks to Aaron Brady)
- Pioneer XW-SMA4 (thanks to Giuseppe Iannello)
- Sony SA-NS510 (thanks to Giuseppe Iannello)
- iHome IW2 (thanks to Nicolas VEYSSIERE)
- Pioneer X-HM71 (thanks to Patrice Mandin)
- Philips AD7050W/10 (thanks to Ralf Ertzinger)
- Sony STR-DN840 (thanks to Cyrus Boadway)
- PURE Contour 200i Air (thanks to Johannes Schinko)
Please e-mail me at Hajime Fujita email@example.com, or you can post a new issue at github (probably a github account is required). Also, this topic (raop2 support) is actively discussed at PulseAudio Bug 42804.
Some other raop2 implementations which allegedly work. (I've not actually tested though.)