Skip to content

ASoC: apple: aop_audio: capture the low-power microphone on T8112 and T6000 - #1493

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
lpmic/lp-mic-pcm
Nov 11, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
lpmic/lp-mic-pcm

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Expose the low-power microphone (lpai) of the T8112 and T6000 AOP audio firmware as capture PCM 1 of the AOP audio card. PCM 0 stays the high-power array, so UCM and the microphone rules are unchanged; the new PCM is not a UCM device.

  • The samples come inline in the audio service's EPIC report subtype 0xee: an absolute, exclusive producer byte count, then an audio packet with its kind (1 = live samples) and total length, then the samples. Every length is checked before use; whole frames are copied into the ALSA buffer and the absolute count keeps the position across reports (stale spans dropped, a gap continues at the new position).
  • The stream format comes from lpai property 302 (selector, rate, channels, bytes per channel). Without it the card keeps the array only.
  • Prepare requests runn through property 202 (device lpai, sequence, 24 MHz timestamp, input parameter), close requests idle; both are read back through property 200.
  • KUnit: report parsing and length checks, continuity, format decoding, the timestamp conversion.

Tests (one-shot test kernel = fleet58 + this change, LP and HQ recorded together for 10 s, before and after three s2idle cycles on the apple-pmu-rtc wakealarm; capture only):

  • M2 (j413): PCM 1 S16_LE 16 kHz 3 ch. LP -72 dBFS, lag-1 autocorrelation 0.99, zero-crossing 0.03; HQ array -74 dBFS on PCM 0, unchanged. s2idle 3/3, 0 AVC, 0 failed units, nothing deferred, no lpai or amplifier messages.
  • M1 Pro (j316s): PCM 1 S16_LE 16 kHz 3 ch. LP -73/-71 dBFS, autocorrelation 0.997-0.999; HQ -76/-74 dBFS (both mics +2.2 dB between the takes). s2idle 3/3, 0 AVC, 0 failed, warnings unchanged from the base kernel.
  • CI: source, rust-build, host-tests and KUnit pass.

🤖 Generated with Claude Code

… T6000

The PDM AOP audio firmware runs a low-power microphone stream (lpai)
next to the high-power array. Expose it as capture PCM 1 of the AOP
audio card, so developers can record it; PCM 0 stays the array, which is
what UCM and the microphone rules use.

On this firmware the samples come inline in the audio service's own
reports, EPIC report subtype 0xee. A report carries the absolute,
exclusive producer byte count and an audio packet whose header gives
its kind (1 = live samples) and total length; the samples follow the
36-byte header. The driver checks every length, copies whole frames
into the ALSA buffer and follows the absolute byte count across reports:
stale spans are dropped and a gap starts a new position.

The stream format is read from lpai property 302 (sample-format
selector, rate, channels per frame, bytes per channel) instead of being
compiled in; a firmware without it keeps the card as before, with the
array only. Prepare requests runn through property 202 with the
device's sequence and a 24 MHz timestamp, close requests idle, and both
are checked through property 200.

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