From 1b21c030dbdcbfbf24a40f6afb8c1e4b0c871804 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 28 Nov 2024 11:36:19 +0200 Subject: [PATCH 1/4] Tools: Topology2: Add pre-processing to ACE1.x PCM DMIC topologies The topologies for PCs those have PCH DMIC enabled have too silent noteboook lid microphones capture level. It can be improved with enable of DRC and beamformer TDFB components in topologies build. Since the same pipelines are not used for other microphone endpoints, it is safe to apply fixed processing configuration. The topologies with -2ch are set with DRC profile "dmic_default" and with TDFB profile "line2_generic_pm10deg". It provides about +10 dB boost to sound level and a user facing microphone stereo beam that improves signal-to-noise ratio. The user space controls are disabled by default, so the user needs to set the features on with alsamixer or amixer conmmands. The 4ch topologies are set with passthrough blob for beamformer. With a lot of variation in array form factors there is no generic setting available. The DRC setting is the same for 4ch and provides +10 dB boost. The impacted topologies are: - sof-mtl-rt711-4ch - sof-mtl-rt711-l0-rt1316-l3-4ch - sof-mtl-rt711-l0-rt1316-l3-2ch - sof-mtl-rt712-l0-4ch - sof-mtl-rt712-l0-2ch Signed-off-by: Seppo Ingalsuo --- .../topology2/production/tplg-targets-ace1.cmake | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/topology/topology2/production/tplg-targets-ace1.cmake b/tools/topology/topology2/production/tplg-targets-ace1.cmake index 40d07bd67510..03409553039a 100644 --- a/tools/topology/topology2/production/tplg-targets-ace1.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace1.cmake @@ -5,7 +5,8 @@ list(APPEND TPLGS # SDW + DMIC topology with passthrough pipelines "cavs-sdw\;sof-mtl-rt711-4ch\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ DMIC0_ID=2,DMIC1_ID=3,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-rt711-4ch.bin,\ -HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" +HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default" "cavs-sdw\;sof-mtl-rt711-l0-rt1316-l23-rt714-l1\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ SDW_SPK_STREAM=SDW2-Playback,SDW_SPK_IN_STREAM=SDW2-Capture,SDW_DMIC_STREAM=SDW1-Capture,\ @@ -21,13 +22,15 @@ HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" SDW_SPK_STREAM=SDW3-Playback,SDW_SPK_IN_STREAM=SDW3-Capture,\ NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-rt711-l0-rt1316-l3-4ch.bin,\ -HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8" +HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default" "cavs-sdw\;sof-mtl-rt711-l0-rt1316-l3-2ch\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,\ SDW_SPK_STREAM=SDW3-Playback,SDW_SPK_IN_STREAM=SDW3-Capture,\ NUM_DMICS=2,PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-rt711-l0-rt1316-l3-2ch.bin,\ -HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8" +HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,EFX_DMIC0_DRC_PARAMS=dmic_default" "cavs-sdw\;sof-mtl-rt712-l0-rt1712-l3\;PLATFORM=mtl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ @@ -47,7 +50,8 @@ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,\ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\ NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-rt712-l0-4ch.bin,\ -HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7" +HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default" # sof_sdw creates dmic01 and dmic16k no matter 1 or 2 dmics are present. # So, HDMI link ids are the same for -2ch and -4ch topologies. @@ -56,7 +60,8 @@ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,\ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\ NUM_DMICS=2,PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,DMIC0_ID=3,DMIC1_ID=4,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-rt712-l0-2ch.bin,\ -HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7" +HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,EFX_DMIC0_DRC_PARAMS=dmic_default" "cavs-sdw\;sof-mtl-rt1318-l12-rt714-l0\;PLATFORM=mtl,SDW_JACK=false,SDW_DMIC=1,\ NUM_SDW_AMP_LINKS=2,SDW_SPK_STREAM=SDW1-Playback,SDW_SPK_IN_STREAM=SDW1-Capture,\ From eefdb9ed834ae41ebbcf95602d43c67cb2b04c26 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 28 Nov 2024 11:45:12 +0200 Subject: [PATCH 2/4] Tools: Topology2: Add pre-processing to ACE2.x PCM DMIC topologies The topologies for PCs those have PCH DMIC enabled have too silent noteboook lid microphones capture level. It can be improved with enable of DRC and beamformer TDFB components in topologies build. Since the same pipelines are not used for other microphone endpoints, it is safe to apply fixed processing configuration. The topologies with -2ch are set with DRC profile "dmic_default" and with TDFB profile "line2_generic_pm10deg". It provides about +10 dB boost to sound level and a user facing microphone stereo beam that improves signal-to-noise ratio. The user space controls are disabled by default, so the user needs to set the features on with alsamixer or amixer conmmands. The 4ch topologies are set with passthrough blob for beamformer. With a lot of variation in array form factors there is no generic setting available. The DRC setting is the same for 4ch and provides +10 dB boost. The impacted topologies are: - sof-lnl-rt711-4ch - sof-lnl-rt713-l0-rt1318-l1-2ch - sof-lnl-cs42l43-l0-4ch - sof-lnl-cs42l43-l0-cs35l56-l3-2ch Signed-off-by: Seppo Ingalsuo --- .../topology2/production/tplg-targets-ace2.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/topology/topology2/production/tplg-targets-ace2.cmake b/tools/topology/topology2/production/tplg-targets-ace2.cmake index 2664022e965e..7a6f4b6ec03b 100644 --- a/tools/topology/topology2/production/tplg-targets-ace2.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace2.cmake @@ -5,7 +5,8 @@ list(APPEND TPLGS # SDW topology for LNL RVP "cavs-sdw\;sof-lnl-rt711-4ch\;PLATFORM=lnl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ DMIC0_ID=2,DMIC1_ID=3,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-rt711-4ch.bin,\ -HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" +HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default" "cavs-sdw\;sof-lnl-rt711-l0-rt1316-l23-rt714-l1\;PLATFORM=lnl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ SDW_SPK_STREAM=SDW2-Playback,SDW_SPK_IN_STREAM=SDW2-Capture,SDW_DMIC_STREAM=SDW1-Capture,\ @@ -36,7 +37,8 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" SDW_SPK_STREAM=SDW1-Playback,SDW_AMP_FEEDBACK=false,\ NUM_DMICS=2,PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-rt713-l0-rt1318-l1-2ch.bin,\ -HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8" +HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,EFX_DMIC0_DRC_PARAMS=dmic_default" # No SDW Jack. SDW DMIC+SPK "cavs-sdw\;sof-lnl-rt1318-l12-rt714-l0\;PLATFORM=lnl,SDW_JACK=false,SDW_DMIC=1,\ @@ -52,7 +54,8 @@ PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-cs42l43-l0-4ch.bin,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,\ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\ -HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7" +HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default" "cavs-sdw\;sof-lnl-cs42l43-l0-cs35l56-l3\;PLATFORM=lnl,NUM_SDW_AMP_LINKS=1,SDW_DMIC=1,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ @@ -63,7 +66,8 @@ NUM_DMICS=2,PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=sof-lnl-cs42l43-l0-cs35l56-l3-2ch.bin,\ NUM_SDW_AMP_LINKS=1,SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,\ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\ -HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8" +HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,EFX_DMIC0_DRC_PARAMS=dmic_default" "cavs-sdw\;sof-lnl-cs42l43-l0-cs35l56-l23\;PLATFORM=lnl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ From 7bcd9a9f14d91e34b61ca6aecf8f6e35cda51408 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 28 Nov 2024 12:01:38 +0200 Subject: [PATCH 3/4] Tools: Topology2: Add pre-processing to ACE3.x PCM DMIC topologies The topologies for PCs those have PCH DMIC enabled have too silent noteboook lid microphones capture level. It can be improved with enable of DRC and beamformer TDFB components in topologies build. Since the same pipelines are not used for other microphone endpoints, it is safe to apply fixed processing configuration. The topologies with -2ch are set with DRC profile "dmic_default" and with TDFB profile "line2_generic_pm10deg". It provides about +10 dB boost to sound level and a user facing microphone stereo beam that improves signal-to-noise ratio. The user space controls are disabled by default, so the user needs to set the features on with alsamixer or amixer conmmands. The 4ch topologies are set with passthrough blob for beamformer. With a lot of variation in array form factors there is no generic setting available. The DRC setting is the same for 4ch and provides +10 dB boost. The impacted topologies are: - sof-ptl-rt722-4ch Signed-off-by: Seppo Ingalsuo --- tools/topology/topology2/production/tplg-targets-ace3.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/topology/topology2/production/tplg-targets-ace3.cmake b/tools/topology/topology2/production/tplg-targets-ace3.cmake index 045a1541973e..1bcbebf083ab 100644 --- a/tools/topology/topology2/production/tplg-targets-ace3.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace3.cmake @@ -28,7 +28,8 @@ JACK_RATE=96000,DEEP_BUF_JACK_RATE=96000" PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=5,DMIC1_ID=6,HDMI1_ID=7,HDMI2_ID=8,HDMI3_ID=9,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\ -PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt722-4ch.bin" +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt722-4ch.bin,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default" "cavs-sdw\;sof-ptl-rt712-l2-rt1320-l1\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=2,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ From 05c75dd8fb05634f8e1c2d467580523e31a45900 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 29 Nov 2024 11:27:52 +0200 Subject: [PATCH 4/4] Tools: Topology2: SDW: Use for PCH DMIC IIR type with +20 dB gain The existing default is high-pass 40 Hz with 0 dB gain. This change amplifies captured sound from DMIC by 20 dB. The same amplifying IIR type is used in hda-generic. The change is for now, but not the final solution. After we have UCM2 control for capture processing in SOF we can shift applying more gain to the DRC component that will provide more robustness with silent and loud environments. Signed-off-by: Seppo Ingalsuo --- tools/topology/topology2/cavs-sdw.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology2/cavs-sdw.conf b/tools/topology/topology2/cavs-sdw.conf index 1a5fa32e95e8..2b7ef48eda76 100644 --- a/tools/topology/topology2/cavs-sdw.conf +++ b/tools/topology/topology2/cavs-sdw.conf @@ -86,6 +86,7 @@ Define { EFX_SPK_DRC_PARAMS passthrough EFX_MIC_TDFB_PARAMS passthrough EFX_MIC_DRC_PARAMS passthrough + DMIC0_DAI_EQIIR "highpass_40hz_20db" } # override defaults with platform-specific config