From 5837f7b4d4d29afcf19f78a235104fa71664d17e Mon Sep 17 00:00:00 2001 From: Yong Zhi Date: Fri, 7 Jul 2023 09:10:28 -0500 Subject: [PATCH] topology2: nocodec-multicore: test multi-stream capture Enable more complex pipelines for multi-core use cases. Signed-off-by: Yong Zhi --- .../topology2/cavs-nocodec-multicore.conf | 249 ++++++++++++++++++ .../topology2/development/tplg-targets.cmake | 2 +- 2 files changed, 250 insertions(+), 1 deletion(-) diff --git a/tools/topology/topology2/cavs-nocodec-multicore.conf b/tools/topology/topology2/cavs-nocodec-multicore.conf index 6ba1fabff137..f1f0072c22a5 100644 --- a/tools/topology/topology2/cavs-nocodec-multicore.conf +++ b/tools/topology/topology2/cavs-nocodec-multicore.conf @@ -61,6 +61,10 @@ Define { DMIC1_PCM_CAPS 'DMIC1 WOV Capture' DMIC0_NAME 'NoCodec-6' DMIC1_NAME 'NoCodec-7' + DMIC0_PCM_0_NAME "DMIC SFX1" + DMIC0_PCM_1_NAME "DMIC SFX2" + DMIC0_PCM_0_PCM_ID 27 + DMIC0_PCM_1_PCM_ID 28 SSP0_PCM_NAME "Port0" SSP1_PCM_NAME "Port1" @@ -294,6 +298,189 @@ Object.Pipeline.io-gateway-capture [ } ] +IncludeByKey.PASSTHROUGH { +"false" { + Object.Pipeline.gain-module-copier [ + { + index 19 + core_id $DMIC_CORE_ID + direction "capture" + Object.Widget.pipeline.1 { + stream_name $DMIC0_DAI_COPIER + core $DMIC_CORE_ID + } + Object.Widget.module-copier.1 { + stream_name 'Gain Capture 19' + num_input_audio_formats 2 + num_output_audio_formats 2 + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.audio_format.2 { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + } + Object.Widget.gain.1 { + num_input_audio_formats 2 + num_output_audio_formats 2 + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.audio_format.2 { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + Object.Control.mixer.1 { + name 'Pre Demux $DMIC0_PCM_0_NAME Capture Volume' + } + } + } + ] + + Object.Pipeline.gain-capture [ + { + format $FORMAT + core_id $DMIC_CORE_ID + index 18 + Object.Widget.pipeline.1 { + stream_name "$DMIC0_PCM_0_NAME" + core $DMIC_CORE_ID + } + Object.Widget.host-copier.1 { + stream_name "Gain Capture 18" + pcm_id $DMIC0_PCM_0_PCM_ID + num_input_audio_formats 2 + num_output_audio_formats 2 + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.audio_format.2 { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + } + Object.Widget.gain.1 { + num_input_audio_formats 2 + num_output_audio_formats 2 + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.audio_format.2 { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + Object.Control.mixer.1 { + name 'Post Demux $DMIC0_PCM_0_NAME Capture Volume' + } + } + } + { + format $FORMAT + index 22 + core_id $DMIC_CORE_ID + Object.Widget.pipeline.1 { + stream_name "$DMIC0_PCM_1_NAME" + core $DMIC_CORE_ID + } + Object.Widget.host-copier.1 { + stream_name "Gain Capture 22" + pcm_id $DMIC0_PCM_1_PCM_ID + num_input_audio_formats 2 + num_output_audio_formats 2 + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.audio_format.2 { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + } + Object.Widget.gain.1 { + num_input_audio_formats 2 + num_output_audio_formats 2 + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.audio_format.2 { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + Object.Control.mixer.1 { + name 'Post Demux $DMIC0_PCM_1_NAME Capture Volume' + } + } + } + ] + } +} + Object.PCM.pcm [ { name "$SSP0_PCM_NAME" @@ -337,6 +524,41 @@ Object.PCM.pcm [ } ] +IncludeByKey.PASSTHROUGH { +"false" { + Object.PCM.pcm [ + { + name "$DMIC0_PCM_0_NAME" + id $DMIC0_PCM_0_PCM_ID + direction "capture" + Object.Base.fe_dai."$DMIC0_PCM_0_NAME" {} + + Object.PCM.pcm_caps."capture" { + name "Gain Capture 18" + # only 32-bit capture supported now + formats 'S32_LE' + channels_min $NUM_DMICS + channels_max $NUM_DMICS + } + } + { + name "$DMIC0_PCM_1_NAME" + id $DMIC0_PCM_1_PCM_ID + direction "capture" + Object.Base.fe_dai."$DMIC0_PCM_1_NAME" {} + + Object.PCM.pcm_caps."capture" { + name "Gain Capture 22" + # only 32-bit capture supported now + formats 'S32_LE' + channels_min $NUM_DMICS + channels_max $NUM_DMICS + } + } + ] + } +} + Object.Base.route [ { source "gain.14.1" @@ -372,6 +594,33 @@ Object.Base.route [ } ] +IncludeByKey.PASSTHROUGH { +"false" { + Object.Base.route [ + { + source $DMIC0_DAI_PIPELINE_SRC + sink gain.19.1 + } + { + source module-copier.19.1 + sink gain.18.1 + } + { + source module-copier.19.1 + sink gain.22.1 + } + { + source "gain.18.1" + sink "host-copier.$DMIC0_PCM_0_PCM_ID.capture" + } + { + source "gain.22.1" + sink "host-copier.$DMIC0_PCM_1_PCM_ID.capture" + } + ] + } +} + # There is pinmux conflict between SSP1 and DMIC on MTL RVP, # so include SSP1 pipelines conditionally. IncludeByKey.SSP1_ENABLED { diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 635755f17adb..76631db94e54 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -48,7 +48,7 @@ SSP2_CORE_ID=1,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-nocodec-multicore-s "cavs-nocodec-multicore\;sof-mtl-nocodec-multicore-4ch\;PLATFORM=mtl,SSP1_ENABLED=false,\ SSP0_CORE_ID=0,DMIC_CORE_ID=1,SSP2_CORE_ID=2,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ -PASSTHROUGH=true,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-nocodec.bin" +PASSTHROUGH=false,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-nocodec.bin" # SSP topology for LNL FPGA with lower DMIC IO clock of 19.2MHz, 2ch PDM1 enabled "cavs-nocodec\;sof-lnl-nocodec-fpga-2ch-pdm1\;PLATFORM=lnl,NUM_DMICS=2,PDM1_MIC_A_ENABLE=1,\