From ac0a2d5ca0e1bfaee30e4c190ea277b1e46f9cce Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 13:28:46 -0700 Subject: [PATCH 01/12] topology2: components: Add a new class definition for the host copier gateway This will replace the generic copier for the host gateway. Signed-off-by: Ranjani Sridharan --- .../include/components/host-copier.conf | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 tools/topology/topology2/include/components/host-copier.conf diff --git a/tools/topology/topology2/include/components/host-copier.conf b/tools/topology/topology2/include/components/host-copier.conf new file mode 100644 index 000000000000..51b952f07f56 --- /dev/null +++ b/tools/topology/topology2/include/components/host-copier.conf @@ -0,0 +1,138 @@ +# +# Host gateway copier widget +# +# A host gateway copier widget. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.host-copier.N.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# Object.Widget.host-copier."N" { +# pcm_id 1 +# } +# +# Where N is the unique instance number for the host-copier object within the same alsaconf node. + +Class.Widget."host-copier" { + # + # Pipeline ID for the copier object + # + DefineAttribute."index" {} + + /* PCM ID that the host-copier is bound with */ + DefineAttribute."pcm_id" {} + + # + # Copier object instance + # + DefineAttribute."instance" {} + + #include common component definition + + + # + # host-copier component UUID + # + DefineAttribute."uuid" { + type "string" + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + # + # Bespoke Attribute Definitions for host copiers + # + + DefineAttribute."direction" { + type "string" + token_ref "sof_tkn_dai.word" + constraints { + !valid_values [ + "playback" + "capture" + ] + !tuple_values [ + 0 + 1 + ] + } + } + + # + # cycles per chunk processed + # + DefineAttribute."cpc" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + DefineAttribute."bss_size" {} + + DefineAttribute."is_pages" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + DefineAttribute."node_type" { + # Token set reference name and type + token_ref "sof_tkn_copier.word" + constraints { + !valid_values [ + $HDA_HOST_OUTPUT_CLASS # HD/A host output (-> DSP) + $HDA_HOST_INPUT_CLASS # HD/A host input (<- DSP) + $HDA_HOST_INOUT_CLASS # HD/A host input/output (rsvd for future use) + ] + } + } + + # + # Deep buffer size in ms. Applicable only for host copiers + # + DefineAttribute."deep_buffer_dma_ms" { + # Token set reference name and type + token_ref "sof_tkn_copier.word" + } + + attributes { + # + # The host copier widget name would be constructed using the copier pcm_id and + # direction. For ex: "host-copier.1.playback". + # + !constructor [ + "pcm_id" + "direction" + ] + + # + # mandatory attributes that must be provided when the buffer class is instantiated. + # num_input_audio_formats for playback and num_output_formats for capture are + # mandatory even though the num_input_pins/num_output_pins are 0 because + # these are used to set the DMA buffer format. + !mandatory [ + "num_input_audio_formats" + "num_output_audio_formats" + "node_type" + ] + + # + # immutable attributes cannot be modified in the object instance + # + !immutable [ + "uuid" + ] + + unique "instance" + } + + # + # Default attributes for Copier + # + #UUID: 9BA00C83-CA12-4A83-943C-1FA2E82F9DDA + uuid "83:0c:a0:9b:12:CA:83:4a:94:3c:1f:a2:e8:2f:9d:da" + no_pm "true" + core_id 0 + cpc 1647 + bss_size 280 + + # math expression for computing is_pages + is_pages "$[(($bss_size + 4095) & -4095) / 4096]" +} From 9a4618c8d3a1a91d5a99682d7bac9b3ae0c7fdf7 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 13:30:04 -0700 Subject: [PATCH 02/12] topology2: host-copier-gain-mixin-playback: Use host-copier Replace the generic copier with host-copier object in the pipeline class definition and all its instances. Signed-off-by: Ranjani Sridharan --- .../topology2/cavs-mixin-mixout-efx-hda.conf | 7 ++++++- .../topology2/cavs-mixin-mixout-hda.conf | 7 ++++++- .../topology2/cavs-nocodec-multicore.conf | 21 ++++++++++++++++--- tools/topology/topology2/cavs-nocodec.conf | 21 ++++++++++++++++--- tools/topology/topology2/cavs-rt5682.conf | 14 +++++++++++-- .../cavs/host-copier-gain-mixin-playback.conf | 16 ++++++-------- .../platform/intel/nocodec-ssp0-2level.conf | 8 ++++++- .../platform/intel/sdw-amp-generic.conf | 7 ++++++- .../platform/intel/sdw-jack-generic.conf | 19 ++++++++++------- 9 files changed, 91 insertions(+), 29 deletions(-) diff --git a/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf b/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf index 8f3b96e87a2b..a9815205eaf8 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf @@ -60,8 +60,9 @@ Object.Pipeline { { index 1 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $ANALOG_PLAYBACK_PCM + pcm_id 0 } Object.Widget.gain.1 { @@ -137,4 +138,8 @@ Object.Base.route [ source 'copier.HDA.4.1' sink 'copier.host.3.1' } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } ] diff --git a/tools/topology/topology2/cavs-mixin-mixout-hda.conf b/tools/topology/topology2/cavs-mixin-mixout-hda.conf index aa00ca621093..3b013e8bbda9 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-hda.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-hda.conf @@ -50,8 +50,9 @@ Object.Pipeline { { index 1 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $ANALOG_PLAYBACK_PCM + pcm_id 0 } Object.Widget.gain.1 { @@ -136,4 +137,8 @@ Object.Base.route [ source 'eqiir.4.1' sink 'copier.host.3.1' } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } ] diff --git a/tools/topology/topology2/cavs-nocodec-multicore.conf b/tools/topology/topology2/cavs-nocodec-multicore.conf index b1dc28426617..924ce41b22ca 100644 --- a/tools/topology/topology2/cavs-nocodec-multicore.conf +++ b/tools/topology/topology2/cavs-nocodec-multicore.conf @@ -120,9 +120,10 @@ Object.Pipeline.host-copier-gain-mixin-playback [ index 1 core $SSP0_CORE_ID - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { core_id $SSP0_CORE_ID stream_name 'SSP0 Playback' + pcm_id 0 } Object.Widget.gain.1 { core_id $SSP0_CORE_ID @@ -135,9 +136,10 @@ Object.Pipeline.host-copier-gain-mixin-playback [ index 5 core $SSP2_CORE_ID - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { core_id $SSP2_CORE_ID stream_name 'SSP2 Playback' + pcm_id 2 } Object.Widget.gain.1 { core_id $SSP2_CORE_ID @@ -323,6 +325,14 @@ Object.Base.route [ source "copier.SSP.12.1" sink "copier.host.11.1" } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } + { + source 'host-copier.2.playback' + sink 'gain.5.1' + } ] # There is pinmux conflict between SSP1 and DMIC on MTL RVP, @@ -358,9 +368,10 @@ IncludeByKey.SSP1_ENABLED { index 3 core $SSP1_CORE_ID - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { core_id $SSP1_CORE_ID stream_name 'SSP1 Playback' + pcm_id 1 } Object.Widget.gain.1 { core_id $SSP1_CORE_ID @@ -468,6 +479,10 @@ IncludeByKey.SSP1_ENABLED { source "copier.SSP.10.1" sink "copier.host.9.1" } + { + source 'host-copier.1.playback' + sink 'gain.3.1' + } ] } } diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index e96e7e25e130..da4f5ac7bd9b 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -174,8 +174,9 @@ IncludeByKey.PASSTHROUGH { { index 1 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0 Playback' + pcm_id 0 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -186,8 +187,9 @@ IncludeByKey.PASSTHROUGH { { index 5 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP2 Playback' + pcm_id 2 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -875,6 +877,14 @@ IncludeByKey.PASSTHROUGH { source "copier.SSP.8.1" sink "smart_amp.2.1" } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } + { + source 'host-copier.2.playback' + sink 'gain.5.1' + } ] } "true" { @@ -977,8 +987,9 @@ IncludeByKey.SSP1_ENABLED { { index 3 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP1 Playback' + pcm_id 1 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -1128,6 +1139,10 @@ IncludeByKey.SSP1_ENABLED { source "gain.4.1" sink "copier.SSP.4.1" } + { + source 'host-copier.1.playback' + sink 'gain.3.1' + } ] } "true" { diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf index cd6932dc9a82..12f314648784 100644 --- a/tools/topology/topology2/cavs-rt5682.conf +++ b/tools/topology/topology2/cavs-rt5682.conf @@ -201,8 +201,9 @@ Object.Pipeline { { index 1 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name '$HEADSET_PLAYBACK_PCM_STREAM_NAME' + pcm_id 0 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -213,8 +214,9 @@ Object.Pipeline { { index 3 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name '$SPEAKER_PLAYBACK_PCM_STREAM_NAME' + pcm_id 1 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -351,4 +353,12 @@ Object.Base.route [ source "copier.SSP.6.1" sink "copier.host.5.1" } + { + source "host-copier.0.playback" + sink "gain.1.1" + } + { + source "host-copier.1.playback" + sink "gain.3.1" + } ] diff --git a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf index 26faeb8891f1..814e78252eb8 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf @@ -17,7 +17,7 @@ # - + @@ -45,12 +45,12 @@ Class.Pipeline."host-copier-gain-mixin-playback" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { type "aif_in" node_type $HDA_HOST_OUTPUT_CLASS num_input_audio_formats 3 num_output_audio_formats 3 + num_output_pins 1 # 16-bit 48KHz 2ch Object.Base.audio_format.1 { out_bit_depth 32 @@ -95,16 +95,12 @@ Class.Pipeline."host-copier-gain-mixin-playback" { } } - Object.Base { - route.1 { - source copier.host.$index.1 - sink gain.$index.1 - } - route.2 { + Object.Base.route [ + { source gain.$index.1 sink mixin.$index.1 } - } + ] direction "playback" dynamic_pipeline 1 diff --git a/tools/topology/topology2/platform/intel/nocodec-ssp0-2level.conf b/tools/topology/topology2/platform/intel/nocodec-ssp0-2level.conf index a2d907ea22c9..8eb119911bd5 100644 --- a/tools/topology/topology2/platform/intel/nocodec-ssp0-2level.conf +++ b/tools/topology/topology2/platform/intel/nocodec-ssp0-2level.conf @@ -5,8 +5,9 @@ Object.Pipeline.host-copier-gain-mixin-playback [ Object.Widget.pipeline.1 { stream_name 'NoCodec-0' } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0 Aux Playback' + pcm_id $SSP0_MIXER_PCM_ID_1 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -49,6 +50,11 @@ Object.Base.route [ source $SSP0_MIXER_SOURCE_2 sink $SSP0_MIXER_SINK_1 } + { + source host-copier.$SSP0_MIXER_PCM_ID_1.playback + sink gain.$SSP0_MIXER_PIPELINE_ID_2.1 + } + { source $SSP0_MIXER_SOURCE_3 sink $SSP0_MIXER_SINK_2 diff --git a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf index 730d582a9bc8..2a4d991f2b2a 100644 --- a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf @@ -33,8 +33,9 @@ Object.Pipeline { { index 20 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name "sdw amplifiers" + pcm_id 2 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -129,6 +130,10 @@ Object.Base.route [ source 'mixin.20.1' sink 'mixout.21.1' } + { + source 'host-copier.2.playback' + sink 'gain.20.1' + } ] IncludeByKey.SDW_AMP_FEEDBACK { diff --git a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf index 0c81629f9e3e..84a7830b23d5 100644 --- a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf @@ -46,13 +46,14 @@ Object.Pipeline { { index 0 - Object.Widget.copier.1 { - stream_name "volume playback 0" - } - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name '1 Playback Volume 0' - } + Object.Widget.host-copier.1 { + stream_name "volume playback 0" + pcm_id 0 + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name '1 Playback Volume 0' + } } } ] @@ -156,4 +157,8 @@ Object.Base.route [ source "eqiir.11.1" sink "copier.host.10.1" } + { + source "host-copier.0.playback" + sink "gain.0.1" + } ] From 36bcad5bf062d601a8db76aac4b6c64f94c60a06 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 13:36:28 -0700 Subject: [PATCH 03/12] topology2: host-copier-gain-src-mixin-playback: Use host-copier Replace the generic copier with host-copier in the class definition and the instances. Signed-off-by: Ranjani Sridharan --- .../topology2/cavs-src-mixin-mixout-hda.conf | 7 ++++- .../host-copier-gain-src-mixin-playback.conf | 26 ++++++++----------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tools/topology/topology2/cavs-src-mixin-mixout-hda.conf b/tools/topology/topology2/cavs-src-mixin-mixout-hda.conf index dfda6d5132ca..7afdd5daee22 100644 --- a/tools/topology/topology2/cavs-src-mixin-mixout-hda.conf +++ b/tools/topology/topology2/cavs-src-mixin-mixout-hda.conf @@ -50,8 +50,9 @@ Object.Pipeline { { index 1 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $ANALOG_PLAYBACK_PCM + pcm_id 0 } Object.Widget.src.1 { @@ -132,4 +133,8 @@ Object.Base.route [ source 'copier.HDA.4.1' sink 'copier.host.3.1' } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } ] diff --git a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-src-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-src-mixin-playback.conf index 292e5b1686c0..c8b3d5f4216a 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-src-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-src-mixin-playback.conf @@ -18,7 +18,7 @@ - + @@ -47,10 +47,10 @@ Class.Pipeline."host-copier-gain-src-mixin-playback" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { type "aif_in" node_type $HDA_HOST_OUTPUT_CLASS + num_output_pins 1 } @@ -73,20 +73,16 @@ Class.Pipeline."host-copier-gain-src-mixin-playback" { } } - Object.Base { - route.1 { - source copier.host..1 - sink gain..1 + Object.Base.route [ + { + source gain.$index.1 + sink src.$index.1 } - route.2 { - source gain..1 - sink src..1 + { + source src.$index.1 + sink mixin.$index.1 } - route.3 { - source src..1 - sink mixin..1 - } - } + ] direction "playback" dynamic_pipeline 1 From bafb9c1a253407b7376c5fb2ea11b48ba0fab3f3 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 13:43:26 -0700 Subject: [PATCH 04/12] topology2: src-gain-mixin-playback: Use host-copier Replace the generic copier with host-copier in the class definition and the instances. Signed-off-by: Ranjani Sridharan --- .../topology2/cavs-sdw-src-gain-mixin.conf | 9 +++++++- .../cavs/src-gain-mixin-playback.conf | 22 +++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf b/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf index 5786ae6d70f4..b69e9c4b0b3d 100644 --- a/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf +++ b/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf @@ -80,7 +80,10 @@ Object.Pipeline { { index 1 - Object.Widget.copier.1.stream_name "Gain Playback 0" + Object.Widget.host-copier.1 { + stream_name "Gain Playback 0" + pcm_id 0 + } Object.Widget.gain.1{ Object.Control.mixer.1 { name 'Src Playback Volume' @@ -183,4 +186,8 @@ Object.Base.route [ source "copier.ALH.3.1" sink "copier.host.4.1" } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } ] diff --git a/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf index d2ae1e08fa0c..aaab347faf37 100644 --- a/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf @@ -18,7 +18,7 @@ - + @@ -43,9 +43,9 @@ Class.Pipeline."src-gain-mixin-playback" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { type "aif_in" + num_output_pins 1 @@ -87,22 +87,16 @@ Class.Pipeline."src-gain-mixin-playback" { } } - Object.Base { - route."1" { - source "copier.host.$index.1" - sink "src.$index.1" - } - - route."2" { + Object.Base.route [ + { source "src.$index.1" sink "gain.$index.1" } - - route."3" { + { source "gain.$index.1" sink "mixin.$index.1" - } - } + } + ] direction "playback" dynamic_pipeline 1 From 0ee388b7375ef2a05cb26a8670f02c53595165aa Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 13:49:45 -0700 Subject: [PATCH 05/12] topology2: deepbuffer-playback: Use host-copier Replace the generic copier with host-copier in the class definition and the instances. Signed-off-by: Ranjani Sridharan --- .../pipelines/cavs/deepbuffer-playback.conf | 16 ++++++---------- .../topology2/platform/intel/deep-buffer.conf | 7 ++++++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf index 8b5ffe020ce2..fbb19283a9dd 100644 --- a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf @@ -17,7 +17,7 @@ # - + @@ -45,12 +45,12 @@ Class.Pipeline."deepbuffer-playback" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { type "aif_in" node_type $HDA_HOST_OUTPUT_CLASS num_input_audio_formats 3 num_output_audio_formats 3 + num_output_pins 1 deep_buffer_dma_ms $DEEPBUFFER_FW_DMA_MS # 16-bit 48KHz 2ch Object.Base.audio_format.1 { @@ -97,16 +97,12 @@ Class.Pipeline."deepbuffer-playback" { } } - Object.Base { - route.1 { - source copier.host.$index.1 - sink gain.$index.1 - } - route.2 { + Object.Base.route [ + { source gain.$index.1 sink mixin.$index.1 } - } + ] direction "playback" dynamic_pipeline 1 diff --git a/tools/topology/topology2/platform/intel/deep-buffer.conf b/tools/topology/topology2/platform/intel/deep-buffer.conf index f66b5d62e39f..047e409a26e2 100644 --- a/tools/topology/topology2/platform/intel/deep-buffer.conf +++ b/tools/topology/topology2/platform/intel/deep-buffer.conf @@ -2,8 +2,9 @@ Object.Pipeline.deepbuffer-playback [ { index $DEEP_BUFFER_PIPELINE_ID - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $DEEP_BUFFER_PCM_NAME + pcm_id $DEEP_BUFFER_PCM_ID } Object.Widget.gain.1 { @@ -37,4 +38,8 @@ Object.Base.route [ source $DEEP_BUFFER_PIPELINE_SRC sink $DEEP_BUFFER_PIPELINE_SINK } + { + source host-copier.$DEEP_BUFFER_PCM_ID.playback + sink gain.$DEEP_BUFFER_PIPELINE_ID.1 + } ] From b00102ae13a9835b701598e2c50e6fe8e258ff94 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 13:51:47 -0700 Subject: [PATCH 06/12] topology2: mixout-gain-host-copier-capture: Use host-copier Replace the generic copier with host-copier in the class definition. Signed-off-by: Ranjani Sridharan --- .../cavs/mixout-gain-host-copier-capture.conf | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf index 35c822a62ad5..594251d66062 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf @@ -17,7 +17,7 @@ # - + @@ -47,12 +47,12 @@ Class.Pipeline."mixout-gain-host-copier-capture" { Object.Widget { mixout."1" {} - copier."1" { - copier_type "host" + host-copier."1" { type "aif_out" node_type $HDA_HOST_INPUT_CLASS num_input_audio_formats 4 num_output_audio_formats 4 + num_input_pins 1 # 16-bit 48KHz 2ch Object.Base.audio_format.1 { in_bit_depth 32 @@ -108,16 +108,12 @@ Class.Pipeline."mixout-gain-host-copier-capture" { } } - Object.Base { - route.1 { - source mixout.$index.1 - sink gain.$index.1 - } - route.2 { + Object.Base.route [ + { source gain.$index.1 sink copier.host.$index.1 } - } + ] direction "capture" dynamic_pipeline 1 From cdc01ff06cf77a3c316042213dc3eea1f8317713 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 14:01:47 -0700 Subject: [PATCH 07/12] topology2: gain-capture: Use host-copier Replace the generic copier with host-copier in the class definition and the instances. Signed-off-by: Ranjani Sridharan --- tools/topology/topology2/cavs-nocodec.conf | 14 ++++++++++++-- .../include/pipelines/cavs/gain-capture.conf | 13 +++---------- .../topology2/platform/intel/dmic-generic.conf | 7 ++++++- .../platform/intel/google-rtc-aec-reference.conf | 7 ++++++- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index da4f5ac7bd9b..b12c3b2f30c9 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -629,8 +629,9 @@ IncludeByKey.PASSTHROUGH { Object.Widget.pipeline.1 { stream_name "DMIC0 Raw" } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name "Gain Capture 18" + pcm_id 27 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -684,8 +685,9 @@ IncludeByKey.PASSTHROUGH { Object.Widget.pipeline.1 { stream_name "DMIC0 Raw 2" } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name "Gain Capture 20" + pcm_id 28 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -885,6 +887,14 @@ IncludeByKey.PASSTHROUGH { source 'host-copier.2.playback' sink 'gain.5.1' } + { + source "gain.18.1" + sink "host-copier.27.capture" + } + { + source "gain.20.1" + sink "host-copier.28.capture" + } ] } "true" { diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf index 371991dbf01d..57e65070b6db 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf @@ -18,7 +18,7 @@ # - + @@ -45,11 +45,11 @@ Class.Pipeline."gain-capture" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { type "aif_out" num_input_audio_formats 3 num_output_audio_formats 3 + num_input_pins 1 # 16-bit 48KHz 2ch Object.Base.audio_format.1 { in_bit_depth 32 @@ -107,13 +107,6 @@ Class.Pipeline."gain-capture" { } } - Object.Base { - route."1" { - source "gain.$index.1" - sink "copier.host.$index.1" - } - } - direction "capture" dynamic_pipeline 1 time_domain "timer" diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf index 34fc26afa8e0..7aa68f9f5f23 100644 --- a/tools/topology/topology2/platform/intel/dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/dmic-generic.conf @@ -73,9 +73,10 @@ IncludeByKey.PASSTHROUGH { format $FORMAT index $DMIC0_HOST_PIPELINE_ID - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $DMIC0_PCM_CAPS core_id $DMIC_CORE_ID + pcm_id $DMIC0_PCM_ID num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -248,6 +249,10 @@ IncludeByKey.PASSTHROUGH { source $DMIC0_DAI_PIPELINE_SRC sink $DMIC0_HOST_PIPELINE_SINK } + { + source "gain.$DMIC0_HOST_PIPELINE_ID.1" + sink "host-copier.$DMIC0_PCM_ID.capture" + } ] } "true" { diff --git a/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf b/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf index e7c641468193..9b0cd412f6d5 100644 --- a/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf +++ b/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf @@ -31,8 +31,9 @@ Object.Pipeline.gain-capture [ { index 20 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name "DMIC0 AN" + pcm_id 28 } Object.Widget.gain.1 { @@ -95,4 +96,8 @@ Object.Base.route [ source "module-copier.18.2" sink "gain.20.1" } + { + source "gain.20.1" + sink "host-copier.28.capture" + } ] From 75b4548a0dc6d1a9f7aaf64bbee4a0ac64042a27 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 14:03:46 -0700 Subject: [PATCH 08/12] topology2: gain-playback: Use host-copier Replace the generic copier with host-copier in the class definition. Signed-off-by: Ranjani Sridharan --- .../include/pipelines/cavs/gain-playback.conf | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf b/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf index cf553651b7ce..81aedde59f7f 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf @@ -17,7 +17,7 @@ # - + @@ -44,11 +44,11 @@ Class.Pipeline."gain-playback" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { type "aif_in" num_input_audio_formats 3 num_output_audio_formats 3 + num_output_pins 1 # 16-bit 48KHz 2ch Object.Base.audio_format.1 { out_bit_depth 32 @@ -91,13 +91,6 @@ Class.Pipeline."gain-playback" { } } - Object.Base { - route."1" { - source "copier.host.$index.1" - sink "gain.$index.1" - } - } - direction "playback" dynamic_pipeline 1 time_domain "timer" From 38ec4896f3fdc64fceb39fe45fdf17e199a7f69b Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 14:08:13 -0700 Subject: [PATCH 09/12] topology2: gain-copier-capture: Use host-copier Replace the generic copier with host-copier in the class definition and the instances. Signed-off-by: Ranjani Sridharan --- tools/topology/topology2/cavs-nocodec.conf | 14 ++++++++++++-- .../pipelines/cavs/gain-copier-capture.conf | 16 ++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index b12c3b2f30c9..846c81a12257 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -258,8 +258,9 @@ IncludeByKey.PASSTHROUGH { { index 7 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0 Capture' + pcm_id 7 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -271,8 +272,9 @@ IncludeByKey.PASSTHROUGH { { index 17 format s32le - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0-1 Capture' + pcm_id 12 } Object.Widget.gain.1 { Object.Control.mixer.1 { @@ -895,6 +897,14 @@ IncludeByKey.PASSTHROUGH { source "gain.20.1" sink "host-copier.28.capture" } + { + source "gain.7.1" + sink "host-copier.7.capture" + } + { + source "gain.17.1" + sink "host-copier.12.capture" + } ] } "true" { diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf index 1003fcb38546..86ee039fd90e 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf @@ -18,7 +18,7 @@ # - + @@ -45,11 +45,11 @@ Class.Pipeline."gain-copier-capture" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { type "aif_out" num_input_audio_formats 3 num_output_audio_formats 3 + num_input_pins 1 # 16-bit 48KHz 2ch Object.Base.audio_format.1 { @@ -108,16 +108,12 @@ Class.Pipeline."gain-copier-capture" { } } - Object.Base { - route."1" { + Object.Base.route [ + { source "module-copier.$index.2" sink "gain.$index.1" } - route."2" { - source "gain.$index.1" - sink "copier.host.$index.1" - } - } + ] direction "capture" dynamic_pipeline 1 From 2380f938de72cc52bec80c15f5ceac07a67433de Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 14:36:13 -0700 Subject: [PATCH 10/12] topology2: host-gateway-capture: use host-copier Replace the generic copier with host-copier in the class definition and the instances. Signed-off-by: Ranjani Sridharan --- .../topology2/cavs-mixin-mixout-efx-hda.conf | 5 +++-- .../topology/topology2/cavs-mixin-mixout-hda.conf | 5 +++-- tools/topology/topology2/cavs-nocodec-bt.conf | 10 ++++++---- .../topology2/cavs-nocodec-multicore.conf | 15 +++++++++------ tools/topology/topology2/cavs-nocodec.conf | 15 +++++++++------ tools/topology/topology2/cavs-rt5682.conf | 5 +++-- .../topology2/cavs-sdw-src-gain-mixin.conf | 15 +++++++++------ .../topology2/cavs-src-mixin-mixout-hda.conf | 5 +++-- .../pipelines/cavs/host-gateway-capture.conf | 6 +++--- .../topology2/platform/intel/bt-generic.conf | 5 +++-- .../topology2/platform/intel/dmic-generic.conf | 5 +++-- .../topology2/platform/intel/dmic-wov.conf | 7 ++++--- .../platform/intel/google-rtc-aec-reference.conf | 5 +++-- .../topology2/platform/intel/sdw-amp-generic.conf | 15 +++++++++------ .../platform/intel/sdw-dmic-generic.conf | 15 +++++++++------ .../platform/intel/sdw-jack-generic.conf | 15 +++++++++------ .../platform/intel/speaker-echo-ref.conf | 5 +++-- 17 files changed, 91 insertions(+), 62 deletions(-) diff --git a/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf b/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf index a9815205eaf8..7da087ed3de1 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf @@ -76,8 +76,9 @@ Object.Pipeline { host-gateway-capture [ { index 3 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $ANALOG_CAPTURE_PCM + pcm_id 0 } } ] @@ -136,7 +137,7 @@ Object.Base.route [ } { source 'copier.HDA.4.1' - sink 'copier.host.3.1' + sink 'host-copier.0.capture' } { source 'host-copier.0.playback' diff --git a/tools/topology/topology2/cavs-mixin-mixout-hda.conf b/tools/topology/topology2/cavs-mixin-mixout-hda.conf index 3b013e8bbda9..88d457ae1dcb 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-hda.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-hda.conf @@ -66,8 +66,9 @@ Object.Pipeline { host-gateway-capture [ { index 3 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $ANALOG_CAPTURE_PCM + pcm_id 0 } } ] @@ -135,7 +136,7 @@ Object.Base.route [ } { source 'eqiir.4.1' - sink 'copier.host.3.1' + sink 'host-copier.0.capture' } { source 'host-copier.0.playback' diff --git a/tools/topology/topology2/cavs-nocodec-bt.conf b/tools/topology/topology2/cavs-nocodec-bt.conf index 33adb22cca52..fea28570bf26 100644 --- a/tools/topology/topology2/cavs-nocodec-bt.conf +++ b/tools/topology/topology2/cavs-nocodec-bt.conf @@ -183,8 +183,9 @@ Object.Pipeline { Object.Widget.pipeline.1 { stream_name 'NoCodec-0' } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0 Capture' + pcm_id 0 } } { @@ -192,8 +193,9 @@ Object.Pipeline { Object.Widget.pipeline.1 { stream_name 'NoCodec-1' } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP1 Capture' + pcm_id 1 } } ] @@ -300,11 +302,11 @@ Object.Base.route [ } { source "copier.SSP.6.1" - sink "copier.host.5.1" + sink "host-copier.0.capture" } { source "copier.SSP.10.1" - sink "copier.host.9.1" + sink "host-copier.1.capture" } { source "copier.SSP.12.1" diff --git a/tools/topology/topology2/cavs-nocodec-multicore.conf b/tools/topology/topology2/cavs-nocodec-multicore.conf index 924ce41b22ca..581126d0c1e6 100644 --- a/tools/topology/topology2/cavs-nocodec-multicore.conf +++ b/tools/topology/topology2/cavs-nocodec-multicore.conf @@ -203,15 +203,17 @@ Object.Pipeline.host-gateway-capture [ { index 7 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0 Capture' + pcm_id 0 } } { index 11 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP2 Capture' + pcm_id 2 } } ] @@ -319,11 +321,11 @@ Object.Base.route [ } { source "copier.SSP.8.1" - sink "copier.host.7.1" + sink "host-copier.0.capture" } { source "copier.SSP.12.1" - sink "copier.host.11.1" + sink "host-copier.2.capture" } { source 'host-copier.0.playback' @@ -415,8 +417,9 @@ IncludeByKey.SSP1_ENABLED { { index 9 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP1 Capture' + pcm_id 1 } } ] @@ -477,7 +480,7 @@ IncludeByKey.SSP1_ENABLED { } { source "copier.SSP.10.1" - sink "copier.host.9.1" + sink "host-copier.1.capture" } { source 'host-copier.1.playback' diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index 846c81a12257..135e1bbe0538 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -552,8 +552,9 @@ IncludeByKey.PASSTHROUGH { { index 7 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0 Capture' + pcm_id 0 } } ] @@ -594,8 +595,9 @@ Object.Pipeline.host-gateway-capture [ { index 11 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP2 Capture' + pcm_id 2 } } ] @@ -834,7 +836,7 @@ IncludeByKey.PASSTHROUGH { Object.Base.route [ { source "copier.SSP.12.1" - sink "copier.host.11.1" + sink "host-copier.2.capture" } ] @@ -911,7 +913,7 @@ IncludeByKey.PASSTHROUGH { Object.Base.route [ { source "copier.SSP.8.1" - sink "copier.host.7.1" + sink "host-copier.0.capture" } { source "copier.host.1.1" @@ -995,8 +997,9 @@ IncludeByKey.SSP1_ENABLED { { index 9 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP1 Capture' + pcm_id 1 } } ] @@ -1177,7 +1180,7 @@ IncludeByKey.SSP1_ENABLED { Object.Base.route [ { source "copier.SSP.10.1" - sink "copier.host.9.1" + sink "host-copier.1.capture" } ] } diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf index 12f314648784..213f2233e834 100644 --- a/tools/topology/topology2/cavs-rt5682.conf +++ b/tools/topology/topology2/cavs-rt5682.conf @@ -267,8 +267,9 @@ Object.Pipeline { { index 5 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name '$HEADSET_CAPTURE_PCM_STREAM_NAME' + pcm_id 0 } } ] @@ -351,7 +352,7 @@ Object.Base.route [ } { source "copier.SSP.6.1" - sink "copier.host.5.1" + sink "host-copier.0.capture" } { source "host-copier.0.playback" diff --git a/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf b/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf index b69e9c4b0b3d..f3840a02122e 100644 --- a/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf +++ b/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf @@ -117,11 +117,14 @@ Object.Pipeline { { index 4 - Object.Widget.copier.1.stream_name "Passthrough Capture 0" - Object.Widget.copier.1.Object.Base.audio_format.1 { - # 32 -> 16 bits conversion is done here, - # so in_bit_depth is 32 (and out_bit_depth is 16). - in_bit_depth 32 + Object.Widget.host-copier.1 { + stream_name "Passthrough Capture 0" + pcm_id 1 + Object.Base.audio_format.1 { + # 32 -> 16 bits conversion is done here, + # so in_bit_depth is 32 (and out_bit_depth is 16). + in_bit_depth 32 + } } } ] @@ -184,7 +187,7 @@ Object.Base.route [ } { source "copier.ALH.3.1" - sink "copier.host.4.1" + sink "host-copier.1.capture" } { source 'host-copier.0.playback' diff --git a/tools/topology/topology2/cavs-src-mixin-mixout-hda.conf b/tools/topology/topology2/cavs-src-mixin-mixout-hda.conf index 7afdd5daee22..8bc3798953e9 100644 --- a/tools/topology/topology2/cavs-src-mixin-mixout-hda.conf +++ b/tools/topology/topology2/cavs-src-mixin-mixout-hda.conf @@ -69,8 +69,9 @@ Object.Pipeline { host-gateway-capture [ { index 3 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $ANALOG_CAPTURE_PCM + pcm_id 0 } } ] @@ -131,7 +132,7 @@ Object.Base.route [ } { source 'copier.HDA.4.1' - sink 'copier.host.3.1' + sink 'host-copier.0.capture' } { source 'host-copier.0.playback' diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf index eb966b869eec..deb9df7f9650 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf @@ -17,7 +17,7 @@ # - + Class.Pipeline."host-gateway-capture" { @@ -43,10 +43,10 @@ Class.Pipeline."host-gateway-capture" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { type "aif_out" node_type $HDA_HOST_INPUT_CLASS + num_input_pins 1 num_input_audio_formats 6 num_output_audio_formats 6 # 16-bit output format 48KHz 2ch. Input sample format is always 32-bit for capture diff --git a/tools/topology/topology2/platform/intel/bt-generic.conf b/tools/topology/topology2/platform/intel/bt-generic.conf index 5962ff9d7f0a..250092068b6e 100644 --- a/tools/topology/topology2/platform/intel/bt-generic.conf +++ b/tools/topology/topology2/platform/intel/bt-generic.conf @@ -105,8 +105,9 @@ Object.Pipeline { Object.Widget.pipeline.1 { stream_name $BT_CP_PIPELINE_STREAM_NAME } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $BT_CP_PCM_CAPS + pcm_id $BT_PCM_ID num_input_audio_formats 3 num_output_audio_formats 3 Object.Base.audio_format.0 { @@ -198,7 +199,7 @@ Object.Base.route [ } { source $BT_CP_DAI_PIPELINE_SRC - sink $BT_CP_HOST_PIPELINE_SINK + sink "host-copier.$BT_PCM_ID.capture" } ] diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf index 7aa68f9f5f23..8c1fc2654f01 100644 --- a/tools/topology/topology2/platform/intel/dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/dmic-generic.conf @@ -259,8 +259,9 @@ IncludeByKey.PASSTHROUGH { Object.Pipeline.host-gateway-capture [ { index $DMIC0_HOST_PIPELINE_ID - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $DMIC0_PCM_CAPS + pcm_id $DMIC0_PCM_ID num_input_audio_formats 2 Object.Base.input_audio_format [ { @@ -336,7 +337,7 @@ IncludeByKey.PASSTHROUGH { Object.Base.route [ { source "copier.DMIC.$DMIC0_DAI_PIPELINE_ID.1" - sink "copier.host.$DMIC0_HOST_PIPELINE_ID.1" + sink "host-copier.$DMIC0_PCM_ID.capture" } ] } diff --git a/tools/topology/topology2/platform/intel/dmic-wov.conf b/tools/topology/topology2/platform/intel/dmic-wov.conf index 42e5815dccac..37796b178077 100644 --- a/tools/topology/topology2/platform/intel/dmic-wov.conf +++ b/tools/topology/topology2/platform/intel/dmic-wov.conf @@ -7,8 +7,9 @@ Object.Pipeline { rate_max 16000 index $DMIC1_HOST_PIPELINE_ID - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $DMIC1_PCM_CAPS + pcm_id 11 Object.Base.audio_format.1 { in_rate 16000 in_bit_depth 32 @@ -108,7 +109,7 @@ Object.Pipeline { Object.Base.route [ { source $DMIC_WOV_DAI_PIPELINE_KPB - sink $DMIC1_HOST_PIPELINE_SINK + sink "host-copier.11.capture" } { source $DMIC_WOV_DAI_PIPELINE_KPB @@ -116,7 +117,7 @@ Object.Base.route [ } { source $WOV_PIPELINE_VIRTUAL - sink $DMIC1_HOST_PIPELINE_SINK + sink "host-copier.11.capture" } ] diff --git a/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf b/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf index 9b0cd412f6d5..430d16373bf9 100644 --- a/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf +++ b/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf @@ -21,8 +21,9 @@ Object.Pipeline.host-gateway-capture[ { index 19 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name "DMIC0 AEC" + pcm_id 27 } } ] @@ -90,7 +91,7 @@ Object.Base.route [ } { source "module-copier.18.2" - sink "copier.host.19.1" + sink "host-copier.27.capture" } { source "module-copier.18.2" diff --git a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf index 2a4d991f2b2a..dacde5399242 100644 --- a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf @@ -159,11 +159,14 @@ IncludeByKey.SDW_AMP_FEEDBACK { { index 30 - Object.Widget.copier.1.stream_name "amp feedback" - Object.Widget.copier.1.Object.Base.audio_format.1 { - # 32 -> 16 bits conversion is done here, - # so in_bit_depth is 32 (and out_bit_depth is 16). - in_bit_depth 32 + Object.Widget.host-copier.1 { + stream_name "amp feedback" + pcm_id 3 + Object.Base.audio_format.1 { + # 32 -> 16 bits conversion is done here, + # so in_bit_depth is 32 (and out_bit_depth is 16). + in_bit_depth 32 + } } } ] @@ -226,7 +229,7 @@ IncludeByKey.SDW_AMP_FEEDBACK { Object.Base.route [ { source "copier.ALH.31.1" - sink "copier.host.30.1" + sink "host-copier.3.capture" } ] } diff --git a/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf b/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf index 0a66cb90ac45..d7320289a7de 100644 --- a/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf @@ -27,11 +27,14 @@ Object.Pipeline { { index 40 - Object.Widget.copier.1.stream_name "sdw dmic" - Object.Widget.copier.1.Object.Base.audio_format.1 { - # 32 -> 16 bits conversion is done here, - # so in_bit_depth is 32 (and out_bit_depth is 16). - in_bit_depth 32 + Object.Widget.host-copier.1 { + stream_name "sdw dmic" + pcm_id 4 + Object.Base.audio_format.1 { + # 32 -> 16 bits conversion is done here, + # so in_bit_depth is 32 (and out_bit_depth is 16). + in_bit_depth 32 + } } } ] @@ -70,6 +73,6 @@ Object.PCM.pcm [ Object.Base.route [ { source "copier.ALH.41.1" - sink "copier.host.40.1" + sink "host-copier.4.capture" } ] diff --git a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf index 84a7830b23d5..1d6c0c97b2f0 100644 --- a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf @@ -80,11 +80,14 @@ Object.Pipeline { { index 10 - Object.Widget.copier.1.stream_name "Passthrough Capture 0" - Object.Widget.copier.1.Object.Base.audio_format.1 { - # 32/32 -> 16/16 bits conversion is done here - in_bit_depth 32 - in_valid_bit_depth 32 + Object.Widget.host-copier.1 { + stream_name "Passthrough Capture 0" + pcm_id 1 + Object.Base.audio_format.1 { + # 32/32 -> 16/16 bits conversion is done here + in_bit_depth 32 + in_valid_bit_depth 32 + } } } ] @@ -155,7 +158,7 @@ Object.Base.route [ } { source "eqiir.11.1" - sink "copier.host.10.1" + sink "host-copier.1.capture" } { source "host-copier.0.playback" diff --git a/tools/topology/topology2/platform/intel/speaker-echo-ref.conf b/tools/topology/topology2/platform/intel/speaker-echo-ref.conf index 3926712264d8..0fba6b61326f 100644 --- a/tools/topology/topology2/platform/intel/speaker-echo-ref.conf +++ b/tools/topology/topology2/platform/intel/speaker-echo-ref.conf @@ -7,8 +7,9 @@ Object.Pipeline { { index $ECHO_REF_HOST_PIPELINE_ID - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $ECHO_REF_STREAM_NAME + pcm_id 27 } } ] @@ -56,6 +57,6 @@ Object.Base.route [ } { source $ECHO_REF_COPIER_MODULE - sink $ECHO_REF_HOST_PIPELINE_SINK + sink "host-copier.27.capture" } ] From a5d4afc1d8cd231dc4aadab12324d7bda0da5102 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 14:45:32 -0700 Subject: [PATCH 11/12] topology2: host-gateway-playback: Use host-copier Replace the generic copier with host-copier in the class definition and the instances. Signed-off-by: Ranjani Sridharan --- tools/topology/topology2/cavs-nocodec-bt.conf | 10 ++++++---- tools/topology/topology2/cavs-nocodec.conf | 15 ++++++++------ .../pipelines/cavs/host-gateway-playback.conf | 6 +++--- .../topology2/platform/intel/bt-generic.conf | 5 +++-- .../platform/intel/hdmi-generic.conf | 20 +++++++++++-------- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec-bt.conf b/tools/topology/topology2/cavs-nocodec-bt.conf index fea28570bf26..db97bb8c55de 100644 --- a/tools/topology/topology2/cavs-nocodec-bt.conf +++ b/tools/topology/topology2/cavs-nocodec-bt.conf @@ -161,8 +161,9 @@ Object.Pipeline { Object.Widget.pipeline.1 { stream_name 'NoCodec-0' } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0 Playback' + pcm_id 0 } } { @@ -170,8 +171,9 @@ Object.Pipeline { Object.Widget.pipeline.1 { stream_name 'NoCodec-1' } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP1 Playback' + pcm_id 1 } } ] @@ -293,11 +295,11 @@ Object.PCM.pcm [ Object.Base.route [ { - source "copier.host.1.1" + source "host-copier.0.playback" sink "copier.SSP.2.1" } { - source "copier.host.3.1" + source "host-copier.1.playback" sink "copier.SSP.4.1" } { diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index 135e1bbe0538..a4919dff7874 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -476,8 +476,9 @@ IncludeByKey.PASSTHROUGH { Object.Pipeline.host-gateway-playback [ { index 1 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP0 Playback' + pcm_id 0 num_input_audio_formats 3 Object.Base.input_audio_format [ { @@ -512,8 +513,9 @@ IncludeByKey.PASSTHROUGH { } { index 5 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP2 Playback' + pcm_id 2 num_input_audio_formats 3 Object.Base.input_audio_format [ { @@ -916,11 +918,11 @@ IncludeByKey.PASSTHROUGH { sink "host-copier.0.capture" } { - source "copier.host.1.1" + source "host-copier.0.playback" sink "copier.SSP.2.1" } { - source "copier.host.5.1" + source "host-copier.2.playback" sink "copier.SSP.6.1" } ] @@ -1090,8 +1092,9 @@ IncludeByKey.SSP1_ENABLED { Object.Pipeline.host-gateway-playback [ { index 3 - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name 'SSP1 Playback' + pcm_id 1 num_input_audio_formats 3 Object.Base.input_audio_format [ { @@ -1171,7 +1174,7 @@ IncludeByKey.SSP1_ENABLED { "true" { Object.Base.route [ { - source "copier.host.3.1" + source "host-copier.1.playback" sink "copier.SSP.4.1" } ] diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf index acae69900f8f..577513ad77b4 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf @@ -16,7 +16,7 @@ # Where N is the unique pipeline ID within the same alsaconf node. # - + @@ -43,10 +43,10 @@ Class.Pipeline."host-gateway-playback" { } Object.Widget { - copier."1" { - copier_type "host" + host-copier."1" { node_type $HDA_HOST_OUTPUT_CLASS type "aif_in" + num_output_pins 1 num_input_audio_formats 3 num_output_audio_formats 3 # 16-bit input format 48KHz 2ch. Output sample format is always 32-bit for playback diff --git a/tools/topology/topology2/platform/intel/bt-generic.conf b/tools/topology/topology2/platform/intel/bt-generic.conf index 250092068b6e..fdd4fa399844 100644 --- a/tools/topology/topology2/platform/intel/bt-generic.conf +++ b/tools/topology/topology2/platform/intel/bt-generic.conf @@ -62,8 +62,9 @@ Object.Pipeline { Object.Widget.pipeline.1 { stream_name $BT_PB_PIPELINE_STREAM_NAME } - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $BT_PB_PCM_CAPS + pcm_id $BT_PCM_ID num_input_audio_formats 3 num_output_audio_formats 3 Object.Base.audio_format.0 { @@ -194,7 +195,7 @@ Object.Pipeline { Object.Base.route [ { - source $BT_PB_DAI_PIPELINE_SRC + source "host-copier.$BT_PCM_ID.playback" sink $BT_PB_HOST_PIPELINE_SINK } { diff --git a/tools/topology/topology2/platform/intel/hdmi-generic.conf b/tools/topology/topology2/platform/intel/hdmi-generic.conf index a22c49e1af93..4a8792751da8 100644 --- a/tools/topology/topology2/platform/intel/hdmi-generic.conf +++ b/tools/topology/topology2/platform/intel/hdmi-generic.conf @@ -34,24 +34,27 @@ Object.Dai.HDA [ Object.Pipeline { host-gateway-playback [ { - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $HDMI1_PCM_CAPS + pcm_id $HDMI1_PCM_ID } index $HDMI1_HOST_PIPELINE_ID use_chain_dma $USE_CHAIN_DMA } { - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $HDMI2_PCM_CAPS + pcm_id $HDMI2_PCM_ID } index $HDMI2_HOST_PIPELINE_ID use_chain_dma $USE_CHAIN_DMA } { - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $HDMI3_PCM_CAPS + pcm_id $HDMI3_PCM_ID } index $HDMI3_HOST_PIPELINE_ID @@ -178,15 +181,15 @@ Object.PCM.pcm [ # top-level pipeline connections Object.Base.route [ { - source $HDMI1_HOST_PIPELINE_SINK + source "host-copier.$HDMI1_PCM_ID.playback" sink $HDMI1_DAI_PIPELINE_SRC } { - source $HDMI2_HOST_PIPELINE_SINK + source "host-copier.$HDMI2_PCM_ID.playback" sink $HDMI2_DAI_PIPELINE_SRC } { - source $HDMI3_HOST_PIPELINE_SINK + source "host-copier.$HDMI3_PCM_ID.playback" sink $HDMI3_DAI_PIPELINE_SRC } ] @@ -234,8 +237,9 @@ IncludeByKey.NUM_HDMIS { ] Object.Pipeline.host-gateway-playback [ { - Object.Widget.copier.1 { + Object.Widget.host-copier.1 { stream_name $HDMI4_PCM_CAPS + pcm_id $HDMI4_PCM_ID } index $HDMI4_HOST_PIPELINE_ID @@ -259,7 +263,7 @@ IncludeByKey.NUM_HDMIS { ] Object.Base.route [ { - source $HDMI4_HOST_PIPELINE_SINK + source "host-copier.$HDMI4_PCM_ID.playback" sink $HDMI4_DAI_PIPELINE_SRC } ] From 1de2209c48f55dc3b10408d8218f8a018a3e4708 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 16 May 2023 15:43:41 -0700 Subject: [PATCH 12/12] topology2: copier: Remove host gateway type support It is now handled by the host-copier class. Renaming the copier class to dai-copier and modifying its naming convention will be done in the follow up patches. Signed-off-by: Ranjani Sridharan --- .../topology2/include/components/copier.conf | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tools/topology/topology2/include/components/copier.conf b/tools/topology/topology2/include/components/copier.conf index 703a13cb0d5b..4de382aebd2d 100644 --- a/tools/topology/topology2/include/components/copier.conf +++ b/tools/topology/topology2/include/components/copier.conf @@ -51,7 +51,6 @@ Class.Widget."copier" { constraints { !valid_values [ "HDA" - "host" "SSP" "ALH" "DMIC" @@ -107,9 +106,6 @@ Class.Widget."copier" { token_ref "sof_tkn_copier.word" constraints { !valid_values [ - $HDA_HOST_OUTPUT_CLASS # HD/A host output (-> DSP) - $HDA_HOST_INPUT_CLASS # HD/A host input (<- DSP) - $HDA_HOST_INOUT_CLASS # HD/A host input/output (rsvd for future use) $HDA_LINK_OUTPUT_CLASS # HD/A link output (DSP ->) $HDA_LINK_INPUT_CLASS # HD/A link input (DSP <-) $HDA_LINK_INOUT_CLASS # HD/A link input/output (rsvd for future use) @@ -133,14 +129,6 @@ Class.Widget."copier" { } } - # - # Deep buffer size in ms. Applicable only for host copiers - # - DefineAttribute."deep_buffer_dma_ms" { - # Token set reference name and type - token_ref "sof_tkn_copier.word" - } - attributes { # # The copier widget name would be constructed using the copier type, index and