Repository navigation
ASoC/arm64: the Mac mini M4 (J773g) speaker, behind the protection lease (stacked on #2236) - #2298
DjDeveloperr wants to merge 6 commits into
Conversation
The Mac mini has no microphones, so the AOP audio node was deleted; but like the M4 Pro Mac mini (J773s) its headphone jack is a CS42L84 on the AOP's jack back-end. Describe the jack's streams, "cout" and "cin" on base-ns ADMAC channels 4 and 5 (ADT audio-codec-output and audio-codec-input), with no "dma" channel so the AOP audio component attaches no microphone, and a jack card of its own. The speaker stays without a card. Signed-off-by: Diljit Singh <hey@djdev.me>
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>
|
Tested on the owner's Mac mini J773g with the macOS 27.2 (26B123) firmware (boot dcp8, 11-20). The kernel was 010c3eb, whose J773g speaker code and DT match this PR's head. The AOP was handed over by aura#418, with the 27.2
Retargeting to integration/aurora so the host tests and dt-checks run (a stacked PR gets neither). The diff now includes #2236, which this PR needs anyway. 🤖 Generated with Claude Code |
|
Blockers: 2. The no-sense speaker service is correct. sound/soc/apple/aop_spkr.rs:1683-1688 reads the
Nit: the PR body quotes a full-scale figure taken from the macOS tuning. Remove it: it is not needed to review the kernel side. The body's last line should be HW row: J773g on this head, default command line. One protected playback as already done. Then kill speakerguardd mid-stream: the stream stops and the amp reads back the floor within the lease. Restart it and the lease is taken again. Also one s2idle cycle with the card present. Pass needs 0 amp faults, 0 failed units, 0 AVC and 0 new kernel errors. Land #2236 first (this diff contains it). Assisted-by: LLM (Claude:Opus 5.5) |
One SN012776 on the AOP's speaker stream: the J616s/J713 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. Derive has_sense on AOP-fed cards from whether the speaker CPU DAI node names a "sense" DMA channel (matching aop_spkr), so J773g does not expose a broken Speaker Sense PCM and shares macaudio_j575c_cfg with J575c rather than duplicating the config struct. Update the spk_fixed_ceiling comment to document how no-sense models governed by a feed-forward protection daemon run at 0 dB under a lease and return to the muted floor via spk_lease_timer / spk_stop_worker / spk_expire_work if the daemon stops renewing. 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. Signed-off-by: Diljit Singh <hey@djdev.me>
eb26359 to
4defe7a
Compare
|
Addressed both blockers and the PR body nit (head
Local checks: per-commit Assisted-by: LLM (Gemini:4 Neon) |
On Macs whose AOP speaker stream has no V/I sense channel (such as the Mac mini M4, J773g), the audio node lists only "spkr", "cout", and "cin" in dma-names. Allow that combination in the binding. 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>
4defe7a to
5047b15
Compare
|
Fixed the Assisted-by: LLM (Gemini:4 Neon) |
|
Both points from the last review are on the head. |
There was a problem hiding this comment.
Verdict: HOLD at 5047b15c3.
Blockers:
sound/soc/apple/macaudio.c:193: The new comment promises that the amp reaches the floor within the lease window. On expiry, the timer closes the start gate and queues the stop and floor work. The floor worker can still wait on the speaker mutex and card power. Please describe the two timings separately and measure expiry-to-stream-stop and expiry-to-amp-floor on the reviewed stack. Exercise renewal loss with the owner still present as well as owner exit and s2idle. Owner exit can take the separate close/release path, so it alone cannot validate expiry. The existing low-volume playback row establishes admission during a lease.- Remove the AI attribution from the PR body. Resolve the base conflict after #2236 and rerun the protected-playback and regression checks on the resulting commit.
Checked: Read the diff and signed commit messages, the AOP binding alternatives, the DT channel ordering, the shared config and the lease stop/floor paths. The no-sense detection follows the DMA property, and the three channel names match the added schema variant. Hosted dt-checks and host-tests passed at the reviewed commit. The safety timing above remains unverified.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Closing this as stale. It has conflicted with main since 11-24, and the requested changes from 11-28 are still open:
These need J773g speaker-safety runs, and the PR is stacked on #2236, which hasn't landed. The branch stays. Reopen this PR, or open a new one, once #2236 is in and the speaker-safety row is done. |
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.Commits
senseDMA channel. Every user of the ring already handles its absence.has_senseon AOP-fed cards from whether the speaker CPU DAI node names a"sense"DMA channel (matchingaop_spkr), sharemacaudio_j575c_cfgfor J773g instead of duplicating the config struct, and update thespk_fixed_ceilingcomment to document how no-sense models governed by a feed-forward protection daemon run at 0 dB under a lease and return to the muted floor if the daemon stops renewing.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.has_sensederived fromdma-names, J773g no longer exposes a Speaker Sense PCM.macaudio.o,t8132-j773g.dtb).