Skip to content

Commit 5416f2e

Browse files
singalsulgirdwood
authored andcommitted
Tools: Topology: Add audio features capture PCM to jack and DMIC
Add a new host-gateway-src-mfcc-capture pipeline class that chains SRC (48 kHz to 16 kHz) with the MFCC component for audio features extraction. Two new platform configuration files are added: - sdw-jack-audio-feature.conf: taps the SoundWire jack capture path (module-copier 11) into an SRC+MFCC pipeline (pipeline 130, PCM 47) - sdw-dmic-audio-feature.conf: taps the SoundWire DMIC capture path (module-copier 41) into an SRC+MFCC pipeline (pipeline 131, PCM 48) Both are gated by new IncludeByKey defines SDW_JACK_AUDIO_FEATURE_CAPTURE and SDW_DMIC_AUDIO_FEATURE_CAPTURE (default false) in cavs-sdw.conf. Development topology targets are added for MTL rt713 and ARL cs42l43+cs35l56 configurations with MFCC features capture enabled. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 4a66432 commit 5416f2e

6 files changed

Lines changed: 266 additions & 0 deletions

File tree

tools/topology/topology2/cavs-sdw.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +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>
3031
<src.conf>
3132
<io-gateway.conf>
3233
<io-gateway-capture.conf>
@@ -248,3 +249,11 @@ IncludeByKey.SDW_JACK_ECHO_REF {
248249
IncludeByKey.SDW_SPK_ECHO_REF {
249250
"true" "platform/intel/sdw-amp-echo-ref.conf"
250251
}
252+
253+
IncludeByKey.SDW_JACK_AUDIO_FEATURE_CAPTURE {
254+
"true" "platform/intel/sdw-jack-audio-feature.conf"
255+
}
256+
257+
IncludeByKey.SDW_DMIC_AUDIO_FEATURE_CAPTURE {
258+
"true" "platform/intel/sdw-dmic-audio-feature.conf"
259+
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,4 +477,13 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,CO
477477
"cavs-sdw\;sof-ptl-rt722-compr\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,\
478478
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
479479
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,COMPRESSED=true"
480+
481+
# Soundwire topologies with MFCC audio features capture
482+
"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-mfcc\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,\
483+
HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6,SDW_JACK_AUDIO_FEATURE_CAPTURE=true"
484+
485+
"cavs-sdw\;sof-arl-cs42l43-l0-cs35l56-l23-mfcc\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\
486+
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
487+
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
488+
SDW_JACK_AUDIO_FEATURE_CAPTURE=true,SDW_DMIC_AUDIO_FEATURE_CAPTURE=true"
480489
)

tools/topology/topology2/include/common/common_definitions.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ Define {
7171
PCM_FORMAT_ALL false # Basic s16/s24/s32, no float, 8-bit etc.
7272
SDW_JACK_ECHO_REF false # No echo reference for 3.5mm jack
7373
SDW_SPK_ECHO_REF false # No echo reference for speaker
74+
SDW_JACK_AUDIO_FEATURE_CAPTURE false # No audio features capture for jack
75+
SDW_DMIC_AUDIO_FEATURE_CAPTURE false # No audio features capture for microphone
7476
}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#
2+
# SRC-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-mfcc-capture.N.attribute_name".
7+
#
8+
# Usage: host-gateway-src-mfcc-capture pipeline object can be instantiated as:
9+
#
10+
# Object.Pipeline.host-gateway-src-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/mfcc.conf>
24+
25+
Class.Pipeline."host-gateway-src-mfcc-capture" {
26+
27+
<include/pipelines/pipeline-common.conf>
28+
29+
attributes {
30+
!constructor [
31+
"index"
32+
]
33+
34+
#
35+
# host-gateway-src-mfcc-capture objects instantiated within the same alsaconf
36+
# node must have unique pipeline_id attribute
37+
#
38+
unique "instance"
39+
}
40+
41+
Object.Widget {
42+
src."1" {
43+
num_input_pins 1
44+
num_output_pins 1
45+
num_input_audio_formats 3
46+
num_output_audio_formats 1
47+
Object.Base.input_audio_format [
48+
{
49+
in_bit_depth 32
50+
in_valid_bit_depth 32
51+
in_rate 48000
52+
}
53+
{
54+
in_bit_depth 32
55+
in_valid_bit_depth 32
56+
in_rate 96000
57+
}
58+
{
59+
in_bit_depth 32
60+
in_valid_bit_depth 32
61+
in_rate 192000
62+
}
63+
]
64+
Object.Base.output_audio_format [
65+
{
66+
out_bit_depth 32
67+
out_valid_bit_depth 32
68+
out_rate 16000
69+
}
70+
]
71+
}
72+
73+
mfcc."1" {
74+
num_input_audio_formats 1
75+
num_output_audio_formats 1
76+
Object.Base.input_audio_format [
77+
{
78+
in_bit_depth 32
79+
in_valid_bit_depth 32
80+
in_rate 16000
81+
}
82+
]
83+
Object.Base.output_audio_format [
84+
{
85+
out_bit_depth 32
86+
out_valid_bit_depth 32
87+
out_rate 16000
88+
}
89+
]
90+
}
91+
92+
host-copier."1" {
93+
type "aif_out"
94+
node_type $HDA_HOST_INPUT_CLASS
95+
num_input_pins 1
96+
num_output_pins 1
97+
num_input_audio_formats 1
98+
num_output_audio_formats 1
99+
Object.Base.input_audio_format [
100+
{
101+
in_bit_depth 32
102+
in_valid_bit_depth 32
103+
in_rate 16000
104+
}
105+
]
106+
Object.Base.output_audio_format [
107+
{
108+
out_bit_depth 32
109+
out_valid_bit_depth 32
110+
out_rate 16000
111+
}
112+
]
113+
}
114+
115+
pipeline."1" {
116+
priority 0
117+
lp_mode 0
118+
}
119+
}
120+
121+
122+
Object.Base {
123+
!route [
124+
{
125+
source src.$index.1
126+
sink mfcc.$index.1
127+
}
128+
]
129+
}
130+
131+
direction "capture"
132+
dynamic_pipeline 1
133+
time_domain "timer"
134+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Define {
2+
SDW_DMIC_MODULE_COPIER_ID 41
3+
SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_NAME "Microphone Audio Features"
4+
SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_ID 48
5+
SDW_DMIC_AUDIO_FEATURE_CAPTURE_STREAM_NAME "Microphone Audio Features Stream"
6+
SDW_DMIC_AUDIO_FEATURE_CAPTURE_PIPELINE_ID 131
7+
}
8+
9+
Object.Pipeline.host-gateway-src-mfcc-capture [
10+
{
11+
index $SDW_DMIC_AUDIO_FEATURE_CAPTURE_PIPELINE_ID
12+
13+
Object.Widget.host-copier.1 {
14+
stream_name "$SDW_DMIC_AUDIO_FEATURE_CAPTURE_STREAM_NAME"
15+
pcm_id $SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_ID
16+
}
17+
18+
Object.Widget.mfcc.1 {
19+
Object.Control {
20+
bytes."1" {
21+
name "$SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_NAME MFCC bytes"
22+
<include/components/mfcc/mel80.conf>
23+
}
24+
}
25+
}
26+
}
27+
]
28+
Object.Base.route [
29+
{
30+
source "module-copier.$SDW_DMIC_MODULE_COPIER_ID.0"
31+
sink "src.$SDW_DMIC_AUDIO_FEATURE_CAPTURE_PIPELINE_ID.1"
32+
}
33+
{
34+
source "mfcc.$SDW_DMIC_AUDIO_FEATURE_CAPTURE_PIPELINE_ID.1"
35+
sink "host-copier.$SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_ID.capture"
36+
}
37+
]
38+
39+
Object.PCM.pcm [
40+
{
41+
name "$SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_NAME"
42+
id $SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_ID
43+
direction "capture"
44+
Object.Base.fe_dai.1 {
45+
name "$SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_NAME"
46+
}
47+
48+
Object.PCM.pcm_caps.1 {
49+
name "$SDW_DMIC_AUDIO_FEATURE_CAPTURE_STREAM_NAME"
50+
formats 'S32_LE'
51+
rates '16000'
52+
channels_min 2
53+
channels_max 2
54+
}
55+
}
56+
]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Define {
2+
SDW_JACK_MODULE_COPIER_ID 11
3+
SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_NAME "Jack In Audio Features"
4+
SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_ID 47
5+
SDW_JACK_AUDIO_FEATURE_CAPTURE_STREAM_NAME "Jack In Audio Features Stream"
6+
SDW_JACK_AUDIO_FEATURE_CAPTURE_PIPELINE_ID 130
7+
}
8+
9+
Object.Pipeline.host-gateway-src-mfcc-capture [
10+
{
11+
index $SDW_JACK_AUDIO_FEATURE_CAPTURE_PIPELINE_ID
12+
13+
Object.Widget.host-copier.1 {
14+
stream_name "$SDW_JACK_AUDIO_FEATURE_CAPTURE_STREAM_NAME"
15+
pcm_id $SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_ID
16+
}
17+
18+
Object.Widget.mfcc.1 {
19+
Object.Control {
20+
bytes."1" {
21+
name "$SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_NAME MFCC bytes"
22+
<include/components/mfcc/mel80.conf>
23+
}
24+
}
25+
}
26+
}
27+
]
28+
Object.Base.route [
29+
{
30+
source "module-copier.$SDW_JACK_MODULE_COPIER_ID.0"
31+
sink "src.$SDW_JACK_AUDIO_FEATURE_CAPTURE_PIPELINE_ID.1"
32+
}
33+
{
34+
source "mfcc.$SDW_JACK_AUDIO_FEATURE_CAPTURE_PIPELINE_ID.1"
35+
sink "host-copier.$SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_ID.capture"
36+
}
37+
]
38+
39+
Object.PCM.pcm [
40+
{
41+
name "$SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_NAME"
42+
id $SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_ID
43+
direction "capture"
44+
Object.Base.fe_dai.1 {
45+
name "$SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_NAME"
46+
}
47+
48+
Object.PCM.pcm_caps.1 {
49+
name "$SDW_JACK_AUDIO_FEATURE_CAPTURE_STREAM_NAME"
50+
formats 'S32_LE'
51+
rates '16000'
52+
channels_min $SDW_JACK_CAPTURE_CH
53+
channels_max $SDW_JACK_CAPTURE_CH
54+
}
55+
}
56+
]

0 commit comments

Comments
 (0)