Skip to content

ASoC: apple: macaudio: bind the J614s speakers for speakerguardd v2 - #1665

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
petrskuta:j614s-speakers
Nov 12, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
petrskuta:j614s-speakers

Conversation

@petrskuta

Copy link
Copy Markdown
Contributor

Binds the MacBook Pro 14" M4 Pro (j614s) speakers so that speakerguardd v2 can protect them, following the speaker team's request to use speakerguardd v2. Tracking issue: #1591.

Change

  • DT (t6040-j614s.dts): the speaker card and its six SN012776 amps are no longer disabled. They use the shared j614/j616 description.
  • macaudio_j614_cfg: enable_speakers = true and the j616s's tweeter_hpf_granted. The rest was already identical to macaudio_j616_cfg.
  • J604 (MacBook Pro 14" M4) shared macaudio_j614_cfg. It gets its own macaudio_j604_cfg with the speakers still off, so its behaviour does not change. It is added to the amp-level KUnit list.

Playback still waits for a protection lease (macaudio_spk_admitted()). The legacy protection has no J614 profile, so without speakerguardd v2 the amps stay at the floor.

Why the shared description is right for j614s

This was checked against the j614s ADT:

Amp ADT DT
Left woofer 1/2, tweeter i2c1 0x38/0x39/0x3a i2c@429014000 0x38/0x39/0x3a
Right woofer 1/2, tweeter i2c3 0x3b/0x3c/0x3d i2c@42901c000 0x3b/0x3c/0x3d
IRQ / SDZ / speaker ID gpio0 0x37 / 0x36 / 0x34,0x35 pinctrl 55 / 54 / 52,53
  • The loader-copied apple,speaker-config rows give level 15 and I/V slots 0/2, 4/6, 8/10, 12/14, 16/18 and 20/22, the same as the DT's ti,imon/vmon-slot-no.
  • Valid speaker IDs are 0 and 3; this unit is 3.

Testing

j614s, os-fw 26.6.2, kernel built from this commit plus #1585/#1588/#1654 on f9f14be0f. The DTB was deployed through an aura-try trial and committed.

  • Boot with the card bound: the card MacBook Pro J614 appears with all six amps' controls. Speaker Protection Interface reads Speaker Volume Unlock and no protection runs, so the speakers stay silent.
    • The first trial boot hung at the splash before the LUKS prompt and fell back. It left no journal and no pstore.
    • A verbose retry of the same candidate booted, and two later normal boots with splash also booted. I could not reproduce the hang.
  • aurora-speaker-upgrade --check: PASS. Identity j614s, AID34; tuning from this Mac's macOS 26B131 (route 1); compile; silent switch test; self-check (kernel: both interfaces; wiring 164e7a0d23003bab, derived; voicing within +0.139/-0.102 dB of macOS 25G83 Audio Units).
  • aurora-speaker-upgrade (switch): done. speakerguardd v2 owns the speakers, and the supervisor reports protection ready: every check holds, granted while a stream plays.
  • Listening test: pass. Music at low and then normal volume, stereo, no distortion. Bass is weaker than macOS, which is the known v2 preview gap.

Needs, outside this repo:

Not tested: suspend/resume with speaker playback, the headphone/speaker switch, J604 (only the configuration split, no behaviour change intended).

The commit was cherry-picked onto 921956593. The amp-level test list was merged with upstream's new macaudio_j714_cfg. Not rebuilt on that base.

🤖 Generated with Claude Code

The J614s has the J616s's six SN012776 amps, slots and frame. The boot
loader copies each amp's ADT speaker-config row (level 15, V/I slots 0/2
through 20/22, which match the device tree). Its speakers were kept off,
with no link bound, waiting for a protection profile.

Bind them as on the J616s: enable the speaker card and its six amps in
the J614s tree and the speakers in macaudio_j614_cfg, with the J616s's
tweeter corner grant. Playback still waits for a protection lease
(macaudio_spk_admitted()), which speakerguardd v2 takes only once it has
compiled and self-checked this Mac's own tuning. The legacy protection
has no J614 profile, so without v2 the amps stay at the floor.

