Skip to content

Commit

Permalink
ucm2: Intel/sof-hda-dsp: Create ALSA config file for
Browse files Browse the repository at this point in the history
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=sofhdadsp,DEV=0
hdmi:CARD=sofhdadsp,DEV=1
hdmi:CARD=sofhdadsp,DEV=2

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

Closes: alsa-project#411
Signed-off-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
  • Loading branch information
ujfalusi authored and perexg committed Apr 29, 2024
1 parent a3e1786 commit a4115e8
Showing 1 changed file with 51 additions and 3 deletions.
54 changes: 51 additions & 3 deletions ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
Syntax 6

Define.DeviceMic "Mic"
Define.DeviceDmic ""

Include.card-init.File "/lib/card-init.conf"

Define {
DeviceMic "Mic"
DeviceDmic ""
Iec61937Pcms1 ""
}

DefineRegex {
Iec61937Pcms {
Regex "iec61937-pcm:(([0-9]+(,))*[0-9]+)"
String "${CardComponents}"
}
}

If.devdmic {
Condition {
Type String
Expand Down Expand Up @@ -115,3 +125,41 @@ If.Capture {
cset "name='Capture Switch' on"
]
}

Include.hdmi-pcm.File "/common/pcm/hdmi.conf"

If.Hdmi3-iec61937 {
Condition {
Type RegexMatch
Regex "((^|,)[3](,|$))"
String "${var:Iec61937Pcms1}"
}
True.Macro.hdmi3.HdmiPCM { Device 3 Index 0 }
}

If.Hdmi4-iec61937 {
Condition {
Type RegexMatch
Regex "((^|,)[4](,|$))"
String "${var:Iec61937Pcms1}"
}
True.Macro.hdmi4.HdmiPCM { Device 4 Index 1 }
}

If.Hdmi5-iec61937 {
Condition {
Type RegexMatch
Regex "((^|,)[5](,|$))"
String "${var:Iec61937Pcms1}"
}
True.Macro.hdmi5.HdmiPCM { Device 5 Index 2 }
}

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

0 comments on commit a4115e8

Please sign in to comment.