Skip to content

Commit 9ab355b

Browse files
committed
Tools: Topology: Add Micsel module to MFCC capture pipeline
This patch adds the Micsel (or Selector) module with a configuration blob for stereo to double mono to source of MFCC. The Micsel module has better input select capabilities than bare MFCC module. The sum of L+R provides a slightly better SNR than the single (left) channel pick with MFCC for it's mono processing. It will reduce a bit noise in the audio features and possibly improve speech recognition quality. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 6e1ee5b commit 9ab355b

4 files changed

Lines changed: 179 additions & 3 deletions

File tree

tools/topology/topology2/cavs-sdw.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<host-gateway-playback.conf>
2828
<host-gateway-capture.conf>
2929
<host-gateway-tdfb-drc-capture.conf>
30-
<host-gateway-src-mfcc-capture.conf>
30+
<host-gateway-src-micsel-mfcc-capture.conf>
3131
<src.conf>
3232
<io-gateway.conf>
3333
<io-gateway-capture.conf>
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
#
2+
# SRC-Micsel-MFCC capture pipeline
3+
#
4+
# This class provides host pipeline for capture with MFCC audio features input.
5+
# All attributes defined herein are namespaced by alsatplg to
6+
# "Object.Pipeline.host-gateway-src-micsel-mfcc-capture.N.attribute_name".
7+
#
8+
# Usage: host-gateway-src-micsel-mfcc-capture pipeline object can be instantiated as:
9+
#
10+
# Object.Pipeline.host-gateway-src-micsel-mfcc-capture."N" {
11+
# period 1000
12+
# time_domain "timer"
13+
# }
14+
#
15+
# Where N is the unique pipeline ID within the same alsaconf node.
16+
#
17+
18+
<include/common/input_audio_format.conf>
19+
<include/common/output_audio_format.conf>
20+
<include/components/pipeline.conf>
21+
<include/components/host-copier.conf>
22+
<include/components/src.conf>
23+
<include/components/micsel.conf>
24+
<include/components/mfcc.conf>
25+
26+
Class.Pipeline."host-gateway-src-micsel-mfcc-capture" {
27+
28+
<include/pipelines/pipeline-common.conf>
29+
30+
attributes {
31+
!constructor [
32+
"index"
33+
]
34+
35+
#
36+
# host-gateway-src-micsel-mfcc-capture objects instantiated within the
37+
# same alsaconf node must have unique pipeline_id attribute
38+
#
39+
unique "instance"
40+
}
41+
42+
Object.Widget {
43+
src."1" {
44+
num_input_pins 1
45+
num_output_pins 1
46+
num_input_audio_formats 3
47+
num_output_audio_formats 1
48+
Object.Base.input_audio_format [
49+
{
50+
in_bit_depth 32
51+
in_valid_bit_depth 32
52+
in_rate 48000
53+
}
54+
{
55+
in_bit_depth 32
56+
in_valid_bit_depth 32
57+
in_rate 96000
58+
}
59+
{
60+
in_bit_depth 32
61+
in_valid_bit_depth 32
62+
in_rate 192000
63+
}
64+
]
65+
Object.Base.output_audio_format [
66+
{
67+
out_bit_depth 32
68+
out_valid_bit_depth 32
69+
out_rate 16000
70+
}
71+
]
72+
}
73+
74+
micsel."1" {
75+
num_input_audio_formats 1
76+
num_output_audio_formats 1
77+
Object.Base.input_audio_format [
78+
{
79+
in_bit_depth 32
80+
in_valid_bit_depth 32
81+
in_rate 16000
82+
}
83+
]
84+
Object.Base.output_audio_format [
85+
{
86+
out_bit_depth 32
87+
out_valid_bit_depth 32
88+
out_rate 16000
89+
}
90+
]
91+
}
92+
93+
mfcc."1" {
94+
num_input_audio_formats 1
95+
num_output_audio_formats 1
96+
Object.Base.input_audio_format [
97+
{
98+
in_bit_depth 32
99+
in_valid_bit_depth 32
100+
in_rate 16000
101+
}
102+
]
103+
Object.Base.output_audio_format [
104+
{
105+
out_bit_depth 32
106+
out_valid_bit_depth 32
107+
out_rate 16000
108+
}
109+
]
110+
}
111+
112+
host-copier."1" {
113+
type "aif_out"
114+
node_type $HDA_HOST_INPUT_CLASS
115+
num_input_pins 1
116+
num_output_pins 1
117+
num_input_audio_formats 1
118+
num_output_audio_formats 1
119+
Object.Base.input_audio_format [
120+
{
121+
in_bit_depth 32
122+
in_valid_bit_depth 32
123+
in_rate 16000
124+
}
125+
]
126+
Object.Base.output_audio_format [
127+
{
128+
out_bit_depth 32
129+
out_valid_bit_depth 32
130+
out_rate 16000
131+
}
132+
]
133+
}
134+
135+
pipeline."1" {
136+
priority 0
137+
lp_mode 0
138+
}
139+
}
140+
141+
142+
Object.Base {
143+
!route [
144+
{
145+
source src.$index.1
146+
sink micsel.$index.1
147+
}
148+
{
149+
source micsel.$index.1
150+
sink mfcc.$index.1
151+
}
152+
]
153+
}
154+
155+
direction "capture"
156+
dynamic_pipeline 1
157+
time_domain "timer"
158+
}

tools/topology/topology2/platform/intel/sdw-dmic-audio-feature.conf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Define {
66
SDW_DMIC_AUDIO_FEATURE_CAPTURE_PIPELINE_ID 131
77
}
88

9-
Object.Pipeline.host-gateway-src-mfcc-capture [
9+
Object.Pipeline.host-gateway-src-micsel-mfcc-capture [
1010
{
1111
index $SDW_DMIC_AUDIO_FEATURE_CAPTURE_PIPELINE_ID
1212

@@ -15,6 +15,15 @@ Object.Pipeline.host-gateway-src-mfcc-capture [
1515
pcm_id $SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_ID
1616
}
1717

18+
Object.Widget.micsel.1 {
19+
Object.Control {
20+
bytes."1" {
21+
name "$SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_NAME Micsel bytes"
22+
<include/components/micsel/downmix_stereo_to_doublemono.conf>
23+
}
24+
}
25+
}
26+
1827
Object.Widget.mfcc.1 {
1928
Object.Control {
2029
bytes."1" {

tools/topology/topology2/platform/intel/sdw-jack-audio-feature.conf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Define {
66
SDW_JACK_AUDIO_FEATURE_CAPTURE_PIPELINE_ID 130
77
}
88

9-
Object.Pipeline.host-gateway-src-mfcc-capture [
9+
Object.Pipeline.host-gateway-src-micsel-mfcc-capture [
1010
{
1111
index $SDW_JACK_AUDIO_FEATURE_CAPTURE_PIPELINE_ID
1212

@@ -15,6 +15,15 @@ Object.Pipeline.host-gateway-src-mfcc-capture [
1515
pcm_id $SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_ID
1616
}
1717

18+
Object.Widget.micsel.1 {
19+
Object.Control {
20+
bytes."1" {
21+
name "$SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_NAME Micsel bytes"
22+
<include/components/micsel/downmix_stereo_to_doublemono.conf>
23+
}
24+
}
25+
}
26+
1827
Object.Widget.mfcc.1 {
1928
Object.Control {
2029
bytes."1" {

0 commit comments

Comments
 (0)