PULSE_LATENCY_MSEC inconsistent?
-
PipeWire version (
pipewire --version
): pipewire Compiled with libpipewire 0.3.45 Linked with libpipewire 0.3.45 -
Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): Archlinux -
Desktop Environment: kde plasma
-
Kernel version (
uname -r
): 5.16.8-arch1-1
How Reproducible:
Since some day i switched to pipewire and I'm using kde plasma. It produces a "click" when you press a key combination to chenge the volume. Immediately after installing pipewire i noticed an higher lag between the keypress and the audible notification. inspecting with pw-top revealed that the quantum used ny libcanberra (pulse) and the alsa device is 1024. If i do my math correctly, 1024 should be around 21ms at 48khz: 1000/(48000/1024)=21.33 But to get comparable results,by ear, i need to lower it to around 256, which seems overkill to me! Experimenting with PULSE_LATENCY_MSEC=xx paplay sound.wav and pw-top, I also discovered that to reach 20msecs
PULSE_LATENCY_MSEC=23 : 254-256
PULSE_LATENCY_MSEC=46 : 507-512
PULSE_LATENCY_MSEC=86 ; 1014-1024 #<--- which is consistent with my experience with sound applet notification!
So, if I'm reading things right, setting a quantum of 1024 translates to a default latency of about 86milliseconds which is about 4 times what it should be (1000/(48000/1024)*4=85.33), which is suspicoius to me.
Is it using 4 buffers? Is this expected? Isn't better to have less larger buffers?
Apologies if what i wrote is all wrong, i'm just exploring pipewire.
attached pw-dump while doing PULSE_LATENCY_MSEC=86 paplay