Skip to content

Commit 7682407

Browse files
committed
topology2: split echo reference part from sdw topologies
Currently, we implement the echo reference pipeline, widgets, routes in the SoundWire config files. It is hard to create a stand alone echo reference topology for the function topology usages. This commit moves the echo reference part from the original config file and include the new echo reference in the original file. The commit also use macros to set the echo reference IDs to fix the issue that both the 2nd SoundWire amp and the echo reference use the same pipeline ID. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 9ce8671 commit 7682407

4 files changed

Lines changed: 294 additions & 262 deletions

File tree

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
2+
Define {
3+
SDW_SPK_ECHO_REF_PCM_ID 12
4+
SDW_SPK_ECHO_REF_PIPELINE_ID 120
5+
}
6+
7+
IncludeByKey.PASSTHROUGH {
8+
"false" {
9+
IncludeByKey.SDW_SPK_ECHO_REF {
10+
"true" {
11+
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
12+
"true" {
13+
IncludeByKey.USE_DAX {
14+
"true" {
15+
Object.Base.route [
16+
{
17+
source "dolby-dax.21.1"
18+
sink "module-copier.21.$SDW_SPK_ECHO_REF_PIPELINE_ID"
19+
}
20+
{
21+
source "module-copier.21.$SDW_SPK_ECHO_REF_PIPELINE_ID"
22+
sink "alh-copier.$SDW_SPK_STREAM.0"
23+
}
24+
]
25+
}
26+
"false" {
27+
Object.Base.route [
28+
{
29+
source "drc.21.1"
30+
sink "module-copier.21.$SDW_SPK_ECHO_REF_PIPELINE_ID"
31+
}
32+
{
33+
source "module-copier.21.$SDW_SPK_ECHO_REF_PIPELINE_ID"
34+
sink "alh-copier.$SDW_SPK_STREAM.0"
35+
}
36+
]
37+
}
38+
}
39+
}
40+
"false" {
41+
Object.Base.route [
42+
{
43+
source "gain.21.1"
44+
sink "module-copier.21.$SDW_SPK_ECHO_REF_PIPELINE_ID"
45+
}
46+
{
47+
source "module-copier.21.$SDW_SPK_ECHO_REF_PIPELINE_ID"
48+
sink "alh-copier.$SDW_SPK_STREAM.0"
49+
}
50+
]
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}
57+
58+
IncludeByKey.SDW_SPK_ECHO_REF {
59+
"true" {
60+
#module-copier ID should match SDW_SPK_ECHO_REF_PIPELINE_ID
61+
Object.Widget.module-copier."120" {
62+
index 21
63+
num_input_pins 1
64+
num_output_pins 2
65+
num_input_audio_formats 1
66+
num_output_audio_formats 1
67+
Object.Base.input_audio_format [
68+
{
69+
in_bit_depth 32
70+
in_valid_bit_depth 32
71+
}
72+
]
73+
Object.Base.output_audio_format [
74+
{
75+
out_bit_depth 32
76+
out_valid_bit_depth 32
77+
}
78+
]
79+
}
80+
81+
Object.Pipeline {
82+
siggen-host-copier-capture [
83+
{
84+
direction "capture"
85+
index $SDW_SPK_ECHO_REF_PIPELINE_ID
86+
Object.Widget.host-copier."1" {
87+
stream_name "Speaker Echo Reference"
88+
pcm_id $SDW_SPK_ECHO_REF_PCM_ID
89+
}
90+
Object.Widget.siggen."1" {}
91+
}
92+
]
93+
}
94+
95+
Object.PCM.pcm [
96+
{
97+
name "Speaker Echo Reference"
98+
id $SDW_SPK_ECHO_REF_PCM_ID
99+
direction "capture"
100+
Object.Base.fe_dai.1 {
101+
name "Speaker Echo Reference"
102+
}
103+
Object.PCM.pcm_caps.1 {
104+
name "Speaker Echo Reference"
105+
formats 'S16_LE,S24_LE,S32_LE'
106+
}
107+
}
108+
]
109+
110+
Object.Base.route [
111+
{
112+
source "alh-copier.Loopback_Virtual.25"
113+
sink "siggen.$SDW_SPK_ECHO_REF_PIPELINE_ID.1"
114+
}
115+
{
116+
source "module-copier.21.$SDW_SPK_ECHO_REF_PIPELINE_ID"
117+
sink "siggen.$SDW_SPK_ECHO_REF_PIPELINE_ID.1"
118+
}
119+
{
120+
source "siggen.$SDW_SPK_ECHO_REF_PIPELINE_ID.1"
121+
sink "host-copier.$SDW_SPK_ECHO_REF_PCM_ID.capture"
122+
}
123+
]
124+
} # SDW_SPK_ECHO_REF true
125+
}

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

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Define {
1313
AMP_FEEDBACK_CH_PER_LINK 2
1414
SDW_AMP_FEEDBACK true
1515
AMP_PLAYBACK_NAME 'Speaker Playback'
16-
SDW_SPK_ECHO_REF_PCM_ID 12
1716
}
1817

1918
# include deep buffer config if buffer size is in 1 - 1000 ms.
@@ -738,50 +737,6 @@ Object.PCM.pcm [
738737
IncludeByKey.PASSTHROUGH {
739738
"false" {
740739
IncludeByKey.SDW_SPK_ECHO_REF {
741-
"true" {
742-
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
743-
"true" {
744-
IncludeByKey.USE_DAX {
745-
"true" {
746-
Object.Base.route [
747-
{
748-
source "dolby-dax.21.1"
749-
sink "module-copier.21.22"
750-
}
751-
{
752-
source "module-copier.21.22"
753-
sink "alh-copier.$SDW_SPK_STREAM.0"
754-
}
755-
]
756-
}
757-
"false" {
758-
Object.Base.route [
759-
{
760-
source "drc.21.1"
761-
sink "module-copier.21.22"
762-
}
763-
{
764-
source "module-copier.21.22"
765-
sink "alh-copier.$SDW_SPK_STREAM.0"
766-
}
767-
]
768-
}
769-
}
770-
}
771-
"false" {
772-
Object.Base.route [
773-
{
774-
source "gain.21.1"
775-
sink "module-copier.21.22"
776-
}
777-
{
778-
source "module-copier.21.22"
779-
sink "alh-copier.$SDW_SPK_STREAM.0"
780-
}
781-
]
782-
}
783-
}
784-
}
785740
"false" {
786741
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
787742
"true" {
@@ -1047,69 +1002,5 @@ IncludeByKey.SDW_AMP_FEEDBACK {
10471002
}
10481003

10491004
IncludeByKey.SDW_SPK_ECHO_REF {
1050-
"true" {
1051-
Object.Widget.module-copier."22" {
1052-
index 21
1053-
num_input_pins 1
1054-
num_output_pins 2
1055-
num_input_audio_formats 1
1056-
num_output_audio_formats 1
1057-
Object.Base.input_audio_format [
1058-
{
1059-
in_bit_depth 32
1060-
in_valid_bit_depth 32
1061-
}
1062-
]
1063-
Object.Base.output_audio_format [
1064-
{
1065-
out_bit_depth 32
1066-
out_valid_bit_depth 32
1067-
}
1068-
]
1069-
}
1070-
1071-
Object.Pipeline {
1072-
siggen-host-copier-capture [
1073-
{
1074-
direction "capture"
1075-
index 22
1076-
Object.Widget.host-copier."1" {
1077-
stream_name "Speaker Echo Reference"
1078-
pcm_id $SDW_SPK_ECHO_REF_PCM_ID
1079-
}
1080-
Object.Widget.siggen."1" {}
1081-
}
1082-
]
1083-
}
1084-
1085-
Object.PCM.pcm [
1086-
{
1087-
name "Speaker Echo Reference"
1088-
id $SDW_SPK_ECHO_REF_PCM_ID
1089-
direction "capture"
1090-
Object.Base.fe_dai.1 {
1091-
name "Speaker Echo Reference"
1092-
}
1093-
Object.PCM.pcm_caps.1 {
1094-
name "Speaker Echo Reference"
1095-
formats 'S16_LE,S24_LE,S32_LE'
1096-
}
1097-
}
1098-
]
1099-
1100-
Object.Base.route [
1101-
{
1102-
source "alh-copier.Loopback_Virtual.25"
1103-
sink "siggen.22.1"
1104-
}
1105-
{
1106-
source "module-copier.21.22"
1107-
sink "siggen.22.1"
1108-
}
1109-
{
1110-
source "siggen.22.1"
1111-
sink "host-copier.$SDW_SPK_ECHO_REF_PCM_ID.capture"
1112-
}
1113-
]
1114-
} # SDW_SPK_ECHO_REF true
1005+
"true" "platform/intel/sdw-amp-echo-ref.conf"
11151006
}

0 commit comments

Comments
 (0)