Skip to content

ASoC: SN012776 amp setup and jack cap from the ADT (no bring-up hand values) - #981

Merged
RyanTheTide merged 5 commits into
integration/aurorafrom
nohand/audio-adt-ship
Nov 5, 2026
Merged

RyanTheTide merged 5 commits into
integration/aurorafrom
nohand/audio-adt-ship

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

No bring-up hand values for the SN012776 speaker amps and the CS42L84 jack. Every per-machine amp value now comes from the Mac's ADT, which aura copies onto each amp's DT node (aurora-silicon/aura #75):

  • tas2764: brownout + DC blockers from the DT. apple,bop-config → BOP_CFG0..BOP_CFG24 (the typed-in copy in the driver is gone); apple,amp-dcblocker-config → DC_BLK0/DC_BLK1. PVDD stays the BOP source. No property: reset values. Wrong length: probe fails (broken DT).
  • tas2764: idle sense slots from the DT. apple,amp-tx-zd-config → SDOUT_HIZ_1..4 + FORCE_0 at probe; it replaces the card's per-board TDM idle masks for that amp (bclk crop still applies). No property: unchanged.
  • macaudio: amp level per amp from the DT. Each SN012776's "Amp Gain Volume" limit is its own level from apple,speaker-config (row byte 1, low 5 bits). All SN012776 gains are gone from the board tables (including the three bring-up ones, J614s/J616s/J713). A speaker link whose amps don't all carry a level keeps its speakers off. Woofers keep the HPF corner the amps got from the ADT instead of a fixed "2 Hz"; tweeters keep the 800 Hz protection floor.
  • macaudio: every CS42L84 jack caps at the DAC's 0 dB (was -6 dB on J616s/J713 by a bring-up margin, +12 dB elsewhere). Cards without a CS42L84 jack are untouched (the earlier draft failed their probe).

On the M1 Pro, M2 and M4 Pro the ADT values equal what the tables had (level 15 on every amp, same brownout block), so limits don't move.

Order: aura #75 must be in the boot chain before a kernel with this runs, or SN012776 speakers stay off (fail-safe). The J616s Stage 2 and every distro's aura need the new aura before the next fleet kernel; the ref Macs' boot.bin too.

#922 (sgv2-kernel-interface): merging this into the sgv2 line conflicts in macaudio_set_speaker and the j316/j413 tables. Resolution (KUnit-tested) on branch n2/sgv2-nohand: the per-amp level becomes a fixed volume there (macaudio_fix_sn012776_levels), tweeters keep macaudio_speaker_hpf(), woofers keep the amp's corner. Follow-up: tweeter_hpf_granted = "2 Hz" should become the woofers' ADT corner.

Tests

  • KUnit (arm64 qemu): tas2764-bop 9/9 (BOP, DC blocker, idle slots: from DT, absent, short/long, not-SN012776), apple-speaker-amp-level 4/4, apple-speaker-pm-volumes 3/3, apple-speaker-admission 1/1 = 17/17.
  • W=1 clean on tas2764.o and macaudio.o; checkpatch 0 errors; dt_binding_check ti,tas27xx.yaml clean.
  • Hardware: M2 (J413) and M1 Pro (J316s), each with this aura as a one-shot Stage 2 trial (aura-try, 7.1 DTB set and U-Boot byte-identical) plus kernel 7.3.0-aurora-nohand2 (this PR's tip 4d8d55d):
    • DT: every amp node carries apple,bop-config / apple,amp-dcblocker-config (M2; absent on the M1 Pro, as its ADT has none) / apple,speaker-config / apple,amp-tx-zd-config, byte-identical to that Mac's ADT (4/4 and 6/6 amps).
    • Registers read back: BOP block, CHNL_0 (amp level 15), DC_BLK0/1 from the ADT on the M2 (woofers 2 Hz, tweeters 800 Hz floor), reset values kept on the M1 Pro, SDOUT_HIZ rows + FORCE_0 on the sense amps. "Amp Gain Volume" max 15 on every amp, as before.
    • Speakers at full volume, pink noise, speakerguardd 0.1 protecting: mic -8.5 dBFS on the M2 (fleet16 baseline -8.6 dBFS), -3.0 dBFS on the M1 Pro; PCM running, speakerguardd active, sense capture running, no audio kernel errors.
    • Jack: "Jack DAC Playback Volume" max 256 (0 dB; fleet16: 280), 3 s jack playback at max rc 0 on both.
    • SELinux enforcing, 0 AVCs, 0 failed units, dmesg err 0 on the M2; on the M1 Pro 2 spi-hid -110 lines, which show up in earlier fleet16/sgv2 boots too.
    • Both Macs back on fleet16 with aura b4 boot.bin unchanged and speakerguardd 0.1.

🤖 Generated with Claude Code

…he DT

The driver wrote a brownout prevention block typed in from a trace to
every SN012776, and left the DC blockers at their reset values. The
Mac's ADT carries both for each amp group (bop-config and
amp-dcblocker-config), and the boot loader now copies them to every
amp's node as apple,bop-config and apple,amp-dcblocker-config.

Program BOP_CFG0..BOP_CFG24 from apple,bop-config, and DC_BLK0 and
DC_BLK1 from the first two bytes of apple,amp-dcblocker-config (the
rest is padding), and drop the copy in the driver. PVDD stays the
brownout source on every SN012776, as before. Without a property its
registers keep their reset values; a property of the wrong length is
a broken device tree and fails the probe.

KUnit tas2764-bop (8 cases): each block is the property byte for byte,
absent means none, a wrong length fails, a TAS2764 ignores both.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Which of an SN012776's idle sense output slots drive zeros instead of
floating comes from per-board masks in the sound card's device tree
node. The Mac's ADT carries it per amp (a row of the group's
amp-tx-zd-config: one byte per eight slots from slot 0), and the boot
loader now copies each amp's row to its node as apple,amp-tx-zd-config.

