Skip to content

Commit 75b2660

Browse files
committed
topology2: cavs: configure WoV module formats
Loadable detectors describe their audio frame and memory requirements in the module manifest. Fixed format values cannot instantiate modules that require a different sample width, frame size, or BSS allocation. Expose the pipeline and PCM formats, container and valid widths, frame bytes, instance pages, and control size as target overrides. Retain the existing 32-bit, one ms frame defaults. Enable TLV writes on wov_init so clients can update module large configuration data after the widget is instantiated. Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com>
1 parent 7ac7b2c commit 75b2660

6 files changed

Lines changed: 82 additions & 42 deletions

File tree

tools/topology/topology2/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,31 @@ default ID ranges for the same endpoint types.
252252
> `BT_PCM_ID` override variable to set the correct value when BT coexists with a speaker
253253
> amplifier (which also uses PCM ID 2 by default).
254254
255+
### Wake-on-voice parameters
256+
257+
For a CAVS topology with PCH DMIC enabled and `PASSTHROUGH=false`, set
258+
`INCLUDE_WOV=true` to add the DMIC1, KPB, detector, and drain PCM
259+
pipelines. IPC4 targets must also override `KPB_UUID` with the `kpb4`
260+
UUID registered by their firmware. The class default is the IPC3 KPB
261+
UUID so existing IPC3 users are unchanged.
262+
263+
The detector's module manifest determines its frame and memory settings.
264+
Override these variables together when selecting a detector:
265+
266+
| Variable | Default | Purpose |
267+
|---|---:|---|
268+
| `WOV_FORMAT` | `s32le` | Pipeline sample format |
269+
| `WOV_PCM_FMT` | `S32_LE` | Drain PCM sample format |
270+
| `WOV_BIT_DEPTH` | 32 | Audio container width |
271+
| `WOV_VALID_BIT_DEPTH` | 32 | Valid sample width |
272+
| `WOV_IBS` | 64 | Detector input frame bytes |
273+
| `WOV_OBS` | 64 | Detector output frame bytes |
274+
| `WOV_IS_PAGES` | 0 | Module instance memory pages |
275+
| `WOV_CONTROL_MAX` | 4096 | Maximum bytes-control payload |
276+
277+
The `wov_init` bytes control supports runtime TLV reads and writes. Increase
278+
`WOV_CONTROL_MAX` only when a detector accepts a larger configuration.
279+
255280
**Intel HDA PCM IDs:**
256281

257282
| Endpoint | Default PCM ID | Override Variable |

tools/topology/topology2/include/components/wov.conf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
#
1515
# Where N is the unique instance number for the wov object within the same alsaconf node.
1616

