[pulseaudio-discuss] Latency/lag with tcp tunnel

Matt Garman matthew.garman at gmail.com
Tue Jan 26 01:33:56 UTC 2021


I am using a Raspberry Pi as a "sound server".  Essentially, the RPI
is connected to the actual audio hardware.  The RPI advertises itself
via module-native-protocol-tcp and module-zeroconf-publish.  My
desktop/workstation in turn uses the RPI for playback via
module-tunnel.

Everything seems to work as expected, except there is a noticeable lag
between doing something on the PC, and having the audio "catch up" on
the RPI.  For example, watching YouTube - the audio and video are out
of sync to the point of being unwatchable.  Or using a simple audio
player on the PC, hitting "play" or "stop", there is a noticeable
delay from when the button is pressed to when the action actually
takes effect.

I can't think of a good way to measure the lag, but I'm guessing it's
around half to three fourths of a second.

To be clear, there are no stutters or skips or other audio artifacts.
Playback is smooth and sounds as good as I expect - but the lag is a
problem.

What's interesting is, this is actually the second RPI sound server
I've built.  The first one had this lag, but to a much smaller degree,
as in, barely noticeable.  The differences between the systems are:
the first (barely noticeably lag) is an RPI 4, connected to a Topping
D70 DAC.  The new system (with the obvious latency issue) is an RPI 3,
connected to an MA12070P-based amplifier.  IOW, the RPI hardware and
audio hardware are different.  But the network is the same, and the
devices are all in the same physical location (i.e. same cable
length).

The RPI 3 does have only 100mbps network, and the RPI 4 has gigabit.
The rest of the network chain is all gigabit.  These are all hardwired
networks (i.e. no wireless).  I feel like 100mbps is more than
sufficient for CD-quality audio.  The RPI isn't running any other
services or doing any other work.

Any thoughts on how I might track this down?  Or what config options I
can play with to see if it improves the situation?  Also, as the RPI
is headless, I can't think of a good way to determine if the latency
is on the RPI itself, or comes from the network between the PC and
RPI.

Thanks!


More information about the pulseaudio-discuss mailing list