Skip to content

Commit d71d0d2

Browse files
bardliaolgirdwood
authored andcommitted
topology2: cavs-sdw: add SDW_ECHO_REF_DAI flag
Currently, the "Loopback_Virtual" copier DAI is created in both sdw-amp-generic.conf and sdw-jack-generic.conf. It works fine in the monolithic topology because with the SDW_SPK_ECHO_REF flag, it will be created either by sdw-amp-generic.conf or sdw-jack-generic.conf. However, it doesn't work in the function topology case. The jack function topology will be loaded first and the "Loopback_Virtual" copier DAI is not created in the jack function topology if the amp function topology is also loaded. The commit suggests to use a SDW_ECHO_REF_DAI flag to indicate whether the "Loopback_Virtual" copier DAI is required or not. So that we can set the flag in the cmake file and create the "Loopback_Virtual" copier DAI in the jack function topology even when the amp function topology is loaded, too. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 48edc76 commit d71d0d2

4 files changed

Lines changed: 35 additions & 63 deletions

File tree

tools/topology/topology2/cavs-sdw.conf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Define {
110110
SDW_AMP_XOVER_EQFIR_PARAMS default
111111
DOLBY_DAX_CORE_ID 0
112112
USE_DAX "false"
113+
SDW_ECHO_REF_DAI "false"
113114
}
114115

115116
# override defaults with platform-specific config
@@ -138,6 +139,37 @@ IncludeByKey.NUM_HDMIS {
138139
"[3-4]" "platform/intel/hdmi-generic.conf"
139140
}
140141

142+
IncludeByKey.SDW_ECHO_REF_DAI {
143+
"true" {
144+
Object.Widget.alh-copier [
145+
{
146+
stream_name "Loopback_Virtual"
147+
direction "capture"
148+
type "dai_out"
149+
index 12
150+
dai_index 25
151+
node_type $ALH_LINK_INPUT_CLASS
152+
num_input_audio_formats 1
153+
num_output_audio_formats 1
154+
Object.Base.input_audio_format [
155+
{
156+
in_rate $JACK_RATE
157+
in_bit_depth 32
158+
in_valid_bit_depth $SDW_LINK_VALID_BITS
159+
}
160+
]
161+
Object.Base.output_audio_format [
162+
{
163+
out_rate $JACK_RATE
164+
out_bit_depth 32
165+
out_valid_bit_depth 32
166+
}
167+
]
168+
}
169+
]
170+
}
171+
}
172+
141173
IncludeByKey.SDW_AMP_XOVER {
142174
"false" {
143175
IncludeByKey.NUM_SDW_AMP_LINKS {

tools/topology/topology2/development/tplg-targets.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-
439439
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
440440
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt721-4ch-echoref.bin,DMIC0_ENHANCED_CAPTURE=true,\
441441
EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default,\
442-
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true"
442+
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true"
443443

444444
# RT721 eval board with PCH-DMIC, sof_sdw_quirk_table with SOC_SDW_PCH_DMIC
445445
# Enable echo reference capture from jack and speaker output
@@ -451,7 +451,7 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
451451
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt721-4ch-echoref.bin,DMIC0_ENHANCED_CAPTURE=true,\
452452
EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default,\
453453
BT_NAME=SSP2-BT,BT_PCM_ID=20,BT_ID=10,BT_PCM_NAME=Bluetooth,ADD_BT=true,\
454-
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true"
454+
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true"
455455

456456
# RT722 with PCH-DMIC and echo reference capture from jack and speaker output
457457
"cavs-sdw\;sof-ptl-rt722-4ch-echoref\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,NUM_DMICS=4,\
@@ -460,5 +460,5 @@ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-
460460
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
461461
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt722-4ch-echoref.bin,DMIC0_ENHANCED_CAPTURE=true,\
462462
EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default,\
463-
SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true"
463+
SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true"
464464
)

tools/topology/topology2/platform/intel/sdw-amp-generic.conf

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,33 +1048,6 @@ IncludeByKey.SDW_AMP_FEEDBACK {
10481048

10491049
IncludeByKey.SDW_SPK_ECHO_REF {
10501050
"true" {
1051-
Object.Widget.alh-copier [
1052-
{
1053-
stream_name "Loopback_Virtual"
1054-
direction "capture"
1055-
type "dai_out"
1056-
index 22
1057-
dai_index 25
1058-
node_type $ALH_LINK_INPUT_CLASS
1059-
num_input_audio_formats 1
1060-
num_output_audio_formats 1
1061-
Object.Base.input_audio_format [
1062-
{
1063-
in_bit_depth 32
1064-
in_valid_bit_depth $SDW_LINK_VALID_BITS
1065-
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
1066-
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
1067-
}
1068-
]
1069-
Object.Base.output_audio_format [
1070-
{
1071-
out_bit_depth 32
1072-
out_valid_bit_depth 32
1073-
}
1074-
]
1075-
}
1076-
]
1077-
10781051
Object.Widget.module-copier."22" {
10791052
index 21
10801053
num_input_pins 1

tools/topology/topology2/platform/intel/sdw-jack-generic.conf

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -741,39 +741,6 @@ IncludeByKey.PASSTHROUGH {
741741

742742
IncludeByKey.SDW_JACK_ECHO_REF {
743743
"true" {
744-
IncludeByKey.SDW_SPK_ECHO_REF {
745-
"false" {
746-
# The virtual DAi is common with speaker. Normally this would be
747-
# provided speaker tplg. If not present instantiate it here.
748-
Object.Widget.alh-copier [
749-
{
750-
stream_name "Loopback_Virtual"
751-
direction "capture"
752-
type "dai_out"
753-
index 12
754-
dai_index 25
755-
node_type $ALH_LINK_INPUT_CLASS
756-
num_input_audio_formats 1
757-
num_output_audio_formats 1
758-
Object.Base.input_audio_format [
759-
{
760-
in_rate $JACK_RATE
761-
in_bit_depth 32
762-
in_valid_bit_depth $SDW_LINK_VALID_BITS
763-
}
764-
]
765-
Object.Base.output_audio_format [
766-
{
767-
out_rate $JACK_RATE
768-
out_bit_depth 32
769-
out_valid_bit_depth 32
770-
}
771-
]
772-
}
773-
]
774-
} # SDW_SPK_ECHO_REF false
775-
}
776-
777744
Object.Widget.module-copier."12" {
778745
index 1
779746
num_input_pins 1

0 commit comments

Comments
 (0)