Skip to content

Commit 89e417a

Browse files
ranj063kv2019i
authored andcommitted
tools: topology2: sof-plugin: Add an option for mixin-mixout pipelines for playback
This will be useful to test volume controls with the plugin. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent 08754de commit 89e417a

2 files changed

Lines changed: 201 additions & 50 deletions

File tree

tools/topology/topology2/development/sof-plugin.conf

Lines changed: 200 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<tokens.conf>
1212
<host-gateway-capture.conf>
1313
<host-gateway-playback.conf>
14+
<mixout-gain-dai-copier-playback.conf>
15+
<host-copier-gain-mixin-playback.conf>
1416
<io-gateway-capture.conf>
1517
<io-gateway.conf>
1618
<data.conf>
@@ -22,6 +24,7 @@
2224
<common_definitions.conf>
2325
<dai-copier.conf>
2426
<module-copier.conf>
27+
<gain.conf>
2528
<pipeline.conf>
2629
<input_audio_format.conf>
2730
<output_audio_format.conf>
@@ -87,57 +90,185 @@ Object.Pipeline.host-gateway-capture [
8790
}
8891
]
8992

90-
Object.Pipeline.io-gateway [
91-
{
92-
index 4
93-
direction playback
93+
IncludeByKey.PLAYBACK_PROCESS {
94+
"passthrough" {
95+
Object.Pipeline.io-gateway [
96+
{
97+
index 4
98+
direction playback
9499

95-
Object.Widget.dai-copier.1 {
96-
dai_index 1
97-
dai_type "SSP"
98-
copier_type "SSP"
99-
stream_name "NoCodec-1"
100-
node_type $I2S_LINK_OUTPUT_CLASS
101-
num_input_audio_formats 1
102-
Object.Base.input_audio_format [
103-
{
104-
in_bit_depth 16
105-
in_valid_bit_depth 16
100+
Object.Widget.dai-copier.1 {
101+
dai_index 1
102+
dai_type "SSP"
103+
copier_type "SSP"
104+
stream_name "NoCodec-1"
105+
node_type $I2S_LINK_OUTPUT_CLASS
106+
num_input_audio_formats 1
107+
Object.Base.input_audio_format [
108+
{
109+
in_bit_depth 16
110+
in_valid_bit_depth 16
111+
}
112+
]
113+
num_output_audio_formats 1
114+
Object.Base.output_audio_format [
115+
{
116+
out_bit_depth 16
117+
out_valid_bit_depth 16
118+
}
119+
]
106120
}
107-
]
108-
num_output_audio_formats 1
109-
Object.Base.output_audio_format [
110-
{
111-
out_bit_depth 16
112-
out_valid_bit_depth 16
121+
}
122+
]
123+
Object.Pipeline.host-gateway-playback [
124+
{
125+
index 3
126+
Object.Widget.host-copier.1 {
127+
stream_name 'SSP1 Playback'
128+
pcm_id 1
129+
num_input_audio_formats 1
130+
Object.Base.input_audio_format [
131+
{
132+
in_bit_depth 16
133+
in_valid_bit_depth 16
134+
}
135+
]
136+
num_output_audio_formats 1
137+
Object.Base.output_audio_format [
138+
{
139+
out_bit_depth 16
140+
out_valid_bit_depth 16
141+
}
142+
]
113143
}
114-
]
115-
}
144+
}
145+
]
116146
}
117-
]
118-
Object.Pipeline.host-gateway-playback [
119-
{
120-
index 3
121-
Object.Widget.host-copier.1 {
122-
stream_name 'SSP1 Playback'
123-
pcm_id 1
124-
num_input_audio_formats 1
125-
Object.Base.input_audio_format [
126-
{
127-
in_bit_depth 16
128-
in_valid_bit_depth 16
147+
"mix" {
148+
Object.Pipeline.mixout-gain-dai-copier-playback [
149+
{
150+
index 4
151+
152+
Object.Widget.dai-copier.1 {
153+
dai_index 1
154+
dai_type "SSP"
155+
copier_type "SSP"
156+
stream_name "NoCodec-1"
157+
node_type $I2S_LINK_OUTPUT_CLASS
158+
num_input_audio_formats 1
159+
Object.Base.input_audio_format [
160+
{
161+
in_bit_depth 16
162+
in_valid_bit_depth 16
163+
}
164+
]
165+
num_output_audio_formats 1
166+
Object.Base.output_audio_format [
167+
{
168+
out_bit_depth 16
169+
out_valid_bit_depth 16
170+
}
171+
]
129172
}
130-
]
131-
num_output_audio_formats 1
132-
Object.Base.output_audio_format [
133-
{
134-
out_bit_depth 16
135-
out_valid_bit_depth 16
173+
Object.Widget.gain.1 {
174+
curve_type "windows_fade"
175+
Object.Control.mixer.1 {
176+
name 'Post Mixer PlugPCM Playback Volume'
177+
}
178+
num_input_audio_formats 1
179+
Object.Base.input_audio_format [
180+
{
181+
in_bit_depth 16
182+
in_valid_bit_depth 16
183+
}
184+
]
185+
num_output_audio_formats 1
186+
Object.Base.output_audio_format [
187+
{
188+
out_bit_depth 16
189+
out_valid_bit_depth 16
190+
}
191+
]
136192
}
137-
]
138-
}
193+
Object.Widget.mixout.1 {
194+
num_input_audio_formats 1
195+
Object.Base.input_audio_format [
196+
{
197+
in_bit_depth 16
198+
in_valid_bit_depth 16
199+
}
200+
]
201+
num_output_audio_formats 1
202+
Object.Base.output_audio_format [
203+
{
204+
out_bit_depth 16
205+
out_valid_bit_depth 16
206+
}
207+
]
208+
}
209+
}
210+
]
211+
Object.Pipeline.host-copier-gain-mixin-playback [
212+
{
213+
index 3
214+
Object.Widget.host-copier.1 {
215+
stream_name 'SSP1 Playback'
216+
pcm_id 1
217+
num_input_audio_formats 1
218+
Object.Base.input_audio_format [
219+
{
220+
in_bit_depth 16
221+
in_valid_bit_depth 16
222+
}
223+
]
224+
num_output_audio_formats 1
225+
Object.Base.output_audio_format [
226+
{
227+
out_bit_depth 16
228+
out_valid_bit_depth 16
229+
}
230+
]
231+
}
232+
Object.Widget.gain.1 {
233+
curve_type "windows_fade"
234+
Object.Control.mixer.1 {
235+
name 'Pre Mixer PlugPCM Playback Volume'
236+
}
237+
num_input_audio_formats 1
238+
Object.Base.input_audio_format [
239+
{
240+
in_bit_depth 16
241+
in_valid_bit_depth 16
242+
}
243+
]
244+
num_output_audio_formats 1
245+
Object.Base.output_audio_format [
246+
{
247+
out_bit_depth 16
248+
out_valid_bit_depth 16
249+
}
250+
]
251+
}
252+
Object.Widget.mixin.1 {
253+
num_input_audio_formats 1
254+
Object.Base.input_audio_format [
255+
{
256+
in_bit_depth 16
257+
in_valid_bit_depth 16
258+
}
259+
]
260+
num_output_audio_formats 1
261+
Object.Base.output_audio_format [
262+
{
263+
out_bit_depth 16
264+
out_valid_bit_depth 16
265+
}
266+
]
267+
}
268+
}
269+
]
139270
}
140-
]
271+
}
141272

142273
Object.PCM.pcm [
143274
{
@@ -188,9 +319,29 @@ IncludeByKey.NOISE_SUPPRESSION {
188319
}
189320
}
190321

191-
Object.Base.route [
192-
{
193-
source "host-copier.1.playback"
194-
sink "dai-copier.SSP.NoCodec-1.playback"
322+
IncludeByKey.PLAYBACK_PROCESS {
323+
"passthrough" {
324+
Object.Base.route [
325+
{
326+
source "host-copier.1.playback"
327+
sink "dai-copier.SSP.NoCodec-1.playback"
328+
}
329+
]
195330
}
196-
]
331+
"mix" {
332+
Object.Base.route [
333+
{
334+
source "host-copier.1.playback"
335+
sink "gain.3.1"
336+
}
337+
{
338+
source "mixin.3.1"
339+
sink "mixout.4.1"
340+
}
341+
{
342+
source "gain.4.1"
343+
sink "dai-copier.SSP.NoCodec-1.playback"
344+
}
345+
]
346+
}
347+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC1_RATE=16000,\
262262
DMIC1_ENABLE=MFCC,DMIC1_MFCC_PARAMS=default"
263263

264264
# Topology for SOF plugin
265-
"development/sof-plugin\;sof-plugin\;NOISE_SUPPRESSION=false"
265+
"development/sof-plugin\;sof-plugin\;NOISE_SUPPRESSION=false,PLAYBACK_PROCESS=passthrough"
266266

267267
# mtl-rt5650 with AEC but not DTS
268268
"cavs-rt5682\;sof-mtl-rt5650-google-aec\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\

0 commit comments

Comments
 (0)