From ad9dc1ec81dba5441e44ae845982f894dee82a4a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 18 Jul 2024 14:15:22 +0200 Subject: [PATCH] modules: don't unload module on stream error Unloading the module on stream errors is a bit too much because a suspend can clear the stream error again (or the error might not be fatal) This can happen for example when negotiation fails on some stream ports (wireplumber tries to link the midi ports to audio ports) and it's better to not completely fail on that. Fixes #4121 --- src/modules/module-ffado-driver.c | 4 ++-- src/modules/module-jack-tunnel.c | 4 +++- src/modules/module-netjack2-driver.c | 2 ++ src/modules/module-netjack2-manager.c | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/module-ffado-driver.c b/src/modules/module-ffado-driver.c index 5656f3227..833e9f76c 100644 --- a/src/modules/module-ffado-driver.c +++ b/src/modules/module-ffado-driver.c @@ -548,8 +548,8 @@ static void stream_state_changed(void *d, enum pw_filter_state old, struct impl *impl = s->impl; switch (state) { case PW_FILTER_STATE_ERROR: - pw_log_error("filter state %d error: %s", state, error); - SPA_FALLTHROUGH; + pw_log_warn("filter state %d error: %s", state, error); + break; case PW_FILTER_STATE_UNCONNECTED: pw_impl_module_schedule_destroy(impl->module); break; diff --git a/src/modules/module-jack-tunnel.c b/src/modules/module-jack-tunnel.c index 00d1d651f..3ec751d04 100644 --- a/src/modules/module-jack-tunnel.c +++ b/src/modules/module-jack-tunnel.c @@ -306,10 +306,12 @@ static void stream_state_changed(void *d, enum pw_filter_state old, struct stream *s = d; struct impl *impl = s->impl; switch (state) { - case PW_FILTER_STATE_ERROR: case PW_FILTER_STATE_UNCONNECTED: pw_impl_module_schedule_destroy(impl->module); break; + case PW_FILTER_STATE_ERROR: + pw_log_warn("stream %p: error: %s", s, error); + break; case PW_FILTER_STATE_PAUSED: s->running = false; break; diff --git a/src/modules/module-netjack2-driver.c b/src/modules/module-netjack2-driver.c index 32bb7773e..c67ccd660 100644 --- a/src/modules/module-netjack2-driver.c +++ b/src/modules/module-netjack2-driver.c @@ -274,6 +274,8 @@ static void stream_state_changed(void *d, enum pw_filter_state old, struct impl *impl = s->impl; switch (state) { case PW_FILTER_STATE_ERROR: + pw_log_warn("stream %p: error: %s", s, error); + break; case PW_FILTER_STATE_UNCONNECTED: pw_impl_module_schedule_destroy(impl->module); break; diff --git a/src/modules/module-netjack2-manager.c b/src/modules/module-netjack2-manager.c index 5be712e80..f9883069a 100644 --- a/src/modules/module-netjack2-manager.c +++ b/src/modules/module-netjack2-manager.c @@ -297,6 +297,8 @@ static void stream_state_changed(void *d, enum pw_filter_state old, struct impl *impl = s->impl; switch (state) { case PW_FILTER_STATE_ERROR: + pw_log_warn("stream %p: error: %s", s, error); + break; case PW_FILTER_STATE_UNCONNECTED: pw_impl_module_schedule_destroy(impl->module); break;