]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
ucm2: sof-soundwire: Create ALSA config file for hdmi:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 11 Apr 2024 12:07:30 +0000 (15:07 +0300)
committerJaroslav Kysela <perex@perex.cz>
Mon, 29 Apr 2024 13:36:17 +0000 (15:36 +0200)
If the HDMI PCM index (3-5) is found in iec61937-pcm list of the card's
components list then use the HdmiPCM/HdmiPCMSave macros to create the
configuration file.

The PCMs that will be created are:
aplay -L | grep hdmi

hdmi:CARD=sofsoundwire,DEV=0
hdmi:CARD=sofsoundwire,DEV=1
hdmi:CARD=sofsoundwire,DEV=2

Audio servers (Pulseaudio, Pipewrire) or applications then can use these for
bytestream passthrough, for example:
mplayer -ao alsa:device=hdmi=sofsoundwire,DEV=0 -ac hwdts <video with dts>

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/411
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/sof-soundwire/sof-soundwire.conf

index 35a262c46d38b20230ab02231fddb90597af88fc..34ceb64c98cf680507b0cb57a7fc0659ca011c69 100644 (file)
@@ -15,6 +15,7 @@ Define {
        HeadsetCodec1 ""
        MicCodec1 ""
        Mics1 "0"
+       Iec61937Pcms1 ""
 }
 
 DefineRegex {
@@ -42,6 +43,10 @@ DefineRegex {
                Regex " cfg-mics:([1-9][0-9]*)"
                String "${CardComponents}"
        }
+       Iec61937Pcms {
+               Regex "iec61937-pcm:(([0-9]+(,))*[0-9]+)"
+               String "${CardComponents}"
+       }
 }
 
 If.hs_init {
@@ -103,3 +108,41 @@ If.mics-array {
                exec "-nhlt-dmic-info -o ${var:LibDir}/dmics-nhlt.json"
        }
 }
+
+Include.hdmi-pcm.File "/common/pcm/hdmi.conf"
+
+If.Hdmi5-iec61937 {
+       Condition {
+               Type RegexMatch
+               Regex "((^|,)[5](,|$))"
+               String "${var:Iec61937Pcms1}"
+       }
+       True.Macro.hdmi5.HdmiPCM { Device 5 Index 0 }
+}
+
+If.Hdmi6-iec61937 {
+       Condition {
+               Type RegexMatch
+               Regex "((^|,)[6](,|$))"
+               String "${var:Iec61937Pcms1}"
+       }
+       True.Macro.hdmi6.HdmiPCM { Device 6 Index 1 }
+}
+
+If.Hdmi7-iec61937 {
+       Condition {
+               Type RegexMatch
+               Regex "((^|,)[7](,|$))"
+               String "${var:Iec61937Pcms1}"
+       }
+       True.Macro.hdmi7.HdmiPCM { Device 7 Index 2 }
+}
+
+If.HdmiIec61937 {
+       Condition {
+               Type RegexMatch
+               Regex "((^|,)[567](,|$))"
+               String "${var:Iec61937Pcms1}"
+       }
+       True.Macro.save_hdmi_cfg.HdmiPCMSave { Name "42-sof-hdmi" }
+}