[pulseaudio-discuss] RTP Latency - how to reduce.
Georg Chini
georg at chini.tk
Mon Jul 8 18:26:04 UTC 2019
On 08.07.19 15:51, Sergei Steshenko wrote:
>
> On 07/07/2019 21:47, tony.chabot at vartaxos.com wrote:
>> I have searched
>>
>> Setup: Desktop machine (Centos 7, PulseAudio 10.0), and a Raspberry
>> Pi 2B (Raspbian (Debian) Buster PulseAudio 12.2) with DAC and speaker.
>>
>> If I play a video point-to-point over TCP the synch is fine, but over
>> RTP (with latency_msec=1 on RPi) there is signifcant audio latency -
>> enough to be irritating.
>>
>> If I add a second, identical RPi (although with Raspbian Stretch and
>> PulseAudio 12.2), the RTP sound is synchronous on each machine (but
>> not with the video).
>>
>> This is on a small private wired LAN (Netgear GS724T V3), 1G to
>> desktop, 100M to RPI.
>>
>> I have set tsched=0 in order to eradicate pops and sprogs.
>>
>> What can I do to reduce RTP latency?
>>
>> I eventually want to connect a guitar, and would need realtime
>> loop-through, so no suggestions about increasing audio latency to
>> obtain lip-synch, please.
>>
>> Tony
>>
> "I eventually want to connect a guitar" - I was doing some estimates,
> and if I were you, I would bypass not only pulseuadio, but also ALSA
> I.e. I would create a dedicated audio program that bypasses the kernel
> and interacts with device directly. I would also starve the OS WRT
> scheduling. I.e. I would allocate, say, 99% of time to the dedicated
> program. I would also tune kernel ticks to be in sync with sample rate.
>
>
> --Sergei.
>
What do you think is the actual latency you can live with? And is RTP a
requirement?
If ~ 10ms is sufficient and you can you also use a tunnel sink, you
could try this merge
request:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/53
It allows to reduce the latency of the tunnel sink by using a command
line parameter.
I was able to get down to around 7ms (real latency, measured with an
oscilloscope).
More information about the pulseaudio-discuss
mailing list