From c0459d01235a441ad279af8e5b937d4e659617e1 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Thu, 5 Sep 2024 22:01:13 -0700 Subject: [PATCH] tools: topology2: sof-plugin: Add an option for mixin-mixout pipelines for playback This will be useful to test volume controls with the plugin. Signed-off-by: Ranjani Sridharan --- .../topology2/development/sof-plugin.conf | 249 ++++++++++++++---- .../topology2/development/tplg-targets.cmake | 2 +- 2 files changed, 201 insertions(+), 50 deletions(-) diff --git a/tools/topology/topology2/development/sof-plugin.conf b/tools/topology/topology2/development/sof-plugin.conf index cad28485ecc0..dcbe68b056de 100644 --- a/tools/topology/topology2/development/sof-plugin.conf +++ b/tools/topology/topology2/development/sof-plugin.conf @@ -11,6 +11,8 @@ + + @@ -22,6 +24,7 @@ + @@ -87,57 +90,185 @@ Object.Pipeline.host-gateway-capture [ } ] -Object.Pipeline.io-gateway [ - { - index 4 - direction playback +IncludeByKey.PLAYBACK_PROCESS { +"passthrough" { + Object.Pipeline.io-gateway [ + { + index 4 + direction playback - Object.Widget.dai-copier.1 { - dai_index 1 - dai_type "SSP" - copier_type "SSP" - stream_name "NoCodec-1" - node_type $I2S_LINK_OUTPUT_CLASS - num_input_audio_formats 1 - Object.Base.input_audio_format [ - { - in_bit_depth 16 - in_valid_bit_depth 16 + Object.Widget.dai-copier.1 { + dai_index 1 + dai_type "SSP" + copier_type "SSP" + stream_name "NoCodec-1" + node_type $I2S_LINK_OUTPUT_CLASS + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] } - ] - num_output_audio_formats 1 - Object.Base.output_audio_format [ - { - out_bit_depth 16 - out_valid_bit_depth 16 + } + ] + Object.Pipeline.host-gateway-playback [ + { + index 3 + Object.Widget.host-copier.1 { + stream_name 'SSP1 Playback' + pcm_id 1 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] } - ] - } + } + ] } -] -Object.Pipeline.host-gateway-playback [ - { - index 3 - Object.Widget.host-copier.1 { - stream_name 'SSP1 Playback' - pcm_id 1 - num_input_audio_formats 1 - Object.Base.input_audio_format [ - { - in_bit_depth 16 - in_valid_bit_depth 16 +"mix" { + Object.Pipeline.mixout-gain-dai-copier-playback [ + { + index 4 + + Object.Widget.dai-copier.1 { + dai_index 1 + dai_type "SSP" + copier_type "SSP" + stream_name "NoCodec-1" + node_type $I2S_LINK_OUTPUT_CLASS + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] } - ] - num_output_audio_formats 1 - Object.Base.output_audio_format [ - { - out_bit_depth 16 - out_valid_bit_depth 16 + Object.Widget.gain.1 { + curve_type "windows_fade" + Object.Control.mixer.1 { + name 'Post Mixer PlugPCM Playback Volume' + } + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] } - ] - } + Object.Widget.mixout.1 { + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } + ] + Object.Pipeline.host-copier-gain-mixin-playback [ + { + index 3 + Object.Widget.host-copier.1 { + stream_name 'SSP1 Playback' + pcm_id 1 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + Object.Widget.gain.1 { + curve_type "windows_fade" + Object.Control.mixer.1 { + name 'Pre Mixer PlugPCM Playback Volume' + } + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + Object.Widget.mixin.1 { + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } + ] } -] +} Object.PCM.pcm [ { @@ -188,9 +319,29 @@ IncludeByKey.NOISE_SUPPRESSION { } } -Object.Base.route [ - { - source "host-copier.1.playback" - sink "dai-copier.SSP.NoCodec-1.playback" +IncludeByKey.PLAYBACK_PROCESS { +"passthrough" { + Object.Base.route [ + { + source "host-copier.1.playback" + sink "dai-copier.SSP.NoCodec-1.playback" + } + ] } -] +"mix" { + Object.Base.route [ + { + source "host-copier.1.playback" + sink "gain.3.1" + } + { + source "mixin.3.1" + sink "mixout.4.1" + } + { + source "gain.4.1" + sink "dai-copier.SSP.NoCodec-1.playback" + } + ] + } +} diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 67567dc78191..780a588ef490 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -262,7 +262,7 @@ NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC1_RATE=16000,\ DMIC1_ENABLE=MFCC,DMIC1_MFCC_PARAMS=default" # Topology for SOF plugin -"development/sof-plugin\;sof-plugin\;NOISE_SUPPRESSION=false" +"development/sof-plugin\;sof-plugin\;NOISE_SUPPRESSION=false,PLAYBACK_PROCESS=passthrough" # mtl-rt5650 with AEC but not DTS "cavs-rt5682\;sof-mtl-rt5650-google-aec\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\