fix(audio): recover the suspended DAC before changing routes

Only acknowledge the recorded sink, retaining failed recovery for reset retries. Restore the Slint device refresh settle delay and release before resetting routing settings. Abort an ALSA backend change when release fails.

cx
This commit is contained in:
vicrodh committed 2026-09-16 09:33:56 -06:00
1 parent ca5f13966e
commit 41e365efab
2 files changed
+76 -54

No files matched your search

+9
View File
@@ -4170,6 +4170,8 @@ pub async fn settings_select(runtime: &Arc<AppRuntime<LoggingAdapter>>, key: &st
// release and raced its own re-enumeration.
if let Err(error) = release_output_device_with_owner(runtime).await {
report_release_failure(&error);
publish_snapshot().await;
return;
}
}
if let Err(e) = with_audio(|s| s.set_backend_type(Some(backend))) {
@@ -4725,6 +4727,10 @@ pub async fn settings_reset(runtime: &Arc<AppRuntime<LoggingAdapter>>) {
let Some(_owner_action) = begin_audio_owner_action("reset live audio settings", false) else {
return;
};
if let Err(error) = release_output_device_with_owner(runtime).await {
report_release_failure(&error);
return;
}
if let Err(e) = with_audio(|s| s.reset_all().map(|_| ())) {
log::error!("[qbz-qt] audio settings reset failed: {e}");
}
@@ -4757,6 +4763,9 @@ pub async fn refresh_devices(runtime: &Arc<AppRuntime<LoggingAdapter>>) {
if let Err(error) = release_output_device_with_owner(runtime).await {
report_release_failure(&error);
}
// As in Slint's release button, allow WirePlumber to recreate the sink
// after PCM/reservation release before publishing the fresh device list.
tokio::time::sleep(std::time::Duration::from_millis(300)).await;
invalidate_device_cache();
// #638 fix 3, trigger 6 — Qt-only, and the easiest of the six to miss.
// This button exists precisely for hotplug: the hardware behind the