Repository navigation
ASoC: apple: aop_audio: leave out T6040 microphones the firmware did not set up - #2349
Conversation
…not set up On the T6040 flow (apple,t6041-aop-audio: J614s, J616s) the probe sends the low-power microphone's channel masks (lpai property 300), the PDM configuration (property 200) and the high-frequency decimator configuration (property 212), and on a refusal or a failed call logs "... refused, continuing" and registers both microphone PCMs anyway. The same PDM and decimator calls fail the probe on every other SoC this driver serves. The T6040 exception was made during bring-up so that each later step's answer could still be seen; it leaves a capture that starts on whatever configuration the firmware held, silence or garbage with nothing in the log at the time of the capture. Make each refusal cost what it configures. Without the PDM or decimator setup no microphone is offered: the probe registers only the speaker and jack streams the node lists, as it does on a Mac without microphones, and fails with the error when it lists none. Without the channel masks the low-power microphone PCM is left out and the array stays. Each failure is logged with its return code. A firmware that accepts all three, as the J616s one does, sees no change. Fixes: 2ba1e89 ("ASoC: apple: aop_audio: configure the T6040 microphones as macOS does") Cc: Jonathan Goyvaerts <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
|
No blockers. I checked the T6040 probe path at the head. A refused PDM or decimator step now goes to
HW row: none required. Optional: the same capture row on a J614s, if an owner has one, since it shares Assisted-by: LLM (Claude:Opus 5.5) |
|
Adversarial pass at 1a9583e: no blockers. Checked: microphones are dropped only on the firmware's own answer (PDM/decimator refusal drops both, mask refusal drops only the LPAI PCM, aop_audio.rs:1250-1276), the speaker/jack registration is the same call on every exit (:1196, :1290) and no speaker code changes, and a firmware that accepts all three steps takes the old path.
Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR review at 1a9583e603a29facc19bad64418ee765dc9a8687: APPROVED (0 blockers; live CI green).
Code, Locking, Memory & Lifetime Audit
SndSocAopDriver::without_microphones()cleanly factors out the speaker/jack-only registration path already used when"dma"is absent: if!streamsit returns the setup error directly; otherwise it registersSpeakerComponentwithcard: null,lpai: None, and an unattachedMicLid.Drop for SndSocAopDriverguardssnd_card_free()on non-nullself.cardand safely detachesMicLid, so there are no leaks or invalid-pointer frees on error or unbind.- On
info.t6040_flow: a refused/failedset_lpai_channel_control()now drops only the LPAI ring PCM while preserving the HPAI microphone array, and a refused/failedset_pdm_config()orset_decimator_config_hf()drops microphone registration viawithout_microphones()while preserving speaker/jack streams. A firmware accepting all three steps follows the exact previous path. - Not superseded on live
integration/aurora(70a00e583b03;sound/soc/apple/aop_audio.rsunchanged sincedb5807513d7b), merges cleanly.
Pre-PR Checklist (§1–§6)
- §1 No model gating: PASS — refusal handling is driven by firmware EPIC return codes (
t6040_flowis pre-existing compatible-selected config). - §2 Production-ready: PASS — removes the bring-up
"refused, continuing"fallback; works on default cmdline. - §3 Safety: PASS — speaker/jack components remain untouched; unconfigured microphone PCMs are withheld instead of exposing undefined firmware state.
- §4 Clean-room & attribution: PASS — commit
1a9583e603a2carries human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:only (zero AI commit trailers); PR body ends withAssisted-by:. - §5 Evidence: PASS — exact commit
1a9583e603a2was booted on affected hardware (J616sapple,t6041-aop-audio) plus M1 Pro J316s and M2 J413 in the 2026-11-20 combined test kernel, confirming 0 setup refusals, identical capture byte counts (1920000/5760000on J616s,960000/5760000on M1 Pro/M2), 2 s2idle cycles, and matching production on kernel errors, failed units, and SELinux denials; arm64 LLVM release and KUnit builds warning-free. - §6 Naming & Live CI: PASS —
host-tests(the only workflow triggered forsound/soc/apple/aop_audio.rs) isSUCCESS.
Non-blocking Nits
set_lpai_channel_control()logsdev_err!onret != 0andprobe()logs a seconddev_err!in.inspect_err(...)on the same failure.- The reflowed comment at
sound/soc/apple/aop_audio.rs:1247retains the pre-existingkIOReturnNotWritablename alongside0xE00002CF; hex alone is cleaner if touched again.
Assisted-by: LLM (Gemini 4 Neon)
Problem
On the T6040 flow (
apple,t6041-aop-audio: J614s, J616s) the AOP audio probe sends three microphone setup steps: the low-power microphone's channel masks (lpai property 300), the PDM configuration (property 200) and the high-frequency decimator configuration (property 212). Since 2ba1e89 ("ASoC: apple: aop_audio: configure the T6040 microphones as macOS does", Jonathan Goyvaerts) a refusal or a failed call of any of them is logged as... refused, continuing(sound/soc/apple/aop_audio.rs:1239-1245 at 0abc2f3) and both microphone PCMs are registered anyway. The same PDM and decimator calls fail the probe on every other SoC this driver serves. The exception was made during bring-up so that each later step's answer could still be seen. It leaves a capture that starts on whatever configuration the firmware held, which records silence or garbage, and the only trace is a line from boot.Change
Each refusal now costs only what that step configures:
without_microphones()), and fails with the error when the node lists none.The order of the three calls does not change. If the firmware accepts all three, as the J616s firmware does in every capture we have, the probe behaves exactly as before. Other SoCs (T8103 to T6030, T8140) do not use this path and are not affected.
Testing
make O=... sound/soc/apple/aop_audio.o(arm64, LLVM, release config): builds with no warnings. Also built withCONFIG_KUNIT=y. The driver's KUnit cases are in aop_lpai/aop_t8140, which this change does not touch.Still to run
J616s (T6040), capture only, nothing kept:
dmesg | grep -iE 'snd_soc_apple_aop|lpai channel masks|microphone setup failed|refused, continuing'. Expected after the change: nomicrophone setup failed, nolpai channel masks not set, noUnable to set .... If one appears, the firmware refuses that step today, and the old kernel was hiding it.arecord -l: cardAppleJ616HPAIwith PCM 0hpaiand PCM 1lpai, the same as before.arecord -D hw:AppleJ616HPAI,0 -f FLOAT_LE -r 48000 -c 3 -d 10 -t raw -vv | wc -creturns 5760000, andarecord -D hw:AppleJ616HPAI,1 -f S32_LE -r 16000 -c 3 -d 10 -t raw -vv | wc -creturns 1920000. The-vvpeak meter should not show silence.ls /sys/kernel/debug/asoc/componentslists the J616s speaker and jack components). Nothing is played.Hardware rows (combined test kernel, 2026-11-20)
This change was booted in a combined test kernel: integration/aurora 0abc2f3 plus the open gate-sweep drafts plus this and the related drafts (7.3.0-aurora-hk2/pwr1/hk3). It ran once on each lab Mac (M1 Pro J316s, M2 J413, J616s, Neo J700) and was compared against the production kernel on the same Mac, using the same silent row script:
M1 Pro, M2 and J616s matched production on every row, apart from the new counters and lines the drafts add. The Neo row found the old-DTB display regression that #2358's follow-up commit fixes.
This PR: J616s: 0 microphone-setup refusals on production and on the test kernel, so no change on a healthy boot. Mic capture byte counts identical before and after (J616s 1920000/5760000, M1 Pro and M2 960000/5760000).
Assisted-by: LLM (Claude:Opus 5.5)