Skip to content

J813: AOP sound on integration/aurora (speakers, jack, microphones) - #1423

Merged
DjDeveloperr merged 22 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j813-sound-int
Nov 11, 2026
Merged

DjDeveloperr merged 22 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j813-sound-int

Conversation

@sithglan

@sithglan sithglan commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Base: integration/aurora (5186d2e). Branch thomas/j813-sound-int (114ebfd), 16 commits:
13 for sound and 3 that add KUnit tests.

The MacBook Air M5 (J813) DT in integration/aurora (t8142-j813-audio.dtsi) already describes
the AOP, its audio service, the four SN012776 amps, the CS42L84 and the macaudio card. Ryan's
eab3e66 also added the T8152-generation AOP and audio bindings. The drivers behind those
nodes never reached integration: they went into aurora-wip with #1000. On integration a J813
therefore has no sound card at all.

This ports #1000 onto integration/aurora:

  • soc: apple: aop: T8152 support, and booting the T8142 AOP through its setup port, whose
    EPMAP names the service endpoints.
  • The T8152 AOP audio driver, with the T8142 (speakers, jack) and the J813 microphone array.
  • tas2764: a fixed BCLK/FS ratio (ti,bclk-ratio, which the J813 DT already sets).
    cs42l84: SDOUT1 routed from the ASP input.
  • apple-admac: restart a paused capture at a frame boundary (the speakers' V/I sense).
  • macaudio: J873 and J813.
  • asahi.config: build the T8152 AOP audio driver, beside the T8140 one.

Differences from #1000:

  • "dt-bindings: apple: Add the T8152 AOP and its audio service" is dropped. Integration has
    Ryan's version of both files (eab3e66), and the J813 DT follows it.
  • "soc: apple: rtkit: Take a crash buffer the firmware maps itself" is dropped: integration
    already has it (ecbb337).
  • The macaudio binding commit now adds J813 as well as J873. Integration's J813 DT names
    apple,j813-macaudio, which no binding listed.
  • The T8152 and T8142 AopHwConfig entries take integration's fields in the commits that add
    them: ncal: None (the firmware keeps its own; neither entry patches boot arguments) and
    bootargs_word_access: false. J813: AOP sound on the MacBook Air M5 (speakers, jack, microphones) #1000 did this in a separate last commit. Here every commit
    builds on its own.
  • The J813 and J873 macaudio tables carry no amp_gain. On integration the SN012776 takes each
    amp's level from its apple,speaker-config, which aura passes on the J813 (level 0x0f on all
    four amps). J873 has no safe level, so macaudio_speakers_allowed() keeps its speaker off.
    please_blow_up_my_speakers cannot override that on integration.
  • The asahi.config line is new.

Not included: Acelogic's two J813 audio commits from #1048 (ad4910c "ASoC: apple:
validate J813 audio topology and use the default worker queue" and 12165bc "ASoC: apple:
initialize J813 output standby before microphone registration"). They have no Signed-off-by,
and the speakers, jack and microphones work without them (below). @Acelogic, if you want
them in integration, they apply on top of this.

The M1-M4 machines

The changes to shared drivers do nothing without the J813 or J873:

  • tas2764: tas2764_parse_bclk_ratio() sets a ratio code only from ti,bclk-ratio, and
    tas2764_apply_bclk_ratio() writes nothing without one. The code starts at -1 in the I2C
    probe, before the device tree is read.
  • apple-admac: admac_config_realign_bytes() takes a frame size only from a 4-byte
    peripheral_config. Only t8152_aop_audio.rs passes one, for its speaker sense capture.
    mca_hw_params() zeroes its slave config. admac_resume_realigns() holds for capture
    channels only.
  • macaudio: the new spk_dai_fmt and spk_secondary_only fields are 0 in every other table,
    and the driver reads them only when they are set.
  • cs42l84: two more DAPM routes into "SDOUT1 Select" (ASP RX CH1/CH2). The default route is
    still the ADC.

KUnit tests:

  • tas2764-bclk-ratio (new):
    • Two amp nodes without ti,bclk-ratio, one with the ADT blocks the MCA machines get and one
      bare. Both keep the ratio auto-detection.
    • Their probe step makes no register write. The register map records every write, and
      TAS2764_CLK_CFG and TDM_CFG0 keep their values.
    • 250 BCLKs writes code 0x30 and sets only TDM_CFG0's fixed-ratio bit.
    • A ratio without a code fails the probe.
  • apple-admac-realign (new):
    • A slave config built as mca_hw_params() builds it gets no frame size, and neither does a
      peripheral_config of another size.
    • A resume realigns only a capture channel that has a frame size and a transfer, never a
      playback channel.
  • apple-speaker-admission: J813 is admitted (it has a safe level) and J873 is not (it has
    none).
  • apple-speaker-amp-level: neither J813 nor J873 carries an SN012776 gain.
  • apple-speaker-interface, a new case on the J813 table:
    • The volumes start at the volume lock's ceiling (1).
    • A daemon that holds the lock without pinging lifts nothing; after its ping the ceiling is
      201.
    • Under "Speaker Protection" the volumes are at 0. Without an owner a grant is -EPERM and no
      start is admitted. The owner's lease gives 201, and the release puts them back at 0.

Run in arm64 QEMU with this kunitconfig:

CONFIG_KUNIT=y
CONFIG_ARCH_APPLE=y
CONFIG_OF=y
CONFIG_OF_DYNAMIC=y
CONFIG_OF_OVERLAY=y
CONFIG_PM=y
CONFIG_PM_SLEEP=y
CONFIG_I2C=y
CONFIG_GPIOLIB=y
CONFIG_REGULATOR=y
CONFIG_COMMON_CLK=y
CONFIG_DMADEVICES=y
CONFIG_APPLE_ADMAC=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SOC=y
CONFIG_SND_SOC_APPLE_MACAUDIO=y
CONFIG_SND_SOC_TAS2764=y
CONFIG_SND_SOC_TAS2764_KUNIT_TEST=y

tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=<that file>
passes 84 / 84 tests in 11 suites. These suites are not in CI: its kunit job runs the SEP
kunitconfig only. As a check that the new cases catch regressions, I broke the drivers in
three ways:

  • the TAS2764 writes CLK_CFG without the property;
  • the ADMAC realigns playback;
  • the J813 table loses its safe level.

Each of these fails the matching cases (6 of 84). At each test commit the run passes too (81
/ 81, 83 / 83). One run at the ADMAC test commit failed macaudio_spk_lease_expires, an
existing test with a 10 ms lease, while the host was building at full load. It passed in the
four runs after that.

Testing

On the J813 (macOS 27.0 stub), booted through aura-try:

  • Kernel 7.3.0-aurora-j813-oni4s+: this branch merged with drm/asahi, drm/apple: J813 (M5 MacBook Air) GPU and display on the macOS 27.0 firmware #1413 (both on integration/aurora
    5186d2e). Built with CONFIG_SND_SOC_APPLE_T8152_AOP_AUDIO=m.
  • Without these commits there is no sound card. With them there are AppleJ813 (Primary,
    Secondary, Speaker Sense) and AppleJ813HPAI (the microphone array), and dmesg has no AOP or
    audio errors.
  • Speaker protection, with speakersafetyd running (its j813.conf): "Speaker Volume Unlock"
    reads 1, and each Speaker Volume's maximum is 201.
  • After systemctl stop speakersafetyd:
    • macaudio logs "Speaker volumes locked: Lock timeout".
    • All four Speaker Volumes read max 1, value 1. Each Amp Gain Volume reads max 15, the
      level in its apple,speaker-config (00 0f 00 02, 01 0f 04 06, 02 0f 08 0a,
      03 0f 0c 0e).
    • Root setting a Speaker Volume to 201 gets 1.
  • "Speaker Protection Interface" set to "Speaker Protection", with no owner:
    • All four Speaker Volumes are at 0, and "Speaker Protection" reads 0.
    • aplay of zeros to hw:AppleJ813,1 (the speakers) fails with "Operation not permitted",
      and speaker_starts_refused goes from 0 to 1.
    • The jack (device 0) still plays.
  • Interface set back to "Speaker Volume Unlock" and speakersafetyd restarted: the volumes are
    unlocked again.
  • The speakers play. A 3 s 1 kHz tone at 0.05 on hw:AppleJ813,1 reaches the three microphones
    at -50.1, -52.1 and -45.7 dBFS at 1 kHz, against -133 to -140 dBFS before the tone. The
    previous round measured -48.0, -49.1 and -42.9 dBFS RMS; J813: AOP sound on the MacBook Air M5 (speakers, jack, microphones) #1000 measured -50.5 dBFS.
  • Integration's rtkit now logs "RTKit: crashlog endpoint not in the endpoint map" (info) for
    the AOP. The aurora-wip kernel did not log this line; it changes nothing.

