From e6e72150e341c0ceb70deb16936c3b7c51384dd8 Mon Sep 17 00:00:00 2001 From: WeirdTreeThing Date: Wed, 24 May 2023 17:27:19 -0400 Subject: [PATCH] cml/sof-cmlda7219max: add dmic split, use front and rear mic --- cml/sof-cmlda7219ma/HiFi.conf | 74 +++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/cml/sof-cmlda7219ma/HiFi.conf b/cml/sof-cmlda7219ma/HiFi.conf index ca29da7..759514d 100644 --- a/cml/sof-cmlda7219ma/HiFi.conf +++ b/cml/sof-cmlda7219ma/HiFi.conf @@ -31,6 +31,44 @@ SectionVerb { ] } +# Split 4ch dmic into 2 virtual 2ch mics +Include.pcm_split.File "/conf.d/dmic-common/split.conf" + +Macro [ + { + SplitPCM { + Name "cml_stereo_in" + Direction Capture + Format S32_LE + Channels 2 + HWChannels 4 + HWChannelPos0 FL + HWChannelPos1 FR + HWChannelPos2 FL + HWChannelPos3 FR + } + } +] + +Include.ctl_remap.File "/conf.d/dmic-common/remap.conf" + +Macro [ + { + CtlRemapStereoVolSw { + Dst "Mic 1 Capture" + Index0 0 + Index1 1 + } + } + { + CtlRemapStereoVolSw { + Dst "Mic 2 Capture" + Index0 2 + Index1 3 + } + } +] + SectionDevice."Speaker" { Comment "Speaker" @@ -66,14 +104,44 @@ SectionDevice."Headphones" { } SectionDevice."Mic" { - Comment "Internal Microphone" + Comment "Front Mic" Value { CapturePriority 100 CapturePCM "hw:sofcmlda7219max,2" CaptureChannels 4 - CaptureChannelMap "2 3 -1 -1 -1 -1 -1 -1 -1 -1 -1" - IntrinsicSensitivity "-2600" + } + Macro.pcm_split.SplitPCMDevice { + Name "cml_stereo_in" + Direction Capture + Device 2 + HWChannels 4 + Channels 2 + Channel0 0 + Channel1 1 + ChannelPos0 FL + ChannelPos1 FR + } +} + +SectionDevice."Mic 1" { + Comment "Rear Mic" + + Value { + CapturePriority 100 + CapturePCM "hw:sofcmlda7219max,2" + CaptureChannels 4 + } + Macro.pcm_split.SplitPCMDevice { + Name "cml_stereo_in" + Direction Capture + Device 2 + HWChannels 4 + Channels 2 + Channel0 2 + Channel1 3 + ChannelPos0 FL + ChannelPos1 FR } }