From 266f4042716a2b80031ba90686085b96e69dd254 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 14 Nov 2024 17:48:38 +0200 Subject: [PATCH 1/5] Tools: Topology2: Intel: Update SDW speaker volume control names The control names "Amplifier Volume" and "Main Amplifier Volume" are not describing well the fact that they control speaker endpoint volume before and after SOF mixer. This patch changes the control names to: - "Pre Mixer Speaker Playback Volume" - "Post Mixer Speaker Playback Volume" These new names are similar as in other SOF topologies. There is no UCM rules dependency with the names yet, so good to do it now. Signed-off-by: Seppo Ingalsuo --- tools/topology/topology2/platform/intel/sdw-amp-generic.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf index 4589484e285f..a332a1dcb7ea 100644 --- a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf @@ -10,6 +10,7 @@ Define { AMP_FEEDBACK_CH 2 AMP_FEEDBACK_CH_PER_LINK 2 SDW_AMP_FEEDBACK true + AMP_PLAYBACK_NAME 'Speaker Playback' } Object.Dai.ALH [ @@ -42,7 +43,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Amplifier Volume' + name 'Pre Mixer $AMP_PLAYBACK_NAME Volume' } } } @@ -82,7 +83,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Main Amplifier Volume' + name 'Post Mixer $AMP_PLAYBACK_NAME Volume' } } } From 8ba01447d35215000cea9ada07258b686a554166 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 21 Nov 2024 19:07:50 +0200 Subject: [PATCH 2/5] Tools: Topology2: Use array for mixout-gain-alh-dai-copier-playback route To use the pipeline class as SubTreeCopy base class the route needs to be an array. Without it the route from base is not present in the modified class. Suggested-by: Ranjani Sridharan Signed-off-by: Seppo Ingalsuo --- .../cavs/mixout-gain-alh-dai-copier-playback.conf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf index 9483629c4ad3..d98997136537 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf @@ -91,10 +91,12 @@ Class.Pipeline."mixout-gain-alh-dai-copier-playback" { } Object.Base { - route.1 { - source mixout.$index.1 - sink gain.$index.1 - } + !route [ + { + source mixout.$index.1 + sink gain.$index.1 + } + ] } direction "playback" From a1c2e2938c4eb7ddcbd42a0e2db140c1a41adae7 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Wed, 13 Nov 2024 19:46:45 +0200 Subject: [PATCH 3/5] Tools: Topology2: Intel: Add enhanced speaker processing to SDW PCs This patch adds to ALH pipeline between gain and ALH processing with IIR, FIR, and DRC. The change is intended for topologies for PCs running Linux OS. Topologies with enable enhanced playback are currently: - sof-mtl-rt713-l0-rt1316-l12.tplg - sof-lnl-rt722-l0.tplg The change adds in MTL platform 4.2 MCPS load to speaker playback in pass-through mode. With highpass IIR and default speaker DRC the load increase is 45 MCPS. Other topologies than above have no MCPS increase. Signed-off-by: Seppo Ingalsuo --- tools/topology/topology2/cavs-sdw.conf | 4 + ...iir-eqfir-drc-alh-dai-copier-playback.conf | 137 +++++++++++++++ .../platform/intel/sdw-amp-generic.conf | 165 +++++++++++++----- .../production/tplg-targets-ace1.cmake | 4 +- .../production/tplg-targets-ace2.cmake | 4 +- 5 files changed, 270 insertions(+), 44 deletions(-) create mode 100644 tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback.conf diff --git a/tools/topology/topology2/cavs-sdw.conf b/tools/topology/topology2/cavs-sdw.conf index bc4a0a343a74..d26d65d30a73 100644 --- a/tools/topology/topology2/cavs-sdw.conf +++ b/tools/topology/topology2/cavs-sdw.conf @@ -13,6 +13,7 @@ + @@ -79,6 +80,9 @@ Define { SDW_JACK_CAPTURE_CH 2 ADD_BT false SDW_LINK_VALID_BITS 24 + EFX_SPK_IIR_PARAMS passthrough + EFX_SPK_FIR_PARAMS passthrough + EFX_SPK_DRC_PARAMS passthrough } # override defaults with platform-specific config diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback.conf new file mode 100644 index 000000000000..47d0aeb7a210 --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback.conf @@ -0,0 +1,137 @@ +# +# BE playback pipeline: mixout-gain-eqiir-eqfir-drc-alh-dai-copier. +# +# All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback.N.attribute_name" +# +# Usage: mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback pipeline object can be instantiated as: +# +# Object.Pipeline.mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback."N" { +# time_domain "timer" +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + + + + +Class.Pipeline."mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback" { + + SubTreeCopy.baseclass { + # this class extends the mixout-gain-alh-dai-copier-playback pipeline class. + source "Class.Pipeline.mixout-gain-alh-dai-copier-playback" + + # target node is not defined which means that the new subtree will be copied to + # the parent node containing the SubTreeCopy node i.e in this case the + # Class.Pipeline.mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback {} node. + + # default copy type is to extend the base class ie the widgets and routes + # will be added to the existing list of widgets/routes in the base class + + tree { + Object.Widget { + eqiir."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + + Object.Control.bytes."1" { + IncludeByKey.EFX_SPK_IIR_PARAMS { + "passthrough" "include/components/eqiir/passthrough.conf" + "highpass_20hz_0db_48khz" "include/components/eqiir/highpass_20hz_0db_48khz.conf" + "highpass_30hz_0db_48khz" "include/components/eqiir/highpass_30hz_0db_48khz.conf" + "highpass_40hz_0db_48khz" "include/components/eqiir/highpass_40hz_0db_48khz.conf" + "highpass_50hz_0db_48khz" "include/components/eqiir/highpass_50hz_0db_48khz.conf" + "highpass_100hz_0db_48khz" "include/components/eqiir/highpass_100hz_0db_48khz.conf" + } + } + } + + eqfir."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + + Object.Control.bytes."1" { + IncludeByKey.EFX_SPK_FIR_PARAMS { + "passthrough" "include/components/eqfir/passthrough.conf" + } + } + } + + drc."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + + Object.Control.bytes."1" { + IncludeByKey.EFX_SPK_DRC_PARAMS { + "passthrough" "include/components/drc/passthrough.conf" + "speaker_default" "include/components/drc/speaker_default.conf" + } + } + } + } + + Object.Base { + !route [ + { + source gain.$index.1 + sink eqiir.$index.1 + } + { + source eqiir.$index.1 + sink eqfir.$index.1 + } + { + source eqfir.$index.1 + sink drc.$index.1 + } + ] + } + } + } +} diff --git a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf index a332a1dcb7ea..167cea4c94b1 100644 --- a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf @@ -11,6 +11,7 @@ Define { AMP_FEEDBACK_CH_PER_LINK 2 SDW_AMP_FEEDBACK true AMP_PLAYBACK_NAME 'Speaker Playback' + SDW_SPK_ENHANCED_PLAYBACK false } Object.Dai.ALH [ @@ -49,45 +50,111 @@ IncludeByKey.PASSTHROUGH { } ] - mixout-gain-alh-dai-copier-playback [ - { - index 21 + IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK { + "true" { + mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback [ + { + index 21 - Object.Widget.alh-copier.1 { - stream_name $SDW_SPK_STREAM - node_type $ALH_LINK_OUTPUT_CLASS - num_input_audio_formats 3 - Object.Base.input_audio_format [ - { - in_bit_depth 16 - in_valid_bit_depth 16 - } - { - in_bit_depth 32 - in_valid_bit_depth 24 - } - { - in_bit_depth 32 - in_valid_bit_depth 32 - } - ] - num_output_audio_formats 1 - Object.Base.output_audio_format [ - { - out_bit_depth 32 - out_valid_bit_depth $SDW_LINK_VALID_BITS - out_sample_type $SAMPLE_TYPE_MSB_INTEGER - out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" - } - ] - } - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name 'Post Mixer $AMP_PLAYBACK_NAME Volume' - } - } - } - ] + Object.Widget.alh-copier.1 { + stream_name $SDW_SPK_STREAM + node_type $ALH_LINK_OUTPUT_CLASS + num_input_audio_formats 3 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth $SDW_LINK_VALID_BITS + out_sample_type $SAMPLE_TYPE_MSB_INTEGER + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $AMP_PLAYBACK_NAME Volume' + } + } + + Object.Widget.eqiir.1 { + Object.Control.bytes."1" { + name 'Post Mixer $AMP_PLAYBACK_NAME IIR Eq bytes' + } + } + Object.Widget.eqfir.1 { + Object.Control.bytes."1" { + name 'Post Mixer $AMP_PLAYBACK_NAME FIR Eq bytes' + } + } + Object.Widget.drc.1 { + Object.Control { + bytes."1" { + name 'Post Mixer $AMP_PLAYBACK_NAME DRC bytes' + } + mixer."1" { + name 'Post Mixer $AMP_PLAYBACK_NAME DRC switch' + } + } + } + } + ] + } + "false" { + mixout-gain-alh-dai-copier-playback [ + { + index 21 + + Object.Widget.alh-copier.1 { + stream_name $SDW_SPK_STREAM + node_type $ALH_LINK_OUTPUT_CLASS + num_input_audio_formats 3 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth $SDW_LINK_VALID_BITS + out_sample_type $SAMPLE_TYPE_MSB_INTEGER + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $AMP_PLAYBACK_NAME Volume' + } + } + } + ] + } + } } } @@ -321,11 +388,25 @@ Object.PCM.pcm [ IncludeByKey.PASSTHROUGH { "false" { + IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK { + "true" { + Object.Base.route [ + { + source "drc.21.1" + sink "alh-copier.$SDW_SPK_STREAM.0" + } + ] + } + "false" { + Object.Base.route [ + { + source "gain.21.1" + sink "alh-copier.$SDW_SPK_STREAM.0" + } + ] + } + } Object.Base.route [ - { - source "gain.21.1" - sink "alh-copier.$SDW_SPK_STREAM.0" - } { source 'mixin.20.1' sink 'mixout.21.1' diff --git a/tools/topology/topology2/production/tplg-targets-ace1.cmake b/tools/topology/topology2/production/tplg-targets-ace1.cmake index 15426e42f1c1..2f9e0ed510fa 100644 --- a/tools/topology/topology2/production/tplg-targets-ace1.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace1.cmake @@ -66,7 +66,9 @@ SDW_DMIC_STREAM=SDW0-Capture" "cavs-sdw\;sof-mtl-rt713-l0-rt1318-l1-rt1713-l3\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,SDW_DMIC=1" # Jack codec + SmartAmp topology. No SDW_DMIC connection -"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" +"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,\ +HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6,SDW_SPK_ENHANCED_PLAYBACK=true,\ +EFX_SPK_IIR_PARAMS=highpass_100hz_0db_48khz,EFX_SPK_DRC_PARAMS=speaker_default" "cavs-sdw\;sof-mtl-rt722-l0\;PLATFORM=mtl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ diff --git a/tools/topology/topology2/production/tplg-targets-ace2.cmake b/tools/topology/topology2/production/tplg-targets-ace2.cmake index 5fffbead28ad..26c1c526a999 100644 --- a/tools/topology/topology2/production/tplg-targets-ace2.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace2.cmake @@ -16,7 +16,9 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" "cavs-sdw\;sof-lnl-rt722-l0\;PLATFORM=lnl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,\ 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" +SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\ +EFX_SPK_IIR_PARAMS=highpass_100hz_0db_48khz,EFX_SPK_DRC_PARAMS=speaker_default,\ +SDW_SPK_ENHANCED_PLAYBACK=true" "cavs-sdw\;sof-lnl-rt712-l2-rt1320-l1\;PLATFORM=lnl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=2,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ From 98e39fe06c7fa02891d446b87dc049f50b8b632d Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 14 Nov 2024 15:57:32 +0200 Subject: [PATCH 4/5] Tools: Topology2: Intel: Add pre-processing to SDW DMIC capture This patch adds to all topologies with SDW DMIC the module copier to in ALH copier pipeline after the IIR equalizer. The module copier allows to duplicate the stream for several post-processing pipelines as analogy with mixin/mixout in playback pipelines. When SDW_DMIC_ENHANCED_CAPTURE is set "true" in topology build the multi-microphone beamformer (TDFB) and dynamic range control (DRC) components are added to host pipeline. The capture pre-processing is enabled for PC topology sof-lnl-rt722-l0.tplg. The beamformer is set for a narrow opening stereo image suitable for notebook user voice enhance. The DRC is set for a default DMIC level boost. Signed-off-by: Seppo Ingalsuo --- tools/topology/topology2/cavs-sdw.conf | 3 + .../cavs/host-gateway-tdfb-drc-capture.conf | 106 ++++++++++++++++ .../platform/intel/sdw-dmic-generic.conf | 114 +++++++++++++++--- .../production/tplg-targets-ace2.cmake | 3 +- 4 files changed, 211 insertions(+), 15 deletions(-) create mode 100644 tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf diff --git a/tools/topology/topology2/cavs-sdw.conf b/tools/topology/topology2/cavs-sdw.conf index d26d65d30a73..810fe84e2107 100644 --- a/tools/topology/topology2/cavs-sdw.conf +++ b/tools/topology/topology2/cavs-sdw.conf @@ -20,6 +20,7 @@ + @@ -83,6 +84,8 @@ Define { EFX_SPK_IIR_PARAMS passthrough EFX_SPK_FIR_PARAMS passthrough EFX_SPK_DRC_PARAMS passthrough + EFX_MIC_TDFB_PARAMS passthrough + EFX_MIC_DRC_PARAMS passthrough } # override defaults with platform-specific config diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf new file mode 100644 index 000000000000..c0912037a424 --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf @@ -0,0 +1,106 @@ +# +# Host gateway capture pipeline +# +# A host gateway pipeline for capture with TDFB and DRC processing. All attributes +# defined herein are namespaced by alsatplg to +# "Object.Pipeline.host-gateway-tdfb-drc-capture.N.attribute_name". +# +# Usage: host-gateway-tdfb-drc-capture pipeline object can be instantiated as: +# +# Object.Pipeline.host-gateway-tdfb-drc-capture."N" { +# period 1000 +# time_domain "timer" +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + + +Class.Pipeline."host-gateway-tdfb-drc-capture" { + + SubTreeCopy.baseclass { + # this class extends the host-gateway-capture pipeline class. + source "Class.Pipeline.host-gateway-capture" + + # target node is not defined which means that the new subtree will be copied to + # the parent node containing the SubTreeCopy node i.e in this case the + # Class.Pipeline.host-gateway-tdfb-drc-capture {} node. + + # default copy type is to extend the base class ie the widgets and routes + # will be added to the existing list of widgets/routes in the base class + + tree { + Object.Widget { + tdfb."1" { + Object.Control { + bytes."1" { + max 16384 + IncludeByKey.EFX_MIC_TDFB_PARAMS { + "line2_pass" "include/components/tdfb/line2_pass.conf" + "line2_generic_pm10deg" "include/components/tdfb/line2_generic_pm10deg_48khz.conf" + "line2_50mm" "include/components/tdfb/line2_50mm_pm0_30_90deg_48khz.conf" + "line2_68mm" "include/components/tdfb/line2_68mm_pm0_30_90deg_48khz.conf" + "line2_74mm" "include/components/tdfb/line2_74mm_pm0_30_90deg_48khz.conf" + "line4_pass" "include/components/tdfb/line4_pass.conf" + "line4to2_pass" "include/components/tdfb/line4to2_pass.conf" + "line4_generic_pm10deg" "include/components/tdfb/line4_generic_pm10deg_48khz.conf" + "line4_28mm" "include/components/tdfb/line2_28mm_pm0_30_90deg_48khz.conf" + } + } + } + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + + drc."1" { + Object.Control { + bytes."1" { + IncludeByKey.EFX_MIC_DRC_PARAMS { + "passthrough" "include/components/drc/passthrough.conf" + "dmic_default" "include/components/drc/dmic_default.conf" + } + } + } + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + + Object.Base { + !route [ + { + source tdfb.$index.1 + sink drc.$index.1 + } + ] + } + } + } +} diff --git a/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf b/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf index 5c10fccbf4df..1010d2bfa281 100644 --- a/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf @@ -5,11 +5,13 @@ Define { SDW_DMIC_STREAM 'SDW3-Capture' SDW_DMIC_BE_ID 4 SDW_DMIC_PASSTHROUGH "false" + SDW_DMIC_ENHANCED_CAPTURE "false" + SDW_DMIC_HOST_PIPELINE_ID 40 } Object.Dai.ALH [ { - dai_index 40 + dai_index $SDW_DMIC_HOST_PIPELINE_ID id $SDW_DMIC_BE_ID direction "capture" name $SDW_DMIC_STREAM @@ -24,17 +26,61 @@ Object.Dai.ALH [ } ] -Object.Pipeline { - host-gateway-capture [ - { - index 40 +IncludeByKey.SDW_DMIC_ENHANCED_CAPTURE { - Object.Widget.host-copier.1 { - stream_name "sdw dmic" - pcm_id 4 - } - } - ] + "true" { + Object.Pipeline { + host-gateway-tdfb-drc-capture [ + { + index $SDW_DMIC_HOST_PIPELINE_ID + + Object.Widget.host-copier.1 { + stream_name "sdw dmic" + pcm_id 4 + } + + Object.Widget.tdfb.1 { + Object.Control { + bytes."1" { + name '$SDW_DMIC_CAPTURE_PCM_NAME Capture TDFB bytes' + } + mixer."1" { + name '$SDW_DMIC_CAPTURE_PCM_NAME Capture TDFB beam switch' + } + enum."1" { + name '$SDW_DMIC_CAPTURE_PCM_NAME Capture TDFB angle set enum' + } + } + } + + Object.Widget.drc.1 { + Object.Control { + bytes."1" { + name '$SDW_DMIC_CAPTURE_PCM_NAME Capture DRC bytes' + } + mixer."1" { + name '$SDW_DMIC_CAPTURE_PCM_NAME Capture DRC switch' + } + } + } + } + ] + } + } + "false" { + Object.Pipeline { + host-gateway-capture [ + { + index $SDW_DMIC_HOST_PIPELINE_ID + + Object.Widget.host-copier.1 { + stream_name "sdw dmic" + pcm_id 4 + } + } + ] + } + } } Object.Widget { @@ -100,6 +146,24 @@ Object.Widget { } } ] + Object.Widget.module-copier [ + { + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + ] } } } @@ -138,9 +202,31 @@ IncludeByKey.SDW_DMIC_PASSTHROUGH { sink "eqiir.41.0" } { - source "eqiir.41.0" - sink "host-copier.4.capture" + source "eqiir.41.0" + sink "module-copier.41.0" } - ] + ] + IncludeByKey.SDW_DMIC_ENHANCED_CAPTURE { + "true" { + Object.Base.route [ + { + source "module-copier.41.0" + sink "tdfb.40.1" + } + { + source "drc.40.1" + sink "host-copier.4.capture" + } + ] + } + "false" { + Object.Base.route [ + { + source "module-copier.41.0" + sink "host-copier.4.capture" + } + ] + } + } } } diff --git a/tools/topology/topology2/production/tplg-targets-ace2.cmake b/tools/topology/topology2/production/tplg-targets-ace2.cmake index 26c1c526a999..2827c025952e 100644 --- a/tools/topology/topology2/production/tplg-targets-ace2.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace2.cmake @@ -18,7 +18,8 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" 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,\ EFX_SPK_IIR_PARAMS=highpass_100hz_0db_48khz,EFX_SPK_DRC_PARAMS=speaker_default,\ -SDW_SPK_ENHANCED_PLAYBACK=true" +EFX_MIC_TDFB_PARAMS=line2_generic_pm10deg,EFX_MIC_DRC_PARAMS=dmic_default.conf,\ +SDW_SPK_ENHANCED_PLAYBACK=true,SDW_DMIC_ENHANCED_CAPTURE=true" "cavs-sdw\;sof-lnl-rt712-l2-rt1320-l1\;PLATFORM=lnl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=2,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ From 591c2cba343eee9f6445ea8b2a32b92f46c432e7 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Tue, 19 Nov 2024 16:35:52 +0200 Subject: [PATCH 5/5] Tools: Topology2: Add processing MTL and LNL SDW topologies for CI test This patch adds speaker post-processing and microphone pre-processing to next topologies: - sof-mtl-rt711-l0-rt1316-l23-rt714-l1.tplg - sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg The SOF CI system currently tests these two SDW platforms. This patch adds test coverage for processing with IIR, FIR, DRC, and TDFB components. Signed-off-by: Seppo Ingalsuo --- tools/topology/topology2/production/tplg-targets-ace1.cmake | 5 ++++- tools/topology/topology2/production/tplg-targets-ace2.cmake | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology2/production/tplg-targets-ace1.cmake b/tools/topology/topology2/production/tplg-targets-ace1.cmake index 2f9e0ed510fa..40d07bd67510 100644 --- a/tools/topology/topology2/production/tplg-targets-ace1.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace1.cmake @@ -8,7 +8,10 @@ DMIC0_ID=2,DMIC1_ID=3,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-rt711-4ch.bi HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" "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" +SDW_SPK_STREAM=SDW2-Playback,SDW_SPK_IN_STREAM=SDW2-Capture,SDW_DMIC_STREAM=SDW1-Capture,\ +EFX_SPK_IIR_PARAMS=highpass_100hz_0db_48khz,EFX_SPK_DRC_PARAMS=speaker_default,\ +EFX_MIC_TDFB_PARAMS=line2_generic_pm10deg,EFX_MIC_DRC_PARAMS=dmic_default.conf,\ +SDW_SPK_ENHANCED_PLAYBACK=true,SDW_DMIC_ENHANCED_CAPTURE=true" "cavs-sdw\;sof-mtl-rt711-l0-rt1316-l3\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,\ SDW_SPK_STREAM=SDW3-Playback,SDW_SPK_IN_STREAM=SDW3-Capture,\ diff --git a/tools/topology/topology2/production/tplg-targets-ace2.cmake b/tools/topology/topology2/production/tplg-targets-ace2.cmake index 2827c025952e..2664022e965e 100644 --- a/tools/topology/topology2/production/tplg-targets-ace2.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace2.cmake @@ -8,7 +8,10 @@ DMIC0_ID=2,DMIC1_ID=3,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-rt711-4ch.bi HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" "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" +SDW_SPK_STREAM=SDW2-Playback,SDW_SPK_IN_STREAM=SDW2-Capture,SDW_DMIC_STREAM=SDW1-Capture,\ +EFX_SPK_IIR_PARAMS=highpass_100hz_0db_48khz,EFX_SPK_DRC_PARAMS=speaker_default,\ +EFX_MIC_TDFB_PARAMS=line2_generic_pm10deg,EFX_MIC_DRC_PARAMS=dmic_default.conf,\ +SDW_SPK_ENHANCED_PLAYBACK=true,SDW_DMIC_ENHANCED_CAPTURE=true" "cavs-sdw\;sof-lnl-rt712-l2-rt1712-l3\;PLATFORM=lnl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\