Skip to content

Add the J714 speaker safety profile - #94

Open
edimoldovan wants to merge 9 commits into
omacom:mainfrom
edimoldovan:j714-speaker-safety
Open

edimoldovan wants to merge 9 commits into
omacom:mainfrom
edimoldovan:j714-speaker-safety

Conversation

@edimoldovan

Copy link
Copy Markdown

speakersafetyd ships no profile for the 14" MacBook Pro with M5 (J714),
so the speakers stay locked there. omarchy-mac now installs
/usr/share/speakersafetyd/apple/j714.conf: speaker order, sense channels
and coil resistances from the J714c ADT and device tree, amplifier
constants from speakersafetyd's j316.conf, and the J716 bring-up thermal
model, which is not yet measured on a J714. The file keeps the
GPL-2.0-only of the profiles it derives from; the recipe's license field
needs GPL-2.0-only added.

Run on a J714c with speakersafetyd: it unlocks the speakers and holds
the kernel's -30 dB ceiling, with no panic across playback and suspend.

🤖 Generated with Claude Code

speakersafetyd ships no profile for the 14" MacBook Pro with M5 (J714),
so the speakers stay locked there. omarchy-mac now installs
/usr/share/speakersafetyd/apple/j714.conf: speaker order, sense channels
and coil resistances from the J714c ADT and device tree, amplifier
constants from speakersafetyd's j316.conf, and the J716 bring-up thermal
model, which is not yet measured on a J714. The file keeps the
GPL-2.0-only of the profiles it derives from; the recipe's license field
needs GPL-2.0-only added.

Run on a J714c with speakersafetyd: it unlocks the speakers and holds
the kernel's -30 dB ceiling, with no panic across playback and suspend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no blocking issue was found.

Summary

Adds J714 speaker protection and audio graphs.

  • speakersafetyd can now manage the J714 speakers.
  • J714 microphones now appear as a processed mono input.
  • J714 speakers now play through a six-channel audio graph.

No actionable new issues were found in the changes since the previous review.

Reviews (7) · Last reviewed commit: "Match the J714 microphone array under it..." · Reviewed by Greptile

edimoldovan and others added 6 commits November 6, 2026 12:52
On the J714c the three amps on the second I2C bus (Right Woofer 1,
Right Woofer 2, Right Tweeter) report V and I at 2.0x the left amps'
(the right tweeter 2.4x) with identical amp registers. Their output is
not doubled: at -9 and -3 dBFS the left and right woofers' sense scale
cleanly by 2x with harmonics at -65 dB or below, where a doubled right
input would wrap at -3 dBFS. So is_scale and vs_scale are halved for
those three speakers, and speakersafetyd reads their power as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The J714 kernel now runs the amps at the ADT gain (15) with no unlocked
ceiling, as on j314/j316, and holds -30 dB only while speakersafetyd is
not holding the controls. The profile's header said -30 dB and gain 10.
Comment only; no value changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The J714 profile's header now says which parts were checked on a J714c,
where every value comes from, and what the kernel does with the speaker
volumes. No value changes.

Checked on the J714c with speakersafetyd 2.0.1 on the main-line kernel:
- Each speaker alone, 100 Hz to 12 kHz at -26 dBFS with the amps held at
  -30 dB: every tone lands on that speaker's own I/V pair, |V| matches
  the drive within 0.2 dB (woofers, 1 kHz) and 0.5 dB (tweeters, 4 kHz)
  with the profile's scales, the halved right-side scales included, and
  V/I gives the ADT coil resistance (woofers 3.78-3.98 ohm, +2 to +7%;
  tweeters 3.70-3.76 ohm).
- The installed daemon with a test copy (is_scale and vs_scale each x100,
  so the model sees 10^4 x the sensed power; t_limit 85; tau_magnet / 10)
  and a -56 dBFS tone: the temperature estimate rises,
  the gain reduction engages at t_limit - t_window, the amp volumes read
  back lower by it (woofers -3 dB, tweeters -4.5 dB), the sensed power
  falls with them, and everything returns to 0 dB after the tone.
- LW1's current sample lags its voltage by one sample, so 2.0.1
  under-reads LW1's power above 1 kHz (-32% at 4 kHz).

The kernel holds the volumes at raw 1 (silent) while the daemon does not
hold the controls, not at -30 dB as the header said, and sets no ceiling
when unlocked. 2.0.1 reads neither z_shunt, a_t_20c, a_t_35c nor
link_gains. The thermal constants remain the J716 bring-up values;
AID40's are in macOS's speaker tuning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchy-mac now installs the J714's microphone setup, which asahi-audio
does not have:
- /usr/share/wireplumber/wireplumber.conf.d/j714-mic.conf names the raw
  array (PCM 0 of the AOP card, hw:AppleJ714AOP,0) RawMics and creates
  the J714 microphone filter on top of it;
- /usr/share/omarchy-mac/j714/mic.json is that filter: the three
  capsules mixed, gain, a 120 Hz high-pass and a -1 dBFS limiter, as
  effect_output.j714-mic, which the microphone mapper then wraps.

The graph is the one tested on a J714c as a user WirePlumber config:
speech at a normal level, claps limited at -10 dBFS, nothing clipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The J714 graph called itself "MacBook Pro J714 Microphone", asahi-audio's
per-board naming. omarchy-mac's device names rename every Mac's mono DSP
microphone to "MacBook Microphone (Mono)" and apps see the mapper's stereo
"MacBook Microphone", so the graph now carries the same name and the README
says which name apps see.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchy-mac now installs the J714's speaker DSP, which asahi-audio does not
have: /usr/share/wireplumber/wireplumber.conf.d/j714-speakers.conf puts
/usr/share/omarchy-mac/j714/speakers.json on the raw speakers
(hw:AppleJ714,1). The graph is asahi-audio's J314 one in the J714's
six-channel order (LW1 RW1 LW2 RW2 LT RT) with the J314 filter files the
asahi-audio package installs, named "MacBook Speakers" as omarchy-mac
names every Mac's.

It is the graph the J714c runs today as a user WirePlumber config
(~/.config/wireplumber/wireplumber.conf.d/90-j714-speakers.conf).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@edimoldovan

Copy link
Copy Markdown
Author

