Fix daemon autostart issue caused by sync pipewire retry loop (#43)

At boot time, PipeWire takes some time to register the `pwsp-daemon` and `pwsp-virtual-mic` devices. Previously, the daemon's retry loop for `link_player_to_virtual_mic()` was synchronous and limited to 5 attempts (1.5 seconds total). This caused systemd autostarts to fail with a code 1 if the devices were not yet available.

This change replaces the synchronous wait with an asynchronous `tokio::spawn` task. It will retry the link attempt up to 60 times with a 1-second delay without blocking the startup of the rest of the daemon. This prevents it from exiting abruptly during autostart.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
Tarasov Aleksandr
2026-03-22 17:05:26 +03:00
committed by GitHub
parent 6114b9a7f8
commit f01a0e656c
5 changed files with 58 additions and 38 deletions
+4 -1
View File
@@ -77,7 +77,10 @@ impl App for SoundpadGui {
// Sync audio player state
{
let guard = self.audio_player_state_shared.lock().unwrap_or_else(|e| e.into_inner());
let guard = self
.audio_player_state_shared
.lock()
.unwrap_or_else(|e| e.into_inner());
self.audio_player_state = guard.clone();
}