Skip to content

speaker tuning: collect the BuzzKill quadrature matrix from AudioDSP - #119

Merged
RyanTheTide merged 2 commits into
mainfrom
speaker-tuning/buzzkill-matrix
Nov 13, 2026
Merged

RyanTheTide merged 2 commits into
mainfrom
speaker-tuning/buzzkill-matrix

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

The BuzzKill unit's detector (macOS speaker voicing on Mac mini, Mac Pro, DTK and MacBook Air M1 graphs) filters its analysis stream through a two-output matrix of second-order sections. Its coefficients are a table inside macOS's own AudioDSP component, not something a formula gives, so, like the lsm2 lattice, the installer reads them from the user's system volume into the tuning bundle and never ships them.

  • asahi_firmware/buzzkill_matrix.py finds the table by structure alone (no offset, hash, symbol or value): 80 bytes of binary32 = four second-order sections b0,b1,b2,a1,a2, output-major, with a fixed pattern of unit and equal coefficients, every section strictly stable, followed by four exact allpass sections, at a naturally aligned address of a file-backed __const section of __TEXT, __DATA_CONST or __DATA. Exactly one per Mach-O slice, identical across slices, else an error and no matrix. On the real 25G83, 25C56 and 26A428 components it finds exactly one table in every slice.
  • audio_tuning.py adds buzzkill-quadrature.bin and a buzzkill_quadrature record (version 1, f32le-sos4-output-major, 4 sections) when the matrix was read. Without one the bundle is still written (a warning), and speakerguardd's voicing compiler refuses Buzz boxes. update() re-verifies record and bytes.
  • Tests: synthetic Mach-O images and made-up sections only (tests/test_buzzkill_matrix.py, a BuzzKillMatrixTest class in tests/test_audio_tuning.py); all suites pass.

Not in this PR: the native Swift installer path (macOS/Sources/AuroraAppleInstaller) does not collect the matrix yet. Bundles from it simply lack the record, and Buzz boxes stay refused. Order: speakerguardd's reader for the record merges first (its manifest parser denies unknown keys), then this.

🤖 Generated with Claude Code

The BuzzKill unit's detector filters its analysis stream through a
two-output matrix of second-order sections. Its coefficients are a table
inside macOS's AudioDSP component, so the installer reads them from the
user's own system volume into the tuning bundle, like the lsm2 lattice,
and never ships them.

buzzkill_matrix.py finds the table by its structure alone (no offset,
hash, symbol or value): four binary32 sections with a fixed pattern of
unit and equal coefficients, all strictly stable, followed by four exact
allpass sections, at a naturally aligned address of a file-backed __const
section; exactly one per Mach-O slice, identical across slices. The
bundle gets buzzkill-quadrature.bin and a buzzkill_quadrature manifest
record, only when the matrix was read: a Mac without it still gets its
bundle, and the voicing compiler refuses Buzz boxes. update() re-verifies
the record and the bytes.

Tests use synthetic Mach-O images and made-up sections only.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Resolve asahi_firmware/audio_tuning.py: keep both the lsm2 param-fill
collection added on main and the BuzzKill quadrature matrix collection,
threading fill and buzzkill through manifest() and tree().
@RyanTheTide
RyanTheTide merged commit 5fc3946 into main Nov 13, 2026
3 checks passed
@RyanTheTide
RyanTheTide deleted the speaker-tuning/buzzkill-matrix branch November 16, 2026 05:19
m0d16l14n1 pushed a commit to m0d16l14n1/aurora-installer that referenced this pull request Nov 22, 2026
…akerguardd reads it

Since aurora-silicon#119 the Python collector adds a `buzzkill_quadrature` record (and
buzzkill-quadrature.bin) to every bundle whose AudioDSP holds the matrix,
which is every macOS build seen so far. speakerguardd v2 parses a schema-2
manifest with deny_unknown_fields and no release reads the record yet
(speakerguardd#138 adds the reader), so every release up to
1.0.0alpha.1-42 refuses such a bundle: "not a schema-2 manifest: unknown
field `buzzkill_quadrature`". aurora-speaker-upgrade --collection then
refuses the switch, and a Mac whose kernel has only the v2 interface,
given the bundle with install-linux.sh, keeps its speakers at the kernel's
floor. Seen on a J713 (AID37) and an M4 Mac mini (J773g, AID36). The
native installer does not collect the matrix, so its bundles are not
affected.

Collect the matrix only when asked (collect/collect-linux
--buzzkill-matrix, AudioTuningFWCollection(buzzkill=True)), as the native
installer does, until a speakerguardd release reads it; then flip
COLLECT_BUZZKILL. A bundle that already carries it is still verified and
read. install-linux.sh installs such a bundle without the matrix by default
(without_buzzkill: the bundle exactly as collected without it) and says
so; --keep-buzzkill-matrix keeps it.

Signed-off-by: Diljit Singh <hey@djdev.me>
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