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: ...@@ -28,19 +28,14 @@ Two structural causes, both fixed here:
BOOT POLICY, and why it is a per-unit field rather than a global 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, "login" enabled at login where explicitly desired (MIDI lens).
hold no audio ports, make no sound, and their whole job is to "on-demand" started by an intentional rig bring-up, not enabled at login.
re-assert a binding that something else keeps breaking. There is This includes SuperDirt AND its six background helpers. The owner
no such thing as "too early" for them. does not perform every day; measured helper CPU is not zero.
"on-demand" NOT enabled. `parvagues-sc` is the sound: it claims MIDI, opens
the audio graph, and its own unit deliberately refuses `is-enabled` returning **`linked`** means the unit is installed but NOT enabled.
Restart=always because audio gear must never flap. PLN launches That is correct for on-demand units. The normal gig-up --ensure path must start
the rig on purpose; a login should not start SuperDirt. these helpers without silently restoring their old every-login cost.
`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.
""" """
from __future__ import annotations from __future__ import annotations
...@@ -62,9 +57,9 @@ import sys ...@@ -62,9 +57,9 @@ import sys
# plugged surface generation; Conflicts= makes auto-start hostile) # plugged surface generation; Conflicts= makes auto-start hostile)
SERVICES = [ SERVICES = [
("parvagues-sc", "SuperDirt", "scsynth", "on-demand", "the sound"), ("parvagues-sc", "SuperDirt", "scsynth", "on-demand", "the sound"),
("parvagues-sc-watchdog", "sc-watchdog", None, "login", "restarts SuperDirt if scsynth dies"), ("parvagues-sc-watchdog", "sc-watchdog", None, "on-demand", "restarts SuperDirt if scsynth dies"),
("tidal-ardour-autoroute", "autoroute", None, "login", "orbits → Ardour Tidal NN tracks"), ("tidal-ardour-autoroute", "autoroute", None, "on-demand", "orbits → Ardour Tidal NN tracks"),
("midi-autoconnect", "MIDI wiring", None, "login", "LCXL → Midi Through, return leg cut"), ("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 # 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 # 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 # translates the v3 DAW protocol to the corpus's v2 CCs (fader → Ardour
...@@ -85,18 +80,18 @@ SERVICES = [ ...@@ -85,18 +80,18 @@ SERVICES = [
# Conflicts=-kills lcxl3-driver — so neither boot nor --ensure may start # Conflicts=-kills lcxl3-driver — so neither boot nor --ensure may start
# it. Start it BY HAND only when the v2 board is plugged. # 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)"), ("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 # 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 # 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 # 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. # 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. # Start it on every rig bring-up; keep it off on non-music days.
("gig-log", "gig-log", None, "login", "1 Hz session recorder: thermals, xruns, gear, MIDI"), ("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 — # 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. # 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 # Debt: its unit file still lives only in ~/.config/systemd/user (not
# repo-owned like the others). # 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 # "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 # ("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 # window flag midiviz already sets; all-desktops is a KWin rule keyed on its
...@@ -197,7 +192,7 @@ def gen_target() -> str: ...@@ -197,7 +192,7 @@ def gen_target() -> str:
# #
# This target is deliberately NOT enabled at boot. It Wants parvagues-sc, and a # 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). # 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) Description=The ParVagues rig (SuperDirt + every reconciler)
After=pipewire.service After=pipewire.service
Wants=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