17+
Define {
18+
WOV_CONTROL_MAX 4096
19+
}
20+
1721
Class.Widget."wov" {
1822
#
1923
# Pipeline ID for the wov object
@@ -72,13 +76,14 @@ Class.Widget."wov" {
7276
name wov_init
7377
access [
7478
tlv_read
79+
tlv_write
7580
tlv_callback
7681
]
7782
Object.Base.extops."extctl" {
7883
get 258
79-
put 0
84+
put 258
8085
}
81-
max 4096
86+
max $WOV_CONTROL_MAX
8287
Object.Base.data."1" {
8388
IncludeByKey.WOV_UUID {
8489
'1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67' {bytes "0x53, 0x4f, 0x46, 0x34, 0x02, 0x00, 0x00, 0x00,

tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ Class.Pipeline."dai-kpb-be" {
8989
Object.Base.input_audio_format [
9090
{
9191
in_rate 16000
92-
in_bit_depth 32
93-
in_valid_bit_depth 32
92+
in_bit_depth $WOV_BIT_DEPTH
93+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
9494
}
9595
{
9696
in_rate 16000
9797
in_channels 4
98-
in_bit_depth 32
99-
in_valid_bit_depth 32
98+
in_bit_depth $WOV_BIT_DEPTH
99+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
100100
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
101101
in_ch_map $CHANNEL_MAP_3_POINT_1
102102
}
@@ -105,14 +105,14 @@ Class.Pipeline."dai-kpb-be" {
105105
Object.Base.output_audio_format [
106106
{
107107
out_rate 16000
108-
out_bit_depth 32
109-
out_valid_bit_depth 32
108+
out_bit_depth $WOV_BIT_DEPTH
109+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
110110
}
111111
{
112112
out_rate 16000
113113
out_channels 4
114-
out_bit_depth 32
115-
out_valid_bit_depth 32
114+
out_bit_depth $WOV_BIT_DEPTH
115+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
116116
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
117117
out_ch_map $CHANNEL_MAP_3_POINT_1
118118
}

tools/topology/topology2/include/pipelines/cavs/wov-detect.conf

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Class.Pipeline."wov-detect" {
6464
in_channels 2
6565
in_ch_map $CHANNEL_MAP_STEREO
6666
in_ch_cfg 1
67-
in_bit_depth 32
68-
in_valid_bit_depth 32
67+
in_bit_depth $WOV_BIT_DEPTH
68+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
6969
}
7070
]
7171
Object.Base.output_audio_format [
@@ -74,8 +74,8 @@ Class.Pipeline."wov-detect" {
7474
out_channels 1
7575
out_ch_map $CHANNEL_MAP_MONO
7676
out_ch_cfg 0
77-
out_bit_depth 32
78-
out_valid_bit_depth 32
77+
out_bit_depth $WOV_BIT_DEPTH
78+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
7979
}
8080
]
8181
}
@@ -89,16 +89,18 @@ Class.Pipeline."wov-detect" {
8989
in_channels 1
9090
in_ch_cfg 0
9191
in_ch_map $CHANNEL_MAP_MONO
92-
in_bit_depth 32
93-
in_valid_bit_depth 32
92+
in_bit_depth $WOV_BIT_DEPTH
93+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
94+
ibs $WOV_IBS
9495
}
9596
]
9697
Object.Base.output_audio_format [
9798
{
9899
out_rate 16000
99100
out_channels 1
100-
out_bit_depth 32
101-
out_valid_bit_depth 32
101+
out_bit_depth $WOV_BIT_DEPTH
102+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
103+
obs $WOV_OBS
102104
}
103105
]
104106
}

tools/topology/topology2/platform/intel/dmic-default.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ Define {
2929
# The UUID corresponds to the test detect component
3030
WOV_UUID '1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67'
3131
WOV_CPC '360000'
32+
WOV_FORMAT s32le
33+
WOV_PCM_FMT 'S32_LE'
34+
WOV_BIT_DEPTH 32
35+
WOV_VALID_BIT_DEPTH 32
36+
WOV_IBS 64
37+
WOV_OBS 64
38+
WOV_IS_PAGES 0
3239
DMIC1_PCM_CAPS 'Passthrough Capture 18'
3340
DMIC_CORE_ID 0
3441
PASSTHROUGH "false"

tools/topology/topology2/platform/intel/dmic-wov.conf

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Object.Pipeline {
22
host-gateway-capture [
33
{
4-
format $FORMAT
4+
format $WOV_FORMAT
55
rate 16000
66
rate_min 16000
77
rate_max 16000
@@ -18,19 +18,19 @@ Object.Pipeline {
1818
in_channels 1
1919
in_ch_cfg $CHANNEL_CONFIG_MONO
2020
in_ch_map $CHANNEL_MAP_MONO
21-
in_bit_depth 32
22-
in_valid_bit_depth 32
21+
in_bit_depth $WOV_BIT_DEPTH
22+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
2323
}
2424
{
2525
in_rate 16000
26-
in_bit_depth 32
27-
in_valid_bit_depth 32
26+
in_bit_depth $WOV_BIT_DEPTH
27+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
2828
}
2929
{
3030
in_rate 16000
3131
in_channels 4
32-
in_bit_depth 32
33-
in_valid_bit_depth 32
32+
in_bit_depth $WOV_BIT_DEPTH
33+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
3434
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
3535
in_ch_map $CHANNEL_MAP_3_POINT_1
3636
}
@@ -41,19 +41,19 @@ Object.Pipeline {
4141
out_channels 1
4242
out_ch_cfg $CHANNEL_CONFIG_MONO
4343
out_ch_map $CHANNEL_MAP_MONO
44-
out_bit_depth 32
45-
out_valid_bit_depth 32
44+
out_bit_depth $WOV_BIT_DEPTH
45+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
4646
}
4747
{
4848
out_rate 16000
49-
out_bit_depth 32
50-
out_valid_bit_depth 32
49+
out_bit_depth $WOV_BIT_DEPTH
50+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
5151
}
5252
{
5353
out_rate 16000
5454
out_channels 4
55-
out_bit_depth 32
56-
out_valid_bit_depth 32
55+
out_bit_depth $WOV_BIT_DEPTH
56+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
5757
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
5858
out_ch_map $CHANNEL_MAP_3_POINT_1
5959
}
@@ -65,7 +65,7 @@ Object.Pipeline {
6565
dai-kpb-be [
6666
{
6767
direction "capture"
68-
format $FORMAT
68+
format $WOV_FORMAT
6969
rate 16000
7070
rate_min 16000
7171
rate_max 16000
@@ -84,14 +84,14 @@ Object.Pipeline {
8484
Object.Base.input_audio_format [
8585
{
8686
in_rate 16000
87-
in_bit_depth 32
88-
in_valid_bit_depth 32
87+
in_bit_depth $WOV_BIT_DEPTH
88+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
8989
}
9090
{
9191
in_rate 16000
9292
in_channels 4
93-
in_bit_depth 32
94-
in_valid_bit_depth 32
93+
in_bit_depth $WOV_BIT_DEPTH
94+
in_valid_bit_depth $WOV_VALID_BIT_DEPTH
9595
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
9696
in_ch_map $CHANNEL_MAP_3_POINT_1
9797
}
@@ -100,14 +100,14 @@ Object.Pipeline {
100100
Object.Base.output_audio_format [
101101
{
102102
out_rate 16000
103-
out_bit_depth 32
104-
out_valid_bit_depth 32
103+
out_bit_depth $WOV_BIT_DEPTH
104+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
105105
}
106106
{
107107
out_rate 16000
108108
out_channels 4
109-
out_bit_depth 32
110-
out_valid_bit_depth 32
109+
out_bit_depth $WOV_BIT_DEPTH
110+
out_valid_bit_depth $WOV_VALID_BIT_DEPTH
111111
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
112112
out_ch_map $CHANNEL_MAP_3_POINT_1
113113
}
@@ -131,11 +131,12 @@ Object.Pipeline {
131131
wov-detect [
132132
{
133133
index $WOV_PIPELINE_ID
134-
format s32le
134+
format $WOV_FORMAT
135135
channels 2
136136
Object.Widget.wov.1 {
137137
uuid $WOV_UUID
138138
cpc $WOV_CPC
139+
is_pages $WOV_IS_PAGES
139140
}
140141
}
141142
]
@@ -172,7 +173,7 @@ Object.PCM.pcm [
172173

173174
Object.PCM.pcm_caps.1 {
174175
name $DMIC1_PCM_CAPS
175-
formats 'S32_LE'
176+
formats $WOV_PCM_FMT
176177
channels_min 1
177178
channels_max $NUM_DMICS
178179
rates '16000'

0 commit comments

Comments
 (0)