Skip to content

ASoC: apple: aop_audio: capture the low-power microphone on T6041 - #1505

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

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

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Expose the T6041 low-power microphone (lpai) as capture PCM 1 of the AOP audio card, next to the high-power array on PCM 0. The new PCM is not a UCM device.

  • The firmware produces into a host ring. The ring is allocated on the audio node's own DART stream, now named in the DT (iommus = <&aop_dart 8>, the stream of the firmware's I/O buffer device, shared with admac-base-ns; binding updated), and handed to the I/O buffer device adpx through its property 300 (IOVA, size), once per AOP lifetime.
  • The AOP core keeps that ring like the T8140 source ring: source_ring() becomes the setup-port case of a new bound_ring() that takes the binding as a closure.
  • lpai property 301 is the stream format (rate, channels, valid bytes per sample; samples are 4-byte containers, most significant aligned: S32_LE with 24 significant bits) and 302 the ring geometry (ring frames, frames per report). The ring size is their product.
  • Producer position: property-change reports (EPIC subtype 0x20, property 305) carry the last completed frame and the ring byte cursor; they are checked against each other. The first report after a start only sets the position; a backwards step or an overrun rebases.
  • Start/stop: property 202 runn / idle for an input, read back through property 200.
  • Only nodes with the DART stream get the PCM; T8132 is unchanged.
  • KUnit: ring report parsing, the consumer steps, the T6041 format.

Tests (J616s, RAM-only Stage 2 DTB trial with the iommus line + one-shot kernel with this change; LP and HQ recorded together for 10 s, before and after three s2idle cycles on the apple-pmu-rtc wakealarm; capture only):

  • PCM 1 S32_LE 16 kHz 3 ch; every sample's low byte is zero, as the 24-bit format says. LP -77 dBFS, lag-1 autocorrelation 0.998, zero-crossing 0.02; HQ array -80 dBFS on PCM 0, unchanged.
  • s2idle 3/3, 0 AVC, nothing deferred, no lpai, DART or amplifier messages; speaker protection withdrawn and granted around each sleep as before.

🤖 Generated with Claude Code

The T6041 AOP firmware produces its low-power microphone (lpai) into a
host ring. Allocate the ring on the audio node's DART stream, which the
DT now names (the stream of the firmware's I/O buffer device, shared
with admac-base-ns), and hand its IOVA and size to that device, adpx,
through its property 300. The binding is made once per AOP lifetime:
the AOP core keeps the ring as it does the T8140 source ring, whose
setup-port binding becomes one case of a generic bound ring.

lpai property 301 gives the stream format: rate, channels and the valid
bytes of a sample. Each sample sits in a 4-byte container, most
significant aligned, so the PCM is S32_LE with 24 significant bits.
Property 302 gives the ring geometry (ring frames, frames per report);
the ring size is their product. The firmware reports the producer
through property-change reports (EPIC subtype 0x20, property 305): the
last completed frame and the ring's byte cursor, checked against each
other. The first report after a start only sets the position, so audio
from before the start is not copied; a backwards step or an overrun
rebases. Start and stop are property 202 runn and idle for an input.

The PCM is the same capture PCM 1 as on T8112/T6000, created only where
the audio node has the DART stream; T8132 keeps the array alone.

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