From 0db4292348d7efafef153bbcbbfe0d8127b9abe0 Mon Sep 17 00:00:00 2001 From: Balamurugan C Date: Wed, 24 Jan 2024 14:30:35 +0530 Subject: [PATCH] topology2: mtl: Add HDMI-in capture support for SSP-based no-headset codec products. Adding support for the product which doesn't have no ssp-based audio codec but need to support HDMI audio playback and HDMI-in capture via I2S. Signed-off-by: Balamurugan C --- tools/topology/topology2/cavs-es83x6.conf | 259 +++++++++--------- .../production/tplg-targets-ace1.cmake | 8 +- 2 files changed, 137 insertions(+), 130 deletions(-) diff --git a/tools/topology/topology2/cavs-es83x6.conf b/tools/topology/topology2/cavs-es83x6.conf index 937c34b5e2ad..d43b4a0c05fd 100644 --- a/tools/topology/topology2/cavs-es83x6.conf +++ b/tools/topology/topology2/cavs-es83x6.conf @@ -53,9 +53,6 @@ Define { MCLK 24576000 # override BE link ids NUM_HDMIS 3 - HDMI1_ID 3 - HDMI2_ID 4 - HDMI3_ID 5 PLATFORM "none" HEADSET_CODEC_NAME 'SSP1-Codec' HEADSET_PLAYBACK_PCM_STREAM_NAME 'Headset Playback' @@ -76,32 +73,34 @@ IncludeByKey.NUM_HDMIS { "[3-4]" "platform/intel/hdmi-generic.conf" } +IncludeByKey.HEADSET_CODEC { +"true" { # # List of all DAIs # #SSP Index: 0, Direction: duplex -Object.Dai.SSP [ - { - id 0 - dai_index $HEADSET_SSP_DAI_INDEX - direction "duplex" - name $HEADSET_CODEC_NAME - default_hw_conf_id 0 - sample_bits 32 - io_clk $MCLK - - Object.Base.hw_config.1 { - name $HEADSET_HW_CONFIG_NAME - id 0 - bclk_freq 3072000 - tdm_slot_width 32 - # TODO: remove this. Needs alsaptlg change. - Object.Base.link_config.1 { - clock_source 1 + Object.Dai.SSP [ + { + id 0 + dai_index $HEADSET_SSP_DAI_INDEX + direction "duplex" + name $HEADSET_CODEC_NAME + default_hw_conf_id 0 + sample_bits 32 + io_clk $MCLK + + Object.Base.hw_config.1 { + name $HEADSET_HW_CONFIG_NAME + id 0 + bclk_freq 3072000 + tdm_slot_width 32 + # TODO: remove this. Needs alsaptlg change. + Object.Base.link_config.1 { + clock_source 1 + } + } } - } - } -] + ] # # Pipeline definitions @@ -111,121 +110,123 @@ Object.Dai.SSP [ # SSP1 ----> PCM0 # Pipeline ID:1 PCM ID: 0 -Object.Pipeline { - # playback pipelines - host-copier-gain-mixin-playback [ - { - index 1 - - Object.Widget.host-copier.1 { - stream_name '$HEADSET_PLAYBACK_PCM_STREAM_NAME' - pcm_id $HEADSET_PCM_ID - } - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name 'Playback Volume 1' + Object.Pipeline { + # playback pipelines + host-copier-gain-mixin-playback [ + { + index 1 + + Object.Widget.host-copier.1 { + stream_name '$HEADSET_PLAYBACK_PCM_STREAM_NAME' + pcm_id $HEADSET_PCM_ID + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Playback Volume 1' + } + } } - } - } - ] - - mixout-gain-dai-copier-playback [ - { - index 2 - - Object.Widget.dai-copier.1 { - dai_index $HEADSET_SSP_DAI_INDEX - dai_type "SSP" - copier_type "SSP" - stream_name "$HEADSET_CODEC_NAME" - node_type $I2S_LINK_OUTPUT_CLASS - } + ] + + mixout-gain-dai-copier-playback [ + { + index 2 + + Object.Widget.dai-copier.1 { + dai_index $HEADSET_SSP_DAI_INDEX + dai_type "SSP" + copier_type "SSP" + stream_name "$HEADSET_CODEC_NAME" + node_type $I2S_LINK_OUTPUT_CLASS + } - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name 'Main Playback Volume 2' + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Main Playback Volume 2' + } + } } - } - } - ] + ] - host-gateway-capture [ - { - index 5 + host-gateway-capture [ + { + index 5 - Object.Widget.host-copier.1 { - stream_name '$HEADSET_CAPTURE_PCM_STREAM_NAME' - pcm_id $HEADSET_PCM_ID - } - } - ] - - io-gateway-capture [ - { - index 6 - - Object.Widget.dai-copier."1" { - dai_index $HEADSET_SSP_DAI_INDEX - dai_type "SSP" - type dai_out - copier_type "SSP" - stream_name "$HEADSET_CODEC_NAME" - node_type $I2S_LINK_INPUT_CLASS - Object.Base.input_audio_format [ - { - in_bit_depth 32 - in_valid_bit_depth 32 + Object.Widget.host-copier.1 { + stream_name '$HEADSET_CAPTURE_PCM_STREAM_NAME' + pcm_id $HEADSET_PCM_ID } - ] - Object.Base.output_audio_format [ - { - out_bit_depth 32 - out_valid_bit_depth 32 + } + ] + + io-gateway-capture [ + { + index 6 + + Object.Widget.dai-copier."1" { + dai_index $HEADSET_SSP_DAI_INDEX + dai_type "SSP" + type dai_out + copier_type "SSP" + stream_name "$HEADSET_CODEC_NAME" + node_type $I2S_LINK_INPUT_CLASS + 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.PCM.pcm [ - { - name "$HEADSET_PCM_NAME" - id $HEADSET_PCM_ID - direction "duplex" - Object.Base.fe_dai.1 { - name "$HEADSET_PCM_NAME" - } + Object.PCM.pcm [ + { + name "$HEADSET_PCM_NAME" + id $HEADSET_PCM_ID + direction "duplex" + Object.Base.fe_dai.1 { + name "$HEADSET_PCM_NAME" + } - Object.PCM.pcm_caps.1 { - direction "playback" - name "$HEADSET_PLAYBACK_PCM_STREAM_NAME" - formats 'S16_LE,S24_LE,S32_LE' - } + Object.PCM.pcm_caps.1 { + direction "playback" + name "$HEADSET_PLAYBACK_PCM_STREAM_NAME" + formats 'S16_LE,S24_LE,S32_LE' + } - Object.PCM.pcm_caps.2 { - direction "capture" - name "$HEADSET_CAPTURE_PCM_STREAM_NAME" - formats 'S16_LE,S24_LE,S32_LE' - } - } -] + Object.PCM.pcm_caps.2 { + direction "capture" + name "$HEADSET_CAPTURE_PCM_STREAM_NAME" + formats 'S16_LE,S24_LE,S32_LE' + } + } + ] -Object.Base.route [ - { - source "gain.2.1" - sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback" - } - { - source "mixin.1.1" - sink "mixout.2.1" - } - { - source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture" - sink "host-copier.$HEADSET_PCM_ID.capture" - } - { - source "host-copier.$HEADSET_PCM_ID.playback" - sink "gain.1.1" + Object.Base.route [ + { + source "gain.2.1" + sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback" + } + { + source "mixin.1.1" + sink "mixout.2.1" + } + { + source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture" + sink "host-copier.$HEADSET_PCM_ID.capture" + } + { + source "host-copier.$HEADSET_PCM_ID.playback" + sink "gain.1.1" + } + ] } -] +} diff --git a/tools/topology/topology2/production/tplg-targets-ace1.cmake b/tools/topology/topology2/production/tplg-targets-ace1.cmake index 46927ef29b3e..713f1520d1d1 100644 --- a/tools/topology/topology2/production/tplg-targets-ace1.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace1.cmake @@ -70,7 +70,13 @@ GOOGLE_RTC_AEC_SUPPORT=1,DEEP_BUF_SPK=true,PLAYBACK_PIPELINE_SRC=dts" #ES83x6+HDMI-IN "cavs-es83x6\;sof-mtl-es83x6-ssp1-hdmi-ssp02\;PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,\ NHLT_BIN=nhlt-sof-mtl-es83x6-ssp1-hdmi-ssp02.bin,HEADSET_SSP_DAI_INDEX=1,\ -HEADSET_CODEC_NAME=SSP1-Codec,HDMI_IN_CAPTURE=true" +HEADSET_CODEC=true,HEADSET_CODEC_NAME=SSP1-Codec,HDMI1_ID=3,HDMI2_ID=4,HDMI3_ID=5,\ +HDMI_IN_CAPTURE=true" + +#No HeadsetCodec+HDMI-IN +"cavs-es83x6\;sof-mtl-hdmi-ssp02\;PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,\ +NHLT_BIN=nhlt-sof-mtl-hdmi-ssp02.bin,HEADSET_CODEC=false,HDMI_IN_CAPTURE=true,\ +HDMI_IN_1_ID=0,HDMI_IN_2_ID=1" # SDW + DMIC + HDMI "cavs-sdw\;sof-mtl-sdw-cs42l42-l0-max98363-l2\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\