From a8db21862c7801751f6361916095ad48851fe1a4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 19 Feb 2024 15:11:30 +0100 Subject: [PATCH] alsa: restart the node on hw_param change When we emit a new EnumFormat, the adapter will renegotiate a new format that will be applied when we restart. Fixes #3858 --- pipewire-alsa/alsa-plugins/pcm_pipewire.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipewire-alsa/alsa-plugins/pcm_pipewire.c b/pipewire-alsa/alsa-plugins/pcm_pipewire.c index beac359ef..8aa5d48fd 100644 --- a/pipewire-alsa/alsa-plugins/pcm_pipewire.c +++ b/pipewire-alsa/alsa-plugins/pcm_pipewire.c @@ -525,8 +525,10 @@ static int snd_pcm_pipewire_prepare(snd_pcm_ioplug_t *io) params[0] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &pw->format); if (pw->stream != NULL) { + pw_stream_set_active(pw->stream, false); pw_stream_update_properties(pw->stream, &pw->props->dict); pw_stream_update_params(pw->stream, params, 1); + pw_stream_set_active(pw->stream, true); goto done; }