Skip to content

Conversation

@ujfalusi
Copy link
Collaborator

@ujfalusi ujfalusi commented Oct 15, 2025

User space (alsa-lib) uses the PCM device name to detect HDMI devices, the name is expected to be in form of 'HDMI'++number. The PCM device name is not configured in ASoC, only the PCM id is set based on the loaded topology.

Detect the HDMI PCM playback devices and configure the name to help user space to handle HDMI PCMs correctly.

aplay -l | grep HDMI (Audio capable monitor connected) Before the change:
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 () []
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (
) []
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) []

after the change:
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 () [DELL P1917S]
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (
) [HDMI 2]
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) [HDMI 3]

bardliao
bardliao previously approved these changes Oct 16, 2025
kv2019i
kv2019i previously approved these changes Oct 16, 2025
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very useful! One improvement idea inline (for code comments).


/*
* Make sure that the name is in"HDMI<SPACE>x" format as this is
* expected by user space
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe even add reference to alsa-lib __snd_pcm_info_eld_fixup() called in alsa-lib snd_ctl_hw_pcm_info()...?

User space (alsa-lib) uses the PCM device name to detect HDMI devices, the
name is expected to be in form of 'HDMI'+<space>+number.
The PCM device name is not configured in ASoC, only the PCM id is set based
on the loaded topology.

Detect the HDMI PCM playback devices and configure the name to help user
space to handle HDMI PCMs correctly.

aplay -l | grep HDMI (Audio capable monitor connected)
Before the change:
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 (*) []
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (*) []
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) []

after the change:
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 (*) [DELL P1917S]
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (*) [HDMI 2]
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) [HDMI 3]

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
@ujfalusi ujfalusi dismissed stale reviews from kv2019i and bardliao via f4fa815 October 17, 2025 05:20
@ujfalusi ujfalusi force-pushed the peter/sof/pr/hdmi-pcm-name branch from fa3fc0e to f4fa815 Compare October 17, 2025 05:20
@ujfalusi
Copy link
Collaborator Author

Changes since v1:

  • comment extended with reference to alsa-lib

@ujfalusi ujfalusi merged commit 1651828 into thesofproject:topic/sof-dev Oct 27, 2025
6 of 16 checks passed
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.

4 participants