Android - How to stream audio from Android to PulseAudio server?

For my linux distribution (Fedora 20) it's quite simple:

  1. [PC] Run PulseAudio. (Runs automatically on Fedora)
  2. [PC] Load module bluetooth-discovery. (It's auto-loaded on Fedora)
  3. [PC, Android] Pair with Android-phone via Bluetooth.
  4. [Android] In device's options set the profile "Use for media audio".
  5. [PC] Connect to the phone.
  6. [Android] Play music. (I use Google Play Music - it works)
  7. [PC] The phone's stream is detected as an Input Source - in case, you want to mute or amplify it.

Caveats

The only problem is the step 5. I can't connect to PC from my phone - I think, it's a linux problem - and it's another question for another forum.


Currently there is no built-in protocol for "stock" Androids to connect to remote Pulseaudio servers. However, a custom ROM HAS been made to include Pulseaudio as the Android sound engine. Maybe soon your answer will be built into Androids.

SO. What CAN you do to get Android sound to a remote rendering engine? One answer says send it over Bluetooth which only works well for short distances and for Media PCs with Bluetooth. This is the first thing to try, and it may even be worth the small expense of buying a USB Bluetooth adapter for your media PC. It has the distinct advantage of working with all players.

If you don't have Bluetooth or you want more range, you can also install a UPnP server on your Linux machine. Rygel is one. Some player applications can send audio to remote UPnP devices, others can't. Look in the settings of your player for words like "throw" and "renderer" these settings allow you to choose a remote player. UPnP devices are recognized automatically and can be selected for playback once found.

One free UPnP audio player is UPnPlay. Install this from Play Store and select the rendering engine of your Linux PC running rygel. This method will use the WiFi of your Android device to send audio to the media PC. The range will be much greater than Bluetooth.

If you run Kodi on your Media PC, turn on UPnP in settings and kodi will do the work of rygel. The paid version of Yatse, a Kodi remote, can also throw to remote servers.