Commit 1294c6d1 by PLN (Algolia)

Keep music helper startup on demand across rig launches

parent 989e2b7b
---
log: 2027
title: "Music helpers start with the rig, not every login"
date: 2026-09-28
task: "SRE #122"
tags: [tooling, performance]
shareable: true
---
## Cap
Reduce the laptop's non-music background cost without breaking one-click rig startup.
## Manœuvre
Changed six existing helper rows in tools/rig_units.py from login to on-demand:
watchdog, autoroute, MIDI wiring, Bridge, gig-log and perf-tray. Normal gig-up
still starts them, but its --ensure step no longer re-enables them at login.
The helpers remain active for tonight. No synth/audio service was restarted.
## Prise
Mocked the actual ensure() execution: every helper starts, none gets enabled,
and manual controller-driver units remain untouched. All six installed units
currently report linked (installed, not enabled). Existing GUI launch unchanged.
## Sel
Disabling a service once is not an on-demand policy if the next launcher silently
re-enables it. Put the intent in the inventory the launcher actually consumes.
......@@ -28,19 +28,14 @@ Two structural causes, both fixed here:
BOOT POLICY, and why it is a per-unit field rather than a global
---------------------------------------------------------------
"login" enable at default.target. The reconcilers: they idle at ~0 CPU,
hold no audio ports, make no sound, and their whole job is to
re-assert a binding that something else keeps breaking. There is
no such thing as "too early" for them.
"on-demand" NOT enabled. `parvagues-sc` is the sound: it claims MIDI, opens
the audio graph, and its own unit deliberately refuses
Restart=always because audio gear must never flap. PLN launches
the rig on purpose; a login should not start SuperDirt.
`is-enabled` returning **`linked`** means the unit file is a symlink and the
unit is NOT enabled — it reads like a healthy word and is not one. That is the
state `parvagues-sc` is in, correctly, and the state the watchdog was in by
accident. `--status` spells it out rather than printing systemd's word.
"login" enabled at login where explicitly desired (MIDI lens).
"on-demand" started by an intentional rig bring-up, not enabled at login.
This includes SuperDirt AND its six background helpers. The owner
does not perform every day; measured helper CPU is not zero.
`is-enabled` returning **`linked`** means the unit is installed but NOT enabled.
That is correct for on-demand units. The normal gig-up --ensure path must start
these helpers without silently restoring their old every-login cost.
"""
from __future__ import annotations
......@@ -62,9 +57,9 @@ import sys
# plugged surface generation; Conflicts= makes auto-start hostile)
SERVICES = [
("parvagues-sc", "SuperDirt", "scsynth", "on-demand", "the sound"),
("parvagues-sc-watchdog", "sc-watchdog", None, "login", "restarts SuperDirt if scsynth dies"),
("tidal-ardour-autoroute", "autoroute", None, "login", "orbits → Ardour Tidal NN tracks"),
("midi-autoconnect", "MIDI wiring", None, "login", "LCXL → Midi Through, return leg cut"),
("parvagues-sc-watchdog", "sc-watchdog", None, "on-demand", "restarts SuperDirt if scsynth dies"),
("tidal-ardour-autoroute", "autoroute", None, "on-demand", "orbits → Ardour Tidal NN tracks"),
("midi-autoconnect", "MIDI wiring", None, "on-demand", "LCXL → Midi Through, return leg cut"),
# Added 2026-09-05, the night the LCXL3 sat untranslated while every check
# was green: the driver only ran when a session remembered to start it. It
# translates the v3 DAW protocol to the corpus's v2 CCs (fader → Ardour
......@@ -85,18 +80,18 @@ SERVICES = [
# Conflicts=-kills lcxl3-driver — so neither boot nor --ensure may start
# it. Start it BY HAND only when the v2 board is plugged.
("lcxl-leds-watch", "LCXL LEDs", None, "manual", "the v2 surface paint (original LCXL only)"),
("parvagues-bridge", "Bridge", None, "login", "dashboard + perf toolbar"),
("parvagues-bridge", "Bridge", None, "on-demand", "dashboard + perf toolbar"),
# Added 2026-08-29. Absent from this list until then, and that absence IS why
# CosmicFest has no session log: the unit was installed 2026-07-29 and never
# enabled, so it only ran when someone remembered to start it by hand. The
# sessions that exist (through 2026-08-20) are exactly those manual runs.
# Costs 0.4% of a core at 1 Hz, so there is no reason for it to ever be off.
("gig-log", "gig-log", None, "login", "1 Hz session recorder: thermals, xruns, gear, MIDI"),
# Start it on every rig bring-up; keep it off on non-music days.
("gig-log", "gig-log", None, "on-demand", "1 Hz session recorder: thermals, xruns, gear, MIDI"),
# Added 2026-09-05: parvagues-gear managed it but THE list didn't know it —
# the exact "list lived in three places" failure this module exists to end.
# Debt: its unit file still lives only in ~/.config/systemd/user (not
# repo-owned like the others).
("perf-tray", "perf tray", None, "login", "tray: what's up, perf mode, gear pause"),
("perf-tray", "perf tray", None, "on-demand", "tray: what's up, perf mode, gear pause"),
# "login", not "manual": PLN asked for the lens to be permanently present
# ("now it should always oppen"), on top and on every desktop. On-top is a
# window flag midiviz already sets; all-desktops is a KWin rule keyed on its
......@@ -197,7 +192,7 @@ def gen_target() -> str:
#
# This target is deliberately NOT enabled at boot. It Wants parvagues-sc, and a
# login must not start SuperDirt (see the boot policy note in rig_units.py).
# The reconcilers are enabled individually, by `rig_units.py --ensure`.
# Login-policy units alone are enabled by `rig_units.py --ensure`.
Description=The ParVagues rig (SuperDirt + every reconciler)
After=pipewire.service
Wants=pipewire.service
......
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