From e34d9d209a297a2fad353ce925f9cb9ee8adc6d1 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Thu, 10 Feb 2022 16:37:27 -0500 Subject: [PATCH] alsa: try to resume after suspend before recovering Fixes no audio after suspending with some audio drivers. See #2001 --- spa/plugins/alsa/alsa-pcm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 456abb5d1..a82d29184 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1646,6 +1646,9 @@ static int alsa_recover(struct state *state, int err) case SND_PCM_STATE_SUSPENDED: spa_log_info(state->log, "%s: recover from state %s", state->props.device, snd_pcm_state_name(st)); + res = snd_pcm_resume(state->hndl); + if (res >= 0) + return res; err = -ESTRPIPE; break; default: