Skip to content

Commit a6c639c

Browse files
committed
tools: topology2: update WoV pipeline graph with dual-path KPB routing
1 parent 3776df6 commit a6c639c

2 files changed

Lines changed: 42 additions & 58 deletions

File tree

tools/topology/topology2/include/pipelines/cavs/host-gateway-src-mfcc-tflm-capture.conf

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# SRC-MFCC-TFLM capture pipeline
2+
# SRC-MFCC-TFLM capture detection pipeline
33
#
4-
# This class provides host pipeline for capture with MFCC feature extraction
4+
# This class provides detection pipeline for capture with MFCC feature extraction
55
# fed to TFLM classification micro speech module.
66
#
77

88
<include/common/input_audio_format.conf>
99
<include/common/output_audio_format.conf>
1010
<include/components/pipeline.conf>
11-
<include/components/host-copier.conf>
1211
<include/components/src.conf>
1312
<include/components/mfcc.conf>
1413
<include/components/tflm.conf>
@@ -30,6 +29,11 @@ Class.Pipeline."host-gateway-src-mfcc-tflm-capture" {
3029
}
3130

3231
Object.Widget {
32+
virtual."1" {
33+
name "virtual.tflm_sink"
34+
type out_drv
35+
}
36+
3337
src."1" {
3438
num_input_pins 1
3539
num_output_pins 1
@@ -107,31 +111,6 @@ Class.Pipeline."host-gateway-src-mfcc-tflm-capture" {
107111
]
108112
}
109113

110-
host-copier."1" {
111-
type "aif_out"
112-
node_type $HDA_HOST_INPUT_CLASS
113-
num_input_pins 1
114-
num_output_pins 1
115-
num_input_audio_formats 1
116-
num_output_audio_formats 1
117-
Object.Base.input_audio_format [
118-
{
119-
in_bit_depth 32
120-
in_valid_bit_depth 32
121-
in_rate 16000
122-
ibs $MFCC_FRAME_BYTES
123-
}
124-
]
125-
Object.Base.output_audio_format [
126-
{
127-
out_bit_depth 32
128-
out_valid_bit_depth 32
129-
out_rate 16000
130-
obs $MFCC_FRAME_BYTES
131-
}
132-
]
133-
}
134-
135114
pipeline."1" {
136115
priority 0
137116
lp_mode 0
@@ -148,6 +127,10 @@ Class.Pipeline."host-gateway-src-mfcc-tflm-capture" {
148127
source mfcc.$index.1
149128
sink tflmcly.$index.1
150129
}
130+
{
131+
source tflmcly.$index.1
132+
sink "virtual.tflm_sink"
133+
}
151134
]
152135
}
153136

tools/topology/topology2/sof-hda-tflm.conf

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ Define {
4747
HDA_ANALOG_CAPTURE_RATE 48000
4848
HDA_ANALOG_PLAYBACK_RATE 48000
4949
HDA_TFLM_CAPTURE_PCM_ID 0
50-
HDA_TFLM_HOST_PIPELINE_ID 1
50+
HDA_TFLM_HOST_PIPELINE_ID 0
51+
HDA_TFLM_DETECT_PIPELINE_ID 1
5152
HDA_TFLM_DAI_PIPELINE_ID 2
5253
}
5354

@@ -72,17 +73,39 @@ Object.Dai.HDA [
7273
]
7374

7475
Object.Pipeline {
75-
host-gateway-src-mfcc-tflm-capture [
76+
host-gateway-capture [
7677
{
7778
index $HDA_TFLM_HOST_PIPELINE_ID
7879

7980
Object.Widget.host-copier.1 {
8081
stream_name $ANALOG_CAPTURE_PCM
8182
pcm_id $HDA_TFLM_CAPTURE_PCM_ID
83+
num_input_audio_formats 1
84+
num_output_audio_formats 1
85+
Object.Base.input_audio_format [
86+
{
87+
in_rate $HDA_ANALOG_CAPTURE_RATE
88+
in_bit_depth 32
89+
in_valid_bit_depth 32
90+
}
91+
]
92+
Object.Base.output_audio_format [
93+
{
94+
out_rate $HDA_ANALOG_CAPTURE_RATE
95+
out_bit_depth 32
96+
out_valid_bit_depth 32
97+
}
98+
]
8299
}
83100
}
84101
]
85102

103+
host-gateway-src-mfcc-tflm-capture [
104+
{
105+
index $HDA_TFLM_DETECT_PIPELINE_ID
106+
}
107+
]
108+
86109
dai-copier-gain-module-copier-capture [
87110
{
88111
index $HDA_TFLM_DAI_PIPELINE_ID
@@ -152,26 +175,6 @@ Object.Pipeline {
152175
}
153176
]
154177
}
155-
156-
Object.Widget.module-copier.2 {
157-
stream_name $HDA_ANALOG_DAI_NAME
158-
num_input_audio_formats 1
159-
num_output_audio_formats 1
160-
Object.Base.input_audio_format [
161-
{
162-
in_rate $HDA_ANALOG_CAPTURE_RATE
163-
in_bit_depth 32
164-
in_valid_bit_depth 32
165-
}
166-
]
167-
Object.Base.output_audio_format [
168-
{
169-
out_rate $HDA_ANALOG_CAPTURE_RATE
170-
out_bit_depth 32
171-
out_valid_bit_depth 32
172-
}
173-
]
174-
}
175178
}
176179
]
177180
}
@@ -185,16 +188,14 @@ Object.Base.route [
185188
source "gain.$HDA_TFLM_DAI_PIPELINE_ID.1"
186189
sink "kpb.$HDA_TFLM_DAI_PIPELINE_ID.1"
187190
}
191+
# KPB output pin 1 -> Real-time detection path (SRC -> MFCC -> TFLM)
188192
{
189193
source "kpb.$HDA_TFLM_DAI_PIPELINE_ID.1"
190-
sink "module-copier.$HDA_TFLM_DAI_PIPELINE_ID.2"
194+
sink "src.$HDA_TFLM_DETECT_PIPELINE_ID.1"
191195
}
196+
# KPB output pin 2 -> Host WoV Draining PCM capture stream
192197
{
193-
source "module-copier.$HDA_TFLM_DAI_PIPELINE_ID.2"
194-
sink "src.$HDA_TFLM_HOST_PIPELINE_ID.1"
195-
}
196-
{
197-
source "tflmcly.$HDA_TFLM_HOST_PIPELINE_ID.1"
198+
source "kpb.$HDA_TFLM_DAI_PIPELINE_ID.1"
198199
sink "host-copier.$HDA_TFLM_CAPTURE_PCM_ID.capture"
199200
}
200201
]
@@ -211,8 +212,8 @@ Object.PCM.pcm [
211212

212213
Object.PCM.pcm_caps.1 {
213214
name $ANALOG_CAPTURE_PCM
214-
formats 'S16_LE'
215-
rates '16000'
215+
formats 'S32_LE'
216+
rates '48000'
216217
channels_min 1
217218
channels_max 1
218219
}

0 commit comments

Comments
 (0)