Skip to content

ASoC: apple: One AOP audio driver, with the lid microphone jack for every MacBook - #537

Merged
RyanTheTide merged 4 commits into
integration/aurorafrom
audio/aop-unify-lid-mic
Oct 28, 2026
Merged

RyanTheTide merged 4 commits into
integration/aurorafrom
audio/aop-unify-lid-mic

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

One AOP audio driver for every Apple silicon Mac, and the lid's microphone jack on all of them.

The MacBook Neo (T8140) had its own AOP audio module, t8140_aop_audio, beside aop_audio, and only the Neo hid its microphones in clamshell mode. On the M4 Pro and the other MacBooks the microphone array stayed on offer with the lid closed and recorded silence.

The series:

  1. Move the lid-following "Internal Mic" jack out of the T8140 driver into aop_lid.rs (MicLid), unchanged. A driver holds an Arc, attaches it to its card and detaches it before freeing the card.
  2. aop_audio matches apple,t8140-aop-audio too. The compatible's match data picks the PDM microphone setup (T8103 to T6041) or the T8140 services, which move unchanged into the aop_t8140 backend of the same module. The Neo card keeps its driver name, id, PCMs and controls, so UCM sees the same card. Autoloading follows the compatible, so no DT changes.
  3. Drop the SND_SOC_APPLE_T8140_AOP_AUDIO option from Kconfig, asahi.config and the Apple firmware KUnit config.
  4. Give the PDM microphone card the same jack. It reads unplugged while any lid switch is closed, and a machine without a lid switch keeps it plugged.

The UCM side is aurora-silicon/alsa-ucm-conf-asahi#8, which points the three-channel array at "Internal Mic Jack".

Testing so far

  • Universal config with WERROR and FORTIFY_SOURCE builds clean (Image, modules, dtbs). snd-soc-aop matches all four compatibles, and snd-soc-t8140-aop-audio is gone.
  • KUnit (arm64 QEMU, audio config) 44/44, including the moved lid suite and the three T8140 suites.
  • Host apple-dcp selftests 63/63.
  • make CLIPPY=1 fails inside rust/kernel on this toolchain before it reaches these files, so clippy was not run.
  • Hardware boots are still to come: a J616s tether candidate (batch5 plus this series) and a Neo install candidate. On both, the microphones have to work with the lid open and disappear with it closed, and Neo audio must not regress.

🤖 Generated with Claude Code

RyanTheTide and others added 4 commits October 28, 2026 15:01
Closing the lid of an Apple silicon MacBook disconnects its internal
microphones in hardware. The T8140 AOP audio driver follows the lid
switches through the input core and reports an "Internal Mic" jack that
reads unplugged while a lid is closed. The other AOP microphone cards
need the same, so move it out of the driver into aop_lid.rs.

MicLid keeps the lid bookkeeping, the input handler and the jack report
work, unchanged, and owns its own reference count, so a driver only holds
an Arc<MicLid>, attaches it to its card before registering the card and
detaches it before freeing the card. The handler's private data is now
the MicLid instead of the T8140 driver data.

No functional change for the T8140 card. The lid KUnit suite moves with
the code as snd_soc_apple_aop_lid.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T8140 (MacBook Neo) had its own AOP audio module next to aop_audio,
both bound to services of the same AOP. Make it one driver: aop_audio
matches apple,t8140-aop-audio as well, and the compatible's match data
selects what the probe sets up. The PDM microphone setups of T8103 to
T6041 keep their hardware configuration as before, and T8140 gets the
services it already had, now as the aop_t8140 backend of the same
module.

The T8140 code moves unchanged apart from its probe and unbind, which
the shared platform driver calls. Its card keeps the t8140-aop-audio
driver name, its id and names, PCMs and controls, so UCM and userspace
see the same card. Module autoloading follows the compatible, so DTs
need no change. The module is snd-soc-aop for every machine now.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aop_audio drives the T8140 services now. Drop the
SND_SOC_APPLE_T8140_AOP_AUDIO option from Kconfig, the Asahi config
fragment and the Apple firmware KUnit config, which enables aop_audio
instead to keep running the T8140 and lid test suites.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closing the lid of any Apple silicon MacBook disconnects its internal
microphones in hardware, but only the T8140 card said so. On the other
laptops the high-power array stayed on offer in clamshell mode and
recorded silence.

Give the PDM microphone card the same "Internal Mic" jack, following the
lid switches through aop_lid. It reads unplugged while any lid switch is
closed, so a UCM device with JackControl "Internal Mic Jack" goes away.
A machine without a lid switch keeps the jack plugged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware results.

  • Neo, 7.3.0-aurora-naoplid (this series on 93de587): snd_soc_aop loads, the card is unchanged, Internal Mic Jack reads on with the lid open, speakerguardd is active, 0 WARN.
  • J616s, 7.3.0-aurora-j616s-aoplid2 (this series rebased cleanly onto 2d428e0, pushed as wip/aop-unify-lid-mic-on-2d428e0a): tether boot is healthy with 0 WARN, no new kernel errors against fold1, display handoff and GNOME up. With the lid closed, snd_soc_aop is bound to the HPAI card, Internal Mic Jack reads off, and with UCM Thunderbolt: M1/M2 Pro display, M1 PCIe and resume recovery #8 PipeWire marks the Mic port and the HiFi profile not available, so no microphone is offered. The lid-open check is next.

The first J616s candidate hung before root because it was packaged wrong: its initramfs lacked the current-GPT /init segment the J616s tether candidates append. The kernel was not involved (snd_soc_aop is a module).

🤖 Generated with Claude Code

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