From 6f3c47d57f5a8dde4b38019c1a1e36a821ffc731 Mon Sep 17 00:00:00 2001 From: Richard Fitzgerald Date: Thu, 31 Oct 2024 16:51:28 +0000 Subject: [PATCH 1/4] topology2: Add config for CDB35L56-EIGHT-C board on TGL This adds a topology for using all 8 amps on a Cirrus Logic CDB35L56-EIGHT-C boardm without the CS42L43 codec. The bus configuration is: SDW0: 4 x CS35L56 SDW1: 4 x CS35L56 All amps are aggregated. Playback is stereo to all 8 amps. Feedback is 8 channels, 1 from each amp. Signed-off-by: Richard Fitzgerald --- .../topology/topology2/production/tplg-targets-cavs25.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/topology/topology2/production/tplg-targets-cavs25.cmake b/tools/topology/topology2/production/tplg-targets-cavs25.cmake index b1ef0942777d..86b926974f19 100644 --- a/tools/topology/topology2/production/tplg-targets-cavs25.cmake +++ b/tools/topology/topology2/production/tplg-targets-cavs25.cmake @@ -37,6 +37,11 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" +"cavs-sdw\;sof-tgl-cs35l56-l01-fb8\;NUM_SDW_AMP_LINKS=2,\ +SDW_AMP_FEEDBACK=true,SDW_SPK_STREAM=Playback,SDW_SPK_IN_STREAM=Capture,\ +AMP_FEEDBACK_CH=8,AMP_FEEDBACK_CH_PER_LINK=4,SDW_JACK=false,NUM_DMICS=0,\ +HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" + # IPC4 topology for TGL rt712 Headset, Amp and DMIC "cavs-sdw\;sof-tgl-rt712\;SDW_JACK_OUT_STREAM=Playback-SimpleJack,\ SDW_JACK_IN_STREAM=Capture-SimpleJack,SDW_SPK_STREAM=Playback-SmartAmp,\ From 8251648d0e011c3d078f10c25354c9d8205ba82d Mon Sep 17 00:00:00 2001 From: Richard Fitzgerald Date: Fri, 11 Oct 2024 14:46:33 +0100 Subject: [PATCH 2/4] topology2: mtl: Add CDB35L56-EIGHT-C board with all speakers aggregated This adds a topology for the Cirrus Logic CDB35L56-EIGHT-C board with the speaker playback (SmartAmp) on all 3 buses aggregated. The buses are: SDW0: CS35L56 (SmartAmp) SDW1: CS35L56 (SmartAmp) SDW3: CS42L43 (SmartJack, SmartMic, SmartAmp) Signed-off-by: Richard Fitzgerald --- tools/topology/topology2/production/tplg-targets-ace1.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/topology/topology2/production/tplg-targets-ace1.cmake b/tools/topology/topology2/production/tplg-targets-ace1.cmake index 40d07bd67510..7e81dd529cce 100644 --- a/tools/topology/topology2/production/tplg-targets-ace1.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace1.cmake @@ -90,6 +90,12 @@ SDW_JACK_IN_STREAM=Capture-SimpleJack" SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" +# CS42L43 speaker output aggregated with two buses of CS35L56, so total +# number of amp links is 3. +"cavs-sdw\;sof-mtl-cs42l43-l3-cs35l56-l01-spkagg\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=3,SDW_DMIC=1,\ +SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ +SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" + # ARL has the same DSP generation. So reuse the platform = mtl. "cavs-sdw\;sof-arl-cs42l43-l0\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,SDW_DMIC=1,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ From 14097d68ae2ccebdc3e652a6e91d265ebf183a13 Mon Sep 17 00:00:00 2001 From: Richard Fitzgerald Date: Thu, 10 Oct 2024 17:05:51 +0100 Subject: [PATCH 3/4] topology2: mtl: Add CDB35L56-EIGHT-C 8xCS35L56 without CS42L43 This adds a topology for a CDB35L56-EIGHT-C board that has only CS35L56 amps, without a CS42L43 codec. SDW0: 4x CS35L56 SDW1: 4x CS35L56 Playback and feedback are aggregated. Signed-off-by: Richard Fitzgerald --- tools/topology/topology2/production/tplg-targets-ace1.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/topology/topology2/production/tplg-targets-ace1.cmake b/tools/topology/topology2/production/tplg-targets-ace1.cmake index 7e81dd529cce..432d8a190191 100644 --- a/tools/topology/topology2/production/tplg-targets-ace1.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace1.cmake @@ -96,6 +96,11 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" +"cavs-sdw\;sof-mtl-cs35l56-l01-fb8\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,\ +SDW_AMP_FEEDBACK=true,SDW_SPK_STREAM=Playback,SDW_SPK_IN_STREAM=Capture,\ +AMP_FEEDBACK_CH=8,AMP_FEEDBACK_CH_PER_LINK=4,SDW_JACK=false,NUM_DMICS=0,\ +HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" + # ARL has the same DSP generation. So reuse the platform = mtl. "cavs-sdw\;sof-arl-cs42l43-l0\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,SDW_DMIC=1,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ From a196b63f17043129514cc19c7ed7ba764346a11d Mon Sep 17 00:00:00 2001 From: Richard Fitzgerald Date: Fri, 1 Nov 2024 17:18:29 +0000 Subject: [PATCH 4/4] topology2: Add CS35L56 connected to SSP2 in DSP_A mode on TGL This adds a topology for CS35L56 amplifiers connected to SSP2 in DSP_A mode. This is used with the Cirrus Logic CDB35L56-FOUR board. SSP configuration is fixed at: 48kHz sample rate, 16-bit samples DSP_A with 8 slots of 16-bit width Playback is stereo on slots 0 and 1 Capture is 8 channels on slots 0..7 This gives stereo playback to all amps and 2 channels of feedback from up to 4 amps. Signed-off-by: Richard Fitzgerald --- tools/topology/topology2/cavs-cs35l56.conf | 423 ++++++++++++++++++ .../topology2/development/tplg-targets.cmake | 4 + 2 files changed, 427 insertions(+) create mode 100644 tools/topology/topology2/cavs-cs35l56.conf 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" )