From 64d97a60f59b1f6784e1365e771cdec8e6485052 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Thu, 18 May 2023 21:52:20 +0300 Subject: [PATCH 1/5] topology2: cavs-nocodec.conf: Rename SSP0, SSP1, and SSP2 playback volumes Rename SSP0, SSP1, and SSP2 playback volumes according to PCM names they are connected to. Define the PCM names as variables so the name can be changed in a single place. This is how the change will look like in sof-tgl-nocodec.tplg: 'gain.1.1 Playback Volume 1' > 'gain.1.1 Pre Mixer Port0 Playback Volume' 'gain.2.1 Main Playback Volume 2' > 'gain.2.1 Post Mixer Port0 Playback Volume' 'gain.3.1 Playback Volume 3' > 'gain.3.1 Pre Mixer Port1 Playback Volume' 'gain.5.1 Playback Volume 5' > 'gain.5.1 Pre Mixer Port2 Playback Volume' 'gain.6.1 Main Playback Volume 6' > 'gain.6.1 Post Mixer Port2 Playback Volume' Signed-off-by: Jyri Sarha --- tools/topology/topology2/cavs-nocodec.conf | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index ea30b2607f9f..dc730c1d3aba 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -82,6 +82,9 @@ Define { SSP0_MIXER_SOURCE_3 'mixin.21.1' SSP1_ENABLED "true" PASSTHROUGH "false" + SSP0_PCM_NAME "Port0" + SSP1_PCM_NAME "Port1" + SSP2_PCM_NAME "Port2" } # override defaults with platform-specific config @@ -180,7 +183,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Playback Volume 1' + name 'Pre Mixer $SSP0_PCM_NAME Playback Volume' } } } @@ -193,7 +196,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Playback Volume 5' + name 'Pre Mixer $SSP2_PCM_NAME Playback Volume' } } } @@ -213,7 +216,7 @@ IncludeByKey.PASSTHROUGH { Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Main Playback Volume 2' + name 'Post Mixer $SSP0_PCM_NAME Playback Volume' } } @@ -248,7 +251,7 @@ IncludeByKey.PASSTHROUGH { Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Main Playback Volume 6' + name 'Post Mixer $SSP2_PCM_NAME Playback Volume' } } } @@ -747,11 +750,11 @@ IncludeByKey.PASSTHROUGH { Object.PCM.pcm [ { - name "Port0" + name "$SSP0_PCM_NAME" id 0 direction "duplex" Object.Base.fe_dai.1 { - name "Port0" + name "$SSP0_PCM_NAME" } Object.PCM.pcm_caps.1 { @@ -767,11 +770,11 @@ Object.PCM.pcm [ } } { - name "Port2" + name "$SSP2_PCM_NAME" id 2 direction "duplex" Object.Base.fe_dai.1 { - name "Port2" + name "$SSP2_PCM_NAME" } Object.PCM.pcm_caps.1 { @@ -1018,7 +1021,7 @@ IncludeByKey.SSP1_ENABLED { } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Playback Volume 3' + name 'Pre Mixer $SSP1_PCM_NAME Playback Volume' } } } @@ -1038,7 +1041,7 @@ IncludeByKey.SSP1_ENABLED { Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Main Playback Volume 4' + name 'Post Mixer $SSP1_PCM_NAME Playback Volume' } } } @@ -1133,11 +1136,11 @@ IncludeByKey.SSP1_ENABLED { Object.PCM.pcm [ { - name "Port1" + name "$SSP1_PCM_NAME" id 1 direction "duplex" Object.Base.fe_dai.1 { - name "Port1" + name "$SSP1_PCM_NAME" } Object.PCM.pcm_caps.1 { From be16eb8532b748ea4aee42e006175aee9e586a73 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Tue, 23 May 2023 18:44:39 +0300 Subject: [PATCH 2/5] topology2: cavs-nocodec.conf: Rename SSP0 Capture Volumes Rename SSP0 capture related volumes. Define a variable for PCM name and refer to it in the mixer names. Using sof-tgl-nocodec.tplg the changes are: 'gain.8.1 Host Capture Volume' > 'gain.8.1 Pre Demux Port0 Capture Volume' 'gain.7.1 Main Capture Volume 1' > 'gain.7.1 Post Demux Port0 Capture Volume' 'gain.17.1 Main Capture Volume 2' > 'gain.17.1 Post Demux ssp-capture Capture Vo' Signed-off-by: Jyri Sarha --- tools/topology/topology2/cavs-nocodec.conf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index dc730c1d3aba..4b5f0774a32e 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -83,6 +83,7 @@ Define { SSP1_ENABLED "true" PASSTHROUGH "false" SSP0_PCM_NAME "Port0" + SSP0_CAPTURE_PCM "ssp-capture" SSP1_PCM_NAME "Port1" SSP2_PCM_NAME "Port2" } @@ -267,7 +268,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Main Capture Volume 1' + name 'Post Demux $SSP0_PCM_NAME Capture Volume' } } } @@ -281,7 +282,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Main Capture Volume 2' + name 'Post Demux $SSP0_CAPTURE_PCM Capture Volume' } } } @@ -382,7 +383,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Host Capture Volume' + name 'Pre Demux $SSP0_PCM_NAME Capture Volume' } } } @@ -795,11 +796,11 @@ IncludeByKey.PASSTHROUGH { "false" { Object.PCM.pcm [ { - name "ssp-capture" + name "$SSP0_CAPTURE_PCM" id 12 direction "capture" Object.Base.fe_dai.1 { - name "ssp-capture" + name "$SSP0_CAPTURE_PCM" } Object.PCM.pcm_caps.1 { name "SSP0-1 Capture" From 8db1cbf7ee24e2f534c7f52d3669ec1bd400029b Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Tue, 23 May 2023 20:38:20 +0300 Subject: [PATCH 3/5] topology2: cavs-nocodec.conf: Rename DMIC0 post mux volumes Rename cavs-nocodec.conf DMIC0 volumes. Define variables for the associated PCM names and refer to them in the mixer names. The changes shown in sof-tgl-nocodec.tplg are: 'gain.18.1 Capture Raw Volume 1' > 'gain.18.1 Post Demux DMIC0 Raw Capture Volu' 'gain.19.1 Main Capture Volume 3' > 'gain.19.1 Pre Demux DMIC0 Raw Capture Volum' 'gain.20.1 Capture Raw Volume 2' > 'gain.20.1 Post Demux DMIC0 Raw 2 Capture Vo' Signed-off-by: Jyri Sarha --- tools/topology/topology2/cavs-nocodec.conf | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index 4b5f0774a32e..ffea7326a076 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -86,6 +86,8 @@ Define { SSP0_CAPTURE_PCM "ssp-capture" SSP1_PCM_NAME "Port1" SSP2_PCM_NAME "Port2" + DMIC0_PCM_0_NAME "DMIC0 Raw" + DMIC0_PCM_1_NAME "DMIC0 Raw 2" } # override defaults with platform-specific config @@ -340,7 +342,7 @@ IncludeByKey.PASSTHROUGH { out_ch_map $CHANNEL_MAP_3_POINT_1 } Object.Control.mixer.1 { - name 'Main Capture Volume 3' + name 'Pre Demux $DMIC0_PCM_0_NAME Capture Volume' } } } @@ -637,7 +639,7 @@ IncludeByKey.PASSTHROUGH { format $FORMAT index 18 Object.Widget.pipeline.1 { - stream_name "DMIC0 Raw" + stream_name "$DMIC0_PCM_0_NAME" } Object.Widget.host-copier.1 { stream_name "Gain Capture 18" @@ -685,7 +687,7 @@ IncludeByKey.PASSTHROUGH { out_ch_map $CHANNEL_MAP_3_POINT_1 } Object.Control.mixer.1 { - name 'Capture Raw Volume 1' + name 'Post Demux $DMIC0_PCM_0_NAME Capture Volume' } } } @@ -693,7 +695,7 @@ IncludeByKey.PASSTHROUGH { format $FORMAT index 20 Object.Widget.pipeline.1 { - stream_name "DMIC0 Raw 2" + stream_name "$DMIC0_PCM_1_NAME" } Object.Widget.host-copier.1 { stream_name "Gain Capture 20" @@ -741,7 +743,7 @@ IncludeByKey.PASSTHROUGH { out_ch_map $CHANNEL_MAP_3_POINT_1 } Object.Control.mixer.1 { - name 'Capture Raw Volume 2' + name 'Post Demux $DMIC0_PCM_1_NAME Capture Volume' } } } @@ -808,10 +810,10 @@ IncludeByKey.PASSTHROUGH { } } { - name "DMIC0 Raw" + name "$DMIC0_PCM_0_NAME" id 27 direction "capture" - Object.Base.fe_dai."DMIC0 Raw" {} + Object.Base.fe_dai."$DMIC0_PCM_0_NAME" {} Object.PCM.pcm_caps."capture" { name "Gain Capture 18" @@ -822,10 +824,10 @@ IncludeByKey.PASSTHROUGH { } } { - name "DMIC0 Raw 2" + name "$DMIC0_PCM_1_NAME" id 28 direction "capture" - Object.Base.fe_dai."DMIC0 Raw 2" {} + Object.Base.fe_dai."$DMIC0_PCM_1_NAME" {} Object.PCM.pcm_caps."capture" { name "Gain Capture 20" From 07226fb0004a87e6d0c1b16f3e5d42c52f5f97c9 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Mon, 22 May 2023 17:02:40 +0300 Subject: [PATCH 4/5] topology2: nocodec-ssp0-2level.conf: Rename Port0 Aux Volume Rename SSP0 Aux Playback stream volume before mixing. Use the associated PCM name in the mixer name. This change affects nocodec topologies and appears on sof-tgl-nocodec.tplg as a following change: 'gain.21.1 Playback Volume 8' -> 'gain.21.1 Pre Mixer Port0 Aux Playback Volu' Unfortunately the new mixer name does fit into the space reserved for it, but it should get fixed once we get rid of the "gain 21.1"-prefix. Signed-off-by: Jyri Sarha --- .../topology2/platform/intel/nocodec-ssp0-2level.conf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology2/platform/intel/nocodec-ssp0-2level.conf b/tools/topology/topology2/platform/intel/nocodec-ssp0-2level.conf index 8eb119911bd5..5c69f8a311c9 100644 --- a/tools/topology/topology2/platform/intel/nocodec-ssp0-2level.conf +++ b/tools/topology/topology2/platform/intel/nocodec-ssp0-2level.conf @@ -1,3 +1,7 @@ +Define { + SSP0_AUX_PCM_NAME "Port0 Aux Playback" +} + Object.Pipeline.host-copier-gain-mixin-playback [ { index $SSP0_MIXER_PIPELINE_ID_2 @@ -11,7 +15,7 @@ Object.Pipeline.host-copier-gain-mixin-playback [ } Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Playback Volume 8' + name 'Pre Mixer $SSP0_AUX_PCM_NAME Volume' } } } @@ -29,7 +33,7 @@ Object.Pipeline.mixout-mixin [ Object.PCM.pcm [ { - name "Port0 Aux Playback" + name "$SSP0_AUX_PCM_NAME" id $SSP0_MIXER_PCM_ID_1 direction "playback" Object.Base.fe_dai."Port0 aux" {} From b5b0f22aeffa4924b24f87007d319361bc26e637 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Wed, 24 May 2023 16:03:42 +0300 Subject: [PATCH 5/5] topology2: dmic-generic.conf: Rename generic DMIC volume Rename generic DMIC mixer name. Define the associated PCM name in a common place and refer to that name on the mixer name. On cavs-tgl-nocodec.tplg is seen a following mixer name change: 'gain.13.1 DMIC0 Capture Volume 1' > 'gain.13.1 DMIC Capture Volume' Signed-off-by: Jyri Sarha --- .../topology2/platform/intel/dmic-generic.conf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf index 8c1fc2654f01..9d0ba0793100 100644 --- a/tools/topology/topology2/platform/intel/dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/dmic-generic.conf @@ -1,3 +1,7 @@ +Define { + DMIC0_PCM_NAME "DMIC" +} + Object.Dai.DMIC [ { dai_index 0 @@ -121,7 +125,7 @@ IncludeByKey.PASSTHROUGH { out_ch_map $CHANNEL_MAP_3_POINT_1 } Object.Control.mixer.1 { - name 'DMIC0 Capture Volume 1' + name '$DMIC0_PCM_NAME Capture Volume' } } @@ -345,11 +349,11 @@ IncludeByKey.PASSTHROUGH { Object.PCM.pcm [ { - name "DMIC" + name "$DMIC0_PCM_NAME" id $DMIC0_PCM_ID direction "capture" Object.Base.fe_dai.1 { - name "DMIC" + name "$DMIC0_PCM_NAME" } Object.PCM.pcm_caps.1 {