Dante/AES67-RTP-Stream to SBC: Latency

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

Dante/AES67-RTP-Stream to SBC: Latency

cvxdev
Hi all,

I am currently playing around with an AudioOverIP Project and wondered if you could help me out. I have a LAN, with an Audio Source (Dante/AES67-RTP-Stream) which I would like to distribute to multiple receivers (SBC (e.g. RaspberryPi) with an Audio Output (e.g. Headphone jack):

Source (e.g. PC)-->Dante-Audio-USB-Dongle-->AES67/RTP-Multicast-Stream-->LAN-Network-Switch-->RPI (Gstreamer --> AudioJack)

I currently use the following Gstreamer Pipeline command on the RPi:

gst-launch-1.0 -v udpsrc uri=udp://239.69.212.18:5004 caps="application/x-rtp,channels=(int)2,format=(string)S16LE,media=(string)audio,payload=(int)96,clock-rate=(int)48000,encoding-name=(string)L24" ! rtpL24depay ! audioconvert ! alsasink device=hw:0,0

It all works fine, but if I watch a video on the PC and listen to the Audio on the RPI, I have some latency (~200-300ms), therefore my questions:

  1. Do I miss something in my Gstreamer Pipeline to be able to reduce latency?
  2. What is the minimal Latency to be expected with RTP-Streams, is <50ms achievable?
  3. Would the latency occur due to the network or due to the speed of the RPi?
  4. Since my audio-input is not a Gstreamer input, I assume rtpjitterbuffer or similar would not help to decrease latency / improve sync?
Here the SDP-extract from the Audio-Source:
v=0
o=- 1484410 1484415 IN IP4 192.168.88.32
s=avio : 2
c=IN IP4 239.69.212.18/32
t=0 0
a=keywds:Dante
m=audio 5004 RTP/AVP 97
i=2 channels: Left, Right
a=recvonly
a=rtpmap:97 L24/48000/2
a=ptime:1
a=ts-refclk:ptp=IEEE1588-2008:00-1D-C1-FF-FE-50-BD-E3:0
a=mediaclk:direct=161726307

Thanks in advance for your feedback & help.



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dante/AES67-RTP-Stream to SBC: Latency

Nicolas Dufresne-5


Le mar. 18 févr. 2020 09 h 15, CVX DEV <[hidden email]> a écrit :
Hi all,

I am currently playing around with an AudioOverIP Project and wondered if you could help me out. I have a LAN, with an Audio Source (Dante/AES67-RTP-Stream) which I would like to distribute to multiple receivers (SBC (e.g. RaspberryPi) with an Audio Output (e.g. Headphone jack):

Source (e.g. PC)-->Dante-Audio-USB-Dongle-->AES67/RTP-Multicast-Stream-->LAN-Network-Switch-->RPI (Gstreamer --> AudioJack)

I currently use the following Gstreamer Pipeline command on the RPi:

gst-launch-1.0 -v udpsrc uri=udp://239.69.212.18:5004 caps="application/x-rtp,channels=(int)2,format=(string)S16LE,media=(string)audio,payload=(int)96,clock-rate=(int)48000,encoding-name=(string)L24" ! rtpL24depay ! audioconvert ! alsasink device=hw:0,0

It all works fine, but if I watch a video on the PC and listen to the Audio on the RPI, I have some latency (~200-300ms), therefore my questions

Alsasink has 200ms latency as default configuration. See buffer-time property.

  1. Do I miss something in my Gstreamer Pipeline to be able to reduce latency?
  2. What is the minimal Latency to be expected with RTP-Streams, is <50ms achievable?
  3. Would the latency occur due to the network or due to the speed of the RPi?
  4. Since my audio-input is not a Gstreamer input, I assume rtpjitterbuffer or similar would not help to decrease latency / improve sync?
Here the SDP-extract from the Audio-Source:
v=0
o=- 1484410 1484415 IN IP4 192.168.88.32
s=avio : 2
c=IN IP4 239.69.212.18/32
t=0 0
a=keywds:Dante
m=audio 5004 RTP/AVP 97
i=2 channels: Left, Right
a=recvonly
a=rtpmap:97 L24/48000/2
a=ptime:1
a=ts-refclk:ptp=IEEE1588-2008:00-1D-C1-FF-FE-50-BD-E3:0
a=mediaclk:direct=161726307

Thanks in advance for your feedback & help.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dante/AES67-RTP-Stream to SBC: Latency

cvxdev
Nicolas Dufresne-5 wrote
> Alsasink has 200ms latency as default configuration. See buffer-time
> property.

Awesome - thanks.
That improves things a lot. By testing it seems like 20000 microseconds is
the lower limit, if i put 19000 no sound is played anymore.
I let it run with 20000 microseconds for a while, after ca. 10min I get some
noise in the audio. I guess the only way to improve that is to increase the
buffer - or is there any "experience" value for stable playback? (e.g. 40000
microseconds)?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dante/AES67-RTP-Stream to SBC: Latency

Nicolas Dufresne-5


Le mar. 18 févr. 2020 11 h 30, cvxdev <[hidden email]> a écrit :
Nicolas Dufresne-5 wrote
> Alsasink has 200ms latency as default configuration. See buffer-time
> property.

Awesome - thanks.
That improves things a lot. By testing it seems like 20000 microseconds is
the lower limit, if i put 19000 no sound is played anymore.
I let it run with 20000 microseconds for a while, after ca. 10min I get some
noise in the audio. I guess the only way to improve that is to increase the
buffer - or is there any "experience" value for stable playback? (e.g. 40000
microseconds)?

Ideally you want to tweak all together latency-time (size of writes to the audio card) buffer-time (the buffer accumulation before starting audio, the added pipeline latency) but also the thresholds. This all play together, with 20ms, you only have 2 writes buffering to the audio card. It makes it a little fragile. Ideally I try to maintain 3 or 4 units of buffer.

The lower the latency in GStreamer, the higher the CPU, be aware. You may also move the ring buffer thread onto deadline scheduler, that will also help. If that still not enough, best is to move to jack or pipewire audio daemons.




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel