Skip to content

drm/apple: clean display power-on for DP audio (refused Open, reopen, ELD refresh) - #1277

Merged
RyanTheTide merged 3 commits into
integration/aurorafrom
dpa3/display-audio-clean
Nov 9, 2026
Merged

RyanTheTide merged 3 commits into
integration/aurorafrom
dpa3/display-audio-clean

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Follow-up to #1267 (display audio on by default). Fixes the one kernel warning that came with every external display power-on, and a missing monitor name on a freshly plugged display.

The warning

apple-dcp ...: AFK[ep:2b]: unexpected compact reply c0 on interface N, once per DPMS on, on the J616s with an external display.

Cause, from a probe kernel that logged every compact message on endpoint 0x2b (J616s, Acer QG270 S3 on a USB-C dock, three DPMS cycles):

  1. At DPMS on, the jack turns on for the audio interface instance the DCP already had. The firmware replaces that instance about 160 ms later.
  2. PipeWire opens the PCM about 25 ms after the jack turns on. The Open (group 0, method 4) goes to the old instance.
  3. That instance refuses at once with the call's descriptor alone: 00 0c 00 00 d7 02 00 e0. That is the request's status (0xc00), with IOReturn 0xe00002d7 (kIOReturnOffline) where the length goes, and no call header.
  4. The reply matcher wanted the call header back for every service call. The refusal matched nothing, so the warning was logged and the Open waited out its 1 s timeout before the retry from drm/apple: display audio on by default, ELD names, J616s DCPEXT1 audio #1267 reopened it on the new instance.

Commits

  • drm/apple: take a refused compact call's bare descriptor as its answer. A descriptor-only reply now matches its call by status and completes it as refused. Offline, not-ready and no-device return -ENODEV; any other refusal returns -EREMOTEIO. The refusal is logged at debug level.
  • drm/apple: reopen display audio on the instance that replaces a refused one. On -ENODEV, the Open waits up to 1 s for the next instance to be published (a waitqueue woken when one is), then opens that one. Two new KUnit cases in apple-av-native-audio: a refused Open with a successor, and one without.
  • drm/apple: update the display audio ELD when the sink's EDID arrives. The firmware reports a new sink before its EDID is read, then reports it again once the mode is set. The card kept the first ELD, which had no monitor name and only the basic-audio fallback. A connected sink reported again with a different ELD now updates the ELD control, which is notified.

Testing (J616s, silent: streams only into the Acer, which has no speakers)

Test kernel: integration 8c4b5c5 plus these commits, as a one-shot entry with an aura-try Stage 2 trial (#1267 DTB, DPA2 enabled). Bootguard and trial guard were on.

  • 4 DPMS cycles: 0 "unexpected compact reply" warnings (before: 1 per cycle). After the refusal the Open goes to the new instance 177 ms later (before: 1.0 s). The user journal has 0 "open failed". The sink comes back each time. paplay at 48, 44.1 and 32 kHz works.
  • DCPEXT1, no replug: with appledrm.typec_hybrid_first=0 set at runtime, rebinding the dock port's Type-C controller moves the display to DCPEXT1. Card 9 (DPA2, SIO channel 0x68) turns its jack on and the sink alsa_output.platform-audio-controller-2.HiFi__HDMI1__sink appears; streams at all three rates work. Without the third commit, card 9's ELD had no monitor name and reported an HDMI connection. With it, the ELD is version 2, 'QG270 S3', DP.
  • SELinux enforcing, 0 AVC denials, 0 failed units. Warning classes match fleet43, apart from the module-swap taint line.
  • M2 (silent, no external display attached): card 8 binds and its jack is off. The built-in cards are unchanged, speaker protection is granted, and there are no new warning classes.
  • KUnit apple-av-native-audio: see the comment below.

This does not touch sound/soc/apple, mca, macaudio or the speaker DT nodes, so the user-path speaker gate does not apply.

🤖 Generated with Claude Code

A desktop 26.x DCP refuses a service call by answering with the call's
descriptor alone: the request's status, and an IOReturn where the length
goes. The reply matcher wanted the call header back for every service
call, so a refusal matched nothing: it logged "AFK[ep:2b]: unexpected
compact reply c0" and the call waited out its full timeout.

On the J616s this happens every time an external display powers on. The
display audio sink is reported on the audio interface instance the DCP
had, PipeWire opens it within some 25 ms, and that instance, which the
firmware replaces about 160 ms later, refuses the Open with
kIOReturnOffline (0xe00002d7). Captured on the J616s with the Acer
QG270 S3 on a USB-C dock, three DPMS cycles: each Open (group 0, method
4, status tag 0xc00) was answered at once with the 8-byte descriptor
00 0c 00 00 d7 02 00 e0.

Match a bare descriptor by its status alone and complete the call with
the refusal: -ENODEV for an interface that is offline, not ready or not
there, -EREMOTEIO for anything else, at debug level.

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

An Open that the dying audio interface refuses (kIOReturnOffline) now
fails at once instead of after its 1 s timeout. The retry looked for the
replacement instance right away, but the firmware publishes it some
160 ms later, so the Open would have failed and PipeWire would have
dropped the output.

On -ENODEV, wait up to 1 s for the next instance to be published, then
open that one. After a display wakes up, its audio output is back about
200 ms after the jack turns on instead of a second later.

KUnit: apple-av-native-audio gains a refused Open with a successor
(reopened on the successor) and without one (fails after the wait).

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
The firmware reports a newly attached sink before the DCP has read its
EDID, and reports it again once the mode is set. The card took the ELD
only from the first report, so a display plugged in after boot, or one
moved to another display processor, kept an ELD with no monitor name
and the basic-audio fallback: on the J616s, the Acer QG270 S3 moved to
DCPEXT1 showed up as an unnamed HDMI sink while the same display on
DCPEXT0 had its name.

When a connected sink is reported again with a different ELD, store it
and notify the ELD control, as HDMI codecs do when the ELD changes.

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

Copy link
Copy Markdown
Contributor Author

KUnit (arm64 qemu, buildbox, head 11319ea): apple-av-native-audio 34/34 passed, including the 4 new refused-Open cases. AFK suites (apple-afk-ring, apple-afk-service-lifetime, and the rest matching afk) 16/16 passed. Hardware receipts are in the PR description.

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 9, 2026 02:52
@RyanTheTide
RyanTheTide merged commit 1852f26 into integration/aurora Nov 9, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the dpa3/display-audio-clean branch November 9, 2026 04:26
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