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" + ] }