The J604 (MacBook Pro 14" M4) shared the J614s's configuration. It keeps
its speakers off with a configuration of its own.

Signed-off-by: Petr Škuta <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

Copy link
Copy Markdown
Member

Additional testing on another J614s (14-inch M4 Pro), running NixOS.

I applied the changes from 7e9a478 to our pinned kernel 15f88e1, adapting only the KUnit configuration-list hunk to that older base. The running release is 7.3.0-j614s-sgv2-1. This tests the PR's functional changes, not its exact rebased tree. I also used the J614 UCM profile and speakerguardd v2 at 26b88eac with the local userspace fixes below.

Tuning was collected from this Mac's macOS 26A434: AID34, speaker ID 3, with per-unit calibration. The existing voicing gate passed; the compiler's macos-build-unvalidated warning for 26A434 remains.

On the final local build:

  • Provisioning and protection start automatically after reboot. The playback mux selects Secondary.
  • All twelve V/I sense switches are enabled and read back before any grant. All twelve telemetry channels carried data during active capture.
  • Kernel, wiring, voicing and live-graph verification passed. The graph locks 512 frames; five silent stream starts produced no xruns.
  • Listening is clean and balanced at a normal distance, at system volume 30% and player volume 50%.
  • All six amp fault registers remain clear. Playback and sense PCMs close at idle.

An earlier userspace build also passed idle suspend/resume, PipeWire restart, and helper/supervisor freeze tests with zero-sample playback. Freezing the helper caused withdrawal and all six amps to mute, observed at about 515 ms. Freezing the supervisor caused kernel lease expiry and mute, observed within 35 ms. Both recovered after resuming the process. These checks predate the final V/I initialization fix and need repeating on that build.

Userspace findings, separate from this kernel PR:

  • V/I initialization was missing in v2. The silent selfcheck enables the switches temporarily, then restores their previous states. On this machine all twelve remained off during normal playback. I fixed this locally in the supervisor's ownership setup: enable and verify the switches through the same control FD that owns protection, before granting; fail closed on initialization errors.
  • The initial Primary mux selection needs correcting. Local provisioning now selects Secondary with readback, leaving an already-correct route untouched.
  • Live verification could falsely pass with missing LV2 filter stages. The ALSA nodes existed even when the protection/voicing plugins failed to load. Verification now checks that the configured graph nodes actually loaded before running pilots.
  • NixOS packaging needed fixes: the installed gen.py policy path, setpriv/runuser in service PATHs, and registering v2 in PipeWire's LV2 plugin packages.

Those fixes are still local and uncommitted. Headphone switching, suspend during playback, sustained thermal/load testing and full-volume playback remain untested. No J604 hardware testing.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The speaker link binds but playback still waits for the protection lease, and the J604 keeps its speakers off. Small follow-up: the comment above the "apple,j614-macaudio" match entry still says the speakers are off until bring-up. Thanks for the second J614s result as well.

@RyanTheTide
RyanTheTide merged commit 8deaa1c into aurora-silicon:integration/aurora Nov 12, 2026
2 checks passed
mouthmantra added a commit to mouthmantra/linux-j614-sound that referenced this pull request Nov 23, 2026
The J614c (MacBook Pro 14-inch, M4 Max) kept its speaker card and six
SN012776 amps disabled, as the J614s did before aurora-silicon#1665 brought its
speakers up. The J614c has the same 14-inch chassis and speakers:
macOS on a J614c reports acoustic-id 34 (0x22), the J614s value, and a
six-record speaker-thiele-small.

Drop the disabled overrides so the J614c binds the J614 card
(apple,j614-macaudio, macaudio_j614_cfg) over the shared J614c/J616c amp
description. Protection is unchanged: playback still waits for a
speakerguardd v2 lease, and without it the amps stay at the floor.

Tested on a J614c with kernel-aurora 7.3.0-40 (9125b31) plus this
change: the Stage 2 trial committed, AppleJ614 binds with all six amps
and both protection interfaces, aurora-speaker-upgrade --check passes
with this Mac's AID34 tuning, and the speakers play under speakerguardd
v2.

Signed-off-by: mouthmantra <[email protected]>
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.

3 participants