Streaming from the input

Moderator: flatmax

abonam
Posts: 20
Joined: Sat May 13, 2017 7:21 am

Re: Streaming from the input

Post by abonam » Wed Jul 26, 2017 8:22 am

Hello,


I noticed ffmpeg does not achieve the latency I need. With several combinations tested, l was never been able to get less than half second.
Tried also jackd, but it seems it does not work at all with wifi, giving me tons of xruns (I opened another thread here in this forum about this issue).
The only configuration so far I was able to get to work is jackd with wired network, acheiving low latency and xruns almost absent.
However for my project I need to work with wifi, so a wired connection is out of question.
Looking into pulseaudio in these days, but I have already read lots of posts on other forum discouraging the usage of PA and wifi as well.

Cheers,
Andrea

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Streaming from the input

Post by flatmax » Thu Jul 27, 2017 4:45 pm

I am starting to think that we should create an ultra low latency solution here.

My current thoughts are to use a trivialised ALSA capture followed by an RTP broadcast.
Anyone familiar with RTP options out there ?

I am inclined to suggest using this trivialised ALSA capture class :
http://gtkiostream.flatmax.org/ALSACapt ... ample.html

Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Streaming from the input

Post by flatmax » Thu Jul 27, 2017 9:25 pm

In tutorial 3 here : http://forum.audioinjector.net/viewtopi ... =10&t=2997
I have put up a simple ALSA capture script which could kick this concept off if anyone is keen to integrate an available rtp library.

It would be interesting to see just how low we can crank the latency and get a reliable RTP stream.

Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

abonam
Posts: 20
Joined: Sat May 13, 2017 7:21 am

Re: Streaming from the input

Post by abonam » Tue Aug 01, 2017 10:25 am

Hello,

this is all great work!
Unluckily I am not a C developer so my contribution here can not be much.
However, I am just thinking if it was possible to integrate a smart codec like opus before broadcast via rtp.

I was trying (and unluckily it does not work) the solution proposed years ago here:
http://www.pogo.org.uk/~mark/trx/

The author implemented a simple pair of commands tx and rx to send audio over the network using rtp and opus.
I tried these commands using the audioinjector (the tx commands allow to access an ALSA device) but the output is all choppy and distorted.

Wondering if you guys can patch something together out of it.

Cheers,
Andrea

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Streaming from the input

Post by flatmax » Tue Aug 08, 2017 8:45 pm

At the moment I don't have time, however another lead is the jackd net driver, which uses opus :
https://github.com/jackaudio/jack2/blob ... k_packet.c

The functions of interest are the following :
render_jack_ports_to_payload_opus
render_payload_to_jack_ports_opus

Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

abonam
Posts: 20
Joined: Sat May 13, 2017 7:21 am

Re: Streaming from the input

Post by abonam » Thu Oct 12, 2017 5:18 am

Hello,


a short note on some codec I found online.

I found this tool
https://github.com/dacarr/rtstream

It provides one command (rtstream) that can be used to send / receive data from the card to another Pi.
It works fine with multicast (224.0.0.1), overall latency of the whole chain rx/tx is less than 200 ms.
If the RX is 100 ft away, the relative distance between source and destination will cancel the delay.
So far I had to modify the file main.c changing the default parameters to different values than the original.
Codec used is OPUS, one must link (manually in my case) the libraries and it compiles just fine.

As a positive note, the CPU load is surprisingly low: once the setup of TX and RX is complete, sending an OPUS file with 128Kbps and 48Khz stereo gives only on a 6% CPU load in both PIs.

Cheers,
Andrea

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests