[pulseaudio-discuss] Latency/lag with tcp tunnel
Matt Feifarek
matt.feifarek at gmail.com
Tue Jan 26 03:27:36 UTC 2021
My guess is that it's likely in the amp; did you try hooking up the Topping
to the new pi? Or, the converse; hook the amp up to the workstation and see
if you see a delay?
Does the Pi have a USB soundcard, or a "hat" sort of thing? Some of the
hats have buffers in them to reclock the audio signal; this can add a delay
too. I'm not familiar with the MA12070P, but as it's I2S, maybe it is
adding a buffer.
Also, you can have module-zeroconf-discover on the workstation rather than
tunnel, and it will be fine, but I doubt that's the source of latency.
You can login to the pi over ssh and turn up logging to a very verbose
degree and watch it, you'll see messages about measured latency, probably
both on the "server" (the Pi) and on the client (your workstation).
100Mbps is indeed fast enough. I've got a similar setup at home but I'm
sending 24/96 audio for boring techy reasons, and it doesn't have any
problem keeping up, so 16/44 is way easier (CD quality is more than
sufficient, that's not why I'm doing this).
Regarding your last question, you could certainly login to the Pi, put a
wav file over there, and do "paplay file.wav" and see if the delay after
hitting enter "feels" the same as over the network. My guess is that it
will.
If the delay can't be worked around, there might be ways to tell the pulse
audio stack to account for it in playback to get for example your YouTube
to sync up right. I know that VLC can do this.
On Mon, Jan 25, 2021 at 7:34 PM Matt Garman <matthew.garman at gmail.com>
wrote:
> 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!
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
>
--
*Matt Feifarek*
+1.608.403.5432 phone / SMS / Signal / WhatsApp
mattfeifarek.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20210125/cffb48ff/attachment.htm>
More information about the pulseaudio-discuss
mailing list