CI checks, run locally:

  • source: the aurora-sep tests pass on this base. On the old base, 064054d,
    test_diag_policy and test_diag_sensor fail on diag_shim.c's linux/bitmap.h, which
    Fix SEP diagnostics source checks and KUnit compilation #1438 fixed.
  • Per-commit build with the J813 config (modules and dtbs, clang 22): 16 / 16 build.
  • scripts/dtc/apple-dt-check.sh integration/aurora..this branch: 0 new warnings, 10 fewer.
    The fixed ones are t8142-j813.dtb's apple,j813-macaudio compatible and ti,bclk-ratio on
    its four amps, which are now documented. apple,macaudio.yaml and ti,tas27xx.yaml pass
    dt_binding_check.

Reviewers: @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10

@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.

Needed before merge:

  1. The failing source job is the diag_shim harness issue (linux/bitmap.h without a stub) that integration/aurora fixed in #1438; merging or rebasing onto current integration/aurora clears it.
  2. tas2764.c, apple-admac.c and macaudio.c are shared with the M1/M2 machines: the ti,bclk-ratio path and the paused-capture restart need to be no-ops when the property is absent and for playback streams. Please add a KUnit or host test that covers the existing (no ti,bclk-ratio) TAS2764 configuration, or show it is unchanged.
  3. For J813, show that the speakers stay behind the kernel speaker-protection interface (Speaker Volume Unlock / Speaker Protection controls) as on the other macaudio machines, so they are not driven above the safe ceiling without a protection daemon.

Add the MacBook Air (M5, J813) and Mac mini (M6, J873) sound cards.
t8142-j813-audio.dtsi already names apple,j813-macaudio.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873 (Mac mini M6) AOP runs the same firmware generation as T8140
(EPIC v4, iBoot-loaded, started by the AP), but the T8140 "setup port"
is not reachable from the AP: mailbox 1 of the AOP's mailbox bank and the
ADT aop-exclave-mailbox both bus-error. The firmware boots without it:
RTKit protocol 12, then its "audio" EPIC service. Add apple,t8152-aop
with the T8140 configuration minus the setup port, starting every
advertised endpoint.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The Mac mini (M6, J873) speaker runs a 250-BCLK TDM frame, which the
SN012776's ratio auto-detection rejects. Describe the property that fixes
the ratio instead.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873 (Mac mini M6) AOP runs the speaker frame at 250 BCLKs of 12 MHz.
The SN012776 cannot auto-detect that ratio and mutes with "fault: bad
TDM clock". With TAS2764_CLK_CFG (register 0x60) set to 0x30 and
TDM_CFG0 bit 6 set it accepts the frame and plays. Do that when the new
ti,bclk-ratio property names the ratio; only this one ratio is supported.

Source of the value: the register write was first seen in the macOS
SN012776 driver; it is a single register value, and its effect (no fault,
correct playback) was verified on J873 hardware. No table or code was
taken from macOS.

The field is initialised in probe, so non-OF matches keep auto-detection.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The SDOUT1 mux offers the ASP receive channels as a source, but no DAPM
route connected them, so selecting "ASP RX CH1" or "ASP RX CH2" left the
capture path without an input. The J873 and J813 AOP audio services use
it to loop the playback stream back.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
On T8152 (J873, Mac mini M6) the AOP firmware owns the audio fabric, as
on T8140. Its "audio" EPIC service offers cout/cin (the CS42L84 jack,
base-ns ADMAC TX5/RX5, MCA4) and spkr (the SN012776 speaker, TX1, MCA0).

