Repository navigation
drm/apple: audio: open the DCP PCM without a sink, and release data_lock on a DMA error - #169
Merged
RyanTheTide merged 2 commits intoOct 8, 2026
Conversation
dcp_pcm_open() takes data_lock before dcpaud_init_dma() and returns its error with the lock still held. The next open, the hotplug notifications (dcpaud_connect()/dcpaud_disconnect()) and hw_params/prepare (through dcpaud_connection_up()) all take data_lock and then block forever. Unlock before returning. Signed-off-by: Christian Bartels <[email protected]>
dcp_pcm_open() fails with -ENXIO while no display is connected, because the format and rate constraints come from the sink's audio elements. PipeWire and PulseAudio probe every PCM of a UCM profile once, when the card appears: they open it, set hw_params and prepare it. If that fails, the profile is marked unsupported for good, and udev "change" events for a card that has already been seen are ignored. So on a Mac booted without a monitor on HDMI or USB-C, a display attached later never gets an audio output until the sound server is restarted. Let the PCM open without a sink, with a plain stereo fallback (2 channels; 32, 44.1 or 48 kHz; S16, S24 or S32), as HDMI PCMs on other platforms do. hw_params and prepare succeed as no-ops for such an open, since alsa-lib prepares straight after hw_params. trigger still fails until a sink is connected, so nothing is sent to a missing display. Once a display is attached, the next open gets the sink's real constraints. Tested on a MacBook Pro 14" M1 Pro (j314s) with a 4K monitor on the built-in HDMI port: booted without a monitor on HDMI, the HDMI output appears when the monitor is plugged in, without restarting WirePlumber, and plays. Audio over DP alt mode on USB-C was not tested. Signed-off-by: Christian Bartels <[email protected]>
This was referenced Oct 4, 2026
This was referenced Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a Mac booted without a monitor on HDMI or USB-C, a display plugged in later never gets an audio output until WirePlumber or PulseAudio is restarted.
Cause:
dcp_pcm_open()returns-ENXIOwhile no sink is connected, because the PCM constraints come from the sink's audio elements. PipeWire's ACP probes every PCM of a UCM profile once, when the card appears: open,hw_params, and alsa-lib's automatic prepare. If that fails, it marks the profile unsupported for good. spa's udev monitor ignores "change" events for a card it has already emitted, so a later hotplug never triggers a new probe.Commits:
drm/apple: audio: release data_lock when DMA setup fails on open:dcp_pcm_open()returned thedcpaud_init_dma()error withdata_lockstill held. Everything that takes that lock then blocks, including the next open, the hotplug notifications andhw_params/prepare. This is an independent bug fix.drm/apple: audio: allow opening the PCM without a sink:hw_paramsandprepareare no-ops for such an open.triggerstill fails until a sink is connected, so nothing is sent to a missing display.Testing: MacBook Pro 14" M1 Pro (j314s), 4K monitor on the built-in HDMI port, plus a UCM profile for the DCP audio cards (AsahiLinux/alsa-ucm-conf-asahi#9).
RUNNING,hw_ptr0), until WirePlumber was restarted. I couldn't reproduce it afterwards, including the first-hotplug case today.Not tested: audio over DP alt mode on USB-C, and other Mac models.
audio.conaurora-wip(f9572b54204e) is identical to the base I tested on, so the commits apply as they are. checkpatch is clean.