Commit 65976d13 by PLN (Algolia)

fix(launch): the guard that could not see Ardour, the gate that was in the other…

fix(launch): the guard that could not see Ardour, the gate that was in the other script, the window that never closed

Three things PLN hit in one launch.

ARDOUR RELAUNCHED OVER A RUNNING ONE. The guard was
`pgrep -f 'ardour-[0-9]'`, and `/usr/bin/ardour` is a BASH WRAPPER that execs
the real binary out of /usr/lib/ardour8 — so for the first second of a launch
the process is `bash /usr/bin/ardour …` and that pattern misses it entirely.
Re-run gig-up inside that window and the second Ardour fights the first for the
session lock. Now matches the wrapper AND the exec'd name, both bracket-tricked
so pgrep cannot match the command line asking the question. Verified against
the live box: neither pattern catches tidal-ardour-autoroute, which runs
permanently and would otherwise have made the guard always true.

THE PRELOAD GATE WAS IN THE SCRIPT NOBODY LAUNCHES. There are two gig-up
scripts with separate histories: this one (528 lines, what parvagues.desktop
runs) has the readiness gate, cut-gpu, the headphones fold and the fader
restore; tools/gig-up.sh (620 lines, what the Bridge's RIG UP runs) has
check-preload, --bt-off and check-boot. Neither is a superset, and both accept
--converge and --quiet, which is exactly how it stayed invisible. So the path
PLN actually presses never checked whether the set's banks are warmed — the
failure check-preload.sh's own header calls "debuted as a crackle at the
venue". Added here as REPORT ONLY: `--fix` regenerates a load-bearing boot
file, and doing that at a venue is the landmine rather than the cure. Output is
filtered to the verdict and any MISSING banks; the 66-name "warmed on purpose"
roster is dropped, because at a venue the useful output is one line long.

THE TERMINAL STAYED OPEN AFTER A CLEAN LAUNCH. `kitty --hold` was a real fence
— GNOME's Terminal=true handler is not guaranteed to exist and the boot log is
what you want when a launch goes sideways — but holding on SUCCESS left a dead
window parked over the rig all night, and on stage every window that is not the
music is in the way. tools/gig-up-window.sh tees the log to
~/.cache/parvagues/gig-up.log every time, keeps the previous one as .log.1, and
holds the window only on a non-zero exit. A file beats a held window on both
counts: it survives the window and it survives success. It is a separate file
rather than a longer Exec= line because the desktop spec reserves
`" $ & ; | < > ( )` inside Exec, so a pipeline with a conditional read has to
be escaped twice and breaks silently on the third edit.

Merging the two gig-up scripts is the right fix and is NOT a two-days-out job —
design landing separately.
parent d80e023e
...@@ -68,7 +68,18 @@ osc_up(){ ss -uln 2>/dev/null | grep -q ':57120'; } ...@@ -68,7 +68,18 @@ osc_up(){ ss -uln 2>/dev/null | grep -q ':57120'; }
midi_claimed(){ aconnect -l 2>/dev/null | grep -qiE "client [0-9]+: 'SuperCollider'"; } midi_claimed(){ aconnect -l 2>/dev/null | grep -qiE "client [0-9]+: 'SuperCollider'"; }
# GUI apps — so re-running gig-up converges the rig instead of spawning dupes # GUI apps — so re-running gig-up converges the rig instead of spawning dupes
# (a 2nd Ardour on the same session = an annoying "already open/locked" dialog). # (a 2nd Ardour on the same session = an annoying "already open/locked" dialog).
ardour_up(){ pgrep -f 'ardour-[0-9]' >/dev/null 2>&1; } # `/usr/bin/ardour` is a BASH WRAPPER that execs the real binary out of
# /usr/lib/ardour8, so for the first second of a launch the process is
# `bash /usr/bin/ardour …` and a pattern matching only `ardour-<digit>` misses
# it entirely. Re-run gig-up in that window and you get a second Ardour
# fighting the first for the same session lock. Match the wrapper AND the
# exec'd name; both patterns are bracket-tricked so pgrep can never match the
# command line asking the question. Checked against the live box: neither
# pattern catches tidal-ardour-autoroute, which runs all the time.
ardour_up(){
pgrep -f '[a]rdour-[0-9]' >/dev/null 2>&1 \
|| pgrep -f '[/]usr/bin/ardour( |$)' >/dev/null 2>&1
}
pulsar_up(){ pgrep -x pulsar >/dev/null 2>&1; } pulsar_up(){ pgrep -x pulsar >/dev/null 2>&1; }
# --- perf-aware gear: performing needs CPU HEADROOM. A capped CPU (low # --- perf-aware gear: performing needs CPU HEADROOM. A capped CPU (low
...@@ -516,6 +527,22 @@ if command -v python3 >/dev/null; then ...@@ -516,6 +527,22 @@ if command -v python3 >/dev/null; then
# three-day-old text back over committed work. This catches that in seconds. # three-day-old text back over committed work. This catches that in seconds.
info "readiness: track drift (did a stale Pulsar buffer overwrite committed work?)" info "readiness: track drift (did a stale Pulsar buffer overwrite committed work?)"
bash "$DIR/tools/check-drift.sh" 2>&1 | tail -8 | sed 's/^/ /' || true bash "$DIR/tools/check-drift.sh" 2>&1 | tail -8 | sed 's/^/ /' || true
# A bank that is NOT warmed is a disk read on the audio thread, mid-transition,
# at the venue — the failure check-preload.sh's own header calls "debuted as a
# crackle at the venue". This gate lived only in tools/gig-up.sh, which the
# desktop launcher does not run, so the path PLN actually presses never checked
# it. REPORT ONLY, deliberately: `--fix` regenerates the plan, and regenerating
# a load-bearing boot file at the venue is the landmine, not the cure.
info "readiness: preload (are the set's sample banks warmed, or read off disk mid-set?)"
# HEAD, not tail: the verdict and any MISSING banks come first, and the tail of
# this output is the "extra banks warmed on purpose" list — 60-odd names of
# deliberate over-coverage, which is the least useful thing to print at a venue.
# The verdict and any MISSING banks are indented 0-4; the "extra banks warmed
# on purpose" roster is indented 5+ and runs to 60-odd names. Keep the finding,
# drop the roster: at a venue the useful output is one line long.
PV_PRELOAD_SETLIST="$DIR/armada/setlist_thu24.txt" \
bash "$DIR/tools/check-preload.sh" 2>&1 \
| grep -vE '^ {5,}' | head -8 | sed 's/^/ /' || true
fi fi
echo echo
......
#!/usr/bin/env bash
# gig-up-window — the WINDOW around gig-up, so gig-up itself stays a rig script.
#
# PLN, 2026-09-22: "it also should close i guess? weirdly mechanical/raw that we
# open a script win like old times ahah".
#
# The old launcher was `kitty --hold … gig-up.sh`, and the `--hold` was a real
# fence, written down in parvagues.desktop: GNOME's `Terminal=true` handler is
# not guaranteed to exist, and the boot log is "the log you actually want when a
# launch goes sideways". Both true. What had no nut was holding on SUCCESS —
# a clean launch left a dead terminal parked over the rig for the rest of the
# night, and on stage every window that is not the music is in the way.
#
# So: the log is written to a file ALWAYS, which is strictly better than holding
# a window (it survives the window, and it survives success). The window itself
# stays only when there is something to read.
#
# exit 0 -> tee the log, close, say nothing
# exit !0 -> tee the log, print the code and the log path, wait for a key
#
# It lives here rather than inside the .desktop Exec= line because the desktop
# spec reserves `" $ & ; | < > ( )` inside Exec, so a pipeline with a
# conditional read has to be escaped twice and breaks silently on the third edit.
# A file has no quoting rules.
#
# tools/gig-up-window.sh [gig-up args...] # every arg is passed straight on
set -uo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
LOG_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/parvagues"
LOG="$LOG_DIR/gig-up.log"
mkdir -p "$LOG_DIR"
# One log per launch, but keep the previous one: the question after a bad gig is
# almost always "what did the launch BEFORE this one say".
[ -f "$LOG" ] && mv -f "$LOG" "$LOG.1"
"$DIR/gig-up.sh" "$@" 2>&1 | tee "$LOG"
rc=${PIPESTATUS[0]}
if [ "$rc" -ne 0 ]; then
printf '\n\033[1;31m● gig-up exited %s\033[0m — log: %s\n' "$rc" "$LOG"
# `[ -t 0 ]` so this never wedges a systemd unit or a CI run that happens to
# call it: with no terminal there is nobody to press the key.
if [ -t 0 ]; then
printf ' press any key to close this window…\n'
read -rsn1 || true
fi
fi
exit "$rc"
...@@ -11,12 +11,18 @@ ...@@ -11,12 +11,18 @@
# jackd -dalsa never enables the SOF codec's speaker route (no ALSA UCM), and # jackd -dalsa never enables the SOF codec's speaker route (no ALSA UCM), and
# Bluetooth cannot work at all (jackd has no BT backend). # Bluetooth cannot work at all (jackd has no BT backend).
# #
# Terminal=false + an explicit kitty --hold instead of Terminal=true: GNOME's # Terminal=false + an explicit kitty instead of Terminal=true: GNOME's
# Terminal=true handler is not guaranteed to exist, and --hold keeps the boot log # Terminal=true handler is not guaranteed to exist, and the boot log is the log
# on screen, which is the log you actually want when a launch goes sideways. # you actually want when a launch goes sideways.
#
# `--hold` is GONE, replaced by tools/gig-up-window.sh, which tees that log to
# ~/.cache/parvagues/gig-up.log every time and holds the window ONLY on a
# non-zero exit. A file beats a held window on both counts: it survives the
# window and it survives success. PLN, 2026-09-22: "it also should close i guess?
# weirdly mechanical/raw that we open a script win like old times ahah".
Name=ParVagues Name=ParVagues
Comment=Bring the rig up in order — SuperDirt, Ardour (the mix), Pulsar Comment=Bring the rig up in order — SuperDirt, Ardour (the mix), Pulsar
Exec=kitty --hold --title "ParVagues — gig up" /home/pln/Work/Sound/Tidal/gig-up.sh Exec=kitty --title "ParVagues — gig up" /home/pln/Work/Sound/Tidal/tools/gig-up-window.sh
Path=/home/pln/Work/Sound/Tidal Path=/home/pln/Work/Sound/Tidal
Icon=/home/pln/Work/Sound/Tidal/tools/tools.png Icon=/home/pln/Work/Sound/Tidal/tools/tools.png
Terminal=false Terminal=false
...@@ -29,7 +35,7 @@ Actions=headphones;doctor;tray; ...@@ -29,7 +35,7 @@ Actions=headphones;doctor;tray;
# Travel rig: no Ardour, no faders, no stems — all 14 orbits folded onto the # Travel rig: no Ardour, no faders, no stems — all 14 orbits folded onto the
# default sink, which is what makes Bluetooth listening possible at all. # default sink, which is what makes Bluetooth listening possible at all.
Name=Headphones (travel rig, all orbits to one sink) Name=Headphones (travel rig, all orbits to one sink)
Exec=kitty --hold --title "ParVagues — headphones" /home/pln/Work/Sound/Tidal/gig-up.sh --headphones Exec=kitty --title "ParVagues — headphones" /home/pln/Work/Sound/Tidal/tools/gig-up-window.sh --headphones
[Desktop Action doctor] [Desktop Action doctor]
Name=Rig doctor (can this box play a set?) Name=Rig doctor (can this box play a set?)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment