From 6b6f3432fe1c8451bd78a09ae1c219d7ea1b93a8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 5 Jun 2023 17:15:30 +0200 Subject: [PATCH] alsa: htimestamp needs an operation to sync with hw So use snd_pcm_avail --- spa/plugins/alsa/alsa-pcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 8fc7a26d0..52a68c292 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1887,6 +1887,7 @@ static int get_avail(struct state *state, uint64_t current_time, snd_pcm_uframes snd_htimestamp_t tstamp; uint64_t then; + avail = snd_pcm_avail(state->hndl); if ((res = snd_pcm_htimestamp(state->hndl, &avail, &tstamp)) < 0) { if ((res = alsa_recover(state, res)) < 0) return res;