Each service is an ASoC back-end DAI: startup attaches it, requests pw0
(which raises the audio fabric) and powers the MCA leaves, all of which
are required. pwrd starts the serializer clocks at prepare, before ASoC
unmutes the codecs: the jack codec locks its PLL to the bit clock, and
the speaker amplifier reports "bad TDM clock" whenever it runs without
one. The jack restarts its clocks on every prepare so that a stream
restarted after an underrun begins on a frame boundary; the mono speaker
(one slot per frame) keeps them running. The front-ends are dmaengine
PCMs on the base-ns channels: the jack in stereo, the speaker in mono
(its serializer runs one 32-bit slot; stereo frames play at half pitch).

The firmware's serializer configuration (property 701) is byte-identical
to the one macOS publishes, so the driver leaves it alone.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873 (Mac mini M6) uses the T8152 AOP audio driver as its CPU
component: the CS42L84 jack on "cout" (DSP_A | IB_NF, one-BCLK sync
pulse) and one SN012776 on "spkr" (I2S, NB_IF: data sampled on the rising
edge, as macOS programs the amp).

Each AOP front-end owns the DMA channel of one serializer, so the speaker
can only be fed from the secondary front-end; the new spk_secondary_only
sets the speaker mux accordingly, and spk_dai_fmt gives the speaker link
its own format.

There is no qualified speaker protection for J873 yet (no verified sense
path, thermal model or power budget) and no safe level, so
macaudio_speakers_allowed() keeps the speaker off. The jack is not
affected.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The T8142 AOP (MacBook Air J813) waits for the host on a setup port, as
the T8140 one does: the ADT's aop-exclave-mailbox at 0x3d067c000 (AOP
ASC + 0x4007c000, not behind the arm-io translation). Its EPMAP announces
other service endpoints than T8140's fixed set (0x4, 0x20, 0x23 and 0x32
on J813), so take the endpoints that must get buffers from the EPMAP when
the match data says so.

The firmware places its own crash log buffer in its firmware-mapped DART
slot; accept it as the firmware's, as for G17P.

After the setup boot all AFK endpoints start, and with the audio fabric
left to the firmware (see the J813 device tree) the firmware announces
its "audio" EPIC service.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Behind an AOP the serializer feeding a capture channel is the firmware's,
and it stops in the middle of a frame whenever it likes. A capture that
stays open across such stops (the speaker V/I sense, which a protection
daemon reads for as long as it runs) then carries the partial frame
forward: every later frame is off by its words, and the samples of one
amplifier are read as another's. On the MacBook Air J813 one restart in
three slipped by one 16-bit word.

Let a client pass the frame size in bytes as a u32 in
dma_slave_config.peripheral_config. A paused cyclic capture on such a
channel resumes at the next frame boundary of its current period: the
reports completed before the pause are accounted for, the rings are
reset and the rest of the period is submitted from the aligned address,
then whole periods as before. Without a frame size nothing changes.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J813 speaker stream (ADT iop-audio-controller/audio-speaker) differs
from J873's: four SN012776 in 32-bit playback slots 0-3, and their voltage
and current sense back on the same stream's RX side (base-ns RX0) as eight
16-bit slots. Make the speaker and sense shapes per-SoC match data:
J873 keeps one playback channel; T8142 gets four, and an 8-channel S16_LE
"Speaker Sense" front-end.

The sense capture is the speaker serializer's RX, which the firmware
stops anywhere in a frame. Before every `pwrd` of the speaker, restart a
running sense capture at a frame boundary (apple-admac realignment, the
partial frame reads as zeros), so that a protection daemon that keeps it
open attributes each amplifier's voltage and current to the right one.

The sense back-end also attaches the speaker service and requests `pw0 `
at startup: its front-end requests the ADMAC channel next, and the ADMAC
only answers while the firmware holds the audio fabric up. Opening the
sense before any other stream since the AOP started (speakersafetyd at
boot) otherwise faults the bus.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
MacBook Air 13" M5 (T8142): as on J873 the AOP firmware owns the audio
fabric and the CPU component is the T8152-style AOP audio driver. The
jack is a CS42L84 on "cout", the speakers four SN012776 (one woofer and
one tweeter per side) on "spkr", with their V/I sense on the same stream.

