From 07e492f659562e9548234b41722751024fb08c17 Mon Sep 17 00:00:00 2001 From: WeirdTreeThing Date: Sun, 29 Sep 2024 16:08:20 -0400 Subject: [PATCH] avs_dmic: Simplify and update to use new volume control name Shoutout to intel for breaking avs_dmic multiple times at this point --- avs/avs_dmic/HiFi.conf | 63 ++++++++++++------------------------------ 1 file changed, 17 insertions(+), 46 deletions(-) diff --git a/avs/avs_dmic/HiFi.conf b/avs/avs_dmic/HiFi.conf index b54a6dd..6f0da6f 100644 --- a/avs/avs_dmic/HiFi.conf +++ b/avs/avs_dmic/HiFi.conf @@ -1,5 +1,5 @@ -SectionVerb { -} +# Stock firmware exposes a 4ch dmic while MrChromebox firmware exposes a 2ch dmic for windows support +# Stock firmware version string includes "Google_" while MrChromebox firmware string is "MrChromebox-" If.4ch { Condition { @@ -7,48 +7,19 @@ If.4ch { Haystack "${sys:devices/virtual/dmi/id/bios_version}" Needle "Google" } - True { - SectionDevice."Internal Mic" { - Comment "Internal Microphone" - - Value { - CapturePriority 100 - CapturePCM "hw:${CardId},2" - CaptureChannels 4 - } - If.dspvol { - Condition { - Type ControlExists - Control "name='DMIC FE DMIC Volume'" - } - True { - EnableSequence [ - cset "name='DMIC FE DMIC Volume' 2147483647" - ] - } - } - } - } - False { - SectionDevice."Internal Mic" { - Comment "Internal Microphone" - - Value { - CapturePriority 100 - CapturePCM "hw:${CardId},2" - CaptureChannels 2 - } - If.dspvol { - Condition { - Type ControlExists - Control "name='DMIC FE DMIC Volume'" - } - True { - EnableSequence [ - cset "name='DMIC FE DMIC Volume' 2147483647" - ] - } - } - } - } + True.Define.DmicChannels 4 + False.Define.DmicChannels 2 +} + +SectionDevice."Internal Mic" { + Comment "Internal Microphone" + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},2" + CaptureChannels "${var:DmicChannels}" + } + EnableSequence [ + cset "name='DMIC Volume' 2147483647" + ] }