From 14d252ec9d54c5df5730c1de40ca9b96475b64b0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 8 Feb 2022 18:31:42 +0100 Subject: [PATCH] alsa: try to resync on commit error When we get a commit error, try to resync our pointers. This fixes a problem of endless commit errors after a quantum change because it never manages to resync properly. --- spa/plugins/alsa/alsa-pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 05af22512..d11875ba8 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1947,8 +1947,8 @@ again: state->props.device, snd_strerror(commitres)); if (commitres != -EPIPE && commitres != -ESTRPIPE) return res; + state->alsa_sync = true; } - if (commitres > 0 && written != (snd_pcm_uframes_t) commitres) { spa_log_warn(state->log, "%s: mmap_commit wrote %ld instead of %ld", state->props.device, commitres, written); @@ -2133,8 +2133,8 @@ int spa_alsa_read(struct state *state) state->props.device, snd_strerror(commitres)); if (commitres != -EPIPE && commitres != -ESTRPIPE) return res; + state->alsa_sync = true; } - if (commitres > 0 && read != (snd_pcm_uframes_t) commitres) { spa_log_warn(state->log, "%s: mmap_commit read %ld instead of %ld", state->props.device, commitres, read);