Skip to content

ASoC/arm64: the Mac mini M4 (J773g) speaker, behind the protection lease (stacked on #2236) - #2298

Open
DjDeveloperr wants to merge 4 commits into
j773g/headphone-jack-20261119from
djdev/j773g-speaker
Open

DjDeveloperr wants to merge 4 commits into
j773g/headphone-jack-20261119from
djdev/j773g-speaker

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Stacked on #2236 (J773g headphone jack). Review the last four commits.

This adds the Mac mini M4's (J773g) internal speaker as a sound card. Its playback is gated: macaudio admits speaker playback only under a protection lease, and only speakerguardd v2 takes one. Nothing here plays sound unprotected.

The hardware

  • One SN012776 at /arm-io/i2c3/audio-speaker (0x38), mono, speaker-protection = 0, on the AOP's speaker stream.
  • The ADT's audio-speaker stream lists a TX channel (base-ns ADMAC 0) but no RX: there is no V/I sense.
  • The tuning is AID36. sgv2's reader finds its protection unit is atsp, one channel and no sense. aurora-speaker-tuning compile --board j773g builds its blob (development, from the 26B123 tuning: 1 channel, 0 sense, 11.9 V full scale). atsp is at parity in sgv2's shipped policy.

Commits

  1. ASoC: apple: aop_spkr: a speaker stream without a sense channel. The sense ring exists only when the node names a sense DMA channel. Every user of the ring already handles its absence.
  2. dt-bindings: sound: apple,macaudio: Add J773g.
  3. ASoC: apple: macaudio: add the Mac mini M4 (J773g) speaker. The J713 frame, one amp on slot 0, no sense, safe level -20 dB, playback behind the lease.
  4. arm64: dts: apple: t8132-j773g: the speaker. The card, the spkr channel, and the amp enabled with no sound-name-prefix. A mono speaker's controls go unprefixed; with the prefix, macaudio refused the card.

Testing (J773g, kernel 7.3.0 on the M4 mini stack)

  • card 0: AppleJ773g [Mac mini J773g] (Secondary = speaker) and card 1: AppleJack.
  • The speaker playback front-end opens; Speaker Sense refuses with -ENODEV.
  • No protection owner is present, so playback is not admitted. Nothing was played.
  • Builds on integration/aurora 0abc2f3 with arm64: dts: apple: t8132-j773g: the headphone jack #2236 (aop_audio, macaudio, the J773g DTB).

Still to do: provisioning speakerguardd v2 on the J773g, which needs the installer's collected AID36 bundle, then a protected playback test.

🤖 Generated with Claude Code

The speaker service always took a V/I sense ring, armed on the sense DMA
channel before every power-up. The Mac mini M4 (J773g) has none: its ADT
audio-speaker stream lists a TX channel only (its RX entry is unused), and
its amp's speaker-protection is 0. Its speaker would fail to start.

Give the speaker service its sense ring only when the audio node names a
"sense" DMA channel. Every user of the ring already handles a service
without one (the jack's); the sense front-end then fails to open with
-ENODEV, as it would without the channel.

Tested on a J773g: the speaker card binds with the "spkr" channel alone, its
playback front-end opens, and opening Speaker Sense fails with -ENODEV.
Nothing was played (playback waits for a protection lease).

Signed-off-by: Diljit Singh <hey@djdev.me>
The Mac mini M4 (J773g) has its own speaker configuration (one SN012776
without V/I sense on the AOP), unlike the M4 Pro Mac mini's J773.

Signed-off-by: Diljit Singh <hey@djdev.me>
One SN012776 on the AOP's speaker stream: the J713's frame (250 BCLKs of
12 MHz, six 32-bit playback slots, which the firmware runs whole), the amp
on the first slot, and no sense channel. Its playback waits for a
protection lease (macaudio_spk_admitted()), which only speakerguardd v2
takes, with a feed-forward unit compiled from the Mac's own tuning: the
J773g's AID36 graph protects the speaker with atsp, one channel, no sense.
Without the lease the speaker stays silent.

Tested on a J773g: the card "Mac mini J773g" registers with its Secondary
(speaker) playback device next to the jack's card; with no protection
owner, playback is not admitted. Nothing was played.

Signed-off-by: Diljit Singh <hey@djdev.me>
The speaker card: the AOP audio component's speaker back-end (DAI 3) to the
SN012776 (ADT /arm-io/i2c3/audio-speaker at 0x38), on base-ns ADMAC channel 0
("spkr", ADT audio-speaker; no "sense", its RX entry is unused). The amp is
enabled and takes no sound-name-prefix: a mono speaker's controls go
unprefixed, as macaudio expects (it refused the card with "Speaker HPF
Corner Frequency"). Playback waits for a protection lease.

Tested on a J773g together with the previous commits: card 0 "Mac mini
J773g" (speaker) and card 1 the jack. Nothing was played.

Signed-off-by: Diljit Singh <hey@djdev.me>
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.

1 participant