From 40a4aa34c8d2bd93c5a73c3dd37c4e68cf6a059f Mon Sep 17 00:00:00 2001 From: berce <75228263+bercedev@users.noreply.github.com> Date: Tue, 29 Sep 2026 05:17:06 +0300 Subject: [PATCH] Don't retry the _pa ipc at a Linux login screen (#16390) At a greeter the cm is not started, so the `_pa` socket never exists and the audio service fails to connect and logs an error once per second for as long as a client is connected. Wait in `pa_impl::run` while `is_prelogin()` is true; audio starts once a user logs in. Fixes #16012 --- src/server/audio_service.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/audio_service.rs b/src/server/audio_service.rs index f7ba94617..b81de7f68 100644 --- a/src/server/audio_service.rs +++ b/src/server/audio_service.rs @@ -97,6 +97,17 @@ mod pa_impl { pub async fn run(sp: EmptyExtraFieldService) -> ResultType<()> { hbb_common::sleep(0.1).await; // one moment to wait for _pa ipc RESTARTING.store(false, Ordering::SeqCst); + // The `_pa` ipc is served by the cm, which is not started at a login + // screen, so connecting there fails and logs an error every second. + // Wait here instead; audio starts once a user logs in. Poll slowly, + // `is_prelogin` spawns a process on every call. + #[cfg(target_os = "linux")] + while crate::platform::is_prelogin() { + if !sp.ok() { + return Ok(()); + } + hbb_common::sleep(3.).await; + } #[cfg(target_os = "linux")] let mut stream = crate::ipc::connect(1000, "_pa").await?; let mut encoder = AudioEncoder::new(Encoder::new(