Skip to content

arm64: dts: apple: t8132-j604: enable the speakers - #1888

Merged
DjDeveloperr merged 2 commits into
aurora-silicon:integration/aurorafrom
aeries0x:j604-speakers-pr
Nov 14, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-silicon:integration/aurorafrom
aeries0x:j604-speakers-pr

Conversation

@aeries0x

Copy link
Copy Markdown
Contributor

Enables the internal speakers of the J604 (MacBook Pro 14-inch, M4): the speaker card and the six SN012776 amps in t8132-j604.dts, and enable_speakers in macaudio's J604 config. The device tree already describes the amps, their sense slots and the card; only the status = "disabled" lines and the "not brought up" comments go.

Safety on a stock install: macaudio keeps the J604's speaker volumes locked at its safe level until speakersafetyd takes them. speakersafetyd needs the J604 profile and its udev line, which come with speakersafetyd-aurora-profiles (aurora-silicon/alarm-aurora#311); that PR should be merged and shipped first. Without it the card appears, but the speakers stay at the locked level.

Tested on a J604 (Mac16,1, macOS 27.2 stub), this commit on integration/aurora 6df7569, with three test-only commits on top that are not part of this PR (a build without the TAS2770/MAX98357A selects, the AOP client without the low-power input, and a hard -20 dB cap on the speaker volumes); Stage 2 = Aurora's served aura 1.0.0b12.1 + U-Boot aurora11; root with Aurora's speakersafetyd 2.0.1-1.2 and the profile package from the PR above:

  • silent: udev starts speakersafetyd before the user session; it reads apple/j604.conf, finds the six speakers on hw:AppleJ604 (cold boot); macaudio logs "Speaker volumes unlocked"; amp gain 15 on all six (the speaker-config level aura passes from the ADT); V/I sense on; no amp faults.
  • audible, quiet (pink noise, 3 s per side, under the -20 dB cap): left then right heard in the right order; speakersafetyd picked up the stream and read the V/I sense, no amp fault, volumes stayed at the cap (the level was too low for it to need to reduce anything).
  • uncapped (a fourth test-only commit sets that cap to 0 dB, i.e. this PR's behaviour; with the J604 UCM file and the J314 tuning in asahi-audio): volumes at 0 dB after the unlock, music up to 75 % sink volume, no amp fault.

Userspace routing: like the J614s, the card needs Speaker Playback Mux = Secondary and the six slots mapped; a J604 UCM file for alsa-ucm-conf-asahi and the J314 tuning in asahi-audio do this (PRs follow this one). In the capped test above the mux was set by hand. macaudio could instead set the mux itself (spk_secondary_only, as for the j8xx/j7xx configs); we followed the J614s. Which do you prefer?

Assisted-by: LLM

The J604 (MacBook Pro 14-inch, M4) has the J614s's six SN012776 amps,
two woofers and a tweeter per side, on the AOP's speaker stream: six
playback and twelve sense slots in the J616s frame. Its device tree
already describes the amps, their sense slots and the speaker card,
all disabled so far.

Enable the card and the amps, and bind the J604's speaker link in
macaudio. The amps stay at macaudio's safe level until speakersafetyd
takes them with the J604 profile (speakersafetyd-aurora-profiles),
which starts it for the AppleJ604 card's sense PCM.

Assisted-by: LLM
Signed-off-by: Friedrich <261542475+aeries0x@users.noreply.github.com>

@DjDeveloperr DjDeveloperr 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.

Reviewed against this tree's speaker-safety rules:

  • Kernel side: this enables the card and the amps and sets enable_speakers, nothing else. macaudio keeps the SN012776 volumes at the lock's ceiling until a protection daemon holds "Speaker Volume Unlock", or a protection engine holds the lease, as on the J614s. With no J604 profile installed, the speakers stay locked, so this fails closed.
  • Protection: speakersafetyd with the J604 profile from alarm-aurora#311, which is still open. That profile is J504's. The J604's speaker amp configuration in its device tree matches the J504's and J614s's (speaker config, idle masks, DC blocker, brown-out config). The profile's sense channels follow the DT's slot order (LW1, RW1, LW2, RW2, LT, RT).
  • Measured on a J604: the daemon reads the V/I sense, with no amp faults in the quiet and the uncapped runs.

On the mux question: following the J614s, with the UCM setting Speaker Playback Mux, is fine.

Approving. macaudio.c has moved since CI ran here (#1856's K116s commit, and now #1884), so I'm updating the branch. It merges once host-tests and dt-checks are green on the new head. The audible path still depends on alarm-aurora#311, which needs its own review.

@DjDeveloperr
DjDeveloperr merged commit 1f5037a into aurora-silicon:integration/aurora Nov 14, 2026
2 checks passed
@davishann15-commits

Copy link
Copy Markdown

A second J604 data point, this time with speakerguardd v2 instead of speakersafetyd. This is the route the speaker team asked the j614s to take, and an Aurora maintainer suggested it to me for the J604 as well.

Setup: J604 (Mac16,1, os-fw 26.6.2, system-fw 27.0, aura 1.0.0b13); linux 2129f55 plus the equivalent of this PR plus tweeter_hpf_granted (now proposed in #1922); speakerguardd-v2 1.0.0alpha.1-40 and aurora-speaker-upgrade 0.1-0.14; the J604 UCM file of alsa-ucm-conf-asahi#17. I used neither a speakersafetyd profile nor asahi-audio.

  • ADT handoff: I checked the loader-built tree against this Mac's own ADT (/dev/mtd2ro).
    • One audio-control,sn012776 group under /arm-io/i2c3 (= i2c@3ad01c000), amps 0x38-0x3d in provider order LW1, RW1, LW2, RW2, LT, RT.
    • IRQ GPIO 14, SDZ GPIO 15, speaker-ID GPIOs 4/13, valid IDs 0 and 3 (this unit is 3), acoustic-id 30.
    • aura gave every amp its speaker-config row (level 15, slots matching ti,imon/vmon-slot-no) and its amp-tx-zd-config row (rows 0/1 = the DT idle masks), plus the group's DC-blocker and BOP blocks.
  • aurora-speaker-upgrade --check: PASS.
    • identity j604, AID30, tuning from this Mac's macOS 26C5035r (route 1)
    • compile, silent switch test
    • verify: wiring 164e7a0d23003bab (derived); voicing within +0.010/-0.102 dB of the 25G83 Audio Units
  • Switch: speakerguardd v2 owns the speakers, protection ready.
  • Listening: left/right correct, clean from 10 % up to 100 % sink volume, amps at 36 °C or below, no faults. It comes back by itself after a reboot.

On your mux question: with v2, the first switch hit the same PipeWire start problem as the j614s (#1591). The v2 graph opens hw:CARD=AppleJ604,DEV=1 while Speaker Playback Mux is still Primary:

spa.alsa: 'hw:CARD=AppleJ604,DEV=1': playback open failed: Invalid argument
default: failed to create context: Invalid argument

PipeWire then exits with status 234 and hits its start limit. Selecting Secondary by hand (and alsactl store) fixed it. Because PipeWire opens the PCM before WirePlumber applies the UCM verb, the UCM file alone doesn't prevent this on a first switch. So macaudio selecting the mux itself (spk_secondary_only) would avoid it for both stacks. That's the option I'd vote for.


Disclosure: an LLM (Claude) did most of the testing on my Mac and drafted this. I listened, reviewed it, and am responsible for it.

Assisted-by: LLM

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