feat(audio): release/refresh output-device button (#263)

After bit-perfect ALSA Direct grabs a DAC exclusively (hw: + D-Bus
reservation), the device stays sequestered and is invisible to PipeWire,
so switching back to the PipeWire backend can't see it without restarting
the app. Tauri had a refresh affordance for hot-plugged DACs; this is the
refresh plus an explicit release, in one button.

Backend: Player::release_device() / AudioCommand::ReleaseDevice tears the
stream down immediately (cancelling the deferred drop), freeing the hw:
grab + its reservation, then un-suspends the parked sink and resets any
forced graph clock (both self-gating). It does NOT reopen, unlike
reinit_device which would re-grab the device.

UI: a refresh-cw icon button beside the Output device select, propagated
through the settings callback chain to handle_release_device, which
releases, waits for PipeWire to reclaim, then re-enumerates so a freed or
hot-plugged DAC reappears without an app restart.

cc
This commit is contained in:
vicrodh committed 2026-05-31 17:41:01 -06:00
1 parent bdb9cadad6
commit d1ebf8ea1c
7 files changed
+150 -15

No files matched your search

@@ -65,6 +65,7 @@ export component SettingsView inherits Rectangle {
callback settings-select(string, int);
callback settings-slider(string, int);
callback settings-reset();
callback settings-release-device();
background: Theme.surface-main;
@@ -178,6 +179,9 @@ export component SettingsView inherits Rectangle {
settings-reset => {
root.settings-reset();
}
settings-release-device => {
root.settings-release-device();
}
}
if !SettingsState.loading && SettingsState.section == 1: PlaybackSettings {
settings-bool(k, v) => {