Skip to content

Commit 2aca03a

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 2aca03a

File tree

4 files changed

+297
-260
lines changed

4 files changed

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

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

Lines changed: 1 addition & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -738,50 +738,6 @@ Object.PCM.pcm [
738738
IncludeByKey.PASSTHROUGH {
739739
"false" {
740740
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-
}
785741
"false" {
786742
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
787743
"true" {
@@ -1047,69 +1003,5 @@ IncludeByKey.SDW_AMP_FEEDBACK {
10471003
}
10481004

10491005
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
1006+
"true" "platform/intel/sdw-amp-echo-ref.conf"
11151007
}

0 commit comments

Comments
 (0)