Repository navigation
ASoC: apple: macaudio: lease-only fixed ceiling, held only at its amp level - #1862
Conversation
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks for the ADT comparison and the careful write-up. The mechanism itself looks right to me: spk_fixed_ceiling keeps the SN012776 volumes under safe_vol in the locked, unlocked and leased states, with no sense PCM. The -15 dB arithmetic also checks out: 8.41 Vrms at full scale is 15.4 W into 4.6 Ω, and -15 dB brings that to about 0.49 W.
I can't merge it as it stands, though, because of this tree's speaker-safety rule. A change may keep a speaker's limits or lower them. Anything that raises one needs explicit sign-off from the project owner and a speaker-safety qualification first, and speaker tests aren't part of review. Here the J873 speaker goes from not admitted (enable_speakers = false, safe_vol = 0) to admitted at a -15 dB ceiling with no closed-loop protection.
Could you split it into two?
- The mechanism alone: the
spk_fixed_ceilingflag and its handling, with no board config setting it, so it changes nothing on any current machine. I'm happy to review that for merge on its own. - Enabling J873:
enable_speakers = true,safe_vol = -15,spk_fixed_ceiling = trueand the KUnit expectation. This waits for the owner's sign-off on the level. It would help to include the thermal side: a continuous full-scale signal at 0.49 W against a 0.94 W rating has no thermal model behind it. The PipeWire high-pass/limiter chain the description mentions would also belong with it.
One technical note on the mechanism. As far as I can tell, with spk_fixed_ceiling set, macaudio_spk_gain(ma, true) still returns SN012776_0DB, which is above the new platform_max. The volume control's put then fails with -EINVAL (soc_mixer_valid_ctl()), and a "Speaker Protection" grant drops straight to the floor with "operating gain not set". That fails safe, but the log reads like a fault. It would be clearer either to return the ceiling there or to refuse the lease explicitly on fixed-ceiling machines.
88adb1a to
66e221d
Compare
|
@DjDeveloperr thanks. I split it as you suggested:
You were right about the lease. Our hardware run switched the interface to the lease and back but never granted one, so it missed the bug. In #1884 a fixed-ceiling machine's operating gain is its ceiling: a grant now runs the amps at The thermal side is in the description and in the commit message. The J873 ADT has no thermal data, so it uses speakersafetyd's Mac mini (J274) model:
The PipeWire high-pass and limiter chain isn't in here yet. |
|
Status from the contributor PR sweep: #1884 (the mechanism) is merged. This PR raises the J873 speaker from not admitted to admitted at a -15 dB fixed ceiling, with no closed-loop protection. Under the tree's speaker-safety rule that needs the project owner's explicit sign-off on the level, as the review said, so it stays open and isn't merged here. Once you rebase it on |
66e221d to
d543077
Compare
d543077 to
d032b1a
Compare
|
@DjDeveloperr this is rebased on integration/aurora, so only the J873 commit is left. Since my last reply there are three changes: 1. A correction to my thermal reply, and a lower ceiling. I worked the thermal case for a full-scale sine. The worst signal is a full-scale square wave, which has twice the power. At -15 dB that is 0.97 W, and the J274 model settles the coil near 143 °C, over its 140 °C limit. So the PR now proposes -16 dB:
The kernel ceiling alone keeps the worst case 17 °C under the limit. speakersafetyd's own floor for that model is -15.2 dB, the gain that holds a square wave at the limit, and -16 dB is 0.8 dB below it. The description and the commit message are updated. The level still waits for the owner's sign-off. 2. The PipeWire high-pass and limiter chain is aurora-silicon/asahi-audio#28. It's a mono downmix, then a 4th-order Butterworth high-pass at 100 Hz, then the LSP true-peak limiter at -1 dBFS. There is no J873 speaker data, so the high-pass corner is chosen so that, at every frequency below 100 Hz, it drives the speaker less than the J274 graph drives the M1 Mac mini's. Measured on the M6 from the graph's output, with the amp muted:
3. The lease now passes on hardware. With "Speaker Protection Interface" on the lease:
The apple-speaker KUnit suites pass at -16 dB (60 tests). |
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 <[email protected]>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks, Thomas. The -16 dB rework is careful work: the square-wave correction, the thermal table and asahi-audio#28. The lease fix that went in with #1884 reads right too.
I can't merge it, and the reason now goes beyond the level itself. Our speaker rule is that nothing produces audible output except through speakerguardd. With spk_fixed_ceiling, macaudio_vlimit_unlock() holds the SN012776 volumes at safe_vol in the locked state as well (sound/soc/apple/macaudio.c:537-538 on integration/aurora). So with this PR, raw ALSA can drive the J873 speaker at -16 dB with no daemon running at all. Every other SN012776 speaker stays at the floor (max = 1) until a protection daemon unlocks it or speakerguardd grants a lease.
The tree already says how a speaker without sense should run. The J775 comment (macaudio.c:4075-4087) says such a speaker "can only be run under a protection lease held by speakerguardd with a no-sense model, as on the J773g". speakerguardd has that path now: the derived no-sense wiring from speakerguardd#212.
What would make this mergeable:
- Kernel: on fixed-ceiling machines, keep the locked state at the floor. Only a speakerguardd grant should lift the amp, and then only to
safe_vol. #1884 already sets the operating gain to the ceiling for a grant, so this is mostly the locked branch ofmacaudio_vlimit_unlock(). The KUnit admission case would then check "admitted, lease only". - speakerguardd: a J873 no-sense model (the J873 counterpart of #212) with -16 dB as its hard cap, and with the asahi-audio#28 high-pass in the protected graph.
- The level: the thermal case still rests on the J274 model, not on a J873 measurement. As a ceiling argument that's reasonable, but the owner's sign-off on the level is still needed, as in the first review.
Happy to review the reworked kernel half as soon as it's up.
A machine with spk_fixed_ceiling has no sense path, so no protection daemon can hold its speakers. Its SN012776 volumes have sat at safe_vol in the locked state as well, so raw ALSA could drive the speaker at that level with no daemon running. Every other SN012776 speaker stays at the floor until a protection daemon unlocks it or a "Speaker Protection" lease is granted. Keep these speakers at the floor while locked, and leave them there for "Speaker Volume Unlock": only a "Speaker Protection" lease lifts the limit, and only to safe_vol, which a grant already uses as the operating gain. macaudio_sn012776_vlimit() computes the limit. The admission KUnit suite checks it, and the fixed-ceiling protection case now also checks that an unlock leaves the amps at the floor. No machine sets spk_fixed_ceiling yet. Signed-off-by: Thomas Glanzmann <[email protected]>
d032b1a to
61fefdb
Compare
|
@DjDeveloperr thanks. The kernel half is up: 1. "ASoC: apple: macaudio: lift a fixed ceiling only for a speaker lease" (no machine sets the flag):
2. The J873 enable: the config comment and commit message now say it is lease-only. The J775 comment no longer calls the J873 speaker off. KUnit (arm64, QEMU): the six apple-speaker suites pass, 61 tests.
The J873 hardware runs in the description are from before this change, when the ceiling applied in every state; the lease path they used is unchanged. A J873g run on this head comes with the speakerguardd model, since without it nothing lifts the speaker. speakerguardd: I'll write the J873 no-sense model next, as a speakerguardd PR on the derived-nosense path from #212. One question about its basis first. #212's J773g model came from its macOS tuning. The J873 ADT marks the amp
The level still needs the owner's sign-off, as you say. |
|
@DjDeveloperr follow-up to my question: macOS does ship a protection tuning for the J873, so the second case doesn't arise. I read the M6's macOS 27.2 System volume with speakerguardd's So the J873 model can be derived from the Mac's own tuning, the derived-nosense way #212 does for the J773g. Its hard cap is -16 dB, and asahi-audio#28's high-pass sits in the protected graph. Next I'll run a dry run of |
|
@DjDeveloperr the speakerguardd half (your point 2) is up as aurora-silicon/speakerguardd#222:
On the J873g, read only:
The self-check and a supervised grant need this PR's kernel with |
|
@DjDeveloperr The owner signs off on -16 dB as the J873 speaker's fixed ceiling. The owner listened to it on the J873g tonight under speakerguardd#222's lease: loud, with no distortion. Kernel. It's the J873g's running kernel source with this PR's macaudio change applied,
Without a lease:
Under the lease (speakerguardd#222
Program: all of it went through the protect stage (100 Hz 4th-order high-pass, then AID48's atsp unit):
For the track, 210 one-second samples all read Speaker Volume 169 and Amp Fault Status 0, with one grant and one withdrawal in the kernel log. One caveat. speakerguardd's own release gate doesn't admit the J873g yet: there is no macOS-parity attestation for the AID48 voicing on 26B123. So for this test the supervisor and the session helper were started by hand without the gate, and the program went straight into the protect stage without the voicing. Details are on speakerguardd#222. |
|
Blockers: 1. The lease-only commit (3fa618e) reads right.
Nit: the HW row: J873g on a kernel built from exactly this head on integration/aurora (not a backport onto the running source), with speakerguardd started through its normal release path, not by hand: after boot "Speaker Volume" platform_max reads 1; an attempt to unlock on the "Speaker Volume Unlock" interface leaves it at 1; under a grant it reads Assisted-by: LLM (Claude:Opus 5.5) |
61fefdb to
505d900
Compare
|
@RyanTheTide thanks.
KUnit (arm64, QEMU): 72 of 72 pass in the Apple sound suites.
HW row: pending, for two reasons.
The parts that need no sound I can run on a kernel built from this head: platform_max 1 after boot, an unlock attempt leaving it at 1, and the logged amp level. I'll post those with the full row. Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-review of 505d900: Blockers: 1. The amended J873 commit closes the level-mismatch hole. It does not give the ceiling a source in the machine's data. The lease paths are unchanged since 61fefdb and still keep the floor. The nit is fixed.
Lease and unlock paths (no change since 61fefdb). Nit (resolved): the The PR description is out of date. It says 61 tests where the commit says 72, it quotes the old log string "the boot loader passed no amp levels", and its "Not in this PR" list says the speakerguardd model does not exist yet. It has no HW row: J873g on a kernel built from exactly this head on integration/aurora, with a DT whose amp node carries the machine-provided limit. Pass criteria: dmesg logs the amp level and the ceiling computed from that limit. With the property removed, or with the level changed, the Speaker link is skipped. After boot "Speaker Volume" platform_max is 1, and an unlock attempt leaves it at 1. Under a grant through speakerguardd's normal release path it never goes above the computed ceiling over a full-scale program, and it returns to 1 at each withdrawal. Amp Fault Status stays 0. 0 AVC, 0 failed units, 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
… -16 dB) The supervisor grants only while every amp's volume reads 0 dB on its own TLV. The J873g's kernel (aurora-silicon/linux#1862) lifts its one SN012776 under the "Speaker Protection" lease only to a fixed ceiling, -16 dB on the DVC (raw 169), and holds it at the floor otherwise. Its first grant would read -16 dB and latch: "granted, but Speaker is at 169 (Some(-1600)) cdB, not 0 dB". Make the ceiling speakerguardd's own hard cap for the board: - gate.json operating_volume_db names it per board, in dB on the control's TLV: {"j873g": -16.0}. gen.operating_volume_db() reads it (0 dB for any other board). A value above 0 dB, below -40 dB or not a number refuses the board. - The self-check records it in selfcheck.bind as volume_cdb=-1600. 0 dB writes no line, so every existing record stays as it is. A bound pass whose volume differs from the gate's (one written before this change on a J873g) is checked again, not reused. - The supervisor parses volume_cdb (absent: 0; outside -4000..0 cdB: the record is refused) and its Expect holds the grant to exactly that volume. 0 dB, a step above or below -16 dB, or a volume without a dB scale latches, as a wrong 0 dB volume does today. The operating point is unchanged: the blob is compiled for the amp gain's full scale (gain 15, 11.89 V peak, read back from "Amp Gain Volume"). The model therefore computes for 16 dB more drive than the speaker gets under the ceiling. Tests: - supervisor (selfcheck.rs): the record's volume_cdb parses, and is refused when positive, below -40 dB, fractional, empty or given twice; - supervisor (supervise.rs): a J873g-shaped machine at -16 dB grants and renews; at 0 dB, -15.5 dB, -16.5 dB or without a dB scale it latches ("not -16 dB"); and without the record's volume, -16 dB latches. Comparing against 0 dB, as before, fails the first case; - test_wiring.py: the shipped gate gives -16 dB for the J873g and 0 dB elsewhere, malformed values refuse, and bind_lines() writes volume_cdb only when it is not 0. cargo test/clippy -D warnings/fmt for sgv2-supervisor, the four session suites, gen.py --check and tools/check-clean.sh pass. Signed-off-by: Thomas Glanzmann <[email protected]>
asahi-audio#28 gave the J873g's speaker, which has no measurement behind its low end, a 4th-order Butterworth high-pass at 100 Hz: two bq_highpass sections, Q 1.3066 and 0.5412. It keeps the drive below 100 Hz under what the J274 graph gives the M1 Mac mini's speaker, at every frequency. The review of aurora-silicon/linux#1862 asked for it in the protected graph. gate.json protect_highpass names it per board ({"hz", "order"}, an even order of 2 to 8, a corner of 20 Hz to 1 kHz). gen.pipewire_conf() puts its sections on every amp's lane in the protect stage, in front of the sgv2 instance's unit port. The unit therefore models the program the amp gets, and no voicing setting can drop the filter. The sections are PipeWire's builtin bq_highpass at the Butterworth Q of each pole pair (butterworth_q(), which the voicing low-pass already uses): monotonic and never above 0 dB. A malformed entry refuses the board's graph. No other board has an entry, so every other generated file is unchanged (gen.py --check). Tests (test_wiring.py, ProtectHighpass): - the shipped gate gives the J873g (100 Hz, 4) and no other board an entry; - the J873g's protect stage has hp0s0 -> hp0s1 -> sgv2:in_0 with the input on hp0s0, and without the entry it is the plain stage; - the cascade's RBJ response at 48 kHz is asahi-audio#28's recording on the J873g (-41.8, -24.1, -12.6 and -3.0 dB at 30, 50, 70 and 100 Hz) and never above 0 dB from 10 Hz to 24 kHz; - malformed entries refuse. Signed-off-by: Thomas Glanzmann <[email protected]>
|
@RyanTheTide the description is updated:
I also corrected the sense statement. The descriptor's slot masks have no receive side, but the same stream names a receive DMA provider. The amp's On the blocker: agreed, it is not resolved. I have no machine source for the value. What this Mac hands over for its amp is the ADT's The one place left is the Mac's own audio tuning on the ESP, which only userspace reads today. I'll check it on the J873g, read only, and report whether it describes a limit for this speaker, without values. If it does, the route would be:
Until then the PR is held, as the description now says. Assisted-by: LLM (Claude:Opus 5.5) |
|
The spk_fixed_ceiling mechanism from #1884 is on integration/aurora, but neither commit here is, and both apply cleanly to 110861f. The open blocker is the J873 enable: the -16 dB ceiling and level 15 are constants in the board table, not values this Mac provides. The lease-only commit and the level check could go in on their own with the J873 left at enable_speakers = false, and the enable follow once the boot loader hands the kernel a limit from the machine's own speaker data. Build check of 110861f plus this change (arm64, LLVM=1, Image, dtbs and every directory it touches, Fedora config plus asahi.config): builds, no warnings in the files it touches. |
505d900 to
09b8160
Compare
A fixed speaker ceiling (spk_fixed_ceiling) is a volume computed for one amp level. The driver takes each SN012776 amp's level from the apple,speaker-config the boot loader passes, and at another level the same volume drives the speaker differently. Let a fixed ceiling name the level it was computed for (spk_ceiling_level), log the level read, and keep the speakers off when any amp has another level. No board uses a fixed ceiling yet. The J873, for which it was written, stays off until its limit comes from the machine's own speaker data. A new amp-level KUnit case admits an amp at the ceiling's level 15 and refuses a link with an amp at 7 or one without a level. It fails when the level check is dropped. Signed-off-by: Thomas Glanzmann <[email protected]>
09b8160 to
226c790
Compare
|
Thanks. Split as you suggested: 505d900 → 226c790. The PR is now the lease-only commit (3fa618e, unchanged) and the amp-level check on its own (226c790, "hold a fixed ceiling only at its amp level"). The J873 stays at
Checks:
Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR review on 226c7903c978c809c4931b977e015182f0fcad12:
- §1 No model gating: Pass. Uses
spk_fixed_ceilingandspk_ceiling_levelinstruct macaudio_platform_cfgand validates per-amp levels from DTapple,speaker-config, with no SoC/board conditionals. - §2 Production-ready: Pass. Clean, minimal, no cmdline/module parameters or workarounds.
- §3 Safety: Pass. Splitting out the J873 enablement resolves the prior
CHANGES_REQUESTEDblockers. Both commits strictly tighten the already-merged#1884mechanism:macaudio_sn012776_vlimit()keepsspk_fixed_ceilingamps at the floor (1) when locked and underSpeaker Volume Unlock(withmacaudio_vlimit_update()returning early), lifting tosafe_volonly under aSpeaker Protectionlease (macaudio_spk_enter_lease()/macaudio_spk_leave_lease()preserve floor invariants on entry and teardown).macaudio_sn012776_level_allowed()/macaudio_sn012776_levels_present()log each amp's level and disable speakers when any amp's level differs fromspk_ceiling_level(withof_node_put()properly handled on all paths).- No board in the tree sets
spk_fixed_ceiling = true(t8152-j873remains atenable_speakers = false, safe_vol = 0), so behavior on all currently supported Macs is unchanged.
- §4 Clean-room & attribution: Pass. Both commits (
3fa618e415f6,226c7903c978) carry human author/committer and humanSigned-off-by:with zero AI trailers in commit messages; PR body includesAssisted-by:. - §5 Evidence & CI: Pass for an inert safety-tightening change with no enabled board. Applies cleanly to current
integration/aurora;host-testsCI is green on226c7903c978; 72/72 Apple sound KUnit cases (including lease-only and amp-level negative controls) andW=1builds are verified. - §6 Naming: Pass.
Clearing prior change requests — ready for merge.
Assisted-by: LLM (Gemini 4 Neon)
065764c
into
aurora-silicon:integration/aurora
… -16 dB) The supervisor grants only while every amp's volume reads 0 dB on its own TLV. The J873g's kernel (aurora-silicon/linux#1862) lifts its one SN012776 under the "Speaker Protection" lease only to a fixed ceiling, -16 dB on the DVC (raw 169), and holds it at the floor otherwise. Its first grant would read -16 dB and latch: "granted, but Speaker is at 169 (Some(-1600)) cdB, not 0 dB". Make the ceiling speakerguardd's own hard cap for the board: - gate.json operating_volume_db names it per board, in dB on the control's TLV: {"j873g": -16.0}. gen.operating_volume_db() reads it (0 dB for any other board). A value above 0 dB, below -40 dB or not a number refuses the board. - The self-check records it in selfcheck.bind as volume_cdb=-1600. 0 dB writes no line, so every existing record stays as it is. A bound pass whose volume differs from the gate's (one written before this change on a J873g) is checked again, not reused. - The supervisor parses volume_cdb (absent: 0; outside -4000..0 cdB: the record is refused) and its Expect holds the grant to exactly that volume. 0 dB, a step above or below -16 dB, or a volume without a dB scale latches, as a wrong 0 dB volume does today. The operating point is unchanged: the blob is compiled for the amp gain's full scale (gain 15, 11.89 V peak, read back from "Amp Gain Volume"). The model therefore computes for 16 dB more drive than the speaker gets under the ceiling. Tests: - supervisor (selfcheck.rs): the record's volume_cdb parses, and is refused when positive, below -40 dB, fractional, empty or given twice; - supervisor (supervise.rs): a J873g-shaped machine at -16 dB grants and renews; at 0 dB, -15.5 dB, -16.5 dB or without a dB scale it latches ("not -16 dB"); and without the record's volume, -16 dB latches. Comparing against 0 dB, as before, fails the first case; - test_wiring.py: the shipped gate gives -16 dB for the J873g and 0 dB elsewhere, malformed values refuse, and bind_lines() writes volume_cdb only when it is not 0. cargo test/clippy -D warnings/fmt for sgv2-supervisor, the four session suites, gen.py --check and tools/check-clean.sh pass. Signed-off-by: Thomas Glanzmann <[email protected]>
asahi-audio#28 gave the J873g's speaker, which has no measurement behind its low end, a 4th-order Butterworth high-pass at 100 Hz: two bq_highpass sections, Q 1.3066 and 0.5412. It keeps the drive below 100 Hz under what the J274 graph gives the M1 Mac mini's speaker, at every frequency. The review of aurora-silicon/linux#1862 asked for it in the protected graph. gate.json protect_highpass names it per board ({"hz", "order"}, an even order of 2 to 8, a corner of 20 Hz to 1 kHz). gen.pipewire_conf() puts its sections on every amp's lane in the protect stage, in front of the sgv2 instance's unit port. The unit therefore models the program the amp gets, and no voicing setting can drop the filter. The sections are PipeWire's builtin bq_highpass at the Butterworth Q of each pole pair (butterworth_q(), which the voicing low-pass already uses): monotonic and never above 0 dB. A malformed entry refuses the board's graph. No other board has an entry, so every other generated file is unchanged (gen.py --check). Tests (test_wiring.py, ProtectHighpass): - the shipped gate gives the J873g (100 Hz, 4) and no other board an entry; - the J873g's protect stage has hp0s0 -> hp0s1 -> sgv2:in_0 with the input on hp0s0, and without the entry it is the plain stage; - the cascade's RBJ response at 48 kHz is asahi-audio#28's recording on the J873g (-41.8, -24.1, -12.6 and -3.0 dB at 30, 50, 70 and 100 Hz) and never above 0 dB from 10 Hz to 24 kHz; - malformed entries refuse. Signed-off-by: Thomas Glanzmann <[email protected]>
…ng; gate.json only caps it Under a grant, macaudio limits every amp volume control to the level the grant runs it at: 0 dB, or on a machine whose speaker only a lease may lift (spk_fixed_ceiling, aurora-silicon/linux#1862) that machine's fixed ceiling (-16 dB on the J873g). Read the operating volume from the card's TLV maximum under the grant instead of demanding 0 dB or hardcoding a per-board volume in gate.json. - kernel.rs: AmpLevel carries max_centi_db, the dB at the control's current maximum (db_scale_centi() at the info maximum). - supervise.rs: volume_problem() takes the ceiling from the card. Every amp must report the same ceiling, within -40..0 dB, at or below any gate.json cap, and sit exactly at it. A card that reports no ceiling latches, whatever gate.json says. - gate.json / gen.py: operating_volume_cap_db is an optional per-board cap that can only lower the card's ceiling; no board carries an entry today, and malformed entries refuse the board. - selfcheck: records the cap (volume_cap_cdb) only when set; refuses any record naming volume_cdb and does not reuse one whose cap differs. - docs: document the card-ceiling contract in docs/CAPABILITIES.md and docs/NEW-PLATFORM.md. On every Mac except a spk_fixed_ceiling board, the card's TLV maximum under a grant equals the held 0 dB, so the check accepts the same state as before. Signed-off-by: Thomas Glanzmann <[email protected]>
asahi-audio#28 gave the J873g's speaker, which has no measurement behind its low end, a 4th-order Butterworth high-pass at 100 Hz: two bq_highpass sections, Q 1.3066 and 0.5412. It keeps the drive below 100 Hz under what the J274 graph gives the M1 Mac mini's speaker, at every frequency. The review of aurora-silicon/linux#1862 asked for it in the protected graph. gate.json protect_highpass names it per board ({"hz", "order"}, an even order of 2 to 8, a corner of 20 Hz to 1 kHz). gen.pipewire_conf() puts its sections on every amp's lane in the protect stage, in front of the sgv2 instance's unit port. The unit therefore models the program the amp gets, and no voicing setting can drop the filter. The sections are PipeWire's builtin bq_highpass at the Butterworth Q of each pole pair (butterworth_q(), which the voicing low-pass already uses): monotonic and never above 0 dB. A malformed entry refuses the board's graph. No other board has an entry, so every other generated file is unchanged (gen.py --check). Tests (test_wiring.py, ProtectHighpass): - the shipped gate gives the J873g (100 Hz, 4) and no other board an entry; - the J873g's protect stage has hp0s0 -> hp0s1 -> sgv2:in_0 with the input on hp0s0, and without the entry it is the plain stage; - the cascade's RBJ response at 48 kHz is asahi-audio#28's recording on the J873g (-41.8, -24.1, -12.6 and -3.0 dB at 30, 50, 70 and 100 Hz) and never above 0 dB from 10 Hz to 24 kHz; - malformed entries refuse. Signed-off-by: Thomas Glanzmann <[email protected]>
Split as Ryan suggested: the lease-only commit and the amp-level check, with the J873 left at
enable_speakers = false. Based on integration/auroraf44bf7af65ea, which has #1884 (thespk_fixed_ceilingmechanism); merges cleanly on the current tip. No board setsspk_fixed_ceilingafter this PR, so no speaker's behaviour changes.spk_fixed_ceiling, the speaker stays at the floor while locked, and "Speaker Volume Unlock" lifts nothing there. Only a "Speaker Protection" lease raises the limit, and only tosafe_vol, the gain a grant runs the amps at.apple,speaker-config. At another level the same volume drives the speaker differently. The ceiling now names its level (spk_ceiling_level), the level read is logged, and at any other level the speakers stay off.The J873 enable: a follow-up
The enable (
safe_vol = -16,spk_fixed_ceiling,spk_ceiling_level = 15, lease-only) is kept for a follow-up PR, together with its power and thermal case: the J274 speaker model, a full-scale square wave at 0.77 W, and the coil settling at 123 °C against the model's 140 °C limit. It follows once the boot loader hands the kernel a limit from the machine's own speaker data. The -16 dB constant has no source in the J873's data, which was the open blocker here.Background, unchanged:
speaker-protection = 0, and no sense PCM reaches Linux.Testing
safe_volonly unlocked under a lease.safe_volin every state), the admission and protection cases fail.macaudio_levels_fixed_ceilingfails (71/72).macaudio.obuilds with W=1 and no warnings. checkpatch--strictis clean on both commits (the amp-level test now uses a small helper).cc @joshuaswarren
Assisted-by: LLM (Claude:Opus 5.5)