Skip to content

Add support for running decimator stage-2 in a separate thread for low power mic configurations.#284

Merged
shuchitak merged 1 commit intoxmos:vx4from
shuchitak:decimator_stg2_task
Mar 11, 2026
Merged

Add support for running decimator stage-2 in a separate thread for low power mic configurations.#284
shuchitak merged 1 commit intoxmos:vx4from
shuchitak:decimator_stg2_task

Conversation

@shuchitak
Copy link
Contributor

Enabled by defining -DMIC_ARRAY_CONFIG_ENABLE_DECIMATOR_STG2_TASK=1, in addition to -DMIC_ARRAY_CONFIG_LOW_POWER=1

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional low-power configuration that runs the second-stage decimator in a separate parallel task/thread, enabled via -DMIC_ARRAY_CONFIG_ENABLE_DECIMATOR_STG2_TASK=1 alongside -DMIC_ARRAY_CONFIG_LOW_POWER=1.

Changes:

  • Extends mic array task startup to optionally spawn an additional “decimator stage-2” task connected via a channel.
  • Adds a new decimator_stg2_task() API + implementation and wires it into the low-power decimator path.
  • Updates C/C++ task entry points and configuration defaults/docs for the new build-time option.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib_mic_array/src/mic_array_task_internal.hpp Updates internal task entrypoint signatures; adds stage-2 task starter declaration.
lib_mic_array/src/mic_array_task.cpp Routes low-power decimator startup to 1-stage vs 2-stage-parallel path; adds stage-2 task starter.
lib_mic_array/src/mic_array_task.c Spawns extra parallel job + channel when stage-2 task is enabled.
lib_mic_array/src/decimator_stg2_task.c Introduces the stage-2 decimator worker task implementation.
lib_mic_array/api/mic_array/mic_array_conf_default.h Documents low-power behavior and adds default for MIC_ARRAY_CONFIG_ENABLE_DECIMATOR_STG2_TASK.
lib_mic_array/api/mic_array/decimator_stg2_task.h New public header for decimator_stg2_task().
lib_mic_array/api/mic_array/cpp/MicArray.hpp Adds new low-power thread entrypoints and adjusts docs.
lib_mic_array/api/mic_array/cpp/Decimator.hpp Adds a channel-based parallel two-stage block processing method and c_decimator member.
lib_mic_array/api/mic_array.h Exposes the new stage-2 task header via the main public include.
Comments suppressed due to low confidence (1)

lib_mic_array/api/mic_array/cpp/MicArray.hpp:174

  • The Doxygen comment for ThreadEntry() appears corrupted ("froThsis function m ...") and will render incorrectly in generated docs. Please restore the intended sentence about collecting PDM blocks from PdmRx (which must have already been started) and remove the stray text.
       * This function does not return. It loops indefinitely, collecting blocks
       * of PDM data from @ref PdmRx (which must have already been started),
       * uses @ref Decimator to filter and decimate the sample stream to the

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…w power mic configurations.

Enabled by defining -DMIC_ARRAY_CONFIG_ENABLE_DECIMATOR_STG2_TASK=1, in addition to -DMIC_ARRAY_CONFIG_LOW_POWER=1
@shuchitak shuchitak force-pushed the decimator_stg2_task branch from f3a3f45 to ee9c01e Compare March 11, 2026 11:50
*
* This function does not return. It loops indefinitely, collecting blocks
* of PDM data from @ref PdmRx (which must have already been started),
* of PDM data froThsis function m @ref PdmRx (which mas long as OutputHandler.OutputSample () doesn't return ust have already been started),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@shuchitak shuchitak merged commit af9d317 into xmos:vx4 Mar 11, 2026
2 checks passed
@shuchitak shuchitak deleted the decimator_stg2_task branch March 11, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants