Skip to content

ASoC/arm64: M5 Mac Studio speaker behind the protection lease (stacked on #2535) - #2536

Draft
RyanTheTide wants to merge 4 commits into
dtfill-t6050/studio-audiofrom
dtfill-t6050/studio-speaker-lease
Draft

RyanTheTide wants to merge 4 commits into
dtfill-t6050/studio-audiofrom
dtfill-t6050/studio-speaker-lease

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #2535 (Mac Studio audio, speaker off). Review the last four commits. Draft until a J775 row and a speakerguardd model for this Mac exist.

Problem

With the base PR the M5 Mac Studio's speaker stays off. Its AOP speaker stream has one TX slot and no RX slot, so V/I sense can't protect it. The only safe way to run it is the J773g path: playback waits for a protection lease that speakerguardd takes with a model for a speaker without sense.

Change

  1. dt-bindings (apple,t8152-aop-audio): an audio node may name only cout, cin, spkr (no sense), and apple,speaker-amps may be 1.
  2. t8152_aop_audio: apple,speaker-amps = <1> on T6050 selects the J873 stream shape: one amp in one 32-bit slot, nothing sent back. The sense DAI keeps its description, and with no sense channel it cannot be opened.
  3. DT: the Studio's audio node gets apple,speaker-amps = <1> and drops the sense channel. Nothing else changes in the J775c/J775d DTBs.
  4. macaudio: the J775 entry gets the -20 dB safe level and no fixed ceiling. The speaker is admitted, and playback waits for the lease (macaudio_spk_admitted()). With no lease it stays silent.

The DT commit comes before the macaudio one, so no commit admits the speaker while its stream still claims sense.

The speakerguardd side is aurora-silicon/speakerguardd#220: the T8142/T6050 transport reads the missing sense channel as "no sense", and the Mac is wired derived-nosense for one amp. It still needs a J775 (AID 47) tuning bundle before speakerguardd will take a lease.

Testing (buildbox, no hardware, nothing played)

  • KUnit (arm64 qemu, apple-speaker-*, built with CONFIG_RUST and the T8152 AOP audio driver): 60/60 pass. The J775 entry is admitted, has no fixed ceiling and no gain table.
  • DTBs: J775d changes only on the audio node (apple,speaker-amps, sense channel dropped), J714s identical. dt-validate against a schema built from this tree: 0 new messages on J775c, J775d, J714s, K114c, K116s, J813, J815.
  • dt-doc-validate clean on both bindings. rustfmt: no new diffs in the changed lines.

Still to run

  • J775c/J775d (no playback): the card probes with no speaker refusal in dmesg; Speaker Sense open fails with -ENODEV; speaker playback is refused with no lease.
  • Open question for that row: on the J773g the firmware ran six slots although its ADT lists one. If the J775 does the same, the stream shape here (one slot) must change before any protected playback.

Assisted-by: LLM (Claude:Opus 5.5)

…ense

On the M5 Mac Studio (J775c, J775d) the AOP's speaker stream carries one
amplifier's playback and no voltage/current sense: the ADT's audio-speaker
stream lists one TX slot and no RX slot. Allow the audio node to name only
the jack and speaker channels, and allow apple,speaker-amps = <1> for such
a stream.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T6050 default speaker stream is the J714s's: six amplifiers in 32-bit
slots and twelve 16-bit sense words back. The M5 Mac Studio's stream is the
J873's instead: one amplifier in one 32-bit slot and nothing sent back (the
same ADT audio-speaker description as the J873, J873s and J773g).

Accept apple,speaker-amps = <1> on T6050 for that shape (and <6>, the
default), keeping the J873's sense DAI description. The audio node of such
a machine names no "sense" channel, so the sense capture cannot be opened.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Describe the M5 Mac Studio's AOP speaker stream as it is: one amplifier
(apple,speaker-amps = <1>) and no "sense" channel, since the ADT's
audio-speaker stream lists one TX slot and no RX slot. A protection daemon
reads the missing "sense" channel as a speaker without V/I sense.

The J775c and J775d DTBs change only on the AOP audio node: the
apple,speaker-amps property and the sense DMA channel dropped.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The M5 Mac Studio's (J775c, J775d) speaker has no V/I sense: its AOP
speaker stream carries one TX slot and no RX slot, and the amp's
speaker-protection is 0. As on the J773g, run it behind the protection
lease: give the entry the -20 dB safe level, so macaudio admits the
speaker, and playback waits for a lease (macaudio_spk_admitted()), which
only speakerguardd takes, with a model for a speaker without sense. With
no lease the speaker stays silent. There is no fixed ceiling.

KUnit: the J775 configuration is admitted, has no fixed ceiling and still
carries no gain table.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Early note on this draft (no full review yet):

  1. sound/soc/apple/macaudio.c:4093 sets .safe_vol = -20 for the J775 as a fixed per-model number, and with spk_fixed_ceiling off a granted lease takes this no-sense speaker past it, with nothing in the kernel that comes from the machine to bound it. The level that protects this speaker has to come from the Mac: its speaker tuning, which speakerguardd already needs before it takes a lease, carried to the kernel through the DT the boot loader writes, or read from the amp's own reported control range. Without a value from the machine, keep enable_speakers off for this config (muted), rather than admitting it with a guessed level.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Closing: this admits the Studio speaker with a fixed level we chose; a replacement should take the limit from the Mac's own speaker tuning.

@RyanTheTide RyanTheTide reopened this Nov 22, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Reopened and kept as a draft; the comment above lists what it still needs before review.

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