As on the other SN012776 laptops the table has a safe level, so the
speakers are behind the speaker protection interfaces from the bind:
under "Speaker Volume Unlock" their volumes stay at the lock's ceiling
until a protection daemon (speakersafetyd) holds them, and under "Speaker
Protection" they stay at the floor and no speaker start is admitted until
an owner is granted. Each amp's level is its apple,speaker-config from
the boot loader.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The MacBook Air J813's three microphones are the AOP's "hpai" service
(ADT iop-audio-controller/audio-hp-mic): the firmware runs the PDM part
and delivers 48 kHz float32 frames of three channels (the ADT's
audio-hp-mic-proxy description: 12 bytes per frame) on leap-s ADMAC RX0.
There is no codec, so it gets a card of its own with one capture PCM,
named like the other AOP microphone cards (AppleJ813HPAI, "MacBook Air
J813 High-Power Audio Interface", driver aop_audio) so that the existing
UCM and DSP configurations for those apply.

As on T8140: open attaches the service and requests pw0 (which raises
the LEAP fabric), powers the LEAP leaves (leap-s ADMAC, RX0, LEAP MCA),
and only then requests the channel, whose registers fault without them.
The trigger starts the DMA and queues pwrd behind it; started earlier,
the LEAP produces into a channel nobody services. Close releases the
channel, then pw0 and the leaves.

The card exists only where the DT gives the LEAP power domains (all
three); J873 is unchanged. The dmaengine substream setup moves into a
helper shared with the ASoC front-ends.

Tested on J813: a tone from the speakers reads -44 to -49 dBFS on all
three channels, 70 dB over the quiet floor, exactly while it plays;
PipeWire picks up the card with asahi-audio's J613 beamformer graph.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The MacBook Air (M5, J813) gets its jack, speakers and microphones from
the T8152 AOP audio driver. Build it beside the T8140 one.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
ti,bclk-ratio is only on the AOP-fed amplifiers (J813, J873). Test that
an amp without it, as on every MCA machine, keeps the ratio
auto-detection and that its probe writes neither TAS2764_CLK_CFG nor
TDM_CFG0's fixed-ratio bit, through a register map that records every
write; that 250 BCLKs programs code 0x30 and sets only that bit; and
that a ratio without a known code fails the probe.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The paused-capture restart at a frame boundary is the T8152 AOP audio
driver's alone: it passes a u32 frame size in the peripheral config for
its speaker sense capture. Test that a slave config as mca_hw_params()
builds it (zeroed, no peripheral config) and one with a peripheral config
of another size give no frame size, and that a resume realigns only a
capture channel with a frame size and a transfer, never a playback one,
so the MCA machines' channels resume as before.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Cover the AOP-fed machines in the speaker KUnit suites:

- apple-speaker-admission: J813 is admitted (it has a safe level), J873
  is not (it has none).
- apple-speaker-amp-level: neither carries an SN012776 gain; each amp's
  level is its apple,speaker-config from the boot loader.
- apple-speaker-interface: on the J813 table the four SN012776 volumes
  start at the volume lock's ceiling, go up only once a daemon holds the
  lock and pings, and under "Speaker Protection" sit at the floor with no
  speaker start admitted until an owner is granted.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan

Copy link
Copy Markdown
Contributor Author

Thanks, @RyanTheTide. All three are addressed. I force-pushed 3679438 -> 114ebfd, which is now 16 commits on integration/aurora 5186d2e. The description has the details.

  1. Rebased onto 5186d2e, which is past Fix SEP diagnostics source checks and KUnit compilation #1438. The rebase changed none of the 13 commits (git range-diff: all =), and integration has not touched the files they change since 064054d. I ran the source job's aurora-sep tests locally: they pass now. On 064054d, test_diag_policy and test_diag_sensor fail on diag_shim.c's linux/bitmap.h, as you said.

  2. The changes to shared drivers do nothing on M1/M2. I added KUnit tests for that (new commits):

    • tas2764: the property handling moved into tas2764_parse_bclk_ratio() and tas2764_apply_bclk_ratio() (squashed into the original commit). The new tas2764-bclk-ratio suite runs a register map that records every write:

      • Two amp nodes without ti,bclk-ratio, one with the ADT blocks the MCA machines get and one bare. Both keep the code at -1 and get no register write: CLK_CFG and TDM_CFG0 keep their values.
      • 250 BCLKs writes CLK_CFG = 0x30 and adds only TDM_CFG0's fixed-ratio bit.
      • 64 fails the probe.

      While doing this I also fixed the error path: a failed write now goes through err_sdz like the rest of tas2764_codec_probe(). It used to return with SDZ still high.

    • apple-admac: the two checks are now admac_config_realign_bytes() and admac_resume_realigns(). The new apple-admac-realign suite covers these cases:

      • A slave config built as mca_hw_params() builds it (zeroed, no peripheral_config) gets no frame size, and neither does a peripheral_config of the wrong size.
      • A resume realigns only a capture channel that has a frame size and a transfer, never a playback channel.

      Only t8152_aop_audio.rs passes the frame size, for its speaker sense capture.

    • macaudio: spk_dai_fmt and spk_secondary_only are 0 in every other table, and the driver reads them only when they are set.

    • Negative control: I made the TAS2764 write CLK_CFG without the property, then made the ADMAC realign playback. Each fails its new cases.

  3. J813 speaker protection: macaudio_j813_cfg has safe_vol -20 on the SN012776. macaudio_speakers_allowed() therefore admits it, has_safety is set, and both interfaces apply from the bind. The "Speaker volumes unlocked" in my earlier test was speakersafetyd (it has a j813.conf on that machine), not the driver.

    • KUnit: apple-speaker-interface has a new case on the J813 table, using the fake card whose four volumes carry the J813 amps' prefixes:

      • At the bind the volumes are at the lock's ceiling (1).
      • A daemon that holds the lock without pinging lifts nothing; after its ping the ceiling is 201.
      • Under "Speaker Protection" the volumes are at 0. Without an owner a grant is -EPERM and nothing is admitted. The owner's lease gives 201, and the release puts them back at 0.

      apple-speaker-admission now expects J813 to be admitted and J873 not.

    • On the J813, this branch plus drm/asahi, drm/apple: J813 (M5 MacBook Air) GPU and display on the macOS 27.0 firmware #1413:

      • systemctl stop speakersafetyd gives "Speaker volumes locked: Lock timeout". All four Speaker Volumes then read max 1, value 1, and root setting 201 gets 1. Each Amp Gain Volume reads max 15, the level in its apple,speaker-config from aura.
      • With "Speaker Protection" as the interface and no owner, the volumes are at 0. aplay of zeros to the speaker PCM fails with "Operation not permitted", and speaker_starts_refused goes from 0 to 1. The jack still plays.
      • Back to "Speaker Volume Unlock" with the daemon restarted, the volumes are unlocked again.
    • Two table fixes:

      • The J813 and J873 tables dropped amp_gain = 15. It is dead on the SN012776, which takes its level from apple,speaker-config (0x0f on all four J813 amps). Both are now in apple-speaker-amp-level's no-table check.
      • J873's comment and commit message said its speaker could be enabled with please_blow_up_my_speakers, which on integration cannot bypass admission. They now say it stays off because it has no safe level.

KUnit: 84 / 84 in arm64 QEMU at the head, with the kunitconfig from the description. These suites are not in CI. At each test commit it is 81 / 81 and 83 / 83. One run at the ADMAC test commit failed macaudio_spk_lease_expires, an existing test with a 10 ms lease, while the host was building at full load. It passed in four runs after that.

Per-commit build: 16 / 16. apple-dt-check: 0 new warnings, 10 fewer. The speakers still play: a 1 kHz tone at 0.05 reaches the microphones at -50 / -52 / -46 dBFS.

cc @Acelogic @DjDeveloperr @LiamRay10

The driver also runs the J813 (T8142, MacBook Air M5) speakers and
its microphone array card. Say so in the Kconfig help and the module
description, which still named only the Mac mini jack and speaker.

Signed-off-by: Diljit Singh <hey@djdev.me>
TAS2764_CLK_CFG went in between TAS2764_INT_CLK_CFG and its
TAS2764_INT_CLK_CFG_IRQZ_CLR field. Put the field back under its
register. No functional change.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Reviewed before merging. I found no correctness problems: the setup-port EPMAP endpoint discovery, the ADMAC capture realignment (only for a client that passes a frame size), the ti,bclk-ratio path (TAS2764_CLK_CFG is cached and writeable, so a resume's cache sync restores it), the new cs42l84 SDOUT1 routes, the J813 and J873 macaudio tables and the bindings all check out, and CI was green.

I pushed two small fixups as separate commits on top of yours, without changing your commits:

  • 8579c33950cb ASoC: apple: t8152-aop-audio: Describe T8142 and the microphones. The Kconfig help and the module description still named only the Mac mini jack and speaker.
  • de172b95d676 ASoC: tas2764: Keep the IRQZ_CLR bit next to INT_CLK_CFG. TAS2764_CLK_CFG had landed between that register and its field. No functional change.

I'll merge once CI is green on the new head.

Flush queued HPAI startup before releasing its dmaengine runtime, and
provide sync_stop so ALSA waits for asynchronous DMA termination before
reusing or freeing the capture buffer. This carries the microphone
lifetime handling already present in the J815 extension into the common
J813/T8152 foundation.

No speaker admission, gain, protection or device-tree behavior changes.

Signed-off-by: Diljit Singh <hey@djdev.me>
Pair the dmaengine front-end asynchronous STOP with sync_stop before
ALSA reuses or releases its buffer. Skip ASoC back-ends, which have no
dmaengine runtime, just as the T8140 AOP component does.

Signed-off-by: Diljit Singh <hey@djdev.me>

@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.

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

No remaining blocking source findings in the reviewed/integrated net change. The source DMA/work lifetime gaps are now fixed on the contributor branch, with author cosmetics and original ancestry preserved. Microphone STOP/close flushes pending HPAI start before DMA/channel reuse, MIC_PCM_OPS has sync_stop, and the ASoC component mirrors the established T8140 FE/BE sync_stop behavior. Only the same Rust file changes; no6amp/DT/protection behavior was added. The EXACT final tree63b92ef compiled sound/soc/apple/t8152_aop_audio.o successfully through linux-build/build with matching generated Rust bindings, CONFIG_RUST=y and the module=m, with no object diagnostics. SEP rust-build compiles only apple-sep.o and is NOT cited as this audio proof. Author's existing84-test shared ADMAC/TAS/admission evidence and J813 protected-audio reports remain attributed. Fresh Hosted CI and the existing kernel interlock/safe-ceiling checks must still hold before merge; no playback/hardware actions were performed here.

Approval does not waive pending CI, dependency order, hardware-safety gates or source-versus-release qualification. No source merge is an installed-loader write or a new hardware test.

…tion

Retain the reviewed DMA/work and FE/BE sync-stop lifetime fix, and combine
T8142 dynamic setup endpoints with current main AOP source/bound rings,
LPAI and other interfaces. Carry the reviewed policy-window test-only
correction, including unsafe-call negative controls.

The audio driver source is unchanged; actual object compilation follows.

Assisted-by: LLM
integration/aurora now has the agreed fix for the policy-window test,
aurora-silicon#1561 (ea10c4d). The earlier merge into this branch had carried a
different version of the same test change, and combining the two leaves
aurora-silicon#1561's deferred-call count at zero, which fails the source check. Take
integration/aurora's test file as it is: this pull request is J813
audio and changes nothing under tools/aurora-sep.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

I pushed 18fa06f, a merge of current integration/aurora. The earlier base merge into this branch (375393a) had carried its own version of the tools/aurora-sep/tests/test_policy_window.py fix. The agreed fix is #1561, now on integration/aurora, and the two versions merge without a conflict into a test that fails: the early continue keeps #1561's deferred-call count at 0. This merge takes integration/aurora's test file unchanged, so this PR no longer touches tools/aurora-sep. The audio, AOP, ADMAC and codec diffs are byte-for-byte what was reviewed (same patch-ids). The negative-control tests from 375393a can go to #1561's area as a separate PR if they're wanted.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Note for any lane that pushes to this branch: please don't push further changes to #1423.

Assisted by Claude Code

@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.

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

Current-head compile follow-up for 18fa06f (tracked tree 794d2a6c554bf0d3cbfaea23ed89be14418110a2): both sound/soc/apple/t8152_aop_audio.o and the merged drivers/soc/apple/aop.o compiled successfully as AArch64 objects through linux-build/build, with matching generated Rust bindings and both modules enabled. This closes the specific current-provider/current-consumer compilation gap; the older sound-only build is not being substituted for it.

Clang23.1.1, Rust1.99.0, corrected bindgen0.73.2. Audio object261696bytes/SHA256 d717ef8cde88b38dc21e0e3888ea54152de0cf596d5bba77f8c017cb50425ecd; AOP object807208bytes/SHA256 6717d1e5ab043b094d2a367d2794c7a893a7607bde0f9b2d758fd5b139ba44f9. Tracked source remained clean and unchanged throughout; prior build/rollback evidence retained.

Existing source approval stands. Current host and DT workflows passed; SEP workflow43068470145 is still queued at this read, so merge remains pending its actual result. This is object compilation, not a full kernel/module-link, hardware audio or playback qualification. Existing protected-audio evidence and kernel interlocks keep their original scope. No further branch changes, boot/default-loader changes or hardware operations were performed.

DjDeveloperr added a commit to m0d16l14n1/linux that referenced this pull request Nov 11, 2026
Carry byte-exact schema files from reviewed aurora-silicon#1423 at 18fa06f so the shared J813/J815 DT can be checked without inventing a second binding implementation.

Original binding updates by Thomas Glanzmann, signed off in commits 9afc945 and bb9ad0e. This is binding metadata only; no driver or speaker-protection adoption or parent edge is added. The M5 merge lane retains ownership of aurora-silicon#1423. Later identical binding changes coalesce in an ordinary merge.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr merged commit 33079a0 into aurora-silicon:integration/aurora Nov 11, 2026
5 checks passed
DjDeveloperr pushed a commit that referenced this pull request Nov 12, 2026
… stream

The J815 (MacBook Air 15-inch, M5) uses the T8142 speaker stream with
six amplifiers instead of J813's four. Its ADT audio-speaker node has
six slots (mask 0x3f) and twelve sense words (mask 0xfff), in
speaker-config order: left woofer 1, right woofer 1, left tweeter,
right tweeter, left woofer 2, right woofer 2.

Add a six-amplifier T8142 configuration and select it with
apple,speaker-amps = <6>. The firmware stream must match the PCM
exactly, so any other count, or the property on a SoC without a second
shape, fails the probe.

Tested on J815 on top of an earlier revision of the J813 audio series
(Linux #1423): all six amplifiers probe, the 12-channel sense PCM opens
at 48 kHz, and a low-level sweep of each speaker under speakersafetyd
found every speaker on its own playback slot and sense pair. Capped
playback and the microphones work. This exact revision has been
build-tested only.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
DjDeveloperr pushed a commit that referenced this pull request Nov 12, 2026
The J815 (MacBook Air 15-inch, M5) has J813's AOP-fed card with six
SN012776: two woofers and a tweeter per side, with left speakers in the
even slots and right speakers in the odd ones. Each amplifier sends a
voltage/current sense pair on the same stream. The speakers are locked
to the safe level until speakersafetyd holds the volume, as on J813.

Tested on J815 on top of an earlier revision of the J813 audio series
(Linux #1423): all six amplifiers probe, the 12-channel sense PCM opens
at 48 kHz, and a low-level sweep of each speaker under speakersafetyd
found every speaker on its own playback slot and sense pair. Capped
playback and the microphones work. This exact revision has been
build-tested only.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
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.

3 participants