diff --git a/SPECS/alsa-ucm-git.patch b/SPECS/alsa-ucm-git.patch new file mode 100644 index 0000000..43b9d26 --- /dev/null +++ b/SPECS/alsa-ucm-git.patch @@ -0,0 +1,433 @@ +diff --git a/ucm2/HDA-Intel/HDAudio-DualCodecs.conf b/ucm2/HDA-Intel/HDAudio-DualCodecs.conf +index 8aaabd0..6fd7bd1 100644 +--- a/ucm2/HDA-Intel/HDAudio-DualCodecs.conf ++++ b/ucm2/HDA-Intel/HDAudio-DualCodecs.conf +@@ -4,3 +4,15 @@ SectionUseCase."HiFi" { + File "HiFi-dual.conf" + Comment "Default" + } ++ ++BootSequence [ ++ cset "name='Headphone Playback Volume' 60%" ++ cset "name='Headphone Playback Switch' off" ++ cset "name='Speaker Playback Volume' 60%" ++ cset "name='Speaker Playback Switch' on" ++ cset "name='Front Playback Volume' 100%" ++ cset "name='Front Playback Switch' on" ++ cset "name='Rear-Panel Capture Volume' 100%" ++ cset "name='Rear-Panel Capture Switch' on" ++ cset "name='Input Source' Rear Mic" ++] +diff --git a/ucm2/HDA-Intel/Hdmi.conf b/ucm2/HDA-Intel/Hdmi.conf +index c8b6e77..c533e49 100644 +--- a/ucm2/HDA-Intel/Hdmi.conf ++++ b/ucm2/HDA-Intel/Hdmi.conf +@@ -6,6 +6,7 @@ If.hdmi1 { + Define { + HdmiNum 1 + HdmiPCM 3 ++ HdmiCtlIndex 0 + HdmiPrio 1100 + } + Include.hdmi1.File "/codecs/hda/hdmi.conf" +@@ -18,6 +19,7 @@ If.hdmi2 { + Define { + HdmiNum 2 + HdmiPCM 7 ++ HdmiCtlIndex 1 + HdmiPrio 1200 + } + Include.hdmi2.File "/codecs/hda/hdmi.conf" +@@ -30,6 +32,7 @@ If.hdmi3 { + Define { + HdmiNum 3 + HdmiPCM 8 ++ HdmiCtlIndex 2 + HdmiPrio 1300 + } + Include.hdmi3.File "/codecs/hda/hdmi.conf" +@@ -42,6 +45,7 @@ If.hdmi4 { + Define { + HdmiNum 4 + HdmiPCM 9 ++ HdmiCtlIndex 3 + HdmiPrio 1400 + } + Include.hdmi4.File "/codecs/hda/hdmi.conf" +@@ -54,6 +58,7 @@ If.hdmi5 { + Define { + HdmiNum 5 + HdmiPCM 10 ++ HdmiCtlIndex 4 + HdmiPrio 1500 + } + Include.hdmi5.File "/codecs/hda/hdmi.conf" +@@ -66,8 +71,9 @@ If.hdmi6 { + Define { + HdmiNum 6 + HdmiPCM 11 ++ HdmiCtlIndex 5 + HdmiPrio 1600 + } +- Include.hdmi5.File "/codecs/hda/hdmi.conf" ++ Include.hdmi6.File "/codecs/hda/hdmi.conf" + } + } +diff --git a/ucm2/HDA-Intel/HiFi-acp.conf b/ucm2/HDA-Intel/HiFi-acp.conf +index 15eeca5..123ae15 100644 +--- a/ucm2/HDA-Intel/HiFi-acp.conf ++++ b/ucm2/HDA-Intel/HiFi-acp.conf +@@ -4,6 +4,5 @@ SectionDevice."Mic1" { + Value { + CapturePriority 100 + CapturePCM "hw:${var:AcpCardId}" +- CaptureMixerElem "Capture" + } + } +diff --git a/ucm2/HDA-Intel/HiFi-dual.conf b/ucm2/HDA-Intel/HiFi-dual.conf +index cff948e..f2c6915 100644 +--- a/ucm2/HDA-Intel/HiFi-dual.conf ++++ b/ucm2/HDA-Intel/HiFi-dual.conf +@@ -8,6 +8,8 @@ SectionVerb { + cset "name='Front Playback Switch' on" + cset "name='Rear-Panel Capture Volume' 100%" + cset "name='Rear-Panel Capture Switch' on" ++ cset "name='Headphone Playback Switch' off" ++ cset "name='Speaker Playback Switch' off" + ] + + DisableSequence [ +@@ -27,6 +29,14 @@ SectionDevice."Speaker" { + PlaybackMixerElem "Speaker" + } + ++ EnableSequence [ ++ cset "name='Speaker Playback Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='Speaker Playback Switch' off" ++ ] ++ + ConflictingDevice [ + "Headphones" + ] +@@ -54,6 +64,14 @@ SectionDevice."Headphones" { + JackHWMute "Speaker" + } + ++ EnableSequence [ ++ cset "name='Headphone Playback Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='Headphone Playback Switch' off" ++ ] ++ + ConflictingDevice [ + "Speaker" + ] +diff --git a/ucm2/HDA-Intel/init.conf b/ucm2/HDA-Intel/init.conf +index 1a351a9..6310eb3 100644 +--- a/ucm2/HDA-Intel/init.conf ++++ b/ucm2/HDA-Intel/init.conf +@@ -15,6 +15,7 @@ If.master { + } + True.BootSequence [ + cset "name='Master Playback Volume' 60%" ++ cset "name='Master Playback Switch' on" + ] + } + +diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf +index 3ccd6b1..105f360 100644 +--- a/ucm2/chtnau8824/HiFi.conf ++++ b/ucm2/chtnau8824/HiFi.conf +@@ -1,4 +1,5 @@ + Define.Speaker "Speaker" ++Define.Mic "InternalMic" + + If.cfg-mspk { + Condition { +@@ -11,6 +12,19 @@ If.cfg-mspk { + } + } + ++If.cfg-mic { ++ Condition { ++ Type RegexMatch ++ String "${CardLongName}" ++ # Medion E22??T models put DMIC in their product version ++ # when using DMICs ++ Regex "(MEDION-E22..T.*-DMIC-)" ++ } ++ True { ++ Define.Mic "DMIC1_2" ++ } ++} ++ + SectionVerb { + + Value { +@@ -34,8 +48,15 @@ SectionVerb { + } + } + +-Include.spk.File "/codecs/nau8824/${var:Speaker}.conf" +-Include.hp.File "/codecs/nau8824/HeadPhones.conf" ++# The includes using $vars in there path must be conditional otherwise the ++# $var gets expanded before the other If-s above can change the vars. ++If.cfg-includes { ++ Condition { Type String Empty "" } ++ True { ++ Include.spk.File "/codecs/nau8824/${var:Speaker}.conf" ++ Include.hp.File "/codecs/nau8824/HeadPhones.conf" + +-Include.mic.File "/codecs/nau8824/InternalMic.conf" +-Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf" ++ Include.mic.File "/codecs/nau8824/${var:Mic}.conf" ++ Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf" ++ } ++} +diff --git a/ucm2/chtrt5645/HiFi.conf b/ucm2/chtrt5645/HiFi.conf +index 10b0a1c..30fad50 100644 +--- a/ucm2/chtrt5645/HiFi.conf ++++ b/ucm2/chtrt5645/HiFi.conf +@@ -18,7 +18,7 @@ If.cfg-dmic2 { + Condition { + Type RegexMatch + String "${CardLongName}" +- Regex "(LENOVO.*LenovoMIIX320|MEDION.*Wingman)" ++ Regex "(LENOVO.*LenovoMIIX320|MEDION.*Wingman|Standard-EF20EA-1.0)" + } + True { + Define.AnalogMic "" +diff --git a/ucm2/codecs/hda/hdmi.conf b/ucm2/codecs/hda/hdmi.conf +index ba80fef..c7b7ba4 100644 +--- a/ucm2/codecs/hda/hdmi.conf ++++ b/ucm2/codecs/hda/hdmi.conf +@@ -5,14 +5,14 @@ If.hdmi { + } + True { + SectionDevice."HDMI${var:HdmiNum}" { +- Comment "HDMI${var:HdmiNum} Output" ++ Comment "HDMI / DisplayPort ${var:HdmiNum} Output" + + EnableSequence [ +- cset "name='IEC958 Playback Switch' on" ++ cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} on" + ] + + DisableSequence [ +- cset "name='IEC958 Playback Switch' off" ++ cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} off" + ] + + Value { +diff --git a/ucm2/codecs/nau8824/DMIC1_2.conf b/ucm2/codecs/nau8824/DMIC1_2.conf +new file mode 100644 +index 0000000..f54f671 +--- /dev/null ++++ b/ucm2/codecs/nau8824/DMIC1_2.conf +@@ -0,0 +1,30 @@ ++# Stereo DMICs on the DMIC1 and DMIC2 inputs ++ ++SectionDevice."Mic" { ++ Comment "Internal Digital Microphones" ++ ++ Value { ++ CapturePriority 200 ++ CapturePCM "hw:${CardId}" ++ } ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ # Note needs to be swapped / swap is deliberate! ++ cset "name='ADC CH0 Select' 1" ++ cset "name='ADC CH1 Select' 0" ++ ++ cset "name='Int Mic Switch' on" ++ cset "name='DMIC1 Enable Switch' on" ++ cset "name='DMIC2 Enable Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='Int Mic Switch' off" ++ cset "name='DMIC1 Enable Switch' off" ++ cset "name='DMIC2 Enable Switch' off" ++ ] ++} +diff --git a/ucm2/codecs/nau8824/EnableSeq.conf b/ucm2/codecs/nau8824/EnableSeq.conf +index 433e8e2..3650d06 100644 +--- a/ucm2/codecs/nau8824/EnableSeq.conf ++++ b/ucm2/codecs/nau8824/EnableSeq.conf +@@ -7,8 +7,8 @@ EnableSequence [ + cset "name='DMIC2 Enable Switch' off" + cset "name='DMIC3 Enable Switch' off" + cset "name='DMIC4 Enable Switch' off" +- cset "name='MIC1 Volume' 10" +- cset "name='MIC2 Volume' 10" ++ cset "name='MIC1 Volume' 14" ++ cset "name='MIC2 Volume' 14" + # Button Configuration + cset "name='THD for key media' 10" + cset "name='THD for key voice command' 16" +diff --git a/ucm2/codecs/rt715/init.conf b/ucm2/codecs/rt715/init.conf +index 6e07b2d..15a0571 100644 +--- a/ucm2/codecs/rt715/init.conf ++++ b/ucm2/codecs/rt715/init.conf +@@ -7,4 +7,5 @@ BootSequence [ + cset "name='rt715 ADC 25 Mux' 4" + cset "name='rt715 ADC 27 Capture Switch' 1" + cset "name='rt715 ADC 07 Capture Switch' 1" ++ cset "name='rt715 ADC 07 Capture Volume' 58" + ] +diff --git a/ucm2/sof-hda-dsp/Hdmi.conf b/ucm2/sof-hda-dsp/Hdmi.conf +index 7b777d1..1726567 100644 +--- a/ucm2/sof-hda-dsp/Hdmi.conf ++++ b/ucm2/sof-hda-dsp/Hdmi.conf +@@ -6,6 +6,7 @@ If.hdmi1 { + Define { + HdmiNum 1 + HdmiPCM 3 ++ HdmiCtlIndex 0 + HdmiPrio 500 + } + Include.hdmi1.File "/codecs/hda/hdmi.conf" +@@ -18,6 +19,7 @@ If.hdmi2 { + Define { + HdmiNum 2 + HdmiPCM 4 ++ HdmiCtlIndex 1 + HdmiPrio 600 + } + Include.hdmi2.File "/codecs/hda/hdmi.conf" +@@ -30,6 +32,7 @@ If.hdmi3 { + Define { + HdmiNum 3 + HdmiPCM 5 ++ HdmiCtlIndex 2 + HdmiPrio 700 + } + Include.hdmi3.File "/codecs/hda/hdmi.conf" +diff --git a/ucm2/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/sof-hda-dsp/sof-hda-dsp.conf +index c8069a6..79b54a9 100644 +--- a/ucm2/sof-hda-dsp/sof-hda-dsp.conf ++++ b/ucm2/sof-hda-dsp/sof-hda-dsp.conf +@@ -24,6 +24,7 @@ If.master { + } + True.BootSequence [ + cset "name='Master Playback Volume' 60%" ++ cset "name='Master Playback Switch' on" + ] + } + +diff --git a/ucm2/sof-soundwire/Hdmi.conf b/ucm2/sof-soundwire/Hdmi.conf +index d0ba790..d5ee9c6 100644 +--- a/ucm2/sof-soundwire/Hdmi.conf ++++ b/ucm2/sof-soundwire/Hdmi.conf +@@ -1,79 +1,40 @@ +-# Use case Configuration for sof-soundwire card ++# Use case Configuration for sof-soundwire + + If.hdmi1 { +- Condition { +- Type ControlExists +- Control "iface=CARD,name='HDMI/DP,pcm=5 Jack'" +- } ++ Condition { Type String Empty "" } + True { +- SectionDevice."HDMI1" { +- Comment "HDMI1/DP1 Output" +- +- EnableSequence [ +- cset "name='IEC958 Playback Switch' on" +- ] +- +- DisableSequence [ +- cset "name='IEC958 Playback Switch' off" +- ] +- +- Value { +- PlaybackPriority 500 +- PlaybackPCM "hw:${CardId},5" +- JackControl "HDMI/DP,pcm=5 Jack" +- } ++ Define { ++ HdmiNum 1 ++ HdmiPCM 5 ++ HdmiCtlIndex 0 ++ HdmiPrio 500 + } ++ Include.hdmi1.File "/codecs/hda/hdmi.conf" + } + } + + If.hdmi2 { +- Condition { +- Type ControlExists +- Control "iface=CARD,name='HDMI/DP,pcm=6 Jack'" +- } ++ Condition { Type String Empty "" } + True { +- SectionDevice."HDMI2" { +- Comment "HDMI2/DP2 Output" +- +- EnableSequence [ +- cset "name='IEC958 Playback Switch',index=1 on" +- ] +- +- DisableSequence [ +- cset "name='IEC958 Playback Switch',index=1 off" +- ] +- +- Value { +- PlaybackPriority 600 +- PlaybackPCM "hw:${CardId},6" +- JackControl "HDMI/DP,pcm=6 Jack" +- } ++ Define { ++ HdmiNum 2 ++ HdmiPCM 6 ++ HdmiCtlIndex 1 ++ HdmiPrio 600 + } ++ Include.hdmi2.File "/codecs/hda/hdmi.conf" + } + } + + If.hdmi3 { +- Condition { +- Type ControlExists +- Control "iface=CARD,name='HDMI/DP,pcm=7 Jack'" +- } ++ Condition { Type String Empty "" } + True { +- SectionDevice."HDMI3" { +- Comment "HDMI3/DP3 Output" +- +- EnableSequence [ +- cset "name='IEC958 Playback Switch',index=2 on" +- ] +- +- DisableSequence [ +- cset "name='IEC958 Playback Switch',index=2 off" +- ] +- +- Value { +- PlaybackPriority 700 +- PlaybackPCM "hw:${CardId},7" +- JackControl "HDMI/DP,pcm=7 Jack" +- } ++ Define { ++ HdmiNum 3 ++ HdmiPCM 7 ++ HdmiCtlIndex 2 ++ HdmiPrio 700 + } ++ Include.hdmi3.File "/codecs/hda/hdmi.conf" + } + }