Skip to content

j873: a high-pass and limiter graph for the J873 speaker (Mac mini, M6) - #28

Closed
sithglan wants to merge 4 commits into
aurora-silicon:mainfrom
sithglan:thomas/j873-speaker-graph
Closed

sithglan wants to merge 4 commits into
aurora-silicon:mainfrom
sithglan:thomas/j873-speaker-graph

Conversation

@sithglan

@sithglan sithglan commented Nov 14, 2026 •

Copy link
Copy Markdown

What: A high-pass and limiter graph for the J873g's (M6 Mac mini) speaker. The rule matches only speakerguardd v2's protect stage, so without speakerguardd there is no J873 speaker sink and the speaker stays muted. A draft until speakerguardd protects it with limits the machine provides.
Tested: J873g M6 Mac mini at 3c9bf25: none yet; the earlier rows describe the graph only, recorded with the amp muted, on older heads.
Risk: two-way door · J873g only.
Not yet: the protected row (the graph's sink through speakerguardd's protect stage with the machine's limits, a sweep and a 200 Hz square wave, the counts), once speakerguardd#222 has those limits; the graph's high-pass and limiter values from the machine as well (today they are written in the graph).

Details

Draft until speakerguardd v2 protects the J873 speaker with limits the machine provides. The AOP's speaker stream has no receive side, so the amp's V/I sense never reaches Linux, and a high-pass plus a peak limiter cannot see excursion or coil temperature. The rule therefore matches only speakerguardd v2's protect stage (aurora-silicon/speakerguardd#212 no-sense path, #222 for the J873g), never the raw speaker PCM. Without speakerguardd there is no J873 speaker sink, and the speaker stays muted.

This is the voicing in front of that protect stage: a high-pass and a limiter.

firs/j873/graph.json has three stages:

Stage Setting
downmix L/2 + R/2: the speaker PCM is mono, S24_LE at 48 kHz only
high-pass 4th-order Butterworth at 100 Hz: two bq_highpass, Q 0.5412 and 1.3066
limiter LSP true-peak limiter at -1 dBFS, the settings of the other graphs' final limiters

There is no measurement of this speaker. That is why the graph has no FIR, no bass extension and no loudness compensation, and why the sink volume is a plain software gain ahead of the graph.

  • The 100 Hz corner is not a tuning. It keeps the drive below 100 Hz under what the J274 graph gives the M1 Mac mini's speaker, at every frequency. That graph's FIR is -5.3, -10.8 and -20.1 dB at 70, 50 and 30 Hz; this high-pass is -12.6, -24.1 and -41.8 dB there.
  • The limiter catches the high-pass's overshoot on full-scale input, and a sink volume above 100 %.

The rule matches { node.name = "alsa_output.platform-sound.RawSpeakers", sgv2.stage = "protect", sgv2.machine = "j873g" }, the protect stage's input as speakerguardd's generated rules name it, and does not hide it (the session helper must see the protect stage's ports). README.J873.md no longer shows how to expose the raw PCM; it says not to.

Evidence

Testing

Earlier rows, from the previous rule on the raw PCM, recorded with the amp muted. They describe the graph only, not a protected path. On the J873g with lsp-plugins-lv2 1.2.37:

  • WirePlumber builds the filter sink, hides the raw node and makes the filter the default sink.

  • Recorded from the graph's output with the amp muted, for full-scale input:

    Input Output
    30 / 50 / 70 / 100 Hz sine -41.8 / -24.1 / -12.6 / -3.0 dB, the Butterworth response to 0.1 dB
    150 Hz to 5 kHz sine peak -1.00 dBFS
    200 Hz square wave peak -1.25 dBFS
    1 kHz sine, left channel only -6.0 dB

    The highest sample of the whole run is -1.00 dBFS.

  • With #1862's kernel, a -40 dBFS tone through the filter sink played under a "Speaker Protection" lease: 52 renewals, none failed, no refused start.

The hardware row needs speakerguardd v2 enforcing the machine's limits on the J873, with that protection on the default command line:

  • the graph's sink plays through the protected node;
  • a full-scale sweep and a 200 Hz square wave run with the protection log showing its limits applied;
  • 0 AVC, 0 failed units and 0 new kernel errors.

That playback also needs the machine's owner to allow it.

cc @DjDeveloperr @RyanTheTide @Acelogic @LiamRay10

The J873's speaker has no V/I sense: the AOP speaker stream has no
receive side, so neither speakersafetyd nor speakerguardd can run.
aurora-silicon/linux#1862 proposes to admit it under a fixed -16 dB
kernel ceiling instead, and its review asked for the userspace part to
go with it.

firs/j873/graph.json downmixes the stereo sink to the mono speaker PCM
(L/2 + R/2). A 4th-order Butterworth high-pass at 100 Hz (two biquads)
follows, then the LSP true-peak limiter at -1 dBFS that ends the other
graphs. There is no measurement of this speaker, so there is no FIR, no
bass extension and no loudness compensation.

Below 100 Hz the high-pass drives the speaker less, at every frequency,
than the J274 graph drives the M1 Mac mini's speaker. The limiter
catches the high-pass's overshoot on full-scale input, and a sink
volume above 100 %, since the volume is a software gain ahead of the
graph.

The rule matches hw:AppleJ873,1. There is no J873 UCM profile yet, so
README.J873.md shows the PipeWire object that stands in for the raw
node until there is one. The Makefile installs j873.

Tested on the J873g with that object, the rule and the graph installed:
- WirePlumber builds the filter sink, hides the raw node and makes the
  filter the default sink.
- Recorded from the graph's output with the amp muted, for full-scale
  input: 30, 50, 70 and 100 Hz come out at -41.8, -24.1, -12.6 and
  -3.0 dB, matching the Butterworth response. 150 Hz to 5 kHz sines
  peak at -1.00 dBFS, a 200 Hz square wave at -1.25 dBFS. One channel
  alone comes out at -6.0 dB.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan
sithglan force-pushed the thomas/j873-speaker-graph branch from 5308a3c to 32ffd0a Compare November 14, 2026 13:00
@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

  1. conf/wireplumber.conf:431 and firs/j873/graph.json:20,29,38: this rule turns the J873 speaker into the default sink with no protection running. The PR body says why there is none: no V/I sense reaches Linux, so no protection daemon can model the voice coil. The 100 Hz corner and the -1 dBFS limiter do not come from this speaker. They are carried over from the J274 graph, which belongs to another driver and enclosure, and a high-pass plus a peak limiter cannot see excursion or coil temperature. Sustained full-scale content at 150 Hz-5 kHz passes at -1 dBFS indefinitely (your own table). Without the speaker's limits from the machine (its ADT/firmware bundle) and a speakerguardd v2 path to enforce them, the speaker has to stay muted. Hold this graph until that protection exists, and make the rule depend on the protected node rather than on hw:AppleJ873,1 directly. The same applies to the context.objects stanza in README.J873.md:53-70: it tells users to expose the raw PCM by hand.
  2. Commit f1190fa ("tests: support mono speaker graphs in clipping checks") has no Signed-off-by. Add one.

Nit: tests/speaker-graph-clips.py:289,292: the recorder is created with --channel-map MONO, but portcfg() then configures its input as AUX0. Pass the same position list to both so the mono case links without a channel remap.

HW row: not until the speaker has machine-provided limits enforced by speakerguardd v2. Then on the J873, with that protection active on the default command line: the graph's sink plays through the protected node, a full-scale sweep and a 200 Hz square wave run with the protection log showing its limits applied, then 0 AVC, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

A graph with one output (the J873's mono speaker) is recorded with the
MONO position, and the recorder's DSP ports take the same position list,
so the mono case links without a channel remap.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873 speaker has no V/I sense on Linux, and a high-pass plus a peak
limiter cannot see excursion or coil temperature. Match the graph's
rule on speakerguardd v2's protect stage (node RawSpeakers, sgv2.stage
protect, sgv2.machine j873g) instead of the raw speaker PCM, and do
not hide it, as speakerguardd's generated rules do. Without
speakerguardd there is no J873 speaker sink, and the speaker stays
muted.

Drop the README's hand-made raw-PCM node: it exposed the speaker with
no protection.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan
sithglan marked this pull request as draft November 21, 2026 13:03
@sithglan
sithglan force-pushed the thomas/j873-speaker-graph branch from f1190fa to 3c9bf25 Compare November 21, 2026 13:03
@sithglan

Copy link
Copy Markdown
Author

@RyanTheTide addressed in 3c9bf25. The PR is a draft now and stays held.

  1. No unprotected path.
    • The J873 rule no longer matches hw:AppleJ873,1. It matches speakerguardd v2's protect stage: node.name = "alsa_output.platform-sound.RawSpeakers", sgv2.stage = "protect", sgv2.machine = "j873g", which is the form speakerguardd's generated rules use.
    • It is no longer hidden, because the session helper must see the protect stage's ports.
    • Without speakerguardd there is no J873 speaker sink, and the speaker stays muted.
    • The context.objects stanza is gone from README.J873.md. The README now says not to expose the raw PCM by hand, and its intro states the speaker plays only behind the protect stage.
    • The PR body's earlier rows are marked as graph-only.
    • Open point on the speakerguardd side: its generated rule also creates a filter from /usr/share/asahi-audio/{m}/graph.json on the same node. Before this leaves draft, either that rule or this one has to be the only one, and #222's protect-stage high-pass and this graph's high-pass must not both run. I'll settle that together with the machine-provided limits.
  2. Sign-off. 0eaaa0d carries the Signed-off-by.

Nit (channel map). The recorder and portcfg() now take the same position list: MONO for a one-output graph, AUX0..n otherwise.

HW row. Deferred as you describe: it waits until speakerguardd v2 enforces the machine's limits on the J873. Nothing will be played without the owner's go.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Author

Superseded: speakerguardd v2 main now compiles J873g's native AID48 voicing and feed-forward Atsp protection directly from the Mac's own tuning bundle (--voicing-pre, compiler-gaps: none), so a static J274-derived 100 Hz high-pass / limiter graph is no longer needed. Kernel speaker enablement behind "Speaker Protection" is in aurora-silicon/linux#3434.

@sithglan sithglan closed this Nov 27, 2026
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.

2 participants