Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions tools/topology/m4/detect.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dnl Define macro for generic detection widget
dnl Detect name)
define(`N_DETECT', `DETECT'PIPELINE_ID`.'$1)

dnl W_DETECT(name, format, periods_sink, periods_source, detect_type, stream_name, mixer_list, enum_list)
dnl W_DETECT(name, format, periods_sink, periods_source, detect_type, stream_name, kcontrols_list)
define(`W_DETECT',
`SectionVendorTuples."'N_DETECT($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
Expand Down Expand Up @@ -44,12 +44,9 @@ define(`W_DETECT',
` "'N_DETECT($1)`_data_w"'
` "'N_DETECT($1)`_data_str"'
` ]'
` mixer ['
$7
` ]'
` enum ['
` $8'
` ]'
` bytes ['
$7
` ]'
`}')

divert(0)dnl
11 changes: 11 additions & 0 deletions tools/topology/m4/detect_test_coef.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# initial coe params for detector, aligned with struct sof_detect_test_config
CONTROLBYTES_PRIV(DETECTOR_priv,
` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,'
` 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x03,'
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
` 0x20,0x00,0x00,0x00,0x05,0x00,0x00,0x00,'
` 0x00,0x00,0x00,0x00,0x80,0x02,0x00,0x00,'
` 0x03,0x00,0x00,0x80,0x00,0x00,0x00,0x00,'
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00"'
)
5 changes: 4 additions & 1 deletion tools/topology/m4/kpbm.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dnl Define macro for Key Phrase Buffer Manager(kpbm) widget
dnl kpbm Name)
define(`N_KPBM', `KPBM'$2`.'$1)

dnl W_KPBM(name, format, periods_sink, periods_source, pipeline_id)
dnl W_KPBM(name, format, periods_sink, periods_source, pipeline_id, kcontrols_list)
Comment thread
keyonjie marked this conversation as resolved.
Resolved
define(`W_KPBM',
`SectionVendorTuples."'N_KPBM($1, $5)`_tuples_w" {'
` tokens "sof_comp_tokens"'
Expand Down Expand Up @@ -41,6 +41,9 @@ define(`W_KPBM',
` "'N_KPBM($1, $5)`_data_w"'
` "'N_KPBM($1, $5)`_data_str"'
` ]'
` bytes ['
$6
` ]'
`}')

divert(0)dnl
15 changes: 14 additions & 1 deletion tools/topology/sof/pipe-detect.m4
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,25 @@ C_CONTROLBYTES(SELECTOR, PIPELINE_ID,
CONTROLBYTES_MAX(, 304),
,
SELECTOR_priv)

# Detector initial parameters for Intel KPD.
include(`detect_test_coef.m4')

# Detector Bytes control with max value of 255
C_CONTROLBYTES(DETECTOR, PIPELINE_ID,
CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258),
CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258),
, , ,
CONTROLBYTES_MAX(, 304),
,
DETECTOR_priv)

#
# Components and Buffers
#

# "Detect 0" has 2 sink period and 0 source periods
W_DETECT(0, PIPELINE_FORMAT, 0, 2, KEYWORD, N_STS(PCM_ID))
W_DETECT(0, PIPELINE_FORMAT, 0, 2, KEYWORD, N_STS(PCM_ID), LIST(` ', "DETECTOR"))

W_SELECTOR(0, PIPELINE_FORMAT, 2, 2, LIST(` ', "SELECTOR"))

Expand Down
28 changes: 27 additions & 1 deletion tools/topology/sof/pipe-kfbm-capture.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,37 @@ include(`buffer.m4')
include(`pcm.m4')
include(`dai.m4')
include(`kpbm.m4')
include(`mixercontrol.m4')
include(`bytecontrol.m4')
include(`pipeline.m4')

dnl Soun Trigger Stream Name)
define(`N_STS', `Sound Trigger Capture '$1)

#
# Controls
#

# kpbm initial parameters, aligned with struct sof_kpb_config
CONTROLBYTES_PRIV(KPB_priv,
Comment thread
keyonjie marked this conversation as resolved.
Resolved
` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,'
` 0x18,0x00,0x00,0x00,0x00,0x10,0x00,0x03,'
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
` 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
` 0x80,0x3e,0x00,0x00,0x10,0x00,0x00,0x00"'
)

# KPB Bytes control with max value of 255
C_CONTROLBYTES(KPB, PIPELINE_ID,
CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258),
CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258),
, , ,
CONTROLBYTES_MAX(, 304),
,
KPB_priv)

#
# Components and Buffers
#
Expand All @@ -26,7 +52,7 @@ define(`N_STS', `Sound Trigger Capture '$1)
W_PCM_CAPTURE(PCM_ID, Sound Trigger Capture, 0, 2, 2)

# "KPBM" has 2 source and 2 sink periods
W_KPBM(0, PIPELINE_FORMAT, 2, 2, PIPELINE_ID)
W_KPBM(0, PIPELINE_FORMAT, 2, 2, PIPELINE_ID, LIST(` ', "KPB"))
Comment thread
keyonjie marked this conversation as resolved.
Resolved

# Capture Buffers
W_BUFFER(0, COMP_BUFFER_SIZE(2,
Expand Down