fix: add 1.5s stabilization check in start_jack to catch flaky JACK startup
CI / test (push) Has been cancelled
CI / test (push) Has been cancelled
JACK can briefly become operational (jack_lsp returns ports) during startup then crash when the ALSA device fails. The initial readiness check catches this window and returns True prematurely. Add a 0.5s stabilization window after first success — if JACK drops, continue the wait loop instead of returning. Without this, profile changes succeed in the API but leave JACK in a zombie state: process exists with SHM infrastructure but can't serve clients.
This commit is contained in:
+12
-4
@@ -353,10 +353,18 @@ class AudioSystem:
|
|||||||
"JACK started: period=%d, nperiods=%d, rate=%d",
|
"JACK started: period=%d, nperiods=%d, rate=%d",
|
||||||
profile["period"], profile["nperiods"], profile["rate"],
|
profile["period"], profile["nperiods"], profile["rate"],
|
||||||
)
|
)
|
||||||
# Auto-connect ports if enabled
|
# Stabilization check — JACK can start briefly then crash
|
||||||
if self.config.auto_connect:
|
# if the ALSA device is flaky. Wait 1.5s with retries.
|
||||||
self.connect_fx_ports()
|
time.sleep(0.5)
|
||||||
return True
|
if _jack_is_operational():
|
||||||
|
# Auto-connect ports if enabled
|
||||||
|
if self.config.auto_connect:
|
||||||
|
self.connect_fx_ports()
|
||||||
|
return True
|
||||||
|
# JACK was running but dropped — don't return yet,
|
||||||
|
# continue the wait loop for a fresh attempt
|
||||||
|
logger.warning("JACK appeared briefly then became non-operational")
|
||||||
|
continue
|
||||||
# JACK process exists but not ready yet — keep waiting
|
# JACK process exists but not ready yet — keep waiting
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user