diff --git a/tools/topology/topology2/cavs-mixin-mixout-ctc-ssp.conf b/tools/topology/topology2/cavs-mixin-mixout-ctc-ssp.conf new file mode 100644 index 000000000000..a2819a91e425 --- /dev/null +++ b/tools/topology/topology2/cavs-mixin-mixout-ctc-ssp.conf @@ -0,0 +1,59 @@ +# +# Pipeline definitions +# +# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> CTC ----> SSP0 +# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> CTC ----> SSP1 +# + +# Pipeline ID:1 PCM ID: 0 +Object.Pipeline { + # playback pipelines + host-copier-gain-mixin-playback [ + { + index $SPEAKER_HOST_PIPELINE_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' + } + } + } + ] + + mixout-gain-ctc-dai-copier-playback [ + { + index $SPEAKER_DAI_PIPELINE_ID + + 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 + } + + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume' + } + } + Object.Widget.ctc.1 { + } + } + ] +} + +Object.Base.route [ + { + source "ctc.$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" + } +] diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf index 396737b58c67..84f3447c1d7c 100644 --- a/tools/topology/topology2/cavs-rt5682.conf +++ b/tools/topology/topology2/cavs-rt5682.conf @@ -19,6 +19,7 @@ + @@ -48,6 +49,7 @@ + Define { MCLK 24576000 @@ -157,6 +159,7 @@ IncludeByKey.INCLUDE_BT_OFFLOAD { IncludeByKey.PLAYBACK_PIPELINE_SRC { "volume" "cavs-mixin-mixout-ssp.conf" "dts" "cavs-mixin-mixout-eqiir-dts-ssp.conf" + "ctc" "cavs-mixin-mixout-ctc-ssp.conf" } diff --git a/tools/topology/topology2/include/components/ctc.conf b/tools/topology/topology2/include/components/ctc.conf new file mode 100644 index 000000000000..792d6ce7a48f --- /dev/null +++ b/tools/topology/topology2/include/components/ctc.conf @@ -0,0 +1,81 @@ +# +# Common widget ctc +# +# A generic ctc widget. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.ctc.N.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# Object.Widget.ctc."N" { +# index 1 +# type "effect" +# } +# +# Where N is the unique instance number for the parent object. + +Class.Widget."ctc" { + # + # Pipeline ID for the CTC widget object + # + DefineAttribute."index" { + type "integer" + } + + # + # Unique instance for CTC widget + # + DefineAttribute."instance" { + type "integer" + } + + #include common component definition + + + # Attribute categories + attributes { + # + # The CTC widget name would be constructed using the index and instance attributes. + # + !constructor [ + "index" + "instance" + ] + + # + # mandatory attributes that must be provided when the class is instantiated + # + !mandatory [ + "uuid" + "num_input_audio_formats" + "num_output_audio_formats" + ] + + # + # immutable attributes cannot be modified in the object instance + # + !immutable [ + "uuid" + "type" + ] + + # + # deprecated attributes should not be added in the object instance + # + !deprecated [ + "preload_count" + ] + + # + # DTS widget objects instantiated within the same alsaconf node must have unique + # instance attribute + # + unique "instance" + } + + # Default attribute values for CTC widget + uuid "bf:0e:1b:bc:dc:6a:45:fe:bc:90:25:54:cb:13:7a:b4" + type "effect" + no_pm "true" + num_input_pins 1 + num_output_pins 1 +} diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-ctc-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-ctc-dai-copier-playback.conf new file mode 100644 index 000000000000..0347a46acb0d --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-ctc-dai-copier-playback.conf @@ -0,0 +1,111 @@ +# +# BE playback pipeline: mixout-gain-ctc-dai-copier. +# +# All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.mixout-gain-ctc-dai-copier-playback.N.attribute_name" +# +# Usage: mixout-gain-ctc-dai-copier-playback pipeline object can be instantiated as: +# +# Object.Pipeline.mixout-gain-ctc-dai-copier-playback."N" { +# period 1000 +# time_domain "timer" +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + + + + + + +Class.Pipeline."mixout-gain-ctc-dai-copier-playback" { + + DefineAttribute."index" {} + + + + attributes { + !constructor [ + "index" + ] + + !immutable [ + "direction" + ] + + # + # mixout-gain-ctc-dai-copier-playback objects instantiated within the same alsaconf node must have + # unique instance attribute + # + unique "instance" + } + + Object.Widget { + mixout."1" {} + dai-copier."1" { + type dai_in + num_input_audio_formats 1 + num_output_audio_formats 1 + num_input_pins 1 + + # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + gain."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + ctc."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + } + + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + Object.Base { + route.1 { + source mixout..1 + sink gain..1 + } + route.2 { + source gain..1 + sink ctc..1 + } + } + + direction "playback" + dynamic_pipeline 1 + time_domain "timer" +} diff --git a/tools/topology/topology2/production/tplg-targets-ace1.cmake b/tools/topology/topology2/production/tplg-targets-ace1.cmake index 487af6855f66..f82df3a307a8 100644 --- a/tools/topology/topology2/production/tplg-targets-ace1.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace1.cmake @@ -71,6 +71,12 @@ SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAM 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" +"cavs-rt5682\;sof-mtl-rt1019-rt5682-ctc\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ +PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,SPK_ID=6,PREPROCESS_PLUGINS=nhlt,\ +NHLT_BIN=nhlt-sof-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\ +SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\ +INCLUDE_ECHO_REF=true,DEEPBUFFER_D0I3_COMPATIBLE=true,INCLUDE_BT_OFFLOAD=false,PLAYBACK_PIPELINE_SRC=ctc" + #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,\