Repository navigation
ASoC/arm64: the Mac mini M4 (J773g) speaker, behind the protection lease (stacked on #2236) - #2298
Open
DjDeveloperr wants to merge 4 commits into
Open
DjDeveloperr wants to merge 4 commits into
DjDeveloperr wants to merge 4 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/arm-io/i2c3/audio-speaker(0x38), mono,speaker-protection = 0, on the AOP's speaker stream.aurora-speaker-tuning compile --board j773gbuilds 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
senseDMA channel. Every user of the ring already handles its absence.spkrchannel, and the amp enabled with nosound-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) andcard 1: AppleJack.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