Skip to content

speakerguardd-v2: package speakerguardd 1.0, installed everywhere, gated by board - #160

Merged
RyanTheTide merged 24 commits into
mainfrom
feat/speakerguardd-v2
Nov 7, 2026
Merged

RyanTheTide merged 24 commits into
mainfrom
feat/speakerguardd-v2

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

speakerguardd 1.0 (v2 branch, pinned at ebab1e0f7c4e = speakerguardd#44 merged into v2), packaged for CUTOVER blockers 2 and 3 under option A.

  • Install everywhere. It installs beside speakersafetyd and speakerguardd 0.1, with no Conflicts, Obsoletes or replaces. The platform's audio stack requires it, and its units are enabled.

  • Gate by board, with upstream data. Upstream's speakerguardd-gate reads gate.json and machines.json (unit, qualified). It is the ExecCondition of every v2 unit, and through a drop-in, of the older daemons' units:

    • v2 runs on a gated board (J616s and J316s today) whose kernel has "Speaker Protection";
    • the older daemons run everywhere else.

    Every fleet kernel today lacks that interface, so this changes nothing until the kernel lands. Under option A the cutover is then a data change upstream: lsm2/atsp go into units_at_parity, and require_qualified_board is set false.

  • No manual steps.

    • Provisioning compiles and binds the installer's tuning bundle, resolves the seat user by name, and writes /etc/speakerguardd/speakerguardd.conf.
    • The graph is generated after the self-check and linked for the seat user only.
    • Any failure fails closed.
  • Rollback: boot a kernel without the v2 interface. The gate starts the older daemons again, with no package change. On NixOS, aurora.speakerguardd.v2.enable = false removes v2 and the gate. The replace-legacy opt-in is removed.

Tested on the M1 Pro (Fedora 45, enforcing). Evidence is in speakerguardd#44.

🤖 Generated with Claude Code

RyanTheTide and others added 2 commits November 4, 2026 23:27
speakerguardd 1.0 (the v2 branch, 1.0.0-alpha.1 at f06b9697e648) is a new
program, so it gets its own package that installs beside speakerguardd 0.1
and speakersafetyd and enables nothing:

- speakerguardd-v2: the supervisor in /usr/libexec/speakerguardd-v2, the
  sgv2 LV2 bundle in %{_libdir}/lv2 and aurora-speaker-tuning. The unit is
  the upstream one as speakerguardd-v2.service, and the build fails if it
  ever chains to another daemon.
- speakerguardd-v2-selinux: the speakerguardd module. speakerguardd_t gets
  the speaker control device, /proc/asound, the tuning bundle locations
  and /run/speakerguardd, where the session user's PipeWire maps its
  engine page.
- speakerguardd-v2-replace-legacy: the opt-in. It conflicts with the 0.1
  daemon and speakersafetyd and enables the unit through a preset. It has
  no Obsoletes, so an upgrade never swaps a machine over, and no Provides,
  because dnf would then pick it for a plain Requires on a fresh install.

aurora-speaker-tuning is based on aurora-audio-dsp by saku (MIT); its
notice ships with the licence.

Co-authored-by: saku <saku-bruh@proton.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both required speakersafetyd and speakerguardd by name, and
aurora-platform-core is protected, so the opt-in could never be installed.
Require (speakersafetyd or speakerguardd-v2-replace-legacy) and the same
for speakerguardd instead, and recommend the current daemons. dnf prefers a
recommended provider, so every install still gets them, with and without
weak dependencies; without the Recommends it would pick the opt-in, which
satisfies both requirements at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RyanTheTide and others added 6 commits November 5, 2026 10:55
…gate

- Pin speakerguardd v2 b1f60b81e975 (speakerguardd#41): the engine with
  spp3 at parity, the supervisor, the session helper and the first-boot
  wiring self-check.
- speakerguardd-v2-selfcheck.service is a hard prerequisite of the
  supervisor (Requires= and After=, checked at build time). The session
  helper ships as a user unit.
- The SELinux module is upstream's packaging/selinux policy. This package
  keeps only the file contexts, now with /var/lib/speakerguardd.
- The opt-in's units carry ExecCondition=speakerguardd-v2-gate. They start
  only on a board that qualified on 1.0 (J616s for now), and elsewhere the
  journal says why. The same gate ships in alarm-aurora and nixos-aurora.

Built with rpmbuild -ba on Fedora 45 aarch64 (M1 Pro), %check passing.
systemd-analyze verify is clean, and the gate refuses the j316s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in the board gate

- speakerguardd v2 c9dcc8ce7bf1 is #41 plus #42: a board whose wiring can be
  derived fails the self-check rather than falling back to a hand map.
- The M1 Pro (J316s) and the M2 Air (J413) passed their audible
  qualification on v2, as the J616s did: 5 minutes at full volume, 0 faults,
  0 AVCs, thermal state kept across PipeWire and supervisor restarts, and
  the self-check passed. The gate now lists exactly those three boards, the
  same file in all three distributions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
speakerguardd v2 3c18a3527055 adds #43. The closed loop relaxes the limit
only on a board whose relaxed closed loop was proven live (the J616s family)
and runs capped at the base elsewhere. The plausibility guard is on for every
board.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…undle compiles

The M2 Air's tuning bundle, collected by the merged installer from its own
macOS, does not compile yet with the speakerguardd v2 tuning reader. Two
gaps:
- its speaker-thiele-small header has a second byte that the reader's one
  known layout does not describe (the records and checksum are otherwise
  consistent);
- its calibration records name data sources that the default
  SpeakerInputDataSourceOrder does not bind to its unit channels.

The J413's qualification run used hand-made inputs rather than this bundle.
A J413 on the opt-in would fail its self-check and stay at the kernel's
floor, so the gate lists only the J616s and J316s until the reader handles
the J413's bundle and the J413 passes on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
speakerguardd#44 adds automatic provisioning at boot and the fleet gate,
so v2 needs no manual step on any Mac (CUTOVER blockers 2 and 3, built
for option A).

- Pin ebab1e0f7c4e (the v2 merge of #44).
- Install everywhere: the platform's audio stack requires speakerguardd-v2
  beside speakersafetyd and speakerguardd 0.1, with no conflicts,
  obsoletes or replaces, and the v2 units are enabled.
- Gate by board: upstream's speakerguardd-gate, with upstream's data
  (gate.json, machines.json unit/qualified), is the ExecCondition of every
  v2 system unit and, through a drop-in, of the older daemons' units. v2
  runs on a gated board whose kernel has "Speaker Protection"; the older
  daemons run everywhere else. No distribution copy of the gate list any
  more, and the replace-legacy opt-in is gone.
- Ship provisioning (speakerguardd-v2-provision.service), the seat
  watcher (speakerguardd-v2-seat.path) and the user's graph unit
  (speakerguardd-v2-graph.service); run upstream's test_provision.py in
  the package's check.
- Rollback: boot a kernel without the v2 interface; the older daemons
  start again with no package change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
@RyanTheTide RyanTheTide changed the title speakerguardd-v2: package speakerguardd 1.0 as an opt-in preview speakerguardd-v2: package speakerguardd 1.0, installed everywhere, gated by board Nov 5, 2026
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 5, 2026 01:34
speakerguardd#48 derives every per-board value from the Mac's device
tree and tuning at run time (wiring.py) and drops machines.json; gate.json
now holds the qualified boards per protection unit (spp3: J316s, J413,
J616s). #45 makes the v2 units read their configuration optionally, so a
board or kernel the gate skips is skipped cleanly, and makes
test_provision.py pass when run as root.

- Pin 4cffd19b102d (the v2 merge of #45, on top of #48).
- Stop installing machines.json; gate.json and wiring.py are the data.
- Tests: no machine table is installed, wiring.py is.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: adds speakerguardd#49 (the tuning reader reads the
installer's macOS 27 manifest fields) and #50 (test_provision.py runs
its stand-in reader without /usr/bin/env). No packaging change.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: speakerguardd#51, #52, #53, #54. The packaged files are unchanged.
Fleet gate (gate.json, upstream's, unchanged here): units at parity: spp3, lsm2; spp3: J316s, J413, J616s; lsm2: J700.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: speakerguardd#55, #56. The packaged files are unchanged; the vendored Cargo.lock follows upstream.
Fleet gate (gate.json, upstream's, unchanged here): units at parity: spp3, lsm2; spp3: J316s, J413, J616s; lsm2: J700.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: speakerguardd#58, #59. The packaged files are unchanged.
Fleet gate (gate.json, upstream's, unchanged here): units at parity: spp3; spp3: J316s, J413, J616s.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Main's aura v1.0.0b5 pin and aurora-kbd-light come in beside the
speakerguardd-v2 pin (8d45c2a4). aurora-platform: both changes are
44-17 on their sides, so the v2 requirement moves to 44-18 after
aurora-kbd-light's 44-17.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: speakerguardd#60, #61. The packaged files are unchanged.
Fleet gate (gate.json, upstream's, unchanged here): units at parity: spp3, atsp; spp3: J316s, J413, J616s; atsp: J274, J293, J313, J375C, J375D, J473, J474s, J475C, J475D, J493.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: speakerguardd#63, #64, #66, #67, #69, #70, #71. The packaged files are unchanged.
Fleet gate (gate.json, upstream's, unchanged here): units at parity: spp3, atsp; spp3: J316s, J413, J616s; atsp: J274, J293, J313, J375C, J375D, J473, J474s, J475C, J475D, J493.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Brings the branch up to the published kernel-aurora 7.3.0-18 and fex-emu
2610-2, so the published-EVR check passes.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: speakerguardd#72. The packaged files are unchanged.
Fleet gate (gate.json, upstream's, unchanged here): units at parity: spp3, atsp; spp3: J316s, J413, J616s; atsp: J274, J293, J313, J375C, J375D, J473, J474s, J475C, J475D, J493.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
aurora-audio: main took Release 8 for the J614 microphone graph
(fedora-aurora#166); the speakerguardd-v2 Requires moves to Release 9.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: speakerguardd#73. The packaged files are unchanged.
Fleet gate (gate.json, upstream's, unchanged here): units at parity: spp3, atsp; spp3: J316s, J413, J616s; atsp: J274, J293, J313, J375C, J375D, J473, J474s, J475C, J475D, J493.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
build-rpm builds Fedora 45 from packages/<name>/f45/<name>.spec when the
overlay has one, but the check always read the Fedora 44 spec. Since the
Fedora 45 testing repository was published, every pull request failed on
aurora-release, avd-fw, mesa-aurora, mesa-aurora-fex-guest and mutter,
whose published Fedora 45 builds come from those overlays.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 tip: speakerguardd#74. The packaged files are unchanged.
Fleet gate (gate.json, upstream's, unchanged here): units at parity: spp3, atsp; spp3: J316s, J413, J616s; atsp: J274, J293, J313, J375C, J375D, J473, J474s, J475C, J475D, J493.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
aurora-platform: main took Release 18 for aurora-platform-selinux and the
irqbalance condition; the speakerguardd-v2 Requires moves to Release 19.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The v2 kernel interface (linux#922) refuses the "Speaker Protection"
lock and every lease write without CAP_SYS_ADMIN, so a supervisor that
lost it would sit at the kernel floor. Fail the build if the upstream
unit's CapabilityBoundingSet or the upstream policy module's sys_admin
rule goes missing.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
@RyanTheTide
RyanTheTide merged commit bfeaa42 into main Nov 7, 2026
64 checks passed
@RyanTheTide
RyanTheTide deleted the feat/speakerguardd-v2 branch November 7, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant