Pipeline#

Generated pipeline interface. Use the source and sink functions defined here to send samples to the generated DSP and receive processed samples back.

Functions

static inline void adsp_pipeline_source(adsp_pipeline_t *adsp, int32_t **data)#

Pass samples into the DSP pipeline.

These samples are sent by value to the other thread, therefore the data buffer can be reused immediately after this function returns.

Parameters:
  • adsp – The initialised pipeline.

  • data – An array of arrays of samples. The length of the array shall be the number of pipeline input channels. Each array contained within shall be contain a frame of samples large enough to pass to the stage that it is connected to.

static inline void adsp_pipeline_sink(adsp_pipeline_t *adsp, int32_t **data)#

Receive samples from the DSP pipeline.

Parameters:
  • adsp – The initialised pipeline.

  • data – An array of arrays that will be filled with processed samples from the pipeline. The length of the array shall be the number of pipeline input channels. Each array contained within shall be contain a frame of samples large enough to pass to the stage that it is connected to.

static inline bool adsp_pipeline_sink_nowait(adsp_pipeline_t *adsp, int32_t **data)#

Non-blocking receive from the pipeline. It is risky to use this API in an isochronous application as the sink thread can lose synchronisation with the source thread which can cause the source thread to block.

Parameters:
  • adsp – The initialised pipeline.

  • data – See adsp_pipeline_sink for details of same named param.

Return values:
  • true – The data buffer has been filled with new values from the pipeline.

  • false – The pipeline has not produced any more data. The data buffer was untouched.

struct adsp_pipeline_t#
#include <adsp_pipeline.h>

The DSP pipeline.

The generated pipeline will contain an init function that returns a pointer to one of these. It can be used to send data in and out of the pipeline, and also execute control commands.

Public Members

module_instance_t *modules#

Array of DSP stage states, must be used when calling one of the control functions.

size_t n_modules#

Number of modules in the adsp_pipeline_t::modules array.

Private Members

channel_t *p_in#
size_t n_in#
channel_t *p_out#
size_t n_out#
adsp_mux_t input_mux#
adsp_mux_t output_mux#