From 1d210a142800423e6dc286d5b7c2e7a81203e7dd Mon Sep 17 00:00:00 2001 From: Vasiliy Kovalev Date: Thu, 1 Dec 2022 13:33:03 +0300 Subject: [PATCH] sof-essx8336: add inverse headset detection without DMic conflict On a Huawei BOD-WX9 MateBook D laptop, the inversion of the assigned audio capture path by an external headphone microphone is not eliminated by the available snd_soc_sof_es8336 driver options. Signed-off-by: Vasiliy Kovalev --- ucm2/Intel/sof-essx8336/HiFi.conf | 65 ++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/ucm2/Intel/sof-essx8336/HiFi.conf b/ucm2/Intel/sof-essx8336/HiFi.conf index 3e53b16..236cb61 100644 --- a/ucm2/Intel/sof-essx8336/HiFi.conf +++ b/ucm2/Intel/sof-essx8336/HiFi.conf @@ -110,35 +110,56 @@ SectionDevice."Headphones" { JackHWMute "Speaker" } } +If.hmic { + Condition { + Type String + Empty "${var:DeviceDmic}" + } + True.SectionDevice."Headset" { + Comment "Headset Microphone" -SectionDevice."Headset" { - Comment "Headset Microphone" - - If.conflict { - Condition { - Type String - Empty "${var:DeviceDmic}" - } - True.ConflictingDevice [ + ConflictingDevice [ "Mic" ] + + EnableSequence [ + cset "name='Differential Mux' lin2-rin2" + cset "name='Headset Mic Switch' on" + ] + + DisableSequence [ + cset "name='Headset Mic Switch' off" + ] + + Value { + CapturePriority 300 + CapturePCM "hw:${CardId}" + CaptureMixerElem "ADC PGA Gain" + CaptureMasterElem "ADC" + JackControl "Headset Mic Jack" + } } + False.SectionDevice."Headset" { + # For topologies with inverse path definition + Comment "Headset Microphone near DMic" - EnableSequence [ - cset "name='Differential Mux' lin2-rin2" - cset "name='Headset Mic Switch' on" - ] + EnableSequence [ + cset "name='Differential Mux' lin1-rin1" + cset "name='Internal Mic Switch' on" + ] - DisableSequence [ - cset "name='Headset Mic Switch' off" - ] + DisableSequence [ + cset "name='Internal Mic Switch' off" + ] - Value { - CapturePriority 300 - CapturePCM "hw:${CardId}" - CaptureMixerElem "ADC PGA Gain" - CaptureMasterElem "ADC" - JackControl "Headset Mic Jack" + Value { + CapturePriority 300 + CapturePCM "hw:${CardId}" + CaptureMixerElem "ADC PGA Gain" + CaptureMasterElem "ADC" + + JackControl "Headset Mic Jack" + } } } -- 2.33.5