diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index 57e9b7731bb5..74eca3d0b10a 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -12,6 +12,8 @@ + + @@ -31,6 +33,8 @@ + + Define { @@ -45,6 +49,7 @@ Define { DMIC1_NAME 'NoCodec-7' DMIC0_PCM_CAPS 'Passthrough Capture 13' DMIC0_PIPELINE_STREAM_NAME 'copier.DMIC.14.1' + DMIC1_PCM_CAPS 'DMIC1 WOV Capture' PLATFORM "none" DEEP_BUFFER_PIPELINE_ID 15 DEEP_BUFFER_PCM_ID 31 diff --git a/tools/topology/topology2/include/common/tokens.conf b/tools/topology/topology2/include/common/tokens.conf index 3d23a2647e64..670102a4faed 100644 --- a/tools/topology/topology2/include/common/tokens.conf +++ b/tools/topology/topology2/include/common/tokens.conf @@ -21,10 +21,6 @@ Object.Base.VendorToken { # the widget name that the queue is connected from/to. sink_pin_binding_wname 413 src_pin_binding_wname 414 - # Token payload_with_output_fmt specifies whether there is - # output audio format in the init instance ipc4 message - # payload. - payload_with_output_fmt 415 } "sof_tkn_dai" { @@ -111,6 +107,12 @@ Object.Base.VendorToken { } + "sof_tkn_process" { + # Token payload_with_output_fmt specifies whether there is + # output audio format in the init instance ipc4 message payload. + payload_with_output_fmt 901 + } + "sof_tkn_stream" { playback_compatible_d0i3 "1200" capture_compatible_d0i3 "1201" diff --git a/tools/topology/topology2/include/components/kpb.conf b/tools/topology/topology2/include/components/kpb.conf new file mode 100644 index 000000000000..6a9bc76e78fa --- /dev/null +++ b/tools/topology/topology2/include/components/kpb.conf @@ -0,0 +1,89 @@ +# +# Widget kpb +# +# A kpb widget. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.kpb.N.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# Object.Widget.kpb."N" { +# +# } +# +# Where N is the unique instance number for the kpb object within the same alsaconf node. + +Class.Widget."kpb" { + # + # Pipeline ID for the kpb object + # + DefineAttribute."index" {} + + # + # Kpb object instance + # + DefineAttribute."instance" {} + + DefineAttribute."cpc" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + DefineAttribute."num_audio_formats" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + #include common component definition + + + # + # kpb component UUID + # + DefineAttribute."uuid" { + type "string" + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + attributes { + # + # The kpb widget name would be constructed using the index and + # instance attributes. For example: "kpb.0.1". + # + !constructor [ + "index" + "instance" + ] + + # + # mandatory attributes that must be provided when the class is instantiated + # + !mandatory [ + "no_pm" + "uuid" + ] + + # + # immutable attributes cannot be modified in the object instance + # + !immutable [ + "uuid" + ] + + unique "instance" + } + + # + # Default attributes for kpb + # + type "effect" + + num_audio_formats 1 + #UUID: D8218443-5FF3-4A4C-B388-6CFE07B9562E + uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:2e" + no_pm "true" + core_id 0 + cpc 720000 + num_sink_pins 1 + num_source_pins 2 +} diff --git a/tools/topology/topology2/include/components/micsel.conf b/tools/topology/topology2/include/components/micsel.conf new file mode 100644 index 000000000000..32b42966579e --- /dev/null +++ b/tools/topology/topology2/include/components/micsel.conf @@ -0,0 +1,95 @@ +# +# Common widget micsel +# +# A generic micsel widget. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.micsel.N.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# Object.Widget.micsel."N" { +# +# } +# +# Where N is the unique instance number for the micsel object within the same alsaconf node. + +Class.Widget."micsel" { + # + # Pipeline ID for the micsel object + # + DefineAttribute."index" {} + + # + # Micsel object instance + # + DefineAttribute."instance" {} + + DefineAttribute."cpc" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + DefineAttribute."num_audio_formats" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + #include common component definition + + + # + # micsel component UUID + # + DefineAttribute."uuid" { + type "string" + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute."payload_with_output_fmt" { + # Token set reference name and type + token_ref "sof_tkn_process.bool" + } + + attributes { + # + # The micsel widget name would be constructed using the index and + # instance attributes. For example: "micsel.0.1". + # + !constructor [ + "index" + "instance" + ] + + # + # mandatory attributes that must be provided when the class is instantiated + # + !mandatory [ + "no_pm" + "uuid" + ] + + # + # immutable attributes cannot be modified in the object instance + # + !immutable [ + "uuid" + ] + + unique "instance" + } + + # + # Default attributes for micsel + # + type "effect" + payload_with_output_fmt 1 + + num_audio_formats 1 + #UUID: 32FE92C1-1E17-4FC2-9758-C7F3542E980A + uuid "c1:92:fe:32:17:1e:c2:4f:97:58:c7:f3:54:2e:98:0a" + no_pm "true" + core_id 0 + cpc 29000 + num_sink_pins 1 + num_source_pins 1 +} diff --git a/tools/topology/topology2/include/components/wov.conf b/tools/topology/topology2/include/components/wov.conf new file mode 100644 index 000000000000..093fa2756e40 --- /dev/null +++ b/tools/topology/topology2/include/components/wov.conf @@ -0,0 +1,108 @@ +# +# wov widget +# +# A wov widget. This is a generic class, which will be used for multiple types of wov +# widget, and the wov widgets can be distinguished from one another with different UUID's. +# All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.wov.N.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# Object.Widget.wov."N" { +# uuid $WOV_UUID +# } +# +# Where N is the unique instance number for the wov object within the same alsaconf node. + +Class.Widget."wov" { + # + # Pipeline ID for the wov object + # + DefineAttribute."index" {} + + # + # wov object instance + # + DefineAttribute."instance" {} + + DefineAttribute."cpc" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + DefineAttribute."num_audio_formats" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + #include common component definition + + + # + # wov component UUID + # + DefineAttribute."uuid" { + type "string" + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute."is_pages" { + # Token set reference name and type + token_ref "sof_tkn_comp.word" + } + + attributes { + # + # The wov widget name would be constructed using the index and + # instance attributes. For example: "wov.0.1". + # + !constructor [ + "index" + "instance" + ] + + # + # mandatory attributes that must be provided when the class is instantiated + # + !mandatory [ + "no_pm" + "uuid" + ] + + # + # immutable attributes cannot be modified in the object instance + # + !immutable [ + "type" + ] + + unique "instance" + } + + Object.Control.bytes."1" { + name wov_init + access [ + tlv_read + tlv_callback + ] + Object.Base.extops."extctl" { + get 258 + put 0 + } + max 4096 + IncludeByKey.WOV_UUID { + '1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67' "platform/intel/test-wov-init-payload.conf" + } + } + + # + # Default attributes for wov + # + type "effect" + num_audio_formats 1 + no_pm "true" + core_id 0 + num_sink_pins 1 + num_source_pins 0 +} diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf b/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf new file mode 100644 index 000000000000..ad4d90081aa7 --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf @@ -0,0 +1,135 @@ +# +# BE dai-kpb pipeline +# +# All attributes defined herein are namespaced by alsatplg to +# "Object.Pipeline.dai-kpb-be.N.attribute_name" +# +# Usage: dai-kpb-be pipeline object can be instantiated as: +# +# Object.Pipeline.dai-kpb-be."N" { +# direction "playback" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + + + +Class.Pipeline."dai-kpb-be" { + + DefineAttribute."index" {} + + + + attributes { + !constructor [ + "index" + ] + + # + # dai-kpb-be objects instantiated within the same alsaconf node must have + # unique pipeline_id attribute + # + unique "instance" + } + + Object.Widget { + copier."1" { + type dai_in + node_type $HDA_LINK_OUTPUT_CLASS + num_audio_formats 3 + # 32-bit 48KHz 2ch + Object.Base.audio_format.3 { + in_bit_depth 32 + in_valid_bit_depth 24 + out_bit_depth 32 + out_valid_bit_depth 24 + dma_buffer_size "$[$obs * 2]" + } + + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + dma_buffer_size "$[$obs * 2]" + } + # 32-bit 48KHz 4ch + Object.Base.audio_format.2 { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + dma_buffer_size "$[$obs * 2]" + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + } + + kpb."1" { + num_audio_formats 2 + Object.Base.audio_format.1 { + in_rate 16000 + out_rate 16000 + obs 128 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + in_channels 2 + out_channels 2 + out_bit_depth 32 + in_bit_depth 32 + in_valid_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.audio_format.2 { + in_rate 16000 + out_rate 16000 + obs 128 + in_ch_cfg $CHANNEL_CONFIG_4_POINT_0 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_4_POINT_0 + out_ch_map $CHANNEL_MAP_3_POINT_1 + in_channels 4 + out_channels 4 + out_bit_depth 32 + in_bit_depth 32 + in_valid_bit_depth 32 + out_valid_bit_depth 32 + } + } + + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + Object.Base { + route."1" { + source "copier.DMIC..1" + sink "kpb..1" + } + } + + time_domain "timer" + dynamic_pipeline 1 + channels 2 + channels_min 2 + channels_max 2 + rate 48000 + rate_min 48000 + rate_max 48000 +} diff --git a/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf b/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf new file mode 100644 index 000000000000..52f651f3f92c --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf @@ -0,0 +1,124 @@ +# +# wov detection pipeline +# +# A wov detection pipeline. All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.wov-detect.N.attribute_name". +# +# Usage: wov-detect pipeline object can be instantiated as: +# +# Object.Pipeline.wov-detect."N" { +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + + + + + + +Class.Pipeline."wov-detect" { + + DefineAttribute."index" {} + + + + attributes { + !constructor [ + "index" + ] + + !mandatory [ + "format" + ] + + !immutable [ + "direction" + ] + + # + # wov-detect objects instantiated within the same alsaconf node must have + # unique pipeline_id attribute + # + unique "instance" + } + + Object.Widget { + + # virtual widget is only used in driver to connect wov widget + # to the host copier. The virtual widget does not exist in + # the firmware. + virtual."virtual.detect_sink" { + type out_drv + } + + micsel."1" { + Object.Base.audio_format.1 { + in_rate 16000 + out_rate 16000 + in_channels 2 + out_channels 1 + in_ch_map CHANNEL_MAP_STEREO + in_ch_cfg 1 + out_ch_map CHANNEL_MAP_MONO + out_ch_cfg 0 + out_bit_depth 32 + in_bit_depth 32 + in_valid_bit_depth 32 + out_valid_bit_depth 32 + } + } + + wov."1" { + Object.Base.audio_format.1 { + in_rate 16000 + out_rate 16000 + in_channels 1 + out_channels 1 + in_ch_cfg 0 + in_ch_map CHANNEL_MAP_MONO + out_bit_depth 32 + in_bit_depth 32 + in_valid_bit_depth 32 + out_valid_bit_depth 32 + ibs 0x80 + obs 0x80 + } + } + + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + Object.Base { + route."1" { + source "micsel..1" + sink "wov..1" + } + + route."2" { + source "wov..1" + sink "virtual.detect_sink" + } + } + + direction "capture" + dynamic_pipeline 1 + time_domain "timer" + channels 2 + channels_min 2 + channels_max 2 + rate 16000 + rate_min 16000 + rate_max 16000 +} diff --git a/tools/topology/topology2/platform/intel/dmic-default.conf b/tools/topology/topology2/platform/intel/dmic-default.conf index 9ea2c5187e8f..543ae9e1b84d 100644 --- a/tools/topology/topology2/platform/intel/dmic-default.conf +++ b/tools/topology/topology2/platform/intel/dmic-default.conf @@ -19,4 +19,18 @@ Define { DMIC1_NAME dmic16k DMIC0_PCM_CAPS "Passthrough Capture 11" DMIC0_PIPELINE_STREAM_NAME "copier.DMIC.12.1" + DMIC1_HOST_PIPELINE_ID 18 + DMIC1_DAI_PIPELINE_ID 19 + WOV_PIPELINE_ID 20 + DMIC1_HOST_PIPELINE_SINK 'copier.host.18.1' + DMIC_WOV_DAI_PIPELINE_SRC 'copier.DMIC.19.1' + DMIC_WOV_DAI_PIPELINE_KPB 'kpb.19.1' + WOV_PIPELINE_SINK 'micsel.20.1' + WOV_PIPELINE_VIRTUAL 'virtual.detect_sink' + INCLUDE_WOV 'false' + # The UUID corresponds to the test detect component + WOV_UUID '1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67' + WOV_CPC '360000' + DMIC1_PCM_CAPS 'Passthrough Capture 18' + DMIC1_PIPELINE_STREAM_NAME 'copier.DMIC.19.1' } diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf index 77abca16a0ed..748dc2b19b03 100644 --- a/tools/topology/topology2/platform/intel/dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/dmic-generic.conf @@ -62,6 +62,10 @@ Object.Dai { } } +IncludeByKey.INCLUDE_WOV { + "true" "platform/intel/dmic-wov.conf" +} + Object.Pipeline { passthrough-capture.100 { format $FORMAT diff --git a/tools/topology/topology2/platform/intel/dmic-wov.conf b/tools/topology/topology2/platform/intel/dmic-wov.conf new file mode 100644 index 000000000000..80cc1023716c --- /dev/null +++ b/tools/topology/topology2/platform/intel/dmic-wov.conf @@ -0,0 +1,137 @@ +Object.Pipeline { + passthrough-capture.1 { + format $FORMAT + rate 16000 + rate_min 16000 + rate_max 16000 + index $DMIC1_HOST_PIPELINE_ID + Object.Widget.pipeline.1 { + stream_name $DMIC1_PIPELINE_STREAM_NAME + } + Object.Widget.copier.1 { + stream_name $DMIC1_PCM_CAPS + Object.Base.audio_format.1 { + in_rate 16000 + in_bit_depth 32 + in_valid_bit_depth 32 + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + dma_buffer_size "$[$ibs * 2]" + } + Object.Base.audio_format.2 { + in_rate 16000 + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_rate 16000 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + dma_buffer_size "$[$ibs * 2]" + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + } + } + + dai-kpb-be.12 { + direction "capture" + format $FORMAT + rate 16000 + rate_min 16000 + rate_max 16000 + index $DMIC1_DAI_PIPELINE_ID + + Object.Widget.copier.1 { + dai_index 1 + type "dai_out" + dai_type "DMIC" + copier_type "DMIC" + type dai_out + stream_name $DMIC1_NAME + node_type $DMIC_LINK_INPUT_CLASS + Object.Base.audio_format.1 { + in_rate 16000 + in_bit_depth 32 + in_valid_bit_depth 32 + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + dma_buffer_size "$[$ibs * 2]" + } + Object.Base.audio_format.2 { + in_rate 16000 + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + out_rate 16000 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + dma_buffer_size "$[$ibs * 2]" + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + } + + Object.Widget.kpb.1 { + Object.Base.src_pin_binding.1 { + src_pin_binding_wname $WOV_PIPELINE_SINK + } + Object.Base.src_pin_binding.2 { + src_pin_binding_wname $DMIC1_HOST_PIPELINE_SINK + } + Object.Base.src_pin_binding.3 { + src_pin_binding_wname "NotConnected" + } + } + } + wov-detect.1 { + index $WOV_PIPELINE_ID + format s32le + channels 2 + Object.Widget.wov.1 { + uuid $WOV_UUID + cpc $WOV_CPC + } + } +} + +Object.Base { + route.102 { + source $DMIC_WOV_DAI_PIPELINE_KPB + sink $DMIC1_HOST_PIPELINE_SINK + } + route.103 { + source $DMIC_WOV_DAI_PIPELINE_KPB + sink $WOV_PIPELINE_SINK + } + route.104 { + source $WOV_PIPELINE_VIRTUAL + sink $DMIC1_HOST_PIPELINE_SINK + } +} + +Object.PCM { + pcm.11 { + name "DMIC16k" + id 11 + direction "capture" + Object.Base.fe_dai."DMIC16k" {} + + Object.PCM.pcm_caps."capture" { + name $DMIC1_PCM_CAPS + # only 32-bit capture supported now + formats 'S32_LE' + channels_min $NUM_DMICS + channels_max $NUM_DMICS + rate_min 16000 + rate_max 16000 + } + } +} diff --git a/tools/topology/topology2/platform/intel/test-wov-init-payload.conf b/tools/topology/topology2/platform/intel/test-wov-init-payload.conf new file mode 100644 index 000000000000..48dece18d158 --- /dev/null +++ b/tools/topology/topology2/platform/intel/test-wov-init-payload.conf @@ -0,0 +1,10 @@ +# The first 32 bytes is: +# struct sof_ipc4_abi_hdr { +# __u32 size; +# __u32 abi; +# __u32 blob_type; +# __u32 param_id; +# __u32 reserved[3]; +# __u32 data[]; +# } __packed; +Object.Base.data."testwov_InitPayload" {bytes "0x53, 0x4f, 0x46, 0x34, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x34, 0x08, 0x00, 0x00"}