diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 642897e3da25..3ea1978788df 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -86,6 +86,50 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-efx-generic-4ch.bin,\ DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\ EFX_DRC_COMPONENT=multiband,EFX_MBDRC_PARAMS=passthrough" +# With 16 kHz DMIC1 +"sof-hda-generic\;sof-hda-generic-4ch-48k-16k\;\ +HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch-48k-16k.bin,\ +NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC1_ENABLE=passthrough,DMIC1_RATE=16000" + +# With 96 kHz DMIC1 +"sof-hda-generic\;sof-hda-generic-4ch-48k-96k\;\ +HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch-48k-96k.bin,\ +NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC1_ENABLE=passthrough,DMIC1_RATE=96000" + +# With 96 kHz DMIC0 +"sof-hda-generic\;sof-hda-generic-4ch-96k\;\ +HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch-96k.bin,\ +NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_RATE=96000" + +# SDW + DMIC + HDMI, with 16 kHz DMIC1 +"cavs-sdw\;sof-mtl-sdw-cs42l42-l0-max98363-l2-48k-16k\;PLATFORM=mtl,\ +NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,\ +DMIC1_ENABLE=passthrough,DMIC1_RATE=16000,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2-48k-16k.bin,\ +BT_NAME=SSP1-BT,BT_INDEX=1,BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,ADD_BT=true,\ +NUM_SDW_AMP_LINKS=1,SDW_SPK_STREAM=SDW2-Playback,SDW_AMP_FEEDBACK=false,\ +SDW_JACK_CAPTURE_CH=1,DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" + +# SDW + DMIC + HDMI, with 96 kHz DMIC1 +"cavs-sdw\;sof-mtl-sdw-cs42l42-l0-max98363-l2-48k-96k\;PLATFORM=mtl,\ +NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,\ +DMIC1_ENABLE=passthrough,DMIC1_RATE=96000,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2-48k-96k.bin,\ +BT_NAME=SSP1-BT,BT_INDEX=1,BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,ADD_BT=true,\ +NUM_SDW_AMP_LINKS=1,SDW_SPK_STREAM=SDW2-Playback,SDW_AMP_FEEDBACK=false,\ +SDW_JACK_CAPTURE_CH=1,DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" + +# SDW + DMIC + HDMI, with 96 kHz DMIC0 +"cavs-sdw\;sof-mtl-sdw-cs42l42-l0-max98363-l2-96k\;PLATFORM=mtl,\ +NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,DMIC0_RATE=96000,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2-96k.bin,\ +BT_NAME=SSP1-BT,BT_INDEX=1,BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,ADD_BT=true,\ +NUM_SDW_AMP_LINKS=1,SDW_SPK_STREAM=SDW2-Playback,SDW_AMP_FEEDBACK=false,\ +SDW_JACK_CAPTURE_CH=1,DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" + # CAVS HDA topology with gain and SRC before mixin for HDA and passthrough pipelines for HDMI "sof-hda-generic\;sof-hda-src-generic\;HDA_CONFIG=src,DEEPBUFFER_FW_DMA_MS=100" diff --git a/tools/topology/topology2/platform/intel/dmic-default.conf b/tools/topology/topology2/platform/intel/dmic-default.conf index 0bbb288e9e03..6ebcab81f89b 100644 --- a/tools/topology/topology2/platform/intel/dmic-default.conf +++ b/tools/topology/topology2/platform/intel/dmic-default.conf @@ -7,6 +7,7 @@ Define { DMIC0_ID 6 # Default link ID based on HDA generic machine driver DMIC1_ID 7 # Default link ID based on HDA generic machine driver DMIC0_PCM_ID 10 # Default DMIC0 PCM ID + DMIC1_PCM_ID 11 # Default DMIC1 PCM ID FORMAT s32le # IO_CLK applicable for TGL and ADL DMIC_IO_CLK 38400000 @@ -36,4 +37,7 @@ Define { DMIC_CORE_ID 0 PASSTHROUGH "false" DMIC_PIPELINE_PRIORITY 0 + DMIC0_RATE 48000 + DMIC1_RATE 16000 + DMIC1_ENABLE "false" } diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf index 5ca0ec27c79b..164bca4f87fa 100644 --- a/tools/topology/topology2/platform/intel/dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/dmic-generic.conf @@ -9,6 +9,7 @@ Object.Dai.DMIC [ id $DMIC0_ID driver_version $DMIC_DRIVER_VERSION io_clk $DMIC_IO_CLK + sample_rate $DMIC0_RATE clk_min 500000 clk_max 4800000 unmute_ramp_time_ms 200 @@ -39,7 +40,7 @@ Object.Dai.DMIC [ dai_index 1 driver_version $DMIC_DRIVER_VERSION io_clk $DMIC_IO_CLK - sample_rate 16000 + sample_rate $DMIC1_RATE clk_min 500000 clk_max 4800000 unmute_ramp_time_ms 200 @@ -84,10 +85,12 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 2 Object.Base.input_audio_format [ { + in_rate $DMIC0_RATE in_bit_depth 32 in_valid_bit_depth 32 } { + in_rate $DMIC0_RATE in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 @@ -97,10 +100,12 @@ IncludeByKey.PASSTHROUGH { ] Object.Base.output_audio_format [ { + out_rate $DMIC0_RATE out_bit_depth 32 out_valid_bit_depth 32 } { + out_rate $DMIC0_RATE out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 @@ -115,10 +120,12 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 2 Object.Base.input_audio_format [ { + in_rate $DMIC0_RATE in_bit_depth 32 in_valid_bit_depth 32 } { + in_rate $DMIC0_RATE in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 @@ -128,10 +135,12 @@ IncludeByKey.PASSTHROUGH { ] Object.Base.output_audio_format [ { + out_rate $DMIC0_RATE out_bit_depth 32 out_valid_bit_depth 32 } { + out_rate $DMIC0_RATE out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 @@ -149,10 +158,12 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 2 Object.Base.input_audio_format [ { + in_rate $DMIC0_RATE in_bit_depth 32 in_valid_bit_depth 32 } { + in_rate $DMIC0_RATE in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 @@ -162,10 +173,12 @@ IncludeByKey.PASSTHROUGH { ] Object.Base.output_audio_format [ { + out_rate $DMIC0_RATE out_bit_depth 32 out_valid_bit_depth 32 } { + out_rate $DMIC0_RATE out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 @@ -192,16 +205,112 @@ IncludeByKey.PASSTHROUGH { type dai_out stream_name $DMIC0_NAME node_type $DMIC_LINK_INPUT_CLASS + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_rate $DMIC0_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_rate $DMIC0_RATE + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 + Object.Base.output_audio_format [ + { + out_rate $DMIC0_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_rate $DMIC0_RATE + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.module-copier."2" { stream_name $DMIC0_NAME + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_rate $DMIC0_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_rate $DMIC0_RATE + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 + Object.Base.output_audio_format [ + { + out_rate $DMIC0_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_rate $DMIC0_RATE + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.eqiir.1 { Object.Control.bytes."1" { name 'DMIC0 Capture IIR Eq' } + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_rate $DMIC0_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_rate $DMIC0_RATE + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 + Object.Base.output_audio_format [ + { + out_rate $DMIC0_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_rate $DMIC0_RATE + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.pipeline."1" { core $DMIC_CORE_ID @@ -234,10 +343,12 @@ IncludeByKey.PASSTHROUGH { num_input_audio_formats 2 Object.Base.input_audio_format [ { + in_rate $DMIC0_RATE in_bit_depth 32 in_valid_bit_depth 32 } { + in_rate $DMIC0_RATE in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 @@ -248,10 +359,12 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 2 Object.Base.output_audio_format [ { + out_rate $DMIC0_RATE out_bit_depth 32 out_valid_bit_depth 32 } { + out_rate $DMIC0_RATE out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 @@ -275,10 +388,12 @@ IncludeByKey.PASSTHROUGH { num_input_audio_formats 2 Object.Base.input_audio_format [ { + in_rate $DMIC0_RATE in_bit_depth 32 in_valid_bit_depth 32 } { + in_rate $DMIC0_RATE in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 @@ -289,10 +404,12 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 2 Object.Base.output_audio_format [ { + out_rate $DMIC0_RATE out_bit_depth 32 out_valid_bit_depth 32 } { + out_rate $DMIC0_RATE out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 @@ -327,6 +444,12 @@ Object.PCM.pcm [ formats 'S32_LE' channels_min $NUM_DMICS channels_max $NUM_DMICS + rate_min $DMIC0_RATE + rate_max $DMIC0_RATE } } ] + +IncludeByKey.DMIC1_ENABLE { + "passthrough" "platform/intel/dmic1-passthrough.conf" +} diff --git a/tools/topology/topology2/platform/intel/dmic1-passthrough.conf b/tools/topology/topology2/platform/intel/dmic1-passthrough.conf new file mode 100644 index 000000000000..07b61783988e --- /dev/null +++ b/tools/topology/topology2/platform/intel/dmic1-passthrough.conf @@ -0,0 +1,119 @@ +Define { + DMIC1_PCM_NAME "DMIC Raw2nd" +} + +Object.Pipeline.host-gateway-capture [ + { + index $DMIC1_HOST_PIPELINE_ID + Object.Widget.host-copier.1 { + stream_name $DMIC1_PCM_CAPS + pcm_id $DMIC1_PCM_ID + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_rate $DMIC1_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_rate $DMIC1_RATE + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 + Object.Base.output_audio_format [ + { + out_rate $DMIC1_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_rate $DMIC1_RATE + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + } + } +] + +Object.Pipeline.io-gateway-capture [ + { + index $DMIC1_DAI_PIPELINE_ID + Object.Widget.dai-copier.1 { + dai_index 1 + dai_type "DMIC" + copier_type "DMIC" + type dai_out + stream_name $DMIC1_NAME + node_type $DMIC_LINK_INPUT_CLASS + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_rate $DMIC1_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_rate $DMIC1_RATE + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 + Object.Base.output_audio_format [ + { + out_rate $DMIC1_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_rate $DMIC1_RATE + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + } + } +] + +Object.Base.route [ + { + source "dai-copier.DMIC.$DMIC1_NAME.capture" + sink "host-copier.$DMIC1_PCM_ID.capture" + } +] + +Object.PCM.pcm [ + { + name "$DMIC1_PCM_NAME" + id $DMIC1_PCM_ID + direction "capture" + Object.Base.fe_dai.1 { + name "$DMIC1_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + name $DMIC1_PCM_CAPS + # only 32-bit capture supported now + formats 'S32_LE' + channels_min $NUM_DMICS + channels_max $NUM_DMICS + rate_min $DMIC1_RATE + rate_max $DMIC1_RATE + } + } +]