Skip to content

ASoC: apple: enable J716c (16-inch M5 Max) AOP audio, v2-only speakers, jack and mic array - #3085

Merged
RyanTheTide merged 11 commits into
mainfrom
feat/j716c-speakers
Nov 29, 2026
Merged

RyanTheTide merged 11 commits into
mainfrom
feat/j716c-speakers

Conversation

@erikwb

@erikwb erikwb commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What: Add v2-only speaker ownership (spk_v2_only, "apple,j716-macaudio") to macaudio, and enable AOP audio, six SN012776 speaker amplifiers, CS42L84 headphone jack, and the internal mic array on J716c (16-inch M5 Max).
Tested: Offline checks at 823c2aa35eb6 (origin/main b48f89158d7c forward-merged at 324ca3a7ddee + macaudio-fixed-controls.py update at 823c2aa35eb6; all runtime audio/DT hunks unchanged vs c14d2f103d25; full details, hashes, and earlier 952e45d7f622/fa6ca3bf0e0b/31a8aca83305 runs in Evidence):

  • Offline at 823c2aa35eb6 (and 324ca3a7ddee): tools/testing/selftests/alsa/macaudio-fixed-controls.py PASS (validation=0 and validation=1, 678 attempts each, 0 failures), arm64 QEMU KUnit (sound/soc/apple/macaudio.kunitconfig) 82/82 passed, tools/asahi/run-host-tests.py 764/765 passed (unrelated apple-dcp 94/96 pre-existing failures only); at 324ca3a7ddee (identical audio/DT tree): dt_binding_check (sound/apple,macaudio.yaml) 0 warnings, CHECK_DTBS=y apple/t6050-j716c.dtb 0 warnings on added audio/I2C/AOP/ADMAC/sound nodes, LLVM=1 ARCH=arm64 W=1 sound/soc/apple/ 0 errors / 0 warnings, and git diff --check clean.
  • J716c (M5 Max, T6050, fw 27.2) at c14d2f103d25: batched 3545ebecb76f (6/9 blob-identical, 2/9 PR hunks present, 1 comment-only merge in macaudio-admission-test.h — runtime hunks verified, default cmdline): AppleJ716HPAI + AppleJ716 (50 controls, legacy unlock/interface absent, all 6 volumes at 0 floor), quiet 5 s -36 dBFS protected playback via speakerguardd-v2 granted 0 -> 201 and returned cleanly to 0 mute (0,0,0 faults; counted 923/923 V/I records belong to 952e45d7f622), 2 s 3-ch mic capture clean, 0 kernel audio errors, 6-item smoke pass (aurora-peripherals.service warm-reboot baseline failure also on default/control).
  • J713 (M4 Air, T8132, fw 27.2) at c14d2f103d25: batched 76649338a1bc (8/9 blob-identical, t6050-j716c.dts hunks-present, default cmdline + panic=10): AppleJ713HPAI, AppleJack, AppleJ713 enumerated, speakerguardd-v2 protected tone rc 0, 0 audio errors, 8-item smoke pass (0 failed units, 0 AppArmor denials).
  • J313 (M1 Air, T8103) at c14d2f103d25: batched Group A (main + 9 PRs, parity-identical per PR against main, undocked): boot smoke (0 AVC denials, baseline speakerguardd-v2-switchtest.service failure also on main), 3x DPMS, 2x deep S2R pass (unisolated ISP capture failed after 1st deep resume on Group A vs passed after 1st deep resume on baseline main, tracked under #3329; no speaker playback run).
    Risk: one-way door (DT binding compatible "apple,j716-macaudio" and J716c v2-only speaker enablement) · J716c (T6050) plus shared macaudio across Apple Silicon Macs.
    Not yet: Loud or sustained speaker playback on J716c (only quiet 5 s plays ran at c14d2f103d25 and 952e45d7f622); physical jack insertion detection on J716c (jack controls read off with nothing plugged in); speaker or jack playback on J713 (protected tone via sgv2.voicing ran at c14d2f103d25, not full speaker/jack hardware characterization) or J313 (and untested on M1/M2/M3/M4 Pro/Max speaker playback); companion PR aurora-silicon/speakerguardd#259 (open) for J716c fixture packaging (on the 2026-11-28 J716c boot, the PR's speakerguardd-selfcheck run passed wiring cbba18ec53f0a442, while verify voicing refused against the older installed rendering library and no mic-3ch plugin or /var/lib/speakerguardd/mic.bin blob is installed on the Mac yet).
    Revert: Revert the PR commits (or git revert -m 1 on the merge commit after landing). Kernel driver, DT, binding, and KUnit changes only; no persistent ESP, Stage 2, or on-disk state is modified, so rebooting or rebinding returns J716c to jack-only without speaker support.
Details

Audio/DTS feature commits plus forward merges from main (b48f89158d7c) and two reverts splitting the PMP/pmc.c changes out into a separate power PR so the net diff against main (10 files changed, 764 insertions(+), 88 deletions(-)) touches only audio/speakers/jack/mic array files and the ALSA fixed-controls selftest:

  1. d64ac3782ae9 (ASoC: apple: macaudio: add v2-only speaker ownership and the J716 (16-inch M5 Max)):
    • Adds spk_v2_only capability and "apple,j716-macaudio" binding/match: drops the two legacy speaker controls (Speaker Volume Unlock and Speaker Protection Interface, MACAUDIO_NUM_LEGACY_SPEAKER_CONTROLS = 2) while retaining Speaker Protection (v2 lease), Speaker Protection Sleeps (merged from main), Speaker Sample Rate, and the dynamically added Speaker Protection Crossover and Speaker Variant ID controls; binds directly in MACAUDIO_SPK_IFACE_LEASE at hardware mute (0), fixes each amp's gain at its boot-loader limit in macaudio_fixup_controls(), refuses PCM start without an active lease, rejects legacy unlock/interface transitions with -EOPNOTSUPP, and never reverts to unlock mode after owner loss.
    • Resets per-bind speaker protection state and control arrays on card removal/rebind (macaudio_card_remove() / macaudio_late_probe()) so component rebind preserves the cold-bind mute floor.
    • Requires boot-loader apple,amp-dcblocker-config (>= 2 bytes) alongside apple,speaker-config before admitting speakers (leaving the headphone jack usable if speaker admission fails).
    • Derives the tweeter safe high-pass corner from the codec's advertised HPF Corner Frequency enum items via macaudio_hpf_safe_item() instead of hardcoding a literal (applies to all speaker Macs; unchanged at 800 Hz on current codecs).
    • Extends apple-speaker-* KUnit suites (78 speaker subtests plus 4 apple-mca-capture-sync subtests under CONFIG_OF_OVERLAY=y).
  2. 31a8aca83305 (arm64: dts: apple: t6050-j716c: enable AOP audio, speakers, jack and mic array):
    • Enables i2c1/i2c2/i2c3, AOP (aop, aop_mbox, aop_setup_mbox, aop_dart), admac-base-ns/admac-ec-proxy, aop_audio, six SN012776 amps (apple,sdz-group-fail-closed, ti,bclk-ratio = <250>, V/I sense slots 0/2..20/22, disjoint active TDM idle-zero masks 0xfff0f0f0/0xff0f0f0f), CS42L84 jack codec (i2c2@4b), and "apple,j716-macaudio" with speaker-id-gpios.
  3. 272977113bc0, fa6ca3bf0e0b, c14d2f103d25, & 324ca3a7ddee (Merge branch 'main' into feat/j716c-speakers):
    • Forward merges bringing in main (ee36fbdcd1c8, then b48f89158d7c, including aurora-silicon/linux#3084, #2587, #3479, #3480, #3484, #3557, and 20e759f912ac).
    • At c14d2f103d25, keeps spk_legacy_selected = false on non-spk_v2_only card binds, orders Speaker Protection Sleeps (MACAUDIO_NUM_COMMON_CONTROLS = 3, MACAUDIO_NUM_SPEAKER_CONTROLS = 5) ahead of the two trailing legacy controls (MACAUDIO_NUM_LEGACY_SPEAKER_CONTROLS = 2) with BUILD_BUG_ON verification so spk_v2_only retains Speaker Protection Sleeps while dropping the legacy controls, drops the removed macaudio_k114_cfg, and updates macaudio_iface_v2_only_never_leaves_lease in macaudio-iface-test.h for macaudio_slk_lock() returning -EPERM without spk_legacy_selected.
    • At 324ca3a7ddee, merges origin/main (b48f89158d7c), keeping both main's positive J704 assertion/comment (#3557) and #3085's J716 v2-only assertions in sound/soc/apple/macaudio-admission-test.h, with all runtime audio and DT code unchanged vs c14d2f103d25 (only macaudio_j704_cfg from origin/main in macaudio.c).
  4. 823c2aa35eb6 (selftests: alsa: update macaudio-fixed-controls for dynamic HPF selection):
    • Updates tools/testing/selftests/alsa/macaudio-fixed-controls.py to extract macaudio_hpf_safe_item() (with simple_strtoul) and macaudio_set_fixed_hpf() instead of the removed macaudio_enum_item(), and adds dynamic unordered highest-Hz (1600 Hz) coverage to hpf_scenario() alongside all existing fixed-control, sense, route, and DT corner assertions.
  5. d5f374213e9f (Revert "pmdomain: apple: pmc: probe without PMP when supplier lacks loader properties") & 952e45d7f622 (Revert "arm64: dts: apple: t6050-j716c: enable the PMP"):
    • Reverts 830c90c8f223 (drivers/pmdomain/apple/pmc.c) and a0f72aa06305 (arch/arm64/boot/dts/apple/t6050-j716c.dts pmp0 / ps_pmp / ps_pms* / apple,static-voters / apple,pmp) without rewriting branch history so both move together into a separate power PR and drivers/pmdomain/apple/pmc.c plus J716c PMC/PMP DT nodes match main.

Companion PRs:

  • aurora-silicon/linux#3084 (t8152_aop_audio SenseRing fix): merged (cec55b3701d5)
  • aurora-silicon/aura#506 (T6050 pmp0 ADT handoff): merged (58dc33f4b283)
  • aurora-silicon/alsa-ucm-conf-asahi#30 (J716 UCM profiles): merged
  • aurora-silicon/speakerguardd#259 (J716c fixture + AID41 playback row): open
Evidence
  • Head SHA: 823c2aa35eb6 (forward merge 324ca3a7ddee of origin/main b48f89158d7c onto c14d2f103d25, plus 823c2aa35eb6 updating tools/testing/selftests/alsa/macaudio-fixed-controls.py; runtime audio/DT hunks unchanged vs c14d2f103d25, where live hardware ran).
  • Offline checks at 823c2aa35eb6 (and 324ca3a7ddee):
    • python3 tools/testing/selftests/alsa/macaudio-fixed-controls.py: PASS (validation=0 attempts=678 failures=0, validation=1 attempts=678 failures=0, exercising macaudio_hpf_safe_item(), macaudio_set_fixed_hpf(), macaudio_spk_take_hpfs(), macaudio_spk_set_hpf(), macaudio_set_speaker(), and macaudio_protect_sense()).
    • arm64 QEMU KUnit (./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=sound/soc/apple/macaudio.kunitconfig): 82 passed, 0 skipped, 0 failed (apple-mca-capture-sync 4/4 PASS, apple-speaker-admission 2/2 PASS, apple-speaker-protection 34/34 PASS, apple-speaker-hpf 12/12 PASS, apple-speaker-pm-volumes 3/3 PASS, apple-speaker-volume-unlock 11/11 PASS, apple-speaker-interface 10/10 PASS, apple-speaker-amp-level 6/6 PASS).
    • python3 -I tools/asahi/run-host-tests.py: 764/765 passed (apple/aop-als, apple/aop-las, apple/aop-motion, aop-service-tests, hardware-defaults-tests, etc. all pass; only apple-dcp exited 1 on 2 unrelated pre-existing tests: same-handle-srcu-index, mux-release-stages).
    • make ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=sound/apple,macaudio.yaml (324ca3a7ddee, binding unchanged at 823c2aa35eb6): PASS (0 warnings).
    • make ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t6050-j716c.dtb (324ca3a7ddee, DT unchanged at 823c2aa35eb6): 0 warnings on added audio/I2C/AOP/ADMAC/sound nodes (only pre-existing opp-table-gpu-afr, opp-table-gpu-cs, pcie@1c50000000, pcie@1c60000000 warnings).
    • make ARCH=arm64 LLVM=1 W=1 sound/soc/apple/ (defconfig + asahi.config, RUST=n, 324ca3a7ddee, sound/soc/apple/ unchanged at 823c2aa35eb6): PASS (0 errors, 0 warnings).
    • git diff --check origin/main..HEAD clean; git merge-tree --write-tree origin/main HEAD clean (2c617703c9d5 at 324ca3a7ddee; 823c2aa35eb6 touches only tools/testing/selftests/alsa/macaudio-fixed-controls.py).
    • ./scripts/checkpatch.pl --strict --git origin/main..HEAD: 0 errors, 0 warnings, 0 checks on the revert commits (./scripts/checkpatch.pl --strict --file tools/testing/selftests/alsa/macaudio-fixed-controls.py 0 errors, 1 pre-existing line-5 filename warning; at c14d2f103d25, 6 pre-existing warnings on d64ac3782ae9: 3 line-length >100 in test headers, simple_strtoul, DT binding patch-split notice, 1 unwrapped commit description line).
  • Live hardware runs at c14d2f103d25 (2026-11-28; all PR runtime audio/DT hunks unchanged at 823c2aa35eb6):
    • J716c (16-inch M5 Max, T6050, firmware 27.2): batched kernel 3545ebecb76f (origin/main b897ccb4e71c + 18 PRs, CONFIG_ARM_APPLE_SOC_CPUFREQ=m, AC power, default command line):
      • Hashes: Image.gz SHA-256 d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312, t6050-j716c.dtb SHA-256 d2f0db7a5026ae9cc4e1cff61dca38b4d1b363d47e5bad696ef65c7d715517e0, modules SHA-256 9d5782bcf02ea60a225278c9319431f902b495f6beb485d79d127c0fb2fccc92, one-shot aura-try Stage 2 SHA-256 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d (default Stage 2 21edee972e1ff1718c6f41c32b91ee151afdc58cbb69f16f2f6a4d8d4c722170, default kernel bf2582ab357573db64031f39e7bc9d617eb574c6b221364ff417810bbddf4c87, default DTB ffe7604c98ad23849b2aff19eb161bec712f8b367a9bc87339fabb6d7dc1276c unchanged).
      • Parity: c14d2f103d25 is an ancestor of 3545ebecb76f; 6/9 changed files are blob-identical, 2/9 have all PR hunks present (t6050-j716c.dts, macaudio.c), and 1 (sound/soc/apple/macaudio-admission-test.h) had a comment-only conflict with main b897ccb4e71c (keeping both J704 and J716 v2-only wording); all runtime audio/DT hunks were verified and match c14d2f103d25 (and 823c2aa35eb6).
      • Audio: AppleJ716HPAI (aop_audio) and AppleJ716 (macaudio) enumerated; amixer -c AppleJ716 controls lists 50 elements including Speaker Protection (0..100, 0 at idle), Speaker Protection Sleeps (read-only, 4), Speaker Sample Rate, and Speaker Variant ID; legacy Speaker Volume Unlock and Speaker Protection Interface absent (Cannot find the given element). All 6 speaker volumes 0 at idle (floor); all 6 Amp Fault Status 0,0,0.
      • Protected playback (speakerguardd-v2 active, protection ready): verifies quiet protected playback and return to mute — 5 s 440 Hz -36 dBFS tone at 0.30 stream volume to sgv2.voicing.j716; Speaker Protection 0 -> 1 and all 6 speaker volumes 0 -> 201 during play and returned cleanly to 0 mute after ~10 s idle (protection granted, 0 frames over capacity, no release/fault/refusal, amp faults 0,0,0; first play's lease sample was missed by the sampling script though kernel/journal lines were clean; second play captured the lease values; the counted 923/923 V/I sense records belong to the earlier 952e45d7f622 solo trial run below). Kernel logged only Speaker protection granted / withdrawn: released by the owner pairs.
      • Mic capture (arecord, 2 s, 3 channels, 48 kHz float on AppleJ716HPAI): 96,000 frames/ch (88,730 non-zero ch 0/2, 88,728 ch 1; -98.0 / -98.5 / -98.9 dBFS, quiet room). 0 kernel errors from macaudio, t8152_aop_audio, MCA, or ADMAC.
      • Smoke: eDP-1 3456x2234@120 enabled, 4 input devices, wlan0 gateway ping 0% loss, Borealis Apple M5 Max (G17C B1) + vkcube --c 180 OK, 0 failed user units, 0 LSM denials, 0 Oops/BUG/fault; 1 failed system unit (aurora-peripherals.service: vendor firmware handoff failed on every warm reboot of the session including control and restored default, though not on the initial long-uptime boot); 40 err+ lines (apple-dcp unable to match service and systemd-gpt-auto-generator /dev/root), all present on the 55-line default boot.
    • J713 (M4 MacBook Air, T8132, firmware 27.2): batched kernel 76649338a1bc (J713 default kernel source 8dbfa2895b93 + PRs; default cmdline + panic=10):
      • Hashes: booted kernel image SHA-256 e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491, one-shot Stage 2 SHA-256 f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa, DTB ceacf1d413c651396f4c1dfd9fa27b15c710dd849e46c2753fcff0a23a6681c6. Parity: c14d2f103d25 is an ancestor; 8/9 files blob-identical (7/8 runtime), t6050-j716c.dts hunks-present.
      • Shared-macaudio: /proc/asound/cards lists AppleJ713HPAI (aop_audio), AppleJack (macaudio), and AppleJ713 (macaudio); aplay -l lists card 1 (MacBook Air J713 Jack) and card 2 (MacBook Air J713); speakerguardd-v2 active, 1 s 440 Hz -26 dB protected-sink tone (sgv2.voicing) rc 0, 0 audio errors.
      • Smoke: eDP-1 2560x1664@60 enabled, MTP keyboard/trackpad enumerated, wlan0 gateway ping 0% loss, Borealis Apple M4 (G16G B0) glmark2 5,099, 0 failed units, 0 AppArmor denials; 4 err+ lines: 3 baseline (AFK[ep:20], unsupported DFB layout 2560x1664, apple_sep notice) plus 1 brcmfmac ... ring 4: r_ptr 0 outside depth 0 line (also observed on the default kernel boot in Part 2).
    • J313 (M1 MacBook Air, T8103): batched Group A (main + #3085, #3290, #3329, #3333, #3495, #3506, #3546, #3289, #3320, undocked on battery, all PR changed files parity-identical against main), kernel SHA-256 888c041944da96032a9252504c4d5543b906fd98717234eca5e091150af85798, one-shot Stage 2 SHA-256 949dc089ed390b7535dd5ef2a6e99975c3026658e58dbd9d17e9b20d2bbb7d71:
      • Boot smoke pass (eDP-1 enabled, keyboard/trackpad registered, wlan0 gateway ping OK, audio cards/sinks enumerated without speaker playback, Borealis Apple M1 (G13G B1) compute/render OK), 0 AVC denials, 1 failed unit (speakerguardd-v2-switchtest.service, also present on baseline main ee36fbdcd1c8 SHA-256 f750b04aebd30c439edbd3b995c17b3fd9ad805a4561dadc7ecbf78040c89289), 3x DPMS off/on pass, 2x deep S2R (rtcwake -d rtc1 -m mem -s 30) pass (0 Oops/BUG/WARN). Post-S2R ISP capture failed after the 1st deep resume on Group A (apple-isp firmware boot -19, DART translation fault) vs passed after the 1st deep resume on baseline main (unisolated, tracked under #3329).
  • Offline checks at earlier head 952e45d7f622:
    • arm64 QEMU KUnit (./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=... 'apple-*'): 104 passed, 0 skipped, 0 failed (apple-admac-position 5/5 PASS, apple-admac-realign 3/3 PASS, apple-pmc 17/17 PASS, apple-mca-capture-sync 4/4 PASS, apple-speaker-admission 2/2 PASS, apple-speaker-protection 34/34 PASS, apple-speaker-hpf 12/12 PASS, apple-speaker-pm-volumes 3/3 PASS, apple-speaker-volume-unlock 9/9 PASS, apple-speaker-interface 9/9 PASS, apple-speaker-amp-level 6/6 PASS).
    • make ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=sound/apple,macaudio.yaml: PASS (0 warnings); make ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t6050-j716c.dtb: 0 warnings on added audio/I2C/AOP/ADMAC nodes; ./scripts/checkpatch.pl --strict --git fa6ca3bf0e0b..HEAD: 0 errors, 0 warnings, 0 checks.
  • Prior live J716c (T6050) protected playback at 952e45d7f622 (one-shot trial boot of the PR head alone, Linux 7.3.0, default command line, default Stage 2, AC 100%, pmp@284e00000 disabled):
    • Boot: single boot ID; 0 panics/Oops/BUG/WARNING/SErrors; only the pre-existing aurora-peripherals and systemd-networkd-wait-online units failed. Live DT /proc/device-tree/soc@200000000/pmp@284e00000/status = disabled, no PMP platform device.
    • Audio: snd_soc_t8152_aop_audio auto-loaded; aplay -l / arecord -l list AppleJ716 (playback 0, 1; capture 0, 2 Speaker Sense) and AppleJ716HPAI (Microphone Array); amixer -c AppleJ716 controls: 49 elements; cget iface=MIXER,name="Speaker Protection" = 0..100, value 0 at idle; cget of Speaker Volume Unlock and Speaker Protection Interface: Cannot find the given element. Idle: all six Speaker Volume controls 0, all six Amp Fault Status 0,0,0.
    • speakerguardd v2 (installed speakerguardd-v2 1.0.0alpha.2-5; J716 PipeWire/WirePlumber files match aurora-silicon/speakerguardd#259 3b4decf0c351): gate j716c (spp3) is gated for v2 and the kernel has the v2 interface on AppleJ716; compiled AID41 (blob bfbbd9fc8008, 6 channels, 12 sense, 48 kHz, unit calibration in use); silent switch test passed (wiring cbba18ec53f0a442, params bfbbd9fc8008); supervisor V/I sense initialized: 12 switches enabled and read back, protection ready: every check holds.
    • Playback (pw-play --target sgv2.voicing.j716, 440 Hz stereo sine, -36 dBFS RMS, -33 dBFS peak, 5 s, slider 0.30, restored to 0.15 after):
      • Run 1: protection granted, 949 records, health_or = 0x0, lost = 0, sense_delay = 1664; during play Speaker Protection = 1 and all six speaker volumes 201; faults 0,0,0 on all six amps; released after idle back to 0 floor.
      • Run 2: 923 records, 923/923 with non-zero V and I on all 12 sense channels, health_or = 0x0, lost = 0, sense_delay = 1664, gain 0 dB, faults 0,0,0 on all six amps. At +7.35 s after grant (2.2 s after pw-play exited, while draining silence), pipewire logged spa.alsa hw:CARD=AppleJ716,DEV=2c: follower delay:4344 target:1024 thr:512 resample:0, resync and audioconvert ... out of buffers on port 0 2 (running at normal scheduling priority due to RTKit ... ServiceUnknown), causing an 80 ms heartbeat gap (heartbeat_fresh: false); speakerguardd released and re-granted after +300 ms, while the kernel refused 2 speaker starts in between and logged zero errors.
    • dmesg across both runs: only Speaker protection granted / withdrawn: released by the owner lines; 0 timeouts, failures or xruns from macaudio, t8152_aop_audio, MCA or ADMAC.
    • Mic capture after playback (arecord -D hw:AppleJ716HPAI,0, 3 channels, 48 kHz float, 2 s): 96,000 frames/ch, 88,738 non-zero/ch, RMS -94.3 / -94.0 / -94.7 dBFS (quiet room; discarded).
  • Prior live J716c (T6050) candidate boots at 952e45d7f622 (c3da8eed6f72 and f59b93fb961f, over main 9af21b007425, Linux 7.3.0, default command line, default Stage 2, AC 100%, pmp0 disabled):
    • 0 panics/Oops/BUG/SErrors/DART faults/GPU faults/WARNING/LSM denials; Borealis Apple M5 Max (G17C B1), /dev/accel/accel0, eDP-1 3456x2234@120; AppleJ716HPAI + AppleJ716 enumerated, Headphone Jack and Headset Mic Jack off (unplugged), Speaker Variant ID (0), v2 Speaker Protection present, legacy controls absent; 2 s 3-channel 48 kHz mic capture (96,000 frames/ch, 88,738 non-zero/ch) clean.
  • Prior live J713 (M4 Air, T8132, firmware 27.2) shared-code regression at 952e45d7f622 (batched candidate b3dbf237542b over main 9e38a276dcb4, Linux 7.3.0, default cmdline, default Stage 2): AppleJ713HPAI (capture), AppleJack (playback/capture) and AppleJ713 (playback, Speaker Sense capture) enumerated; snd-soc-macaudio bound with Speaker protection interface: Speaker Protection (lease); Speaker Volume Unlock refused; 0 macaudio/mca/admac/snd_soc errors; no playback ran.
  • Earlier-head live hardware runs (fa6ca3bf0e0b and 31a8aca83305, dated 2026-11-24 to 2026-11-27):
    • J716c (fa6ca3bf0e0b in candidate 3e4078f656d5, PMP enabled): clean desktop boot, dEQP-VK.ssbo.* 7,940/7,940 Pass, AppleJ716/AppleJ716HPAI up, 3-ch mic capture clean, 0 new failed units, 0 LSM denials.
    • J713 (fa6ca3bf0e0b in 90de523e9ed9): snd_soc_macaudio bound cleanly, 0 failed units, 0 AppArmor denials; deep sleep rtcwake -d /dev/rtc1 -m mem -s 15 reset with PMU panic counter 1 (also reproduced on main fcb124279183).
    • J716c (31a8aca83305, candidate a60c110f35e0, + #3084 5f1321879f34, Stage 2 1.0.0b17-gae94218e): speakerguardd-v2.service active (AppleJ716: v2 interface only, wiring cbba18ec53f0a442, params bfbbd9fc8008), gpubench-vk 18/18 ok, dEQP-VK.api.smoke.* 6/6 Pass, 0 new kernel errors, 0 AVC lines.
    • J716c (#3085 31a8aca83305 + #3084 26f1ac62bcbd + aura#506 2eb142fe): PMP running (status 0x1), speakerguardd-selfcheck verify 4/4 PASS (5 silent pilot starts, no xrun), 6/6 L/R 200 Hz alignment bursts (shift == 0, health_or = 0x0, 0,0,0 faults on all 6 amps) across 13 s idle and mid-burst kill -9 (Speaker protection withdrawn: owner gone -> re-granted with 1 speaker starts refused before).
    • J716c (prior #3084 c3feb10d6265 + same macaudio/DTS commits + aura#506): full 420 s AID41 0.3/0.6/1.0 ladder (39,762 rows, lost = 0, health_or = 0x0, 0,0,0 faults across all 6 amps), 3-ch AppleJ716HPAI mic capture [-39.2, -35.9, -36.5] dBFS, kill -9 re-grant in 1.254 s.
    • J713 (31a8aca83305, one-shot GRUB trial): 0 failed units, 0 AppArmor denials, 0 new kernel errors/warnings, snd-soc-macaudio, apple-pmc, and apple_soc_cpufreq bound cleanly.

…-inch M5 Max)

Add a v2-only speaker ownership capability (spk_v2_only) to macaudio and
wire the J716 (16-inch M5 Pro/Max) compatible ("apple,j716-macaudio") to it:

- Expose only "Speaker Protection" (v2 lease) and "Speaker Sample Rate";
  omit the legacy "Speaker Volume Unlock" and "Speaker Protection Interface"
  controls. Bind directly in MACAUDIO_SPK_IFACE_LEASE at hardware mute (0)
  with each amp's gain fixed at its boot-loader limit in
  macaudio_fixup_controls(), refuse PCM start without an active lease,
  reject legacy unlock/interface transitions with -EOPNOTSUPP, and never
  revert to unlock mode after owner loss.
- Reset per-bind speaker protection state and control arrays on card
  removal and rebind so ASoC component rebind does not reuse stale counts
  or skip the cold-bind mute floor.
- Do not require a dummy safe_vol on v2-only digital-gain amps whose
  ungranted floor is hardware mute (0), and require per-amp
  apple,amp-dcblocker-config (>= 2 bytes) from the boot loader alongside
  apple,speaker-config before admitting speakers (leaving the headphone jack
  available if speaker admission fails).
- Derive the tweeter safe high-pass corner from the codec's advertised
  "HPF Corner Frequency" enum items (highest "<N> Hz" corner) instead of
  hardcoding a frequency literal.
- Extend the apple-speaker KUnit suites to cover v2-only admission,
  DC-blocker admission checks, permanent lease-only ownership, component
  rebind mute floor, and codec-derived safe HPF selection.

Signed-off-by: Erik Bourget <[email protected]>
…operties

When a board DT leaves PMP calibration and identity properties
(apple,board-id, apple,dram-vendor-id) to the boot loader and references
that PMP from PMC via apple,pmp, booting under an older loader causes
apple_pmp to fail probe permanently with -EINVAL. Deferring PMC on that
supplier would keep PMC and its CLPC child (cpufreq) from probing at all.

Check that an apple,pmp supplier carries apple,board-id and
apple,dram-vendor-id before linking and deferring on it. When they are
absent, log once, skip the PMP supplier link and omit PMP agent 0 from
static_agents so PMC and CLPC keep running as before.

Signed-off-by: Erik Bourget <[email protected]>
Enable pmp0, pmp0_report, pmp0_dart, pmp0_mbox, their power domains, and
the PMC static voters on J716c. Leave apple,board-id, apple,dram-vendor-id,
apple,pmc, apple,pmc-pmgr, and apple,tunable-* to the boot loader so every
unit runs on its own ADT values rather than compiled-in tunables.

The AOP audio firmware requires the PMP to bring up its LEAP power domains
so the audio controller reaches systemReady.

Signed-off-by: Erik Bourget <[email protected]>
…mic array

Enable i2c1, i2c2, i2c3, the audio GPIOs on pinctrl_ap, the AOP,
admac-base-ns, admac-ec-proxy, aop_audio, six SN012776 speaker amplifiers
(shared SDZ regulator on AP pin 107 with apple,sdz-group-fail-closed,
shared fault IRQ on AP pin 106, ti,bclk-ratio 250, V/I sense slots 0/2
through 20/22), the CS42L84 headphone jack codec, and the
apple,j716-macaudio sound card with speaker-id GPIOs on AP pins 136 and
137.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb requested review from a team as code owners November 24, 2026 15:58
@erikwb
erikwb requested review from Acelogic and maralcbr November 24, 2026 15:58
@github-actions github-actions Bot added area:audio Area from CODEOWNERS (bot) area:bringup Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at 823c2aa3: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 823c2aa3
Conflicts ok not computed yet
PR text ok Risk: one-way · (DT binding compatible "apple,j716-macaudio" and J716c v2-only speaker enablement) · J716c (T6050) plus shared macaudio across Apple Silicon Macs.

Areas: area:audio, area:bringup

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH at 31a8aca83305

0 code, safety, or policy blockers found. Ready to approve and merge once the merge-order prerequisites and the §5 shared-code regression row are in place.

Blockers:

  1. Merge order: aurora-silicon/linux#3084 (multi-amp t8152_aop_audio SenseRing, currently open with requested changes) and aurora-silicon/aura#506 (T6050 pmp0 ADT handoff, currently open) are unmerged prerequisites. Land #3084 first so 12-ch V/I sense capture on J716c cannot rotate mid-frame on stream restart.
  2. §5 shared-code regression row: This PR modifies shared sound/soc/apple/macaudio.c and drivers/pmdomain/apple/pmc.c. Per merge policy §1(2), please add an exact-head (31a8aca83305) regression row on a second Mac using macaudio + apple-pmc (e.g. J713 / J616s / J714s) showing 0 SELinux denials, 0 failed units, 0 new kernel errors (and record 0 failed units on the J716c row).

Checked:

  • v2-only speaker ownership & fail-closed invariants (sound/soc/apple/macaudio.c, apple,macaudio.yaml):
    • spk_v2_only (apple,j716-macaudio) drops "Speaker Volume Unlock" and "Speaker Protection Interface" (MACAUDIO_NUM_LEGACY_SPEAKER_CONTROLS = 2), keeping "Speaker Sample Rate", "Speaker Protection", "Speaker Protection Crossover", and "Speaker ID".
    • Cold bind enters MACAUDIO_SPK_IFACE_LEASE directly, enforces mute (0) and tweeter safe HPF (800 Hz) via macaudio_spk_floor() in macaudio_late_probe(), limits each SN012776's Amp Gain Volume from ADT apple,speaker-config, and fixes all amp gains via macaudio_spk_fix_amp_gains() in macaudio_fixup_controls() before snd_card_register(), failing probe cleanly on any write failure.
    • Userspace writes to speaker volumes and amp gains return -EPERM while leased; speaker playback triggers (macaudio_fe_refuses, macaudio_be_trigger) refuse starts without an active lease; macaudio_spk_leave_lease() is a no-op, macaudio_spk_unlock() never arms spk_unowned_work, and legacy unlock/interface writes return -EOPNOTSUPP.
    • Admission (macaudio_speakers_allowed, macaudio_sn012776_levels_present) permits safe_vol == 0 only on non-fixed-ceiling digital mute-floor amps (AMP_TAS5770/AMP_SN012776) and requires boot-loader apple,amp-dcblocker-config (>= 2 bytes) on spk_v2_only boards while keeping the headphone jack usable if speaker admission fails.
    • macaudio_hpf_safe_item() and macaudio_set_fixed_hpf() derive the tweeter safe corner from the codec's advertised "<N> Hz" enum items (resolving to index 6 / "800 Hz" on tas2764 and failing closed with -ENOENT otherwise).
    • macaudio_card_remove() and macaudio_late_probe() reset per-bind state and control array counts so ASoC component unbind/rebind preserves the cold-bind mute floor without array overflow.
    • KUnit coverage (macaudio-*-test.h, macaudio-kunit.dtso) exercises v2-only admission, DC-blocker checks, permanent lease mode, rebind floor reset, and codec-derived HPF selection.
  • PMC fallback (drivers/pmdomain/apple/pmc.c):
    • Guards the apple,pmp supplier link on of_device_is_available(pmp_node) plus apple,board-id and apple,dram-vendor-id (matching drivers/soc/apple/pmp.rs required properties), skipping the link and clearing PMP static voter BIT(0) when absent so apple-pmc and apple-clpc keep running under older boot loaders.
    • Verified PMP is agent 0 across all apple-pmc SoCs (t8132, t8140, t8142, t6040/t6041, t8152, t6050); boards with populated PMP properties keep unchanged behavior.
  • J716c DTS & cross-repo alignment (arch/arm64/boot/dts/apple/t6050-j716c.dts):
    • pinctrl_ap gpio-reserved-ranges = <0 80>, <81 25>, <108 26>, <135 1>, <140 81> opens exactly pins 80, 106, 107, 134, 136, 137, 138, 139 while keeping pin 112 (SError) reserved.
    • pmp0 leaves per-unit calibration/IDs to the boot loader (aura#506).
    • Six SN012776 amps (i2c1 0x38..0x3a, i2c3 0x3b..0x3d, shared SDZ AP 107 with apple,sdz-group-fail-closed, fault IRQ AP 106, ti,bclk-ratio = <250>, V/I slots 0/2..20/22, TDM idle masks 0xfff0f0f0/0xff0f0f0f), CS42L84 jack (i2c2@4b, reset AP 139, IRQ AP 134), speaker-id-gpios (AP 136/137), and aop_audio DMAs match t6050-j714s.dts, linux#3084, and speakerguardd#259 (packaging/session/fixtures/j716.json, wiring hash cbba18ec53f0a442).
  • Commits, CI, and policy:
    • All 4 commits have human author/committer (Erik Bourget) with valid Signed-off-by:; zero AI attribution; no banned names; default cmdline; no hardcoded safety limits; mergeable: MERGEABLE.
    • All 5 CI checks green at exact head 31a8aca833050357290695dccb3b2ba88e681ee6.
Evidence
  • Head SHA: 31a8aca833050357290695dccb3b2ba88e681ee6 (state: OPEN, isDraft: false, mergeable: MERGEABLE, mergeStateStatus: BLOCKED)
  • CI at head: dt-checks (success), host-tests (success), kunit (success), readiness / readiness (success), pr-text / pr-text (success)
  • Prerequisite status at review time:
    • aurora-silicon/linux#3084: OPEN, CHANGES_REQUESTED at edf11ddd623bf71e8d044148025eab45b949ef8c
    • aurora-silicon/aura#506: OPEN at 2eb142fe92ad46f74e33439409de8cc4256e0315
    • aurora-silicon/speakerguardd#259: OPEN at ef275fa8b21a99eca2e0e4f278988f522fb51387 (wiring hash cbba18ec53f0a442 matches t6050-j716c.dts)

@erikwb

erikwb commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

[!NOTE]

Branch head 31a8aca833050357290695dccb3b2ba88e681ee6 has no code changes requested and merged cleanly onto main at checked SHA 08a28858393942b60a6887bf99fec4f33598abd5 (where arch/arm64/boot/dts/apple/t6050-j716c.dts touched disjoint simple-framebuffer and smc_hwmon nodes; live main has since landed another drivers/pmdomain/apple/pmc.c change).

Updated the PR body to drop internal trial-build identifiers and align **Not yet:** with the remaining merge gates:

  1. Merge-order prerequisites: aurora-silicon/linux#3084 (OPEN, CHANGES_REQUESTED) and aurora-silicon/aura#506 (OPEN, CHANGES_REQUESTED) remain unmerged.
  2. Hardware regression rows at 31a8aca83305: a shared-code regression run on a second Mac using macaudio + apple-pmc (such as J713) and an explicit 0 failed units check on J716c remain pending.

@erikwb

erikwb commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

[!NOTE]

Completed the shared-code regression row at exact head 31a8aca83305 on J713 (M4 Air, T8132) (one-shot Linux 7.3.0 trial kernel, default command line):

  • systemctl --failed: 0 failed units
  • LSM: SELinux not built (CONFIG_SECURITY_SELINUX unset; AppArmor active), 0 AppArmor DENIED / audit AVC lines
  • Kernel journal (err+ and warnings vs prior daily boot): 0 new errors, 0 new warnings
  • Shared drivers: snd-soc-macaudio bound (AppleJ713HPAI, AppleJack, AppleJ713; no playback run), apple-pmc bound (382800000.power-management), apple_soc_cpufreq loaded with 2 apple-cpufreq policies

Updated the PR body's Tested, Not yet, and Evidence sections accordingly. Head 31a8aca83305 is unchanged.

satchlj
satchlj previously approved these changes Nov 25, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gemini 4 Neon on @satchlj's behalf

Verdict at 31a8aca83305

Approve — clean J716c AOP audio enablement and v2-only speaker protection path, with green CI and exact-head J716c + J713 hardware rows posted.

Blockers

None for code review.

Merge-order note: Both merge-order prerequisites listed in the PR body (aurora-silicon/linux#3084 and aurora-silicon/aura#506) are still OPEN; keep the documented merge order when landing.

Checked

  • Full static audit of all 10 changed files (+784/-84):
    • sound/soc/apple/macaudio.c:
      • spk_v2_only admission (macaudio_speakers_allowed()): requires digital-gain amps (AMP_TAS5770 / AMP_SN012776), !spk_fixed_ceiling, and per-amp ADT apple,amp-dcblocker-config (>= 2 u8 elements) in macaudio_sn012776_levels_present(), failing closed (speakers disabled, jack retained) if missing.
      • Control exposure & safety floor: drops legacy "Speaker Volume Unlock" and "Speaker Protection Interface" controls via MACAUDIO_NUM_LEGACY_SPEAKER_CONTROLS (moving "Speaker Protection" ahead of them in macaudio_controls[]), returns -EOPNOTSUPP in macaudio_slk_put(), starts directly in MACAUDIO_SPK_IFACE_LEASE with full-scale SW gain + hardware mute floor (macaudio_spk_floor()), and fixes ADT-derived operating amp gains in macaudio_fixup_controls() before exposing the card.
      • macaudio_hpf_safe_item() + macaudio_set_fixed_hpf(): cleanly derives the highest <N> Hz corner frequency from the codec's advertised enum items instead of hard-coding a frequency string.
      • Per-bind reset in macaudio_late_probe() and macaudio_card_remove(): cleanly resets spk_* state, counters (spk_nr_vols, spk_nr_amp_gains, spk_nr_hpfs), and kcontrol pointers across ASoC component rebinds.
    • DT / bindings / PMP / KUnit tests: t6050-j716c audio/AOP/amp nodes, macaudio binding update, and KUnit coverage audit cleanly.
  • CI at 31a8aca83305: all checks SUCCESS (dt-checks, host-tests, kunit, readiness, pr-text).
  • Posted hardware evidence at exact head 31a8aca83305: J716c (16-inch M5 Max) live playback/sense/mic/jack row and J713 (M4 Air) shared-code regression row both recorded in the PR thread.
  • Untested scope: no local kernel build or boot performed on our hardware (review based on full diff audit, CI results, and posted hardware rows).
Evidence
  • Changed files (10): +784/-84.
  • Checked prerequisite PR states at review time: aurora-silicon/linux#3084 (OPEN), aurora-silicon/aura#506 (OPEN).
  • CI: dt-checks, host-tests, kunit, readiness, pr-text all green at 31a8aca83305.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@erikwb

erikwb commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

[!NOTE]

Updated the PR body (**Tested:**, **Not yet:**, and Evidence) to record the verified J716c (16-inch M5 Max, T6050) one-shot trial boot at head 31a8aca83305 in composed candidate a60c110f35e0 (main 1b09b76b53e9 + #3085 31a8aca83305 unchanged + #3084 5f1321879f34 unchanged + landed #2185/#2187, booted via Stage 2 1.0.0b17-gae94218e on the default kernel command line) and update companion SHAs from the earlier #3084 26f1ac62bcbd / aura#506 2eb142fe entries:

  • J716c (a60c110f35e0) boot & smoke: clean boot and Hyprland desktop up, GPU /dev/dri/renderD128 up, gpubench-vk quick set 18/18 ok, dEQP-VK.api.smoke.* 6/6 Pass (0 GPU-error lines).
  • speakerguardd v2: speakerguardd-v2.service active (AppleJ716: v2 interface only, wiring cbba18ec53f0a442) and silent switch self-check PASS (params bfbbd9fc8008).
  • Whole-boot regression counts: 0 new kernel errors (3 err+ lines total, all pre-existing on the default boot), 1 pre-existing failed unit (aurora-peripherals.service, same as default), 0 AVC lines (SELinux N/A).
  • Remaining gates (Not yet): open prerequisite PRs aurora-silicon/linux#3084 (5f1321879f34) and aurora-silicon/aura#506 (currently conflicting on main; tested Stage 2 was 1.0.0b17-gae94218e), plus live speaker playback at 5f1321879f34+31a8aca83305 once owner playback permission is granted (prior audio/mic/jack checks remain dated and attributed to their tested revisions). The J713 shared-code regression row at 31a8aca83305 is unchanged.

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed ready-to-merge Meets the merge policy: merge it (bot) labels Nov 26, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

This branch conflicts with main again. Could you merge main into it with a normal push (no force push) within 24 hours? After that a maintainer will do the forward merge and merge it once CI is green. Rows carry over if the changed files stay byte-identical.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict at fa6ca3bf: audio part OK; please split out the pmc.c change before merge.

Rows: they carry over to this head. The PR's own diff against main is unchanged from 31a8aca8 (the J716c target row and J713 regression row) apart from conflict context: main's J704 and K114 entries in the same table and comment.

Checked (audio, OK)

  • spk_v2_only admits only the "Speaker Protection" lease. The card binds muted at the hardware floor, legacy unlock is never exposed, and losing the owner never reverts.
  • has_safe_floor also accepts v2-only digital-gain amps, whose ungranted floor is hardware mute.
  • It fails closed without the boot loader's apple,amp-dcblocker-config.
  • The tweeter high-pass "safe" item now comes from the codec's own enum (highest advertised N Hz) instead of a hard-coded "800 Hz". That follows the safety-values-from-the-machine rule. On today's codecs, whose enums top out at 800 Hz, nothing changes. A codec that offers a higher corner would get it, which is more protective. That's worth one line in the commit message because it applies to every speaker Mac. KUnit covers the selection.

Fix first

  • The drivers/pmdomain/apple/pmc.c change isn't audio. When the PMP node lacks the boot loader's apple,board-id/apple,dram-vendor-id, it probes PMC without the PMP and drops the PMP static voter. That's shared power code for any board with a PMP node, a fallback for older loaders, and the J716c/J713 audio rows don't exercise it. Please move it to its own PR (one feature per PR), with a row on a board booted with and without those properties. Then this PR can merge on its audio rows.

…oader properties"

This reverts commit 830c90c.

Signed-off-by: Erik Bourget <[email protected]>
This reverts commit a0f72aa.

Signed-off-by: Erik Bourget <[email protected]>

# Conflicts:
#	arch/arm64/boot/dts/apple/t6050-j716c.dts
@erikwb erikwb changed the title ASoC: apple: enable J716c (16-inch M5 Max) AOP audio, v2-only speakers, jack, mic array and PMP ASoC: apple: enable J716c (16-inch M5 Max) AOP audio, v2-only speakers, jack and mic array Nov 27, 2026
@erikwb

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Split both the drivers/pmdomain/apple/pmc.c fallback and the J716c PMP devicetree enablement out of feat/j716c-speakers at 952e45d7f622 (on top of d5f374213e9f) without a force push.

  • Reverted pmc.c and PMP DT changes: d5f374213e9f reverts 830c90c8f223 (pmdomain: apple: pmc: probe without PMP when supplier lacks loader properties), and 952e45d7f622 reverts a0f72aa06305 (arm64: dts: apple: t6050-j716c: enable the PMP, including pmp0 / ps_pmp / ps_pms*, apple,static-voters, and apple,pmp = <&pmp0>). Against main (fcb124279183), the diff (9 files changed, 714 insertions(+), 74 deletions(-)) now touches only audio/speakers/jack/mic array files (Documentation/devicetree/bindings/sound/apple,macaudio.yaml, arch/arm64/boot/dts/apple/t6050-j716c.dts, sound/soc/apple/macaudio.c, and its KUnit suites), leaving drivers/pmdomain/apple/pmc.c and J716c PMC/PMP DT nodes identical to main so apple-pmc still probes and creates its CLPC child normally. Both 830c90c8f223 and a0f72aa06305 remain intact in history to move together into a separate power PR. Because a0f72aa06305 documented that AOP audio needed PMP to power the LEAP domains and reach systemReady, while 952e45d7f622 leaves pmp0 disabled (and prior J716c captures ran with PMP enabled), the J716c row at 952e45d7f622 (batched candidate c3da8eed6f72, default command line) ran with pmp0 disabled (pmp@284e00000 reads status = "disabled" in the live DT, no PMP device bound): snd_soc_t8152_aop_audio auto-loaded, AppleJ716 and AppleJ716HPAI enumerated, macaudio granted then withdrew speaker protection with no playback, a 2 s 3-channel mic capture returned non-zero samples, and dmesg showed 0 timeouts or failures, so card enumeration and mic capture do not need the separate PMP change. A second four-PR J716c candidate (f59b93fb961f, default command line) then read the live controls at the same head: Headphone Jack and Headset Mic Jack off (nothing plugged in), Speaker Variant ID 0, the v2 Speaker Protection lease control present and the legacy Speaker Volume Unlock and Speaker Protection Interface controls absent, pmp@284e00000 still status = "disabled", and 0 panics/Oops/BUG/SErrors/DART faults/GPU faults/LSM denials on the boot. Speaker playback and physical jack insertion remain unmeasured, and a J713 shared-macaudio boot at the same head (candidate b3dbf237542b) enumerated AppleJ713HPAI, AppleJack and AppleJ713 with 0 macaudio/mca/admac/snd_soc errors.
  • PR title, body, and J713 deep-sleep control: Updated the PR title/body to drop PMP claims and made the earlier J713 candidate 90de523e9ed9 deep-sleep reset (rtcwake -d /dev/rtc1 -m mem -s 15, PMU panic counter 1) visible in **Tested:**, noting that the same reset also reproduced on main (fcb124279183) and leaving the root cause and relative frequency open.
  • Tweeter HPF commit message: Commit d64ac3782ae9 already records the macaudio_hpf_safe_item() change (Derive the tweeter safe high-pass corner from the codec's advertised "HPF Corner Frequency" enum items (highest "<N> Hz" corner) instead of hardcoding a frequency literal.). It applies across speaker Macs and selects 800 Hz on current codecs.
  • Checks at 952e45d7f622:
    • ./scripts/checkpatch.pl --strict --git fa6ca3bf0e0b..HEAD: 0 errors, 0 warnings, 0 checks.
    • make ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=sound/apple,macaudio.yaml: 0 warnings.
    • make ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t6050-j716c.dtb: 0 warnings on added audio/I2C/AOP/ADMAC nodes.
    • arm64 QEMU KUnit (apple-*): 104 passed, 0 skipped, 0 failed (apple-admac-position 5/5, apple-admac-realign 3/3, apple-pmc 17/17, apple-mca-capture-sync 4/4, apple-speaker-* 75/75).

@github-actions github-actions Bot removed the area:power Area from CODEOWNERS (bot) label Nov 27, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train status at 952e45d7: speakerguardd#259 is waiting on this. Before merge: (1) the pmc.c split asked for at fa6ca3bf, if it isn't done yet; (2) the J716c row at this exact head (AOP audio up, speakerguardd v2 gating, quiet start, sense flowing, no guard trip); (3) one regression row on another family for the shared ASoC/AOP code; (4) the review App's approval at the head. Then it can merge under the 6-point rule.

@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Status of the merge-train checklist at 952e45d7f622:

  1. pmc.c split: done at this head. d5f374213e9f reverts the pmc.c change and 952e45d7f622 reverts the J716c PMP DT enablement, so drivers/pmdomain/apple/pmc.c and the J716c PMC/PMP nodes match main. Both move to a separate power PR.
  2. J716c row at exact head 952e45d7f622: ran, with one protection event. One-shot trial boot of the PR head alone (default command line, default Stage 2):
    • AOP audio auto-loaded. AppleJ716 and AppleJ716HPAI are up and pmp@284e00000 is disabled.
    • Only the v2 Speaker Protection control exists, and all six speaker volumes sit at the 0 floor before the grant.
    • speakerguardd v2 passed its silent switch test on this kernel (wiring cbba18ec53f0a442) and reported protection ready.
    • Two quiet plays through the protected graph (440 Hz stereo sine, -36 dBFS RMS, 5 s, slider 0.30). The lease was granted on stream start (volumes 0 -> 201). Telemetry: health_or = 0x0, lost = 0, sense_delay = 1664, 923/923 records with non-zero V and I on all 12 sense channels, 0,0,0 faults on all six amps, no kernel errors. Volumes were back at the 0 floor after release.
    • The event: 2.2 s after the second tone ended, while the sink drained silence, the supervisor released the lease on an 80 ms stale engine heartbeat. It re-granted after 0.32 s, and the kernel refused 2 speaker starts in between (the fail-closed path). No fault, health or thermal flag was raised, and I stopped playback there.
    • This is the only stale-heartbeat release in this Mac's retained journal (159 grants, including the default kernel). Its cause, kernel PCM timing or graph teardown, is not known yet.
    • A 2 s mic capture afterwards was clean. Details are in the body's Evidence.
  3. Regression row on another family: in the body. J713 (M4 Air) at this head, in candidate b3dbf237542b: AppleJ713HPAI, AppleJack and AppleJ713 enumerated, with 0 macaudio/mca/admac/snd_soc errors.
  4. Ready for the review App at 952e45d7f622. The reviewer should weigh the post-tone heartbeat release in item 2 before approving.

@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on the heartbeat_fresh: false release noted above: checking the boot journal shows it was a PipeWire graph stall rather than a kernel or speakerguardd fault:

  • 22:47:51.512429 (pipewire): spa.alsa hw:CARD=AppleJ716,DEV=2c: follower delay:4344 target:1024 thr:512 resample:0, resync
  • 22:47:51.512641 (pipewire): audioconvert … out of buffers on port 0 2
  • 22:47:51.520885 (speakerguardd, 8 ms later): protection released: heartbeat_fresh: false, engine beat Some(80) ms ago (steady-state bound is 31–53 ms)
  • 22:47:51.523935 (kernel): Speaker protection withdrawn (2 speaker starts refused fail-closed during the gap)
  • 22:47:51.827781 (speakerguardd, +300 ms): engine has beaten steadily for 300 ms since the graph changed → protection granted

PipeWire also logged RTKit ... ServiceUnknown on this host (running at normal scheduling priority). The kernel audio driver logged zero errors during the stall, and fail-closed withdrawal and re-grant behaved as designed.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 28, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at 952e45d7

Blockers:

  1. Branch is CONFLICTING (DIRTY) with main; forward-merge main (no force push) and re-run the cancelled pr-text and readiness checks to green on the merged head.

Checked:

  • Prior split-out blocker resolved cleanly at 952e45d7: d5f37421 and 952e45d7 revert the pmc.c and J716c PMP DT changes so this PR focuses strictly on J716c AOP audio and v2-only speaker ownership (spk_v2_only, "apple,j716-macaudio").
  • Exact-head J716c hardware row PASS (PipeWire stall explained as userspace follower delay, 0 kernel/speakerguardd faults); no Apple material, tool attribution, or private serials.
Evidence
  • Head: 952e45d7f622 (base: main, mergeable: CONFLICTING, +714/-74 across 9 files).

@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Forward-merged origin/main (ee36fbdcd1c8 -> c14d2f103d25, then b48f89158d7c -> 324ca3a7ddee, no force push) into feat/j716c-speakers, and updated tools/testing/selftests/alsa/macaudio-fixed-controls.py in 823c2aa35eb6 for dynamic HPF corner selection.

Conflict resolution & selftest update:

  • sound/soc/apple/macaudio.c: preserved ma->spk_legacy_selected = false; in the non-spk_v2_only path of macaudio_late_probe(), placed "Speaker Protection Sleeps" (MACAUDIO_NUM_COMMON_CONTROLS = 3, MACAUDIO_NUM_SPEAKER_CONTROLS = 5, with BUILD_BUG_ON verification) before the two trailing legacy-only controls ("Speaker Volume Unlock" and "Speaker Protection Interface", MACAUDIO_NUM_LEGACY_SPEAKER_CONTROLS = 2) so spk_v2_only keeps "Speaker Protection Sleeps" while dropping the legacy controls, and dropped the removed macaudio_k114_cfg (superseded by macaudio_j714_cfg on main); 324ca3a7ddee leaves all PR runtime audio and DT hunks unchanged vs c14d2f103d25 (bringing in only macaudio_j704_cfg from origin/main).
  • sound/soc/apple/macaudio-admission-test.h and sound/soc/apple/macaudio-amp-level-test.h: kept macaudio_j716_cfg test coverage, dropped macaudio_k114_cfg, and at 324ca3a7ddee kept both main's positive J704 assertion/comment and #3085's J716 v2-only assertions in macaudio-admission-test.h.
  • sound/soc/apple/macaudio-iface-test.h: updated macaudio_iface_v2_only_never_leaves_lease to expect macaudio_slk_lock(...) == -EPERM (reflecting spk_legacy_selected gating on main) alongside -EOPNOTSUPP on macaudio_slk_put and macaudio_spk_iface_put.
  • tools/testing/selftests/alsa/macaudio-fixed-controls.py (823c2aa35eb6): replaced extraction of the removed macaudio_enum_item() with macaudio_hpf_safe_item() (with #define simple_strtoul strtoul) and macaudio_set_fixed_hpf(), and added dynamic highest-Hz (1600 Hz, unordered) HPF selection and write-denial assertions in hpf_scenario().

Offline checks at 823c2aa35eb6 (and 324ca3a7ddee for unchanged audio/DT files):

  • python3 tools/testing/selftests/alsa/macaudio-fixed-controls.py: PASS (validation=0 attempts=678 failures=0, validation=1 attempts=678 failures=0).
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=sound/soc/apple/macaudio.kunitconfig: 82/82 passed (apple-mca-capture-sync 4/4, apple-speaker-admission 2/2, apple-speaker-protection 34/34, apple-speaker-hpf 12/12, apple-speaker-pm-volumes 3/3, apple-speaker-volume-unlock 11/11, apple-speaker-interface 10/10, apple-speaker-amp-level 6/6).
  • python3 -I tools/asahi/run-host-tests.py: 764/765 passed (apple/aop-*, aop-*, hardware-defaults-tests, etc. all pass; only apple-dcp failed on 2 unrelated pre-existing tests same-handle-srcu-index and mux-release-stages).
  • make ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=sound/apple,macaudio.yaml (324ca3a7ddee, binding unchanged at 823c2aa35eb6): 0 warnings.
  • make ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t6050-j716c.dtb (324ca3a7ddee, DT unchanged at 823c2aa35eb6): 0 warnings on added audio/I2C/AOP/ADMAC/sound nodes.
  • make ARCH=arm64 LLVM=1 W=1 sound/soc/apple/ (defconfig + asahi.config with RUST=n, 324ca3a7ddee, sound/soc/apple/ unchanged at 823c2aa35eb6): 0 errors, 0 warnings.

Updated the PR body to update the head SHA to 823c2aa35eb6, preserve the earlier a60c110f35e0, 952e45d7f622 (104-test KUnit), 26f1ac62bcbd, and c3feb10d6265 rows, fold the c14d2f103d25 multi-Mac hardware runs, and reflect the journal confirmation that the post-tone heartbeat lapse at 952e45d7f622 was a PipeWire userspace stall (follower delay:4344 / out of buffers, 0 kernel errors) rather than an open kernel question.

Live hardware at c14d2f103d25 (all PR runtime audio and DT hunks unchanged at 823c2aa35eb6):

  • J716c (T6050): batched kernel 3545ebecb76f (Image.gz d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312, Stage 2 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d, 6/9 files blob-identical, 2/9 PR hunks present, 1 comment-only merge in macaudio-admission-test.h — runtime hunks verified, default cmdline): AppleJ716HPAI + AppleJ716 enumerated, 50 controls (Speaker Protection 0, Speaker Protection Sleeps 4, legacy unlock/interface absent), quiet 5 s -36 dBFS playback via speakerguardd-v2 verified grant 0 -> 201 and clean return to 0 mute (0,0,0 faults; the counted 923/923 V/I records belong to 952e45d7f622), 2 s 3-ch mic capture clean, 0 kernel audio errors; 6-item smoke pass (aurora-peripherals.service warm-reboot baseline failure also on default/control).
  • J713 (T8132): batched kernel 76649338a1bc (e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491, Stage 2 f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa, 8/9 blob-identical, default cmdline + panic=10): AppleJ713HPAI, AppleJack, AppleJ713 enumerated, speakerguardd-v2 protected-sink tone rc 0, 0 audio errors, 8-item smoke pass (0 failed units, 0 AppArmor denials).
  • J313 (T8103): batched Group A (888c041944da96032a9252504c4d5543b906fd98717234eca5e091150af85798, Stage 2 949dc089ed390b7535dd5ef2a6e99975c3026658e58dbd9d17e9b20d2bbb7d71, parity-identical per PR): boot smoke, 3x DPMS, and 2x deep S2R pass (speakerguardd-v2-switchtest.service also fails on baseline main; post-S2R ISP capture failed after 1st deep resume on Group A vs passed after 1st deep resume on baseline main, unisolated, tracked under #3329).

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 823c2aa after hosted checks

Checked the forward-merge control ordering and dynamic HPF fixture. The v2-only control prefix retains sleep accounting and omits the two legacy ownership controls. The unordered fixture checks the highest advertised Hz item, restoration on grant, and denied ordinary writes on the fixed path. Both merge-order prerequisites landed. The reported target and peer receipts cover the relevant runtime hunks. Require current hosted CI and readiness before merging, including disposition of the unrelated DCP host-suite failure.

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping @DjDeveloperr: closeout merge at 823c2aa3 once the queued CI is green. App approved at this head. Ryan's 11-28 checklist is met. The J716c row at 952e45d7/c14d2f10 still holds: the PR diff of macaudio.c, t6050-j716c.dts and macaudio.yaml is byte-identical at this head. The J713 shared-macaudio regression row is done. The speakers open only through the speakerguardd v2 lease (fail-closed), with volumes at the 0 floor. Loud/sustained playback and jack insertion on the J716c stay with speakerguardd#259. The 94/96 apple-dcp host-test failures also happen on main and are not from this PR. Merging under the 6-point rule 1 h from now unless you object.

@github-actions github-actions Bot removed the merge-conflict Conflicts with the base branch (bot) label Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at 823c2aa3. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J716c@952e45d7(byte-identical)+J713-regression;speakers-v2-lease-only. (5) There's no blocking review. (6) Dj was pinged here 188 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit 2160045 into main Nov 29, 2026
5 of 9 checks passed
@RyanTheTide
RyanTheTide deleted the feat/j716c-speakers branch November 29, 2026 03:59
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merged. Thanks @erikwb: J716c AOP audio is in, with speakers only through the v2 lease. Loud/sustained playback and jack insertion stay with speakerguardd#259.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:audio Area from CODEOWNERS (bot) area:bringup Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:one-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants