Sound Open Firmware
Loading...
Searching...
No Matches
static_pipeline.h File Reference

Declarative Static Audio Pipeline Engine API. More...

Include dependency graph for static_pipeline.h:

Go to the source code of this file.

Data Structures

struct  sof_static_caps
 Audio stream format and sample rate capability descriptor. More...
 
struct  sof_static_comp
 Declarative component descriptor. More...
 
struct  sof_static_module_ops
 Static pipeline module driver operations. More...
 
struct  sof_static_buffer
 Declarative intermediate audio buffer descriptor. More...
 
struct  sof_static_route
 Declarative graph route connecting an upstream component to a downstream component. More...
 
struct  sof_static_pcm
 Declarative PCM endpoint descriptor. More...
 
struct  sof_static_kcontrol
 Declarative static kcontrol descriptor. More...
 
struct  sof_static_pipeline_desc
 Declarative audio pipeline descriptor. More...
 
struct  sof_static_topology
 Top-level static audio topology descriptor. More...
 

Macros

#define SOF_STATIC_RATE_8K   SOF_RATE_8000
 Supported sample rate bitmasks for static capability negotiation.
 
#define SOF_STATIC_RATE_11K   SOF_RATE_11025
 11025 Hz
 
#define SOF_STATIC_RATE_12K   SOF_RATE_12000
 12000 Hz
 
#define SOF_STATIC_RATE_16K   SOF_RATE_16000
 16000 Hz
 
#define SOF_STATIC_RATE_22K   SOF_RATE_22050
 22050 Hz
 
#define SOF_STATIC_RATE_24K   SOF_RATE_24000
 24000 Hz
 
#define SOF_STATIC_RATE_32K   SOF_RATE_32000
 32000 Hz
 
#define SOF_STATIC_RATE_44K1   SOF_RATE_44100
 44100 Hz
 
#define SOF_STATIC_RATE_48K   SOF_RATE_48000
 48000 Hz
 
#define SOF_STATIC_RATE_64K   SOF_RATE_64000
 64000 Hz
 
#define SOF_STATIC_RATE_88K2   SOF_RATE_88200
 88200 Hz
 
#define SOF_STATIC_RATE_96K   SOF_RATE_96000
 96000 Hz
 
#define SOF_STATIC_RATE_176K4   SOF_RATE_176400
 176400 Hz
 
#define SOF_STATIC_RATE_192K   SOF_RATE_192000
 192000 Hz
 
#define SOF_STATIC_RATE_384K   (1 << 14)
 384000 Hz
 
#define SOF_STATIC_FMT_S16_LE   BIT(SOF_IPC_FRAME_S16_LE)
 Supported PCM frame format bitmasks (matching enum sof_ipc_frame)
 
#define SOF_STATIC_FMT_S24_4LE   BIT(SOF_IPC_FRAME_S24_4LE)
 
#define SOF_STATIC_FMT_S32_LE   BIT(SOF_IPC_FRAME_S32_LE)
 
#define SOF_STATIC_FMT_FLOAT   BIT(SOF_IPC_FRAME_FLOAT)
 
#define SOF_STATIC_FMT_S24_3LE   BIT(SOF_IPC_FRAME_S24_3LE)
 
#define SOF_STATIC_FMT_S24_4LE_MSB   BIT(SOF_IPC_FRAME_S24_4LE_MSB)
 
#define SOF_STATIC_FMT_U8   BIT(SOF_IPC_FRAME_U8)
 
#define SOF_STATIC_FMT_S16_4LE   BIT(SOF_IPC_FRAME_S16_4LE)
 
#define SOF_STATIC_FMT_A_LAW   BIT(SOF_IPC_FRAME_A_LAW)
 
#define SOF_STATIC_FMT_MU_LAW   BIT(SOF_IPC_FRAME_MU_LAW)
 
#define SOF_STATIC_RATE_MASK_ALL
 Mask covering all supported sample rates.
 
#define SOF_STATIC_FMT_MASK_ALL
 Mask covering all supported frame formats.
 
#define SOF_STATIC_CAPS(_fmt, _rate, _ch)
 Helper macro to initialize a static capability structure.
 
#define SOF_STATIC_COMP_MODULE(...)    { .type = SOF_STATIC_COMP_MODULE, __VA_ARGS__ }
 Declare a processing module component.
 
#define SOF_STATIC_COMP_HOST(...)    { .type = SOF_STATIC_COMP_HOST, .ep_type = SOF_STATIC_EP_USB_TERMINAL, __VA_ARGS__ }
 Declare a USB/Host streaming endpoint component.
 
#define SOF_STATIC_COMP_DAI(...)    { .type = SOF_STATIC_COMP_DAI, .ep_type = SOF_STATIC_EP_DAI, __VA_ARGS__ }
 Declare a hardware DAI endpoint component.
 
#define SOF_STATIC_MODULE(_id, _ppl, _name, _dir, _uuid, _fmt, _rate, _ch, _blob, _blob_sz)
 Generic constructor macro for an audio processing module component.
 
#define SOF_STATIC_MODULE_RATE_CONV(_id, _ppl, _name, _dir, _uuid, _fmt, _in_rate, _out_rate, _ch)
 Generic constructor macro for a sample rate converter component (SRC / ASRC).
 
#define SOF_STATIC_ENDPOINT_USB(_id, _ppl, _name, _dir, _fmt, _rate, _ch, _term_id)
 Simple constructor macro for a USB / UAC2 streaming endpoint.
 
#define SOF_STATIC_ENDPOINT_DAI(_id, _ppl, _name, _dir, _fmt, _rate, _ch, _type, _idx, _clk_fmt)
 Generic constructor macro for a hardware Digital Audio Interface (DAI) endpoint.
 
#define SOF_STATIC_ENDPOINT_DAI_CFG(_id, _ppl, _name, _dir, _fmt, _rate, _ch, _type, _idx, _clk_fmt, _cfg_fn)
 Constructor macro for a hardware DAI endpoint with custom platform configuration callback.
 
#define DECLARE_STATIC_MODULE_OPS(name, ops)
 Macro to automatically register static module operations at system startup.
 
#define SOF_STATIC_BUFFER(...)    { .flags = SOF_MEM_FLAG_DMA | SOF_MEM_FLAG_USER, .fmt = SOF_IPC_FRAME_INVALID, __VA_ARGS__ }
 Helper macro to declare an intermediate audio buffer with standard flags.
 
#define SOF_STATIC_ROUTE(...)    { __VA_ARGS__ }
 Helper macro to declare a connection route.
 
#define SOF_STATIC_PCM(...)    { __VA_ARGS__ }
 Helper macro to declare a static PCM stream.
 
#define SOF_STATIC_KCONTROL_VOLUME(...)    { .type = SOF_STATIC_CTRL_VOLUME, __VA_ARGS__ }
 Helper macro to declare a volume kcontrol.
 
#define SOF_STATIC_KCONTROL_SWITCH(...)    { .type = SOF_STATIC_CTRL_SWITCH, __VA_ARGS__ }
 Helper macro to declare a boolean switch/bypass kcontrol.
 
#define SOF_STATIC_KCONTROL_ENUM(...)    { .type = SOF_STATIC_CTRL_ENUM, __VA_ARGS__ }
 Helper macro to declare an enumeration selector kcontrol.
 
#define SOF_STATIC_KCONTROL_BINARY(...)    { .type = SOF_STATIC_CTRL_BINARY, __VA_ARGS__ }
 Helper macro to declare a binary configuration kcontrol.
 

Typedefs

typedef int(* sof_static_kcontrol_handler_fn) (const struct sof_static_kcontrol *ctl, int32_t val, void *priv)
 Custom kcontrol callback handler type.
 

Enumerations

enum  sof_static_comp_type { SOF_STATIC_COMP_MODULE = 0 , SOF_STATIC_COMP_HOST , SOF_STATIC_COMP_DAI }
 Category of a static pipeline component. More...
 
enum  sof_static_ep_type { SOF_STATIC_EP_NONE = 0 , SOF_STATIC_EP_USB_TERMINAL , SOF_STATIC_EP_DAI }
 Hardware endpoint binding type. More...
 
enum  sof_static_ctrl_type { SOF_STATIC_CTRL_VOLUME = 0 , SOF_STATIC_CTRL_SWITCH , SOF_STATIC_CTRL_ENUM , SOF_STATIC_CTRL_BINARY }
 Type of static kcontrol. More...
 

Functions

int sof_static_topology_init (const struct sof_static_topology *topo)
 Initialize and instantiate the static topology graph.
 
const struct sof_static_topology * sof_static_topology_get (void)
 Retrieve the currently active static topology descriptor.
 
struct pipeline * sof_static_pipeline_get (uint32_t pipeline_id)
 Retrieve a pipeline instance by its pipeline ID.
 
struct comp_dev * sof_static_comp_get (uint32_t comp_id)
 Retrieve a component device instance by its component ID.
 
struct comp_buffer * sof_static_buffer_get (uint32_t buffer_id)
 Retrieve an intermediate buffer instance by its buffer ID.
 
int sof_static_register_module_ops (struct sof_static_module_ops *ops)
 Register static module operations for an audio component.
 
const struct sof_static_module_ops * sof_static_find_module_ops (const struct sof_uuid *uuid)
 Find registered static module operations by component UUID.
 
void sof_static_init_base_cfg (struct ipc4_base_module_cfg *base_cfg, const struct sof_static_comp *cdesc, uint32_t period_us)
 Synthesize standard IPC4 base module configuration structure.
 
struct comp_dev * sof_static_module_create_default (const struct comp_driver *drv, struct comp_ipc_config *cfg, const struct sof_static_comp *cdesc, uint32_t period_us)
 Default fallback creation for standard IPC4 module adapters.
 
int sof_static_kcontrol_set (uint32_t ctrl_id, int32_t val)
 Set kcontrol value by control ID.
 
int sof_static_kcontrol_set_chan (uint32_t ctrl_id, uint32_t channel, int32_t val)
 Set kcontrol value for a specific audio channel.
 
int sof_static_kcontrol_set_binary (uint32_t ctrl_id, const void *data, size_t size)
 Set binary raw configuration blob on a static kcontrol by control ID.
 
int sof_static_kcontrol_get (uint32_t ctrl_id, int32_t *val)
 Retrieve cached kcontrol value by control ID.
 
int sof_static_kcontrol_find_by_name (const char *name)
 Find kcontrol ID by human-readable name.
 
int sof_static_kcontrol_set_by_uac2 (uint8_t entity_id, uint8_t channel, int32_t val, bool is_volume)
 Dispatch UAC2 feature unit control to registered kcontrols.
 
int sof_static_kcontrol_get_by_uac2 (uint8_t entity_id, uint8_t channel, int32_t *val, bool is_volume)
 Retrieve kcontrol value formatted for UAC2 feature unit response.
 
int sof_static_pipeline_trigger_by_uac2_term (uint8_t terminal_id, bool start)
 Trigger pipeline start or stop associated with a UAC2 terminal ID.
 
int sof_static_pipeline_start (uint32_t pipeline_id)
 Start a static pipeline by pipeline ID.
 
int sof_static_pipeline_stop (uint32_t pipeline_id)
 Stop a static pipeline by pipeline ID.
 
int sof_static_pipeline_trigger (uint32_t pipeline_id, bool start)
 Directly trigger a static pipeline start or stop by pipeline ID.
 
int sof_static_pipeline_set_sample_rate (uint32_t pipeline_id, uint32_t rate)
 Re-negotiate the stream sample rate for a specific static pipeline.
 
uint32_t sof_static_pipeline_get_sample_rate (uint32_t pipeline_id)
 Retrieve the current stream sample rate for a specific static pipeline.
 
int sof_static_set_sample_rate (uint32_t rate)
 Set global sample rate across active static pipelines.
 
uint32_t sof_static_get_sample_rate (void)
 Retrieve current primary sample rate.
 

Detailed Description

Declarative Static Audio Pipeline Engine API.

Author
Liam Girdwood liam..nosp@m.r.gi.nosp@m.rdwoo.nosp@m.d@li.nosp@m.nux.i.nosp@m.ntel.nosp@m..com