diff --git a/tools/topology/topology2/cavs-mixin-mixout-eqiir-dts-ssp.conf b/tools/topology/topology2/cavs-mixin-mixout-eqiir-dts-ssp.conf new file mode 100644 index 000000000000..2d5800617c85 --- /dev/null +++ b/tools/topology/topology2/cavs-mixin-mixout-eqiir-dts-ssp.conf @@ -0,0 +1,129 @@ +# +# Pipeline definitions +# +# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> EQ IIR ----> DTS ----> SSP0 +# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> EQ IIR ----> DTS ----> SSP1 + +# 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 'Pre Mixer $HEADSET_PCM_NAME Playback Volume' + } + } + } + { + index 3 + + 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-eqiir-dts-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 'Post Mixer $HEADSET_PCM_NAME Playback Volume' + } + } + + Object.Widget.eqiir.1 { + Object.Control.bytes."1" { + name 'EQIIR2.0 eqiir_coef_2' + } + } + + Object.Widget.dts.1 { + Object.Control.bytes."1" { + max 2048 + name 'CODEC_ADAPTER2.0 DTS Codec Setup 2' + } + } + } + { + index 4 + + 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.eqiir.1 { + Object.Control.bytes."1" { + name 'EQIIR1.0 eqiir_coef_1' + } + } + + Object.Widget.dts.1 { + Object.Control.bytes."1" { + max 2048 + name 'CODEC_ADAPTER1.0 DTS Codec Setup 1' + } + } + + } + ] +} + +Object.Base.route [ + { + source "gain.2.1" + sink "eqiir.2.1" + } + { + source "dts.2.1" + sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback" + } + { + source "mixin.1.1" + sink "mixout.2.1" + } + { + source "gain.4.1" + sink "eqiir.4.1" + } + { + source "dts.4.1" + sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback" + } + { + source "mixin.3.1" + sink "mixout.4.1" + } +] diff --git a/tools/topology/topology2/cavs-mixin-mixout-ssp.conf b/tools/topology/topology2/cavs-mixin-mixout-ssp.conf new file mode 100644 index 000000000000..d5a0c2c28ba8 --- /dev/null +++ b/tools/topology/topology2/cavs-mixin-mixout-ssp.conf @@ -0,0 +1,95 @@ +# +# Pipeline definitions +# +# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP0 +# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP1 +# + +# 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 'Pre Mixer $HEADSET_PCM_NAME Playback Volume' + } + } + } + { + index 3 + + 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-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 'Post Mixer $HEADSET_PCM_NAME Playback Volume' + } + } + } + { + index 4 + + 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.Base.route [ + { + source "gain.2.1" + sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback" + } + { + source "mixin.1.1" + sink "mixout.2.1" + } + { + source "gain.4.1" + sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback" + } + { + source "mixin.3.1" + sink "mixout.4.1" + } +] diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf index 721c97afe94e..2984cf202036 100644 --- a/tools/topology/topology2/cavs-rt5682.conf +++ b/tools/topology/topology2/cavs-rt5682.conf @@ -17,6 +17,7 @@ + @@ -105,6 +106,7 @@ Define { GOOGLE_AEC_PIPELINE_PRIORITY 2 DMIC_PIPELINE_PRIORITY 1 ECHO_REF_PIPELINE_PRIORITY 0 + PLAYBACK_PIPELINE_SRC "volume" } # override defaults with platform-specific config @@ -140,6 +142,12 @@ IncludeByKey.INCLUDE_BT_OFFLOAD { "true" "platform/intel/bt-generic.conf" } +IncludeByKey.PLAYBACK_PIPELINE_SRC { + "volume" "cavs-mixin-mixout-ssp.conf" + "dts" "cavs-mixin-mixout-eqiir-dts-ssp.conf" +} + + # # List of all DAIs # @@ -198,81 +206,11 @@ Object.Dai.SSP [ # # Pipeline definitions # -# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP0 -# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP1 -# # SSP0 ----> PCM0 # SSP1 ----> PCM1 # 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 'Pre Mixer $HEADSET_PCM_NAME Playback Volume' - } - } - } - { - index 3 - - 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-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 'Post Mixer $HEADSET_PCM_NAME Playback Volume' - } - } - } - { - index 4 - - 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' - } - } - } - ] - host-gateway-capture [ { index 5 @@ -350,22 +288,6 @@ Object.PCM.pcm [ ] Object.Base.route [ - { - source "gain.2.1" - sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback" - } - { - source "mixin.1.1" - sink "mixout.2.1" - } - { - source "gain.4.1" - sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback" - } - { - source "mixin.3.1" - sink "mixout.4.1" - } { source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture" sink "host-copier.$HEADSET_PCM_ID.capture" @@ -374,7 +296,7 @@ Object.Base.route [ source "host-copier.$HEADSET_PCM_ID.playback" sink "gain.1.1" } - { + { source "host-copier.$SPEAKER_PCM_ID.playback" sink "gain.3.1" } diff --git a/tools/topology/topology2/include/components/dts.conf b/tools/topology/topology2/include/components/dts.conf new file mode 100644 index 000000000000..071ee058de0a --- /dev/null +++ b/tools/topology/topology2/include/components/dts.conf @@ -0,0 +1,107 @@ +# +# Common widget dts +# +# A generic dts widget. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.dts.N.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# Object.Widget.dts."N" { +# index 1 +# type "effect" +# } +# +# Where N is the unique instance number for the smart_amp object within the same alsaconf node. + +Class.Widget."dts" { + # + # Pipeline ID for the DTS widget object + # + DefineAttribute."index" { + type "integer" + } + + # + # Unique instance for DTS widget + # + DefineAttribute."instance" { + type "integer" + } + + #include common component definition + + + DefineAttribute."cpc" { + # Token set reference name and type + token_ref "comp.word" + } + + Object.Control.bytes."1" { + !access [ + tlv_read + tlv_write + tlv_callback + ] + Object.Base.extops.1 { + name "extctl" + get 258 + put 258 + } + max 2048 + Object.Base.data.1 { + + } + } + + # Attribute categories + attributes { + # + # The DTS 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 [ + "no_pm" + "uuid" + "num_input_audio_formats" + "num_output_audio_formats" + ] + + # + # immutable attributes cannot be modified in the object instance + # + !immutable [ + "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 smart_amp widget + + # UUID can be overridden in the top-level topology file + uuid "4f:c3:5f:d9:0f:37:c7:4a:bc:86:bf:dc:5b:e2:41:e6" + type "effect" + no_pm "true" + core_id 0 + cpc 5000 + num_input_pins 1 + num_output_pins 1 +} diff --git a/tools/topology/topology2/include/components/dts/dts_spk.conf b/tools/topology/topology2/include/components/dts/dts_spk.conf new file mode 100644 index 000000000000..ae4f5fb67cc4 --- /dev/null +++ b/tools/topology/topology2/include/components/dts/dts_spk.conf @@ -0,0 +1,9 @@ +Object.Base.data."dts_spk" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x0c,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00,0x0c,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-dts-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-dts-dai-copier-playback.conf new file mode 100644 index 000000000000..f48a6449b682 --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-dts-dai-copier-playback.conf @@ -0,0 +1,139 @@ +# +# BE playback pipeline: mixout-gain-dts-dai-copier. +# +# All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.mixout-gain-eqiir-dts-dai-copier-playback.N.attribute_name" +# +# Usage: mixout-gain-dts-dai-copier-playback pipeline object can be instantiated as: +# +# Object.Pipeline.mixout-gain-dts-dai-copier-playback."N" { +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + + + + + + + +Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" { + + DefineAttribute."index" {} + + + + attributes { + !constructor [ + "index" + ] + + !immutable [ + "direction" + ] + + # + # mixout-gain-dts-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 + } + ] + } + eqiir."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 + } + + Object.Control.bytes."1" { + + } + } + dts."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 eqiir..1 + } + route.3 { + source eqiir..1 + sink dts..1 + } + } + + direction "playback" + dynamic_pipeline 1 + time_domain "timer" + channels 2 + channels_min 2 + channels_max 2 + rate 48000 + rate_min 48000 + rate_max 48000 +}