From 473a8ba670b129f0faf659bc1696669ae10f8c1a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 29 Mar 2022 16:48:32 -0300 Subject: [PATCH 1/5] ucm2: sof-essx8336: Fill in SectionVerb session at HiFi.conf There is an open: SectionVerb { at HiFi.conf, which is not only unused, but also it is missing its close bracket. Signed-off-by: Mauro Carvalho Chehab --- ucm2/Intel/sof-essx8336/HiFi.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ucm2/Intel/sof-essx8336/HiFi.conf b/ucm2/Intel/sof-essx8336/HiFi.conf index 14575c57..1a57a2ba 100644 --- a/ucm2/Intel/sof-essx8336/HiFi.conf +++ b/ucm2/Intel/sof-essx8336/HiFi.conf @@ -1,4 +1,13 @@ SectionVerb { + EnableSequence [ + # Disable all inputs / outputs + cset "name='Speaker Switch' off" + cset "name='Headphone Switch' off" + cset "name='Headset Mic Switch' off" + cset "name='Internal Mic Switch' off" + cset "name='DAC Mono Mix Switch' off" + ] +} If.amic { Condition { From e0da0365a72e24b0ec478ef964873b6a08840cc1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 29 Mar 2022 16:48:32 -0300 Subject: [PATCH 2/5] ucm2: sof-essx8336: Fix location of HiFi.conf There's a typo there: sof-es8336 -> sof-essx8336 That causes ucm HiFi profile to not load, nor Hdmi. Signed-off-by: Mauro Carvalho Chehab --- ucm2/Intel/sof-essx8336/sof-essx8336.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucm2/Intel/sof-essx8336/sof-essx8336.conf b/ucm2/Intel/sof-essx8336/sof-essx8336.conf index 88e3edb5..02f7fad3 100644 --- a/ucm2/Intel/sof-essx8336/sof-essx8336.conf +++ b/ucm2/Intel/sof-essx8336/sof-essx8336.conf @@ -12,7 +12,7 @@ If.devdmic { } SectionUseCase."HiFi" { - File "/Intel/sof-es8336/HiFi.conf" + File "/Intel/sof-essx8336/HiFi.conf" Comment "Play and record HiFi quality Music" } From 34804b07b6c61c962de62361cc8c3cbaab359500 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 29 Mar 2022 16:48:32 -0300 Subject: [PATCH 3/5] ucm2: sof-essx8336: Add a boot sequence Add a boot sequence to place the card on a reliable state. Signed-off-by: Mauro Carvalho Chehab --- ucm2/Intel/sof-essx8336/sof-essx8336.conf | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ucm2/Intel/sof-essx8336/sof-essx8336.conf b/ucm2/Intel/sof-essx8336/sof-essx8336.conf index 02f7fad3..91b84002 100644 --- a/ucm2/Intel/sof-essx8336/sof-essx8336.conf +++ b/ucm2/Intel/sof-essx8336/sof-essx8336.conf @@ -1,5 +1,29 @@ Syntax 4 +BootSequence [ + # Setup muxes / switches + cset "name='Left Headphone Mixer Left DAC Switch' on" + cset "name='Right Headphone Mixer Right DAC Switch' on" + # Set digital mix mux to "dmic disable" + # That doesn't affect dmic, but other values mute headset mic + cset "name='Digital Mic Mux' 0" + + # Set HP vol to 0 dB + cset "name='Headphone Playback Volume' 100%" + cset "name='Headphone Mixer Volume' 100%" + + # Set DAC vol + cset "name='DAC Playback Volume' 60%" + # LDATA TO LDAC, RDATA TO RDAC + cset "name='DAC Source Mux' 0" + + # Disable Auto Level Control + cset "name='ALC Capture Switch' off" + + # Set capture vol + cset "name='ADC Capture Volume' 60%" +] + Define.DeviceDmic "" If.devdmic { From 31838502a96465f8a9f9815394fa3059d1ee1d37 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 3 Apr 2022 08:13:00 -0300 Subject: [PATCH 4/5] ucm2: sof-essx8336: drop conditional control settings The Headphone controls are used by both speaker and headphone, due to that, can't be used to detect if the device has Speaker and/or headphones. Also, all such controls are already initialized during the BootSequence. So, just drop them. Signed-off-by: Mauro Carvalho Chehab --- ucm2/Intel/sof-essx8336/sof-essx8336.conf | 31 ----------------------- 1 file changed, 31 deletions(-) diff --git a/ucm2/Intel/sof-essx8336/sof-essx8336.conf b/ucm2/Intel/sof-essx8336/sof-essx8336.conf index 91b84002..da92e314 100644 --- a/ucm2/Intel/sof-essx8336/sof-essx8336.conf +++ b/ucm2/Intel/sof-essx8336/sof-essx8336.conf @@ -39,28 +39,6 @@ SectionUseCase."HiFi" { File "/Intel/sof-essx8336/HiFi.conf" Comment "Play and record HiFi quality Music" } - -# the kcontrols initial values, which will be set by `alsactl init` -If.speaker { - Condition { - Type ControlExists - Control "DAC Playback Volume" - } - True.BootSequence [ - cset "name='DAC Playback Volume' 60%" - ] -} - -If.headphone { - Condition { - Type ControlExists - Control "name='Headphone Playback Volume'" - } - True.BootSequence [ - cset "name='Headphone Playback Volume' 60%" - ] -} - If.dmic { Condition { Type String @@ -77,12 +55,3 @@ If.dmic { } } -If.Capture { - Condition { - Type ControlExists - Control "name='ADC Capture Volume'" - } - True.BootSequence [ - cset "name='ADC Capture Volume' 60%" - ] -} From 3a07e08e442bd7024ec87623eca9d62f70b0c7be Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 2 Apr 2022 07:03:06 -0300 Subject: [PATCH 5/5] ucm2: sof-essx8336: use the right mixers for speaker/headphone On es8316 and es8336, both speaker and headphone share the same mixer. Adjust the controls to reflect the actual control names, at the same way as bytcht-es8316. Signed-off-by: Mauro Carvalho Chehab --- ucm2/Intel/sof-essx8336/HiFi.conf | 44 ++++++++++++++----------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/ucm2/Intel/sof-essx8336/HiFi.conf b/ucm2/Intel/sof-essx8336/HiFi.conf index 1a57a2ba..fc155f82 100644 --- a/ucm2/Intel/sof-essx8336/HiFi.conf +++ b/ucm2/Intel/sof-essx8336/HiFi.conf @@ -21,18 +21,21 @@ If.amic { "Headset" ] - Value { - CapturePriority 100 - CapturePCM "hw:${CardId}" - } - EnableSequence [ + cset "name='Differential Mux' lin1-rin1" cset "name='Internal Mic Switch' on" ] DisableSequence [ cset "name='Internal Mic Switch' off" ] + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId}" + CaptureMixerElem "ADC PGA Gain" + CaptureMasterElem "ADC" + } } } @@ -65,7 +68,7 @@ If.dmic { } SectionDevice."Speaker" { - Comment "Speaker" + Comment "Speakers" ConflictingDevice [ "Headphones" @@ -81,10 +84,10 @@ SectionDevice."Speaker" { Value { PlaybackPriority 100 PlaybackPCM "hw:${CardId}" - PlaybackMixerElem "Speaker" - PlaybackMasterElem "Master" - PlaybackVolume "Speaker Volume" - PlaybackSwitch "Speaker Switch" + # The es8316 only has a HP-amp which is muxed to the speaker + # or to the headpones output + PlaybackMixerElem "Headphone Mixer" + PlaybackMasterElem "DAC" } } @@ -95,21 +98,11 @@ SectionDevice."Headphones" { "Speaker" ] - EnableSequence [ - cset "name='Headphone Switch' on" - ] - - DisableSequence [ - cset "name='Headphone Switch' off" - ] - Value { PlaybackPriority 300 PlaybackPCM "hw:${CardId}" - PlaybackMixerElem "Headphone" - PlaybackMasterElem "Master" - PlaybackVolume "Headphone Volume" - PlaybackSwitch "Headphone Switch" + PlaybackMixerElem "Headphone Mixer" + PlaybackMasterElem "DAC" JackControl "Headphone Jack" JackHWMute "Speaker" } @@ -129,16 +122,19 @@ SectionDevice."Headset" { } EnableSequence [ - cset "name='Headset Mic Switch' on" + cset "name='Headset Switch' on" + cset "name='Digital Mic Mux' 'dmic disable'" ] DisableSequence [ - cset "name='Headset Mic Switch' off" + cset "name='Headset Switch' on" ] Value { CapturePriority 300 CapturePCM "hw:${CardId}" + CaptureMixerElem "ADC PGA Gain" + CaptureMasterElem "ADC" JackControl "Headset Mic Jack" } }