Upcoming J714c (14" M5 Max) work depends on this PR:

  • The J714c sound kernel PR for omacom/linux-aurora. Its macaudio driver unlocks the speakers only while speakersafetyd runs with a profile for the machine. Without j714.conf from this PR, speakersafetyd has no J714 profile and the speakers stay held at -30 dB. The sound PR follows once this one is merged.
  • The packaged J714 microphone graph (j714-mic.conf, mic.json) is in this PR too. The next sound changes build on it.

The speaker graph stopped at every pause and restarted at every play,
cutting its output mid-signal and resuming with the bass enhancer's and
limiters' stale state: an audible click at pause and play. Keep both
filter-chain nodes processing (node.always-process), so a stream's end
fades through the filters and the next starts from settled state. The
graph then costs about 2 % of one core in wireplumber while idle.

Tested on a J714c: with a user copy of this graph, play and pause no
longer click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 7.3 kernel names the J714's microphone array card AppleJ714HPAI, as every
other model's HPAI card; the 7.2 kernel names it AppleJ714AOP. The rule
matches both, so the mic graph loads on either kernel.

Tested on the J714c (M5 Max), 7.3 kernel: effect_output.j714-mic is the
microphone.

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

@scottjones scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this carefully. The sense checks are good work: each tone on its own I/V pair, |V| within half a dB, Re from V/I matching the ADT, and the x100 test copy proving the gain loop engages and releases. I don't want to merge it yet though, because the values that actually decide whether a speaker survives aren't from this machine, and the file lives in a package where it will cause trouble later.

1. The thermal model isn't the J714's, and it isn't from a 14" either. tr_coil, tr_magnet, tau_coil, tau_magnet and t_limit come from the J716 bring-up profile, which is j316 with t_limit 140 -> 120 and tr_* x1.25. Every upstream 14" profile (j314, j414, j514, all identical) uses a different driver model: woofer tau_coil 3.05 s vs the 5.6 s here, tweeter tr_coil 34.5 / tau_coil 2.31 vs 56.25 / 1.3. The lower t_limit and higher tr_* do buy margin on steady state (max sustained power per woofer works out to 0.89 W vs 1.44 W on j414), but the longer woofer coil time constant means the model heats slower than a 14"-style woofer would. I ran speakersafetyd 2.0.1's model in a quick simulation, with this profile controlling the gain and the j414 woofer standing in as the real speaker: at full drive the real coil ends up about 5 C hotter than the estimate (121 vs 117 C). That still stays under j414's 140 C limit, so I'm not saying this is unsafe. I'm saying it's only safe if the J714's drivers look like older Apple drivers, and nobody has checked that. AID40's real values are in the macOS speaker tuning that audump.py reads, so this is fixable.

2. The right-side 2x sense correction is load-bearing and we don't know why it's needed. is_scale 1.875 / vs_scale 7 on RW1, RW2 and RT (j714.conf:78-79, 112-113, 146-147) correct V and I reading 2x high on the i2c3 amps with identical amp registers. If that 2x goes away (a kernel change to amp init, another J714c, a J714s, or state after resume), the daemon reads those speakers' power at a quarter of the truth. In the same simulation a 4x under-read lets a woofer run to well over 200 C while the estimate sits near 105 C, so the protection is effectively off. Before this ships I'd want the cause found (TDM slot width, sense gain, something in the bus setup) and ideally fixed in the kernel so the profile can use the same scales as every other Mac.

3. It also applies to the J714s, which nobody tested. speakersafetyd strips trailing letters from the first compatible, so apple,j714s (14" M5 Pro, already in the kernel tree) loads j714.conf too. Its audio topology has the same six amps on the same buses, so it's probably the same hardware, but points 1 and 2 haven't been checked there. The README also says "14-inch MacBook Pro with M5 (J714)", which covers both.

4. LW1 under-reads by up to 32% at 4 kHz. The header says the asahi-audio graph keeps LW1 out of that range, but speakersafetyd is the last line of protection and shouldn't depend on the DSP graph being loaded (raw ALSA, a broken filter chain, or a user who removes it). With j414 as the real woofer and a 32% under-read the coil reaches about 130 C against a 115 C estimate. A one-sample I/V lag on one amp only also sounds like a slot setup issue worth fixing in the kernel rather than living with.

5. The test evidence in the description is from the old kernel. The description says the run "holds the kernel's -30 dB ceiling", and the playback and suspend test was done with amp gain 10 and that ceiling. 76571ca says the kernel now runs gain 15 with no ceiling once unlocked, and the full-scale check used a -56 dBFS tone. So nothing has run this profile at full power on the current kernel.

6. This file belongs in the speakersafetyd package, not omarchy-mac. omarchy-mac now installs /usr/share/speakersafetyd/apple/j714.conf, a path the speakersafetyd package owns the directory for. When upstream (or our recipe) adds j714.conf, pacman will hit a file conflict and block the upgrade on every Mac, not just J714s. omarchy-pkgs already carries speakersafetyd 2.0.1 with a patch (j504), so adding j714.conf there as a patch keeps ownership in one place, puts the GPL file in a GPL-licensed package instead of asking omarchy-mac's MIT license field to change, and lets us add the matching AppleJ714 line to 95-speakersafetyd.rules. Without that udev line the daemon only starts from the preset at boot. If it starts before the card shows up it panics on hw:AppleJ714, and after 10 restarts in 60 s systemd gives up, so the speakers stay silent until someone restarts it.

7. Smaller things.

  • No test covers the profile. I set vs_chan = 11 to 99, is_scale on the right speakers to 0.01, and deleted j714-speakers.conf, and omarchy-mac/test/all still passed all 115. If it stays in this repo, a check that the file stages and has sane channels and scales would help.
  • The branch conflicts with main on omarchy-mac/version (main is 0.2.6).
  • The profile depends on the J714c sound kernel PR's DT names (Left Woofer 1 and so on). The J714c DT currently in the tree still names codec@38 Speaker 0. If that mismatch ever ships, the daemon fails to find its controls and the speakers stay silent, which is safe, but worth landing together.

What I'd want before this goes in:

  1. audump.py output from macOS on a J714c (and a J714s if anyone has one), with the profile's thermal values taken from it.
  2. The cause of the i2c3 2x sense reading, checked on a second J714c and on a J714s, after a cold boot and after resume, on the current kernel.
  3. A full-power run on the current kernel, for example bass-heavy content at max volume for 10 minutes or more, with speakersafetyd -v logs. If you can, compare the model's coil temperature with the coil temperature from the V/I resistance rise, which checks the thermal model on the real hardware.
  4. A cold boot journal showing speakersafetyd starts and unlocks on its own.

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