fix(sound): recover port 57121 from zombie on boot
CI build oscope-of / build-check (push) Has been cancelled

The data-only boot opened the OSC receive port 57121 but fell back
silently to the lang port when it was busy — so /pose (data_only_viz)
and /data (data_feeds bridge), both sent to 57121, never reached
sclang and the patch looked alive but reacted to nothing. The port is
typically squatted by a zombie: a scsynth or data_feeds bridge launched
by a previous boot via unixCmd inherits the 57121 socket FD and outlives
its sclang parent, so a fresh boot can't bind it. Instead of falling
back, free the stale holder (lsof -ti UDP:57121 | xargs kill -9) and
retry openUDPPort. Verified: a planted zombie on 57121 is killed and the
port recovered on boot ("57121 recupere — sclang listening on 57121").
This commit is contained in:
L'électron rare
2026-06-26 19:43:57 +02:00
parent 480aa79ef4
commit 83dc910624
+17 -6
View File
@@ -92,13 +92,24 @@
Routine({
var maxWait, waited;
// Ouvre le port 57121 pour recevoir les /control/* du launcher et
// de tout client externe (cf OSCSender swift). Echec silencieux
// si le port est deja pris (ex: web bridge actif) — dans ce cas
// sclang reste sur son langPort par defaut.
// Ouvre le port 57121 pour recevoir /control/* (launcher), /pose/* et
// /data/* (data_only_viz + data_feeds bridge). Si le port est pris,
// c'est presque toujours un holder zombie : un scsynth/bridge orphelin
// d'un sclang precedent qui a herite le socket 57121 via unixCmd et a
// survecu a son parent. On le libere et on reessaie, plutot que de
// fallback silencieusement (les /pose/data n'arriveraient jamais sur le
// langPort de repli).
if(thisProcess.openUDPPort(57121).not) {
("[data-only/boot] WARN: port 57121 occupe, fallback sur langPort = "
++ NetAddr.langPort).postln;
"[data-only/boot] 57121 occupe — liberation du holder zombie...".postln;
"lsof -ti UDP:57121 | xargs kill -9 2>/dev/null".unixCmd;
0.5.wait;
if(thisProcess.openUDPPort(57121).not) {
("[data-only/boot] WARN: 57121 toujours occupe, fallback sur langPort = "
++ NetAddr.langPort).postln;
} {
("[data-only/boot] 57121 recupere — sclang listening on "
++ NetAddr.langPort ++ " + 57121").postln;
};
} {
("[data-only/boot] sclang listening on " ++ NetAddr.langPort ++ " + 57121").postln;
};