-
Notifications
You must be signed in to change notification settings - Fork 312
ucm2: sof: hdmi: Add 5.1 and 7.1 variants of HDMI devices when using IPC4 #633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The 5.1 variant advertises 6 channels while the 7.1 variant 8 channels. These will be only used if the SectionUseCase defines the variants. Signed-off-by: Peter Ujfalusi <[email protected]>
… is not empty Iec61937Pcms1 indicates that the IPC4 is in use and we have HDMI PCM devices configured to use ChainDMA. This translates to support for multichannel audio and passthrough. In such case define the "HiFi 5+1" and "HiFi 7+1" variants which is handled by the hdmi configuration. Signed-off-by: Peter Ujfalusi <[email protected]>
…not empty Iec61937Pcms1 indicates that the IPC4 is in use and we have HDMI PCM devices configured to use ChainDMA. This translates to support for multichannel audio and passthrough. In such case define the "HiFi 5+1" and "HiFi 7+1" variants which is handled by the hdmi configuration. Signed-off-by: Peter Ujfalusi <[email protected]>
|
pipewire issue and discussion: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4755#note_3171336
A little correction: UCM does not set PlaybackChannels for HDMI devices (but it's assumed that the number is 2 by default when this variable is missing). |
|
@perexg, I think this is not a workable solution, it results too confusing UI for end users. |
|
To compare with the "legacy" ACP driver which combines only HDMI and analog I/O (sorry, some names are in Czech, but it does not matter for this example):
I think that we should move this discussion to https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4755 , because it's mostly about to put a lot of variants to one dimensional array. |
|
@perexg, I guess this is also boils down on how PW/WP interprets legacy HDA and UCM (SOF HDA or SNDW for example) In Legacy you select Analog Duplex as profile and then you can select Speaker/Headphone for the Playback port, and also select the port for capture. Basically you have a single Playback/Capture device per ALSA card (?), hence when you want to use HDMI, the speaker is on a different profile With UCM card you select the profile and that might or might give you a list of different devices that you can select from it kind of provides the same information, but in a different way, right? There are rough edges with this imho, but it is not related to the Variant change at all. I have a version which 'emulates' what legacy does by hiding the playback devices for the surround profiles, but I don't think that is the right thing to do. If you think this is a good way to move forward, I will re-open the PR and see how we can make things better via PW and UIs for users? Note: The same machine at the same time with |
|
@perexg, another thing I have observed with this variant change is that the mics starts to hoard the ConflictingDevices on the 5+1 an 7+1 variants, It does not seam to affect functionality and I'm yet to figure out how to prevent such buildup of conflicts.. |
If I put the ConflictingDevice settings in Then only the devices under the "HiFi" verb have ConflictingDevices, "HiFi 5+1" and "HiFi 7+1" devices are all without this marker, I guess this is not good either, but again, does not seam to affect UI or |
|
I bet that the issue is alsa-lib variant code - the macros and variables should be "reset" for each variants to initial state. Actually they are preserved. Variables are mostly overwritten, but for macro array '[]' blocks, the new contents is appended, thus you see duplicated entries (equivalent to variant iteration). I'll fix that. |
It is necessary to reset the state logic before each verb variant is parsed. So save the original variable list and macros and restore them before each parser iteration. BugLink: alsa-project/alsa-ucm-conf#633 Signed-off-by: Jaroslav Kysela <[email protected]>
|
@perexg, I think the channel mapping issue is identified and with https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2647 it is going to be sorted out. for background and debugging with user see: thesofproject/linux#5627 I will re-open this PR as this is now the second user who hit the same issue that 5.1/7.1 is not available and then the channels got spread out 'randomly' |
|
@perexg, if https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4928 is implemented then we are not going to need variants at all, right? PW will ignore some or all information from UCM regarding to HDMI and will use ELD to magically present the surround configurations. |
|
Yes, I already noted that the forced variants are not the best idea when we know the device parameters through ELD (handling also the device parameter changes through standard ALSA control API event mechanism). Note that in |
|
This has the benefit that it will make it work right away. Even distros released this spring could get the fix. Pipewire work seems to be stuck at design decisions and it requires UI support from DE which will delay it even further. Meanwhile users of past several intel generations can't get surround sound output. I think it would be nice to get this done here, then calmly wait for ELD approach to finalize. |
|
We may follow the SplitPCM application variable (feature handshake) - alsa-ucm-conf/ucm2/common/pcm/split.conf Line 55 in 4d9d7ad
For example: If EDIT: Changed variable name from |
|
@perexg, the If we could have a flag for a SectionDevice to instruct the application (PW) to look at the PCM device/ELD/etc for information on what is supported? |
Yes, it's problematic. Maybe we can also add ELD parsing support to UCM to filter out the "unsupported" UCM devices, but there are other issues that UCM does not handle like plugging monitor when UCM is probed... So the best way is to handle this on the server side at the moment.
To my knowledge, the current PW/PA automatically detects ELD elements through the control API associated to the given PCM device. I believe that presence of this element is enough to detect the HDMI/DP PCM device. So nothing else is required. |




Systems using IPC4 can support up to 8 channels of audio (and passthrough) via HDMI.
In UCM the default PlaybackChannels is set to 2, which prevents users from selecting multichannel configurations.
When probing the card, Pipewire will drop configurations that are not supported either by the PCM device or based on ELD information.
This means that if the equipment supports only stereo then the 5.1 and 7.1 variants should not be visible, if the equipment is 5.1 capable, then only the 7.1 variant is removed.
The kernel will refine the PCM parameters based on the ELD information as wall when https://lore.kernel.org/linux-sound/[email protected]/ is applied.
@perexg, @wtay, @ford-prefect, is this something which can help PW and user space to handle the HDMI a bit better with SOF?