Repository navigation
MacBook Neo DisplayPort audio; SIO channel records as macOS - #1280
Conversation
macOS 26.6 writes a six-word record for a DisplayPort audio channel: [2, 0, 0x800, 0x600, 0x800, 0] on T6041 and [2, 0, 0x800, 0x800, 0x800, 0] on T8140. The T6041 backend sent 5 as the limit: that is the host's mailbox call timeout, not part of the record. Send 0x800, as on the earlier SoCs. Add the T8140 (MacBook Neo) SIO: its firmware reports protocol 10 and takes the T6041 boot tables and driver-owned arrays (its ADT describes the same map-range, DMA shim and device-type tables key for key); its DisplayPort audio channels refill at 0x800, as its ADT dp-audioN records say. KUnit apple-sio-t6041: the T6041 and T8140 records, and the T8140 match. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
The MacBook Neo (J700, T8140) DCPEXT runs H17P firmware, but its DisplayPort/HDMI audio service is the desktop 26.x one: compact EPIC on endpoint 0x2b, dcpav-audio-interface-epic unit 0, with the 13.5 method numbers (open 4, close 5, prepare 6, start 7, stop 10, complete 11, elements 1/16, product attributes 1/18) and the same 64-byte link data. macOS 26.6 drives it that way. Take that role for the H17P external processor too: endpoint 0x2b speaks compact EPIC there (only that endpoint; the display endpoints stay as they are), avep_init starts it with the desktop service table when the firmware has the endpoint, and its messages are routed to the AV endpoint instance. Without an audio port in the device tree nothing changes. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
The J700 ADT power-state record of DPA1 (the external display's audio interface) names ANS and APCIE_ST as its parents. DPA_P is the parent of DPA0, the internal panel's. Describe DPA1 as the ADT does. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
macOS plays audio to external displays on the MacBook Neo. Its ADT ties dp-audio1 (SIO DMA channel 0x66, power state DPA1) to the DCPEXT; dp-audio0 belongs to the internal panel's DCP, which has no audio sink, and stays off. Describe DPA1 and its graph link to the DCPEXT, and enable the SIO DART (with the window above the preloaded firmware segments) and the SIO mailbox. The SIO node stays disabled: the boot loader enables it once it has reserved the preloaded firmware and published the boot tables, and finds it by the new sio alias. Without such a loader DPA1 waits for its DMA channel and nothing else changes. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
|
J616s receipt (T6041 record change). Kernel: dpa3n = this branch at 878ac25, as a one-shot entry; production Stage 2 already carries the DPA2 DTB. The SIO bound at protocol v10 with the macOS channel record [2, 0, 0x800, 0x600, 0x800, 0]. Over 3 DPMS cycles: 0 AFK warnings, and the sink came back each time with ELD 'QG270 S3' (DP). paplay at 48, 44.1 and 32 kHz into the Acer (no speakers, silent) ran clean with no SIO errors, and the user journal has 0 'open failed'. SELinux enforcing, 0 AVC denials, 0 failed units. Warning classes match fleet44 apart from one intermittent ANE startup retry, which recovered and is not in code this branch touches. The Neo receipt will follow. |
The J700 ADT has the SIO block as a power state of its own (SIO, off at boot), the parent of SIO_CPU and DPA_P; the SIO DART sits behind it. Only SIO_CPU was described, so the SIO firmware ran with its block unpowered and took an SError when it committed its DMA shim table (key 0x23). Describe it, make it SIO_CPU's and DPA_P's parent, and put the SIO DART on it, as on T6041. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
|
Neo trial 1, headless: dpa3n kernel + aura-try Stage 2 (cda450df + aura#120 + aura#122, DTB from this branch at 878ac25), pins kept, guards on. aura published the T8140 tables and enabled the SIO, and the firmware reported protocol v10. It then crashed when it committed the DMA shim table (key 0x23, size 0xd8) with an SError. The firmware's own dump showed its devices unmapped. The driver failed closed: probe -62, SIO down, nothing else affected. Cause: the J700 has a physical SIO power state (ADT SIO, pmgr 0x260, off at boot), the parent of SIO_CPU and DPA_P, and it was missing from the DT. Added in f5c5483 (ps_sio, with the SIO DART on it as on T6041). Trial 2 is queued for the Neo. |
|
Neo trial 2 (f5c5483 with ps_sio, dock and Acer QG270 S3 on the Neo's USB-C):
This stays a draft. Without aura#122 the new sio alias would make the current Neo loader publish the old-layout tables. The T8140 backend refuses those, but the branch must not ship before the SIO boots. |
The T8140 (MacBook Neo) SIO firmware reaches its MISC map range and its native DMA shims through the SIO DART at the physical addresses in its boot-table records. T6041 has a bypass stream for that; T8140 does not. With only the firmware and table windows mapped, the firmware ACKs the setup keys up to 0x23 and then takes an SError (with an AP event-log error) on its first MISC access, when 0x23 brings up the shims. The boot loader now reserves those ranges as apple,asc-mmio memory regions mapped 1:1 for the SIO, so the IOMMU core maps them before the probe. Check for them on T8140: every such region must be mapped whole at its own address, 16K aligned, within the DART reach and disjoint from the others, and at least one must exist. Otherwise leave the SIO stopped, as an older loader would crash it. The T6041/T8140 window limit (memory regions) grows from 8 to 16 to hold the native ranges next to the tables; T6030 keeps 8. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
When the T8140 (MacBook Neo) SIO firmware takes its DMA shim table (boot key 0x23) it brings up its native SPI and UART shims, which sit in those blocks. On the Neo spi_p and uart_p were off at that point, and the firmware took an SError there every boot (PC 0x1a16c, FAR 0x100000005c4, with an AP event-log error). On the J616s (T6041) spi_p happens to be on and the UART has no gate, so the same path worked. Make spi_p and uart_p parents of sio_cpu, next to sio. With them on, the Neo SIO takes every boot key and DisplayPort audio streams. Without a boot loader that enables the SIO nobody holds sio_cpu, so the states stay off as before. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
The I2C, FPWM, SPI and UART parents and AES sit in the SIO subsystem, as on t8103 and t8112, but the T8140 description left them without their sio parent, so sio could be off while one of them was powered. Give all eleven the ps_sio parent. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
# Conflicts: # drivers/dma/apple-sio-t6041-test.c # drivers/dma/apple-sio.c
|
Status update. This stays a draft until the stream is clean. SIO boot fixed (Neo hardware, aura-try trial). The SError at boot key 0x23 came from power. When the firmware takes its shim table, it brings up its native SPI and UART shims, and spi_p and uart_p were off on the Neo. On the J616s, spi_p happens to be on and the UART has no gate. With b43e048 (sio_cpu parents sio, spi_p and uart_p, the same pattern t8103 and t8112 use), the SIO takes every boot key and binds, card 8 gets its sink, and streams run at 48, 44.1 and 32 kHz. Enforcing, 0 AVC, 0 failed units. Also in this push:
Open, and blocking: a line-level loopback of the Acer's 3.5 mm output shows a one-sample timing slip every 672 frames (71.4 Hz), about -28 dB relative to the signal at every level. That is a rate mismatch of about 1488 ppm between the sample feed and the sink's recovered DP audio clock. Levels and harmonic THD (-57 dB) are fine. S16_LE plays digital silence. Both are under investigation. 🤖 Generated with Claude Code |
macOS runs a native DisplayPort audio link (the 13.5-numbered audio service: 14.7 external role, desktop 26.x, J700 DCPEXT) through six methods: prepare 6, start 7, did-start 8, will-stop 9, stop 10 and complete 11, each with the same link data. Linux skipped 8 and 9. Send did-start after start (a failure stops the link and fails the start) and will-stop before stop. 12.3 firmware has no such methods. The DPA takes one 32-bit entry per channel sample whatever the link sample size, and the SIO channel is configured for 32-bit entries, so packed S16_LE (one word per stereo frame) reached the sink as silence. Offer native links 32-bit containers only (S20/S24/S32) and pin the 24-bit element; userspace converts 16-bit streams. KUnit apple-dcpaud-release-link: the link sequences now carry did-start and will-stop. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
…MIO mapped" This reverts commit 2d6feba. The T8140 SIO does not need its MMIO mapped 1:1 in its DART. A Neo boot with a loader that publishes no such ranges booted the SIO cleanly once spi_p and uart_p are its parents, and no trial ever logged a DART fault. The boot-key 0x23 SError was the power state, not a missing translation. Drop the check and the larger window limit with it. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
|
Update (head ab57089, still a draft):
🤖 Generated with Claude Code |
A DisplayPort sink on a native audio link got its first link from the first stream, after the display's mode was set. On the MacBook Neo such a link left a monitor recovering a clock ~1500 ppm fast: it repeated one sample every ~680 frames (71 Hz sidebands around a 1 kHz tone, -28 dB). A link that was already running when the mode was set again played clean. As macOS does, give the connection its default link (stereo at the rate and sample size a stream is pinned to) before the display's mode is set, held with silence until a stream takes it over. The external mode set calls av_audio_before_modeset() just before set_digital_out_mode, when the sink's elements are known; it reaches the audio driver outside plug_lock, which the endpoint's receive path takes. A link already held and a running stream stay as they are, so later mode sets keep the link that runs through them. The link takes the same path as one a stream leaves behind: PREPARE, the silence as the channel's idle transfer, START and the started notification, with the PM reference; the first stream of that element follows it without a link call. A failed start unwinds and leaves the first stream to start its own link. KUnit: apple-dcpaud-release-link gains the hold sequence, the first stream on it, START and started-notification failures, and a missing channel. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
…tops dcp_external_stop_locked() powered the pipe off and withdrew the DPTX link first, and only then disconnected the AV audio service, which stops and completes a native audio link. With a link held at that point (a stream's, or the held link's silence), the next power-on of the display timed out on the MacBook Neo: apple-dcp 416e00000.dcp: external display activation failed: -110 apple-dcp 416e00000.dcp: display link not restored (-5), reporting it disconnected and the display stayed dark after a DPMS off/on until a reboot. Disconnect the audio service at the start of the stop, as the 14.7 external mode set does around its power cycle. It is connected again with the link (dcp_dptx_connect_raw()) before the pipe is powered on. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
…ld ones Each time the external display's DPTX link comes back after it was withdrawn (DPMS off/on, a replug), the MacBook Neo's external DCP announces its AV video and audio interfaces again under new interface numbers on the AV endpoint, without closing the previous ones. They were all from one AFK power generation, so afk_compact_slot() kept them as siblings: after seven DPMS cycles the endpoint had no slot left, apple-dcp 416e00000.dcp: AFK[ep:2b]: too many enabled compact services the new audio interface was never bound and display audio was gone until a reboot. Start a new generation when an external display that is not running is started, before its link is established, so each re-announced interface replaces the one it supersedes, as the hotplug endpoints' services do. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
|
Head 34ee031: integration/aurora 7a7cfa1 merged in, plus
MacBook Neo (J700), dock + 1080p180 DP monitor, monitor line out into a USB line-in, 1 kHz -20 dBFS S24 straight to the DP PCM, analysed per 1 ms for the tone phase:
|
…AV names The EDID harnesses extract dcp_afkep(), which now looks the J700 DCPEXT's audio endpoint up with IS_ERR_OR_NULL(), and the queue-quiesce control extracts afk_compact_capable(), which compares against AV_AUDIO_ENDPOINT_DESKTOP; the dropped-swap lifecycle fixture extracts dcp_external_start_locked(), which now starts an AFK power generation. Define the macro and the endpoint number in their preludes and add afk_power_gen to the fixture's struct apple_dcp, so the extracted units build again (service-rebind, provider-admission, ordered-rx and dropped-swap-teardown failed to compile). Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
|
Head 7c90838 adds "selftests: apple-dcp: give the EDID and lifecycle harnesses the J700 AV names": the harnesses that extract dcp_afkep(), afk_compact_capable() and dcp_external_start_locked() now define IS_ERR_OR_NULL(), AV_AUDIO_ENDPOINT_DESKTOP and afk_power_gen, so service-rebind, provider-admission, ordered-rx and dropped-swap-teardown build again. host-tests and dt-checks pass (224/224 locally). Also checked on the Neo with the Stage 2 from aurora-silicon/aura#122 at a4bae363 (contains aura#135): SIO protocol 10, the link held before the boot mode set, -20 dBFS loopback clean (residual -48.6 dB re tone, no phase steps), DPMS x3, SELinux enforcing, 0 AVC. Open before this can go into a release kernel: every boot of a kernel with this branch latches one AP event-log error ( This needs aurora-silicon/aura#122 in the Neo's Stage 2: without it the SIO stays stopped and there is no DP audio (the T8140 backend refuses the old table layout). |
The ADT describes the T8140 SIO power state as no_ps: it is on when the OS starts and has no state word the AP controls. ps_sio described it as an ordinary PMGR power state, so the pwrstate driver read the word at 0x260 at probe and wrote the auto-PM and target bits later. The PMGR register-access lockdown reports that access through the AP event-log handler, and every MacBook Neo boot with this node latched one uncorrectable error: apple_soc_edac 300700000.event-log-handler: hardware error: event-log source 0 Mark ps_sio apple,firmware-owned. The domain keeps its place as the parent of the SIO CPU, DPA_P and the SIO peripheral states, and the driver no longer reads, writes or resets its register. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
DPA1's ADT record names DPA_P as its only parent, as DPA0's does. ANS and APCIE_ST are the parents of the next record, APCIE_SYS_ST; the earlier change read the parent list of the wrong record. Give DPA1 the same parent as DPA0. Fixes: fbc87b1 ("arm64: dts: apple: t8140: give DPA1 the parents the ADT names") Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
|
Fixed the event-log error that every boot with this branch logged (
MacBook Neo, one-shot 7.3.0-aurora-dbr1280a (this head), Stage 2 aura bd9f3e82 + aura#122 with this head's j700 DTB, checked at 40 s and 217 s uptime:
🤖 Generated with Claude Code |
DisplayPort/HDMI audio for the MacBook Neo (J700, T8140), as macOS has it. This also changes the SIO channel record on the M4 Pro/Max to match macOS.
Reference: the live J700 ADT (macOS 26.6.2) and a clean-room behavioural spec of macOS 26.6 (25G83, RELEASE_ARM64_T8140). The spec has no Apple code and no binary details.
Commits
sioalias. The boot loader enables the SIO node once it has published the T8140 boot tables (sio: the MacBook Neo (T8140) takes the T6041 SIO tables aura#122). Without that loader, DPA1 waits for its DMA channel and nothing else changes.Testing
Draft until the hardware receipts are in.
🤖 Generated with Claude Code