Skip to content

Commit

Permalink
ucm2: sof-soundwire: Create ALSA config file for hdmi:
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=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: 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 a4115e8 commit 2740b6c
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions ucm2/sof-soundwire/sof-soundwire.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Define {
HeadsetCodec1 ""
MicCodec1 ""
Mics1 "0"
Iec61937Pcms1 ""
}

DefineRegex {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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" }
}

0 comments on commit 2740b6c

Please sign in to comment.