How to use android 2.1 phone as remote audio receiver?

Two days ago I stumbled on this question and couldn't get it right. Eventually I read in AirBubble manual that RAOP is unsupported.

I finally solved it with DLNA/UPnP capabilities of pulseaudio. It works just like you would expect. You play sound with any app with pulseaudio output on your box and select the streaming output whenever you like to redirect it to your Android device.

First, install Rygel:

$ sudo apt-get install rygel rygel-preferences rygel-gst-launch

Then alter the file /etc/rygel.conf, so that the line with the parameter enable-transcoding looks like this:

enable-transcoding=false

Then load the DLNA and TCP modules and start rygel:

$ pactl load-module module-http-protocol-tcp
$ pactl load-module module-rygel-media-server 
$ pactl load-module module-null-sink sink_name=upnp format=s16be channels=2 rate=44100 sink_properties="device.description='DLNA/UPnP Streaming' device.bus='network' device.icon_name='network-server'"
$ rygel

On your Android device download the app BubbleUPnP. Your pulseaudio output devices will be listed under the server "Sound on %HOSTNAME%". Direct the output on your computer to the DLNA device in sound preferences. Select the same output in BubbleUPnP.

Bear in mind that BubbleUPnP streams the first 30 minutes for free. The full version is 3,49€, but I guess it's worth the price. I didn't get any other app to work for me.

Finally, you can disable the media browser if you don't like it using rygel-preferences:

$ rygel-preferences

One more heads-up: this directly streams raw LPCM data, which is constantly ~250 kB/s. Any spurious WLAN activity will induce stuttering if you're on anything but an 802.11 n network. If you plan to base your entertainment solutions on wireless streaming, consider buying a wireless n router.

FOLLOW UP: TRANSCODING

To reduce network overhead and stuttering (which will happen unless you're on a 802.11 n network), it is possible to turn to transcoding the audio stream to mp3.

Paste this into ~/.config/rygel.conf

[GstLaunch]
enabled=true
launch-items=mypulseaudiosink
mypulseaudiosink-title=Sound on @HOSTNAME@
mypulseaudiosink-mime=audio/mpeg
mypulseaudiosink-launch=pulsesrc device=upnp.monitor ! lamemp3enc target=quality quality=6

Use the "Gst Launch" DLNA service which will now appear when you start rygel.

FOLLOW UP 2: FLAC

LAME can cause up to 2 minutes (!) of delay. FLAC on the other hand is pretty fast, normally clocking below one second. Change the lines in the above example to:

mypulseaudiosink-mime=audio/flac
mypulseaudiosink-launch=pulsesrc device=upnp.monitor ! flacenc quality=8

This reduces the stream to about 100 kB/s, allowing for smooth playback on most 802.11g networks with multiple users. I tested it while downloading a torrent. At full speed, there was some stuttering, but when I limited the download speed to around 200 kB/s below my maximum bandwidth, it was smooth again.

Plus, you have eliminated any loss in quality.


Couple of issues on the above - check and edit ~/.config/rygel.conf instead, the /etc/.config/rygel.conf if it isn't loaded by default (?).

The sink creation will not work on later Ubuntu versions.

What worked for me, however, is to follow all instructions (sans the sink creation). Then run paprefs, and on the "Network server" tab, select the bottom option "Make local sound devices available as uPnP server" (and maybe the suboption is required as well).

Start rygel, and select the new "DLNA/UPnP Streaming" option in PulseAudio settings.

On BubbleUPnP select "Gst Launch" as Library. In the app, select Library and there should now be an option on the top called "Sound on ".


I think you're over-working the idea, trying to make your phone do something it was never intended to do (connect to PulseAudio or something even more low-level). Make your computer do the hard work.

I'd suggest going with something like Icecast (tutorial here) and using one of the 30-odd apps for Android that can stream it.


Shairplay doesn't support TCP and raop_play (I think pulseaudio-module-raop is based on this) doesn't support UDP. Why raop is TCP only is weird, UDP seems like an easier and more suited protocol on the face of it.

And if you're source is flac then icecast via MP3 is going to kill quality, plus it's more of a CPU hog. MPD natively supports pulseaudio output so you could "switch on and off" different rooms of the house using e.g. an android phone with mpdroid app. If you could use airplay docks as endpoints you'd have a fantastic setup. But you can't cos raop doesn't support the simpler UDP endpoints!


You might want to look outside the Pulseaudio community.

I'm trying out Subsonic to do this. It has worked well so far. I've installed it on my Ubuntu system, my living room Roku, on my primary Android phones and on my secondary Android phone which is wifi-only. All of these devices are connected via wifi. I'm planning to install it on a Windows machine as well, so that my wife can stream her iTunes collection to other devices.

I can now stream Audio and Video from my Ubuntu system to my Roku in the living room, or my Android which I can take to the kitchen or while folding laundry. I can also stream from any computer which has a web-browser. I stream music and podcasts while working on long, boring house maintenance projects.

So far it has worked out well.