From d04390c0a8d6ec567e5b4677dd5bdc54c6a19d3b Mon Sep 17 00:00:00 2001 From: Mac Chiang Date: Tue, 30 Jan 2024 21:02:27 -0500 Subject: [PATCH] topology2: sof-mtl-rt5650: add FMT_24 support RT5650 need to use 24 bit format due to S32_LE not support. Signed-off-by: Mac Chiang --- .../cavs-mixin-mixout-eqiir-dts-ssp.conf | 26 +++++++++++++++++-- .../topology2/cavs-mixin-mixout-ssp.conf | 22 ++++++++++++++++ tools/topology/topology2/cavs-rt5682.conf | 1 + .../production/tplg-targets-ace1.cmake | 4 +-- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/tools/topology/topology2/cavs-mixin-mixout-eqiir-dts-ssp.conf b/tools/topology/topology2/cavs-mixin-mixout-eqiir-dts-ssp.conf index 2d5800617c85..edca243c8c6a 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-eqiir-dts-ssp.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-eqiir-dts-ssp.conf @@ -46,7 +46,18 @@ Object.Pipeline { copier_type "SSP" stream_name "$HEADSET_CODEC_NAME" node_type $I2S_LINK_OUTPUT_CLASS - } + IncludeByKey.I2S_AMP_FMT_24 { + "true" { + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] + } + } + } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -76,7 +87,18 @@ Object.Pipeline { copier_type "SSP" stream_name "$SPEAKER_CODEC_NAME" node_type $I2S_LINK_OUTPUT_CLASS - } + IncludeByKey.I2S_AMP_FMT_24 { + "true" { + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] + } + } + } Object.Widget.gain.1 { Object.Control.mixer.1 { diff --git a/tools/topology/topology2/cavs-mixin-mixout-ssp.conf b/tools/topology/topology2/cavs-mixin-mixout-ssp.conf index 3b26c1102838..788cf49553ac 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-ssp.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-ssp.conf @@ -47,6 +47,17 @@ Object.Pipeline { copier_type "SSP" stream_name "$HEADSET_CODEC_NAME" node_type $I2S_LINK_OUTPUT_CLASS + IncludeByKey.I2S_AMP_FMT_24 { + "true" { + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] + } + } } Object.Widget.gain.1 { @@ -64,6 +75,17 @@ Object.Pipeline { copier_type "SSP" stream_name "$SPEAKER_CODEC_NAME" node_type $I2S_LINK_OUTPUT_CLASS + IncludeByKey.I2S_AMP_FMT_24 { + "true" { + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] + } + } } Object.Widget.gain.1 { diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf index 12de16d9e818..cfcb68d2139b 100644 --- a/tools/topology/topology2/cavs-rt5682.conf +++ b/tools/topology/topology2/cavs-rt5682.conf @@ -118,6 +118,7 @@ Define { DMIC_PIPELINE_PRIORITY 1 ECHO_REF_PIPELINE_PRIORITY 0 PLAYBACK_PIPELINE_SRC "volume" + I2S_AMP_FMT_24 false } # override defaults with platform-specific config diff --git a/tools/topology/topology2/production/tplg-targets-ace1.cmake b/tools/topology/topology2/production/tplg-targets-ace1.cmake index 487af6855f66..36f2421a6021 100644 --- a/tools/topology/topology2/production/tplg-targets-ace1.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace1.cmake @@ -64,12 +64,12 @@ NHLT_BIN=nhlt-sof-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_I SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\ INCLUDE_ECHO_REF=true,INCLUDE_BT_OFFLOAD=false" -"cavs-rt5682\;sof-mtl-rt5650-dts\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ +"cavs-rt5682\;sof-mtl-rt5650\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\ NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\ SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\ BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,USE_CHAIN_DMA=true,\ -GOOGLE_RTC_AEC_SUPPORT=1,DEEP_BUF_SPK=true,PLAYBACK_PIPELINE_SRC=dts" +GOOGLE_RTC_AEC_SUPPORT=1,DEEP_BUF_SPK=true,I2S_AMP_FMT_24=true" #ES83x6+HDMI-IN "cavs-es83x6\;sof-mtl-es83x6-ssp1-hdmi-ssp02\;PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,\