diff --git a/tools/topology/topology2/cavs-cs35l56.conf b/tools/topology/topology2/cavs-cs35l56.conf new file mode 100644 index 000000000000..9b5eb8e91fc4 --- /dev/null +++ b/tools/topology/topology2/cavs-cs35l56.conf @@ -0,0 +1,423 @@ +# Topology for CDB35L56-FOUR board with 4x CS35L56 using TDM +# @48000 sample rate, 16 bits per sample, 8 TDM slots per frame. +# Stereo playback, 8 channel feedback capture. +# +# This setup has only speaker playback and speaker feedback devices. +# No headset, DMICs or HDMI. +# +# Based on cavs-es83x6.conf and cavs-rt5682.conf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Define { + MCLK 24576000 + # override DMIC default definitions + NUM_DMICS 0 + # override BE link ids + NUM_HDMIS 0 + + SPK_ID 0 + PLATFORM "none" + SPEAKER_CODEC_NAME 'SSP2-Codec' + SPEAKER_PLAYBACK_PCM_STREAM_NAME 'Speaker Playback' + SPEAKER_FEEDBACK_PCM_STREAM_NAME 'Speaker Feedback' + SPEAKER_SSP_DAI_INDEX 2 + SPEAKER_HW_CONFIG_NAME 'SPEAKER HWCFG' + SPEAKER_HOST_PIPELINE_ID 3 + SPEAKER_DAI_PIPELINE_ID 4 + SPEAKER_PCM_CORE_ID 0 + SPEAKER_PCM_NAME "Speakers" + SPEAKER_FEEDBACK_PCM_NAME "Feedback" + SPEAKER_PCM_ID 2 + SPEAKER_FEEDBACK_PCM_ID 3 + PLAYBACK_PIPELINE_SRC "volume" + SSP_SPK_FMT_24 false + SSP_HS_FMT_24 false +} + +# override defaults with platform-specific config +IncludeByKey.PLATFORM { + "mtl" "platform/intel/mtl.conf" + "tgl" "platform/intel/tgl.conf" +} + +# +# Define bidirectional DAI for SSP +# +Object.Dai.SSP [ + { + id $SPK_ID + dai_index $SPEAKER_SSP_DAI_INDEX + direction "duplex" + name $SPEAKER_CODEC_NAME + default_hw_conf_id 0 + sample_bits 16 + io_clk $MCLK + + # + # TDM configuration is 48kHz, 16 bit slots, DSP_A. + # There are 8 slots: + # TX to amp on slots 0 and 1 + # RX from amp on slots 0..7 + # + Object.Base.hw_config.1 { + name $SPEAKER_HW_CONFIG_NAME + id 0 + + bclk_freq 6144000 + fsync_freq 48000 + tdm_slot_width 16 + tdm_slots 8 + tx_slots 3 # bitmask of active slots + rx_slots 255 # bitmask of active slots + format "DSP_A" + bclk "codec_consumer" + fsync "codec_consumer" + # TODO: remove this. Needs alsaptlg change. + Object.Base.link_config.1 { + clock_source 1 + } + } + } +] + +Object.Pipeline { + # + # Playback volume control pipeline + # + host-copier-gain-mixin-playback [ + { + index $SPEAKER_HOST_PIPELINE_ID + core_id $SPEAKER_PCM_CORE_ID + + Object.Widget.host-copier.1 { + stream_name '$SPEAKER_PLAYBACK_PCM_STREAM_NAME' + pcm_id $SPEAKER_PCM_ID + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $SPEAKER_PCM_NAME Playback Volume' + } + } + Object.Widget.pipeline.1 { + core $SPEAKER_PCM_CORE_ID + } + } + ] + + # + # Playback pipeline towards SSP + # + mixout-gain-dai-copier-playback [ + { + index $SPEAKER_DAI_PIPELINE_ID + core_id $SPEAKER_PCM_CORE_ID + + # + # Define widget to send audio to SSP + # + Object.Widget.dai-copier.1 { + dai_index $SPEAKER_SSP_DAI_INDEX + dai_type "SSP" + copier_type "SSP" + stream_name "$SPEAKER_CODEC_NAME" + node_type $I2S_LINK_OUTPUT_CLASS + + # + # Playback audio format on SSP is fixed at 48kHz, + # 2 channels, 16 bits. + # Override default dai-copier audio format. + # + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_rate 48000 + out_channels 2 + out_bit_depth 16 + out_valid_bit_depth 16 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] + } + + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume' + } + } + + Object.Widget.pipeline.1 { + core $SPEAKER_PCM_CORE_ID + } + } + ] + + # + # Capture pipeline for BE DAI + # + host-gateway-capture [ + { + index 5 + + # + # Define host-copier to output audio to BE DAI + # + Object.Widget.host-copier.1 { + stream_name '$SPEAKER_FEEDBACK_PCM_STREAM_NAME' + pcm_id $SPEAKER_FEEDBACK_PCM_ID + + # + # Capture is fixed at 48kHz with 8 channels, + # but allow for different sample widths on + # BE DAI. + # Default host-copier audio format is + # stereo so need to override for 8 channels. + # + num_input_audio_formats 3 + num_output_audio_formats 3 + Object.Base.input_audio_format [ + { + in_channels 8 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + in_ch_map $CHANNEL_MAP_7_POINT_1 + } + { + in_channels 8 + in_bit_depth 32 + in_valid_bit_depth 24 + in_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + in_ch_map $CHANNEL_MAP_7_POINT_1 + } + { + in_channels 8 + in_bit_depth 16 + in_valid_bit_depth 16 + in_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + in_ch_map $CHANNEL_MAP_7_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_channels 8 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + out_ch_map $CHANNEL_MAP_7_POINT_1 + } + { + out_channels 8 + out_bit_depth 32 + out_valid_bit_depth 24 + out_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + out_ch_map $CHANNEL_MAP_7_POINT_1 + } + { + out_channels 8 + out_bit_depth 16 + out_valid_bit_depth 16 + out_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + out_ch_map $CHANNEL_MAP_7_POINT_1 + } + ] + } + } + ] + + # + # Capture pipeline from SSP + # + io-gateway-capture [ + { + index 6 + + # + # Define dai-copier to receive audio from SSP + # + Object.Widget.dai-copier."1" { + dai_index $SPEAKER_SSP_DAI_INDEX + dai_type "SSP" + type dai_out + copier_type "SSP" + stream_name "$SPEAKER_CODEC_NAME" + node_type $I2S_LINK_INPUT_CLASS + + # + # Capture audio format on SSP is fixed at 48kHz, + # 8 channels, 16 bits. + # Override default dai-copier audio format. + # + num_input_audio_formats 1 + num_output_audio_formats 3 + Object.Base.input_audio_format [ + { + in_rate 48000 + in_channels 8 + in_bit_depth 16 + in_valid_bit_depth 16 + in_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + in_ch_map $CHANNEL_MAP_7_POINT_1 + } + ] + # + # Capture is fixed at 48kHz with 8 channels, + # but allow for different sample widths + # towards BE DAI. + # Default dai-copier audio format is + # stereo so need to override for 8 channels. + # + Object.Base.output_audio_format [ + { + out_channels 8 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + out_ch_map $CHANNEL_MAP_7_POINT_1 + } + { + out_channels 8 + out_bit_depth 32 + out_valid_bit_depth 24 + out_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + out_ch_map $CHANNEL_MAP_7_POINT_1 + } + { + out_channels 8 + out_bit_depth 16 + out_valid_bit_depth 16 + out_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + out_ch_map $CHANNEL_MAP_7_POINT_1 + } + ] + } + } + ] +} + +# +# FE DAIs +# +Object.PCM.pcm [ + # Playback FE DAI + { + name "$SPEAKER_PCM_NAME" + id $SPEAKER_PCM_ID + direction "playback" + Object.Base.fe_dai.1 { + name "$SPEAKER_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + direction "playback" + name "$SPEAKER_PLAYBACK_PCM_STREAM_NAME" + formats 'S16_LE,S24_LE,S32_LE' + channels_min 2 + channels_max 2 + periods_max 16 + period_size_min 192 + period_size_max 16384 + buffer_size_min 65536 + buffer_size_max 65536 + } + } + + # Capture FE DAI + { + name "$SPEAKER_FEEDBACK_PCM_NAME" + id $SPEAKER_FEEDBACK_PCM_ID + direction "capture" + Object.Base.fe_dai.1 { + name "$SPEAKER_FEEDBACK_PCM_STREAM_NAME" + } + + Object.PCM.pcm_caps.1 { + name "$SPEAKER_FEEDBACK_PCM_STREAM_NAME" + formats 'S16_LE,S24_LE,S32_LE' + channels_min 8 + channels_max 8 + periods_max 16 + period_size_min 192 + period_size_max 16384 + buffer_size_min 65536 + buffer_size_max 65536 + } + } +] + +# +# Pipeline routing +# +Object.Base.route [ + # + # Playback: + # FE DAI -> host-copier -> gain -> dai-copier -> SSP + # + { + source "gain.$SPEAKER_DAI_PIPELINE_ID.1" + sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback" + } + { + source "mixin.$SPEAKER_HOST_PIPELINE_ID.1" + sink "mixout.$SPEAKER_DAI_PIPELINE_ID.1" + } + { + source "host-copier.$SPEAKER_PCM_ID.playback" + sink "gain.$SPEAKER_DAI_PIPELINE_ID.1" + } + + # + # Capture: + # FE DAI <- host-copier <- dai-copier <- SSP + # + { + source "dai-copier.SSP.$SPEAKER_CODEC_NAME.capture" + sink "host-copier.$SPEAKER_FEEDBACK_PCM_ID.capture" + } +] diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 52c19f85976c..8e715ef7bff0 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -337,4 +337,8 @@ NHLT_BIN=nhlt-sof-mtl-rt5650-dts.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_IND 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,\ DEEP_BUF_SPK=true,PLAYBACK_PIPELINE_SRC=ctc,SSP_SPK_FMT_24=true,SSP_HS_FMT_24=true" + +# CS35L56 SSP2 +"cavs-cs35l56\;sof-tgl-cs35l56-ssp2\;PLATFORM=tgl,PREPROCESS_PLUGINS=nhlt,\ +NHLT_BIN=nhlt-sof-tgl-cs35l56-ssp2.bin" )