16

I have seen a lot of apps and solutions online to receive audio from a desktop to an android phone. I also know how to stream audio from one desktop to another, using paprefs and pavucontrol.

What I want is to be able to stream from my Android phone to pulseaudio. There are individual apps with chromecast support, but then you're stuck with the app, and you need to be running something like Kodi on the desktop to receive it.

When you connect to a bluetooth audio source from Android, it just streams all outgoing audio. This is what I want to do over wi-fi, to pulseaudio. How can it be done?

1

5 Answers 5

3

This can not be done

Don't read below if you are not interested in a solution for using DLNA-streams from Android to Ubuntu.


To send audio via a network connection from Android to Ubuntu you always need a renderer on your Ubuntu desktop and a streaming application on the android device. Android does not use pulseaudio as a sound server. We therefore depend on an additional app to send audio to the desktop.

There are several applications that can do this. I tested this successfully with gmediarender on the Ubuntu side and BubbleUpnp for Android.

  1. Install and run gmediarender on Ubuntu from the command line.

    sudo apt install gmediarender
    gmediarender -f <Name>
    

    Consult the manpage for more options.

  2. Install and run Bubble UPnP on the Android device.

  3. Search for the renderer name you gave in Bubble UPnP > Local Renderer

    enter image description here

  4. Select tracks to play on the Android device and listen to them on the Ubuntu machine.

    enter image description here

Note that this will also work for photos or video content you can stream to your computer using Bubble UPnP.

6
  • 1
    Thanks for the reply, but this doesn't resolve the issue that you're still stuck with the app. I'm looking for something that will stream all outgoing audio, like it would if you were streaming to bluetooth.
    – 3x5
    Nov 7, 2017 at 19:22
  • You will always need an app for that - neither Android nor Ubuntu can do this without.
    – Takkat
    Nov 7, 2017 at 19:30
  • 2
    Ubuntu actually can. You can set up a Pulseaudio server on one computer, and sink on the other, and all audio from one will stream to the other.
    – 3x5
    Nov 7, 2017 at 23:08
  • While it is true that gmediarender + BubbleUPNP combination will work, the questions was clearly about any audio. Sep 7, 2018 at 15:30
  • @AtomHeartFather: see edit. I'd be more than interested if you had a solution for this.
    – Takkat
    Sep 7, 2018 at 15:55
2

Not a solution for bt over wifi. I'll still leave this here for people searching for sending audio to bt on linux and then to a bt headset another bt (as it took me several months to find this solution.)

..found on ycombinator.. (https://news.ycombinator.com/item?id=24441112)

From this post:

"First, install the PulseAudio Bluetooth modules. On ArchLinux this is called pulseaudio-bluetooth and on Ubuntu/Debian it is called pulseaudio-module-bluetooth.

After you have installed this package open the following file:

/etc/pulse/system.pa And add the following couple of lines:

load-module module-bluetooth-policy
load-module module-bluetooth-discover

Then, as your regular user, restart PulseAudio:

$ pulseaudio -k
$ pulseaudio --start

"

..I am even able to stream the Android audio through pulseaudio directly to my also connected bluetooth headset..!!

2
  • Also setting the linux output codec to SBC in pavucontrol is something that helped with sound problems
    – arilebedey
    Mar 7, 2022 at 20:46
  • It's not a solution for this question. They want it via WiFi, not BT.
    – AlexP11223
    Aug 7, 2022 at 9:30
1

sndcpy, it's like scrcpy, but for audio.

It's not ALL audio but it's close enough.

It works on adb, so any way you can get a connection through adb, i.e. USB and wifi.

It has some buffering issues which makes unusable for me (once in a while it skips a few words on my audiobook), and has a high delay even on USB, but on some cases that doesn't matter. I have just tried it.

1

I think a way better trade-off than the enormous stress with BubbleUpnp would be SoundWire. This will not stream to pulseaudio but to SoundWire server running on your Computer. But it will stream all audio from your Android device to it after and it can run in the background.

An alternative may be AirAudio but it needs root and it did not work for me even with Magisk...

2
  • just successfully used your mentioned "AirAudio" and works fine [on Magisk ROOTED Android]. Important comment for others - it is not free; either you have to live with some beeps after 5min or spent ~4€ in PlayStore (just did it my self). Sound streaming from Android to VLC seems more HiFi-ish than streaming audio to BlueTooth sink on Ubuntu.
    – linolino
    Jan 8, 2020 at 17:25
  • SoundWire only passes audio from the PC to the Android device (at least the free version in Oct 2020, and given the documentation, likely the payfer too). Oct 26, 2020 at 10:03
0

I was able to do this using audiorelay, works both ways, over wifi. It's kinda choppy but as far as I've seen, reliable enough. And the setup is pretty simple, install the app and program on both systems, and just connect with the automatic discovery.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .