[Unit]
Description=LCXL LED watcher (track-aware surface paint, #78/#85)
Documentation=file:///home/pln/Work/Sound/Tidal/tools/lcxl-leds.py
# The LCXL is hot-pluggable and often absent at boot. Rather than bind to a
# device unit (whose name changes with the USB topology), this unit simply
# retries forever. Plug the board in and it lights up within RestartSec.
#
# StartLimitIntervalSec=0 lives HERE, in [Unit] — systemd silently ignores it in
# [Service] ("Unknown key ... ignoring"), which would leave the default limit of
# 5 restarts / 10 s in force and let the unit fall into `failed` with the board
# dark for the rest of the session. Exactly the silent-failure shape this rig
# keeps getting bitten by, one section heading away.
StartLimitIntervalSec=0

[Service]
Type=simple
WorkingDirectory=/home/pln/Work/Sound/Tidal
ExecStart=/usr/bin/python3 /home/pln/Work/Sound/Tidal/tools/lcxl-leds.py --watch -q

Restart=always
RestartSec=10

# It must never be the reason audio stutters. The watcher forks a helper per LED
# write (a known cost — one fork+exec per LED), so cap it below every audio thread.
# Measured: 2.1 s CPU over 1 h 53 m wall = 0.03% of a core. It is not the problem.
Nice=5
CPUWeight=20
IOWeight=20

[Install]
WantedBy=default.target
