Skip to content
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

[DNM] common: pcm: hdmi/sof-hda-dsp/sof-soundwire: Syntax 7 dependent macro to generate the hdmi device sections #413

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ujfalusi
Copy link
Contributor

@ujfalusi ujfalusi commented Apr 30, 2024

Hi,

The PR will introduce a generic HdmiDevice macro, which can replace duplicated conditions in sof UCM files and potentially used by other devices to generate the needed section for the hdmi PCM devices to allow passthrough.

The PR is marked as DNM and is in draft since the change depends on Syntax 7 support, which is only available in git version of alsa-lib, it is not a simple ask for a user (or developer) to use it and the change would break UCM for released alsa-lib.

@perexg, is this something that you were suggesting? I think the macro and it's definition is generic enough, I hope that it will be usable for non SOF setups.

…evice

The new HdmiDevice macro can be used to create the hdmi PCM device for a
hardware PCM whose ID can be found in the Iec61937Devices comma separated
device ID list.
It is the caller's responsibility to pass correct device id of an HDMI PCM
as Dev.

The new macro needs Syntax 7 support.

Example for a use by sof-hda-dsp where the HDMI devices are 3, 4 and 5

Macro.0.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 3 Idx 0 }
Macro.1.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 4 Idx 1 }
Macro.2.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 5 Idx 2 }

If.HdmiIec61937 {
	Condition {
		Type RegexMatch
		Regex "((^|,)[345](,|$))"
		String "${var:Iec61937Pcms1}"
	}
	True.Macro.save_hdmi_cfg.HdmiPCMSave { Name "42-sof-hdmi" }
}

The Iec61937Pcms1 contains a match string of "5,4,3"

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…ation

The duplicated code for the hdmi device creation can be removed by using
the HdmiDevice macro.

The macro needs Syntax 7 to work (variable as parameter support), update
the Syntax version of the file as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The duplicated code for the hdmi device creation can be removed by using
the HdmiDevice macro.

The macro needs Syntax 7 to work (variable as parameter support), update
the Syntax version of the file as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
@perexg
Copy link
Member

perexg commented Apr 30, 2024

It looks fine. Let's merge this when alsa-lib is released.

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.

None yet

2 participants