With the property, program SDOUT_HIZ_1..4 from the row's first four
bytes and enable FORCE_0 at probe, and leave the card's idle masks
unused for that amp; the bit clock ratio still crops the mask to the
frame. An all-zero row leaves every idle slot in high impedance, as an
amp without a card mask has today. Like those masks, slots from 32 on
are not driven; a row that asks for them is warned about. Without the
property nothing changes.

KUnit tas2764-bop: tas2764_tx_zd (row to mask, absent, short row, not
a TAS2764 property).

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The driver limited every SN012776's "Amp Gain Volume" to a value from
its per-board table; three of those values (J614s, J616s, J713) were
picked at bring-up. The Mac's ADT gives each amp's operating level: the
second byte of the amp's row in its group's speaker-config, which the
boot loader now copies to the amp's node as apple,speaker-config.

Limit each SN012776's "Amp Gain Volume" to its own level from that row
(low five bits) and drop the SN012776 gains from the board tables. A
speaker link whose amps do not all carry a level in the amp's range
(an older boot loader) keeps its speakers off, as a model whose safety
the driver can't assure does. The woofers keep the playback high-pass
corner the amps were given from the ADT (apple,amp-dcblocker-config)
instead of a fixed "2 Hz"; the tweeters keep the 800 Hz protection
floor.

On the M1 Pro, M2 and M4 Pro every amp's ADT level is the level their
tables had, so their limits do not change.

KUnit apple-speaker-amp-level (4 cases): the level is the row's second
byte, out-of-range and short or absent rows are rejected, speakers need
every amp's level, no SN012776 board table carries a gain.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The J616s/J713 jack was capped 6 dB below the DAC's 0 dB by a margin
chosen at bring-up; the other CS42L84 machines had no cap and reached
the DAC's digital gain above 0 dB, which only clips. macOS's own
headphone volume ends at 0 dB on every machine whose audio
configuration we have collected. Drop the per-board value and cap every
CS42L84 jack at 0 dB. Cards without a CS42L84 jack have no such
control and are left alone.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
macaudio now leaves an SN012776 woofer's playback high-pass at the
corner the amp got from the Mac's ADT (apple,amp-dcblocker-config) and
only locks it, instead of setting "2 Hz". Expect the control to keep
the value it holds; tweeters still go to the 800 Hz floor.

macaudio-fixed-controls: 0 failures in 590 attempts with and without
CONFIG_SND_CTL_INPUT_VALIDATION.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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