alsa-plugin: status timestamps a lot more imprecise than raw alsa
- PipeWire version (
pipewire --version
): 1.0.0 - Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): Arch Linux - Desktop Environment: KDE
- Kernel version (
uname -r
): 6.6.9-arch1-1
Description of Problem:
I am writing a fairly advanced alsa application that does not use the poll descriptors, but rather timeouts for scheduling. For that I enable timestamps (type SND_PCM_TSTAMP_TYPE_MONOTONIC
) and rely on that the timing info I get via snd_pcm_status_get_htstamp(status)
reasonably approximates the time point of the current stream position indicated by snd_pcm_status_get_avail(status)
. When using my soundcard directly this works very well, but when going through the pipewire alsa-plugin, the precision drops very significantly (I have to increase the 'slack margins' quite a bit). I have also seen that sometimes I get a status where the timestamp value increased without the avail value increasing, which afaiu shouldn't happen and seems to indicate that there is a bug or misunderstanding about that timestamp.