Skip to content

J616s (M4 Pro): DisplayPort/HDMI audio: T6041 SIO backend, desktop DCP audio fixes, DPA1 chain - #1256

Merged
RyanTheTide merged 5 commits into
integration/aurorafrom
dpaj6/t6041-sio-dpaudio
Nov 8, 2026
Merged

RyanTheTide merged 5 commits into
integration/aurorafrom
dpaj6/t6041-sio-dpaudio

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

DisplayPort/HDMI audio on the M4 Pro (J616s: the built-in HDMI port and USB-C DP alt mode, through DCPEXT0). It stays behind appledrm.hdmi_audio (off by default) until it has been checked on a real monitor.

Commits

  • dmaengine: apple-sio: add the T6041 SIO. Adds strict apple,t6041-sio match data, kept separate from T6030 even though both report protocol 10:
    • the loader's control tables go out in the firmware's order and the driver adds the power-gating scalar 0x2a = 0;
    • the driver owns the segment array (0xaaa × 12 B) and the response array (0x1cc0 × 16 B) and publishes both as entry counts. DMA is registered only after the response count is ACKed;
    • the channel config is six words {shape, 0, 0x800, 0x600, 5, 0}, and recycled descriptors are cleared before reuse;
    • the probe refuses wrong tables, or any protocol other than 10, before it starts the coprocessor.
      The firmware is preloaded by iBoot. Nothing is loaded or shipped.
  • drm/apple: start desktop external audio on the T6041 DCPEXTs. The drm/apple: draft desktop 26.x external audio and J616s DPA graphs #729 path could never start on hardware: avep_init() required dcp->external, which is set only for apple,t6030-dcpext (hdmi_audio=1 logged "endpoint 0x2b (AUDIO) not started: audio init failed (-95)" on both DCPEXTs). This commit:
    • adds a desktop_external flag;
    • uses the service name dcpav-audio-interface-epic (unit 0);
    • matches compact announcements that the firmware cut to its 32-byte field (the role prefix pushes the name past it).
  • drm/apple: take the T6041 DCPEXT CEC interface on endpoint 0x2b. Adds a no-op CEC service (as on T6030), so the cut dcpav-cec-interface-ep no longer logs "unable to match".
  • arm64: dts: apple: t6040-j616s: enable the DPA1 audio chain. Adds the sio alias and enables the SIO CPU domain, DART, mailbox, DPA power domains and DPA1. The SIO node stays disabled: the loader enables it after the handoff (sio: hand the T6041 SIO its boot tables aura#120). DPA2/DCPEXT1 stays disabled.
  • Docs update.

Tests

  • KUnit apple-sio*: 22/22, including the new apple-sio-t6041 suite (admission, order, optional tables, every ACK failure, array counts, six-word config). apple-av-native-audio: 30/30, including the new admission and cut cases.
  • apple-av-audio-lifetime crashes in qemu with my kunitconfig. It crashes the same way on the untouched base 8a8adee, so this branch did not cause it.
  • J616s, silent, headless (test kernel 7.3.0-aurora-dpaj6a = 8a8adee + this branch minus the CEC commit, with an aura-try Stage 2 trial of aura#120 on the live head and this DTB, hdmi_audio=1):
    • the loader published the exact T6041 tables inside the SIO DART window;
    • SIO protocol v10, the probe bound, every setup ACK succeeded, and DMA was registered (128 channels);
    • no DART fault or SError;
    • dcp-dp-audio bound DPA1 and holds SIO channel 0x66;
    • card "Apple DisplayPort" is present, HDMI/DP Jack is off with nothing plugged in, and the channel maps are listed;
    • a raw hw_params at 48 kHz / 2 ch succeeded and hw_free succeeded (no sink, so no DMA configuration);
    • speakerguardd still grants (after the same one transient "no wiring" message seen on the M1 Pro); the self-check passed;
    • Enforcing, 0 AVC, 0 failed units;
    • the kernel warning classes match the fleet40 baseline except the CEC line, which the CEC commit fixes.
    • The first trial with the earlier aura build was also useful: the driver correctly refused the old table layout and left the SIO stopped (fail-closed).
  • Not covered: the CONFIGURE/ISSUE path and a real ELD need a sink. That is the audible check on a real monitor (daytime, low volume).

🤖 Generated with Claude Code

The M4 Pro/Max (T6041) SIO carries the DisplayPort/HDMI audio streams of
the external display processors. Its firmware reports protocol 10, as
T6030's does, but its boot contract differs, so the compatible selects it
and protocol 10 alone does not:

- the boot loader's control tables go to the firmware in a fixed order
  (panic buffer, map ranges, wrapper tunables, the optional register
  tables, a power-gating scalar 0x2a = 0, DMA shims, device types,
  performance buffer), each as its address and then its exact size;
- the driver owns the segment array (0xaaa entries of 12 bytes) and the
  response array (0x1cc0 entries of 16 bytes, one per endpoint and tag)
  and publishes both as entry counts; DMA is registered only after the
  response count is acknowledged;
- a channel configuration is six words: shape, timeout, FIFO size,
  refill threshold 0x600, the host default timeout 5 and a zero word;
- recycled period descriptors are cleared before reuse.

The probe refuses tables that are not exactly that contract (a missing,
repeated, unknown or wrongly sized table, the DMA arrays or the scalar
from the loader, or a table outside the windows the loader mapped) before
it starts the coprocessor, and refuses firmware that reports another
protocol. The firmware itself is preloaded by iBoot; nothing is loaded.

KUnit: apple-sio-t6041 covers admission, order, optional tables, every
ACK failure, the array counts and the six-word configuration; the
existing protocol 9 and T6030 suites are unchanged and pass.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
The desktop 26.x audio binding (endpoint 0x2b) could not start on any
Mac: avep_init(), its admission and the native-link check all required
dcp->external, which is set only for apple,t6030-dcpext. The M4 Pro/Max
external processors are apple,t6041-dcpext, so appledrm.hdmi_audio=1 on
the J616s logged "endpoint 0x2b (AUDIO) not started: audio init failed
(-95)" for both. Record the desktop external role in its own flag and use
it on those paths.

The audio interface those processors publish is dcpav-audio-interface-epic,
unit 0, not the provisional dcpav-audio-epic. With its role in front
("dispext0:") the compact announcement is longer than the 32-byte field
and arrives cut to 31 characters, without its unit. Let an ops entry name
its full "<name>:<unit>" (compact_full) and match a cut of it of at least
20 characters, only when the announcement filled its field; the admission
takes such a cut as unit 0 and nothing else.

The binding stays behind appledrm.hdmi_audio (off by default).

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
Enable what the first DisplayPort/HDMI audio stream needs: the SIO CPU
power domain, the SIO DART and mailbox, the DPA power domains and the
DPA1 client of DCPEXT0 (SIO channel 0x66). The SIO node itself stays
disabled: the boot loader enables it once it has reserved the firmware
iBoot preloaded and published the T6041 boot tables, and finds it through
the new "sio" alias. Without such a loader DPA1 waits for its channel.
DPA2 (DCPEXT1, channel 0x68) stays disabled until it is qualified.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
…hain

Name the published desktop audio service, describe how its cut compact
announcement is admitted, and say which part of the J616s DPA chain the
device tree enables and what the boot loader enables.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
Endpoint 0x2b of the M4 Pro/Max external processors also publishes their
CEC interface, which arrives cut to "dispext0:dcpav-cec-interface-ep".
Unmatched, every boot with appledrm.hdmi_audio=1 logged "unable to match
compact service". The host makes no use of CEC: take it with the same
no-op service the T6030 HDMI port uses and drop its reports.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware proof on the J616s (M4 Pro). Silent, headless, nothing plugged in, with the auto-revert guards armed (bootguard + aura-try trial-guard).

Default (no hdmi_audio): test kernel 7.3.0-aurora-dpaj6b = 8a8adee + this PR head db20365, booted on an aura-try Stage 2 trial (aura#120 on the live head, with this DTB).

  • apple-sio: "SIO protocol v10", bound. The T6041 tables were accepted.
  • dcp-dp-audio binds DPA1 but registers no card and holds no SIO channel, so the ALSA card list matches production (no renumbering).
  • Kernel warning classes: 5, the same as the fleet baseline.
  • Speaker protection granted, self-check passed, Enforcing, 0 AVC, 0 failed units.

appledrm.hdmi_audio=1 (dpaj6a, the same tree before the CEC commit):

  • card "Apple DisplayPort" is present, HDMI/DP Jack is off, and the channel maps are listed;
  • DPA1 holds SIO channel 0x66;
  • a raw hw_params at 48 kHz / 2 ch and hw_free both succeeded (unplugged path, so no DMA configuration);
  • protection still granted;
  • the only new warning class was the CEC "unable to match", which db20365 fixes.

Afterwards the Mac was put back on fleet41 with Stage 2 b6133b33, and the test kernels were removed.

Still needed: an audible check on a real monitor (SIO CONFIGURE/ISSUE, ELD, the DCPEXT0 link source byte). Until then this stays opt-in behind appledrm.hdmi_audio (default N).

🤖 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