Skip to content

ASoC: restore DT tweeter HPF on grant and protect amp sense switches - #990

Merged
RyanTheTide merged 5 commits into
sgv2-kernel-interfacefrom
fix/sgv2-dcblocker-sense
Nov 5, 2026
Merged

RyanTheTide merged 5 commits into
sgv2-kernel-interfacefrom
fix/sgv2-dcblocker-sense

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

On J316, J413 and J616, a protection grant currently replaces the tweeter HPF with a literal “2 Hz”. Save each amp’s codec-loaded DT corner before applying the 800 Hz policy floor, then restore that value on grant. The SN012776 driver also explicitly programs DC_BLK0=0x01 and DC_BLK1=0x00 when apple,amp-dcblocker-config is absent, on every amp.

While Speaker Protection is owned, reject writes to every ISENSE/VSENSE DAPM switch from any other control file. An optional ALSA write-check callback supplies the caller identity before validation or the DAPM put callback, serialized with lock/unlock and file close. The owner keeps write access before, during and after a grant; unlocking protection releases the restriction.

KUnit covers DT corner capture/restore, the absent-property pair, sense control selection and owner authorization. The fixed-controls selftest exercises the actual ALSA write path with input validation both off and on (660 attempts each).

Validation at 87af9e9: fixed-controls passes (660 attempts per input-validation setting); ARM64 QEMU KUnit passes all 36 macaudio tests and all 9 TAS2764 tests. The ARM64 Apple MCA reference Image/modules/DTBs build also passes with Rust disabled; the Rust-enabled build encounters generated binding alignment assertions. Physical boot qualification is pending. The v2 selfcheck companion change issues sense writes on its grant-holding file.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

M2 (J413) hardware check, 2026-11-06, test kernel 7.3.0-aurora-sgv2xo1 (sgv2-kernel-interface + linux #990 + #993) with speakerguardd #70 + #67:

  • The self-check grant runs without a declaration: the kernel logs "No crossover declared: tweeter high-pass stays at the safe corner". The self-check passes, with sense written through the owner file.
  • v2 declares the crossover ("crossover declared to the kernel: true"; Speaker Protection Crossover = on), and the grant follows. DC_BLK0 reads 0x01, the DT corner, on all four amps.
  • Pre-stage in the live graph, with a -70 dBFS tone into the protect stage and its output captured: at 100 Hz the woofers are at -71.9 dBFS and the tweeters at -186.5 dBFS; at 3 kHz the woofers are at -88.3 and the tweeters at -83.3.
  • 0 amp faults, 0 AVC (enforcing). The M2 is restored to fleet17 with speakerguardd 0.1.

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 5, 2026 15:06
@RyanTheTide
RyanTheTide merged commit e665695 into sgv2-kernel-interface Nov 5, 2026
@RyanTheTide
RyanTheTide deleted the fix/sgv2-dcblocker-sense branch November 5, 2026 15:07
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