Streaming low-latency bi-directional audio between Android 4.x and a Linux desktop

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Streaming low-latency bi-directional audio between Android 4.x and a Linux desktop

Stuart Longland
Hi all,

Firstly, apologies if this is not quite relevant to this list.  I'll
happily take it elsewhere if this is the case.

I was wondering if someone knew of a tool that would enable me to
connect my phone (running Android 4.1, I know this is old but it's what
I have) over WiFi to my desktop (Ubuntu 18.04 LTS) or my laptop (Gentoo).

I have a proof-of-concept going using JACK, icecast2 and darkice… I was
able to get `qt-dab` to pipe audio to `darkice` and receive the stream
from my phone using `HaveRadiosion`, however there's quite a bit of
latency introduced, and it's one-way.

Fine for music, but if I'm in a VoIP call with someone and have to step
away from my desk at work I'm kinda stuck.

Both JACK (netjack[12]) and PulseAudio are able to operate over a
network.  It seems all I really need is a compatible Android application
that can link to the phone's headset and advertise that to the
PulseAudio or JACK server.

Before I go embark on a quest to scratch my own itch, is anyone aware of
software that would allow such a link to take place?

Regards,
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Streaming low-latency bi-directional audio between Android 4.x and a Linux desktop

Len Ovens
On Sun, 3 Nov 2019, Stuart Longland wrote:

> I was wondering if someone knew of a tool that would enable me to
> connect my phone (running Android 4.1, I know this is old but it's what
> I have) over WiFi to my desktop (Ubuntu 18.04 LTS) or my laptop (Gentoo).

Mummble? There are more than one mummble clients avaiable for android and
of course linux as well. I think mummble uses opus by default which is 5ms
(or can be) and at least between desktops seems very instantaious. The
android audio stack tends to be laggy, I think there is an alsa in there
somewhere but the application only sees it through a higher level API
which on most smart (cough) phones/tablets seems to introduce too much
delay. Playing drums on the screen for example is too latent to be able to
play with myself even. Hopefully your device is better.



--
Len Ovens
www.ovenwerks.net
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Streaming low-latency bi-directional audio between Android 4.x and a Linux desktop

Stuart Longland
On 3/11/19 2:17 pm, Len Ovens wrote:
> Mummble? There are more than one mummble clients avaiable for android
> and of course linux as well.

Ahh okay, yes, I could try that.  I actually have plumble installed on
this phone already (for a different task), but I'll give that a shot.

> I think mummble uses opus by default which
> is 5ms (or can be) and at least between desktops seems very
> instantaious. The android audio stack tends to be laggy, I think there
> is an alsa in there somewhere but the application only sees it through a
> higher level API which on most smart (cough) phones/tablets seems to
> introduce too much delay. Playing drums on the screen for example is too
> latent to be able to play with myself even. Hopefully your device is
> better.

Yeah well, this is why I'm not being too picky about latency.
The device is a ZTE T83 (with a pirated Linux kernel no less… they do
not comply with Sect. 3 of the GPLv2), not exactly the pinnacle of
mobile computing.  That said, this device seems to work in parts of the
worlds where others do not, so I'll put up with its imperfections and
dated OS.

I have a tool called 'Microphone' installed on that phone which feeds
microphone audio out to the headset jack -- mainly intended for use with
a male-male 3.5mm cable to provide a microphone to a computer, but it
can also serve for testing a headset connection.  I notice a little bit
of latency, maybe 100ms, which is fine for this application.

If we can keep the latency below a second, it'll be good enough-ish --
it was tens of seconds that I didn't like. :-)
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Streaming low-latency bi-directional audio between Android 4.x and a Linux desktop

Stuart Longland
On 3/11/19 2:28 pm, Stuart Longland wrote:
>> Mummble? There are more than one mummble clients avaiable for android
>> and of course linux as well.
> Ahh okay, yes, I could try that.  I actually have plumble installed on
> this phone already (for a different task), but I'll give that a shot.

Right, so just gave this a try… and after adjusting the bit rate, I
could get reasonable quality audio, but the client only seems to support
mono transmission.  I think this might be an architectural limitation of
Mumble (understandable given its use case).

Stereo would be preferable and should be doable, yes this doubles the
audio rate, but even 11Mbps WiFi should keep up.  Audio codec wise
though, it's better than I expected for a VoIP application, but the
channel count is a no-go here.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user