Sound Open Firmware
Loading...
Searching...
No Matches
Audio Component Infrastructure & Driver Model

Component driver interface, operations vtable, hardware abstraction, IPC binding, and state machines. More...

Data Structures

struct  bind_info
 Component module binding metadata and endpoint references. More...
 
struct  comp_ops
 Audio component operations table. More...
 
struct  comp_driver
 Audio component base driver "class". More...
 
struct  comp_driver_info
 Holds constant pointer to component driver. More...
 
struct  comp_ipc_config
 Audio component base configuration from IPC at creation. More...
 
struct  comp_perf_data
 Component performance measurement tracking data. More...
 
struct  comp_dev
 Audio component base device "class" used by all other component types. More...
 
struct  comp_copy_limits
 Struct for use with comp_get_copy_limits() function. More...
 
struct  comp_driver_list
 Holds list of registered components' drivers. More...
 
struct  get_attribute_remote_payload
 Remote payload for component get_attribute IPC4 message. More...
 

Macros

#define SOF_DRV_UID_NAME(drv)   (drv)->tctx->uuid_p
 
#define comp_dev_for_each_producer(_dev, _producer)
 Macro to iterate through component's list of producer buffers.
 
#define comp_dev_for_each_producer_safe(_dev, _producer, _next_producer)
 Safe macro to iterate through component's producer buffers allowing buffer deletion.
 
#define comp_dev_for_each_consumer(_dev, _consumer)
 Macro to iterate through component's list of consumer buffers.
 
#define comp_dev_for_each_consumer_safe(_dev, _consumer, _next_consumer)
 Safe macro to iterate through component's consumer buffers allowing buffer deletion.
 
#define comp_set_drvdata(c, data)    (c->priv_data = data)
 Assigns private data to component device.
 
#define comp_get_drvdata(c)    (c->priv_data)
 Retrieves driver private data from component device.
 
#define DECLARE_MODULE(init)
 
#define comp_buffer_list(comp, dir)
 Retrieves the component device buffer list based on direction.
 

Enumerations

enum  comp_endpoint_type { COMP_ENDPOINT_HOST , COMP_ENDPOINT_DAI , COMP_ENDPOINT_NODE }
 Type of endpoint this component is connected to in a pipeline. More...
 
enum  comp_copy_type { COMP_COPY_INVALID = -1 , COMP_COPY_NORMAL = 0 , COMP_COPY_BLOCKING , COMP_COPY_ONE_SHOT }
 Type of next dma copy mode, changed on runtime. More...
 
enum  bind_type { COMP_BIND_TYPE_SOURCE , COMP_BIND_TYPE_SINK }
 Component module binding endpoint type. More...
 

Functions

static struct comp_buffer * comp_dev_get_first_data_producer (struct comp_dev *component)
 Get a pointer to the first comp_buffer object providing data to the component.
 
static struct comp_buffer * comp_dev_get_next_data_producer (struct comp_dev *component, struct comp_buffer *producer)
 Get a pointer to the next comp_buffer object providing data to the component.
 
static struct comp_buffer * comp_dev_get_next_data_producer_safe (struct comp_dev *component, struct comp_buffer *producer)
 Safely get a pointer to the next comp_buffer object providing data to the component.
 
static struct comp_buffer * comp_dev_get_first_data_consumer (struct comp_dev *component)
 Get a pointer to the first comp_buffer object receiving data from the component.
 
static struct comp_buffer * comp_dev_get_next_data_consumer (struct comp_dev *component, struct comp_buffer *consumer)
 Get a pointer to the next comp_buffer object receiving data from the component.
 
static struct comp_buffer * comp_dev_get_next_data_consumer_safe (struct comp_dev *component, struct comp_buffer *consumer)
 Safely get a pointer to the next comp_buffer object receiving data from the component.
 
static uint32_t dev_comp_id (const struct comp_dev *dev)
 Retrieves Component ID from device.
 
static uint32_t dev_comp_pipe_id (const struct comp_dev *dev)
 Retrieves Component pipeline ID from device.
 
static enum sof_comp_type dev_comp_type (const struct comp_dev *dev)
 Retrieves component type from device.
 
static void comp_init (const struct comp_driver *drv, struct comp_dev *dev, size_t bytes)
 Initialize common part of a component device.
 
static struct comp_dev * comp_alloc (const struct comp_driver *drv, size_t bytes)
 Allocates memory for the component device and initializes common part.
 
static void comp_free_device (struct comp_dev *dev)
 Frees memory allocated for component device.
 
static struct processing_module * comp_mod (const struct comp_dev *dev)
 Module adapter associated with a component.
 
void sys_comp_dai_init (void)
 
void sys_comp_host_init (void)
 
void sys_comp_kpb_init (void)
 
void sys_comp_selector_init (void)
 
void sys_comp_module_aria_interface_init (void)
 
void sys_comp_module_asrc_interface_init (void)
 
void sys_comp_module_copier_interface_init (void)
 
void sys_comp_module_crossover_interface_init (void)
 
void sys_comp_module_dcblock_interface_init (void)
 
void sys_comp_module_demux_interface_init (void)
 
void sys_comp_module_dolby_dax_audio_processing_interface_init (void)
 
void sys_comp_module_drc_interface_init (void)
 
void sys_comp_module_dts_interface_init (void)
 
void sys_comp_module_eq_fir_interface_init (void)
 
void sys_comp_module_eq_iir_interface_init (void)
 
void sys_comp_module_gain_interface_init (void)
 
void sys_comp_module_google_rtc_audio_processing_interface_init (void)
 
void sys_comp_module_google_ctc_audio_processing_interface_init (void)
 
void sys_comp_module_igo_nr_interface_init (void)
 
void sys_comp_module_level_multiplier_interface_init (void)
 
void sys_comp_module_mfcc_interface_init (void)
 
void sys_comp_module_mixer_interface_init (void)
 
void sys_comp_module_mixin_interface_init (void)
 
void sys_comp_module_mixout_interface_init (void)
 
void sys_comp_module_multiband_drc_interface_init (void)
 
void sys_comp_module_mux_interface_init (void)
 
void sys_comp_module_nxp_eap_interface_init (void)
 
void sys_comp_module_phase_vocoder_interface_init (void)
 
void sys_comp_module_rtnr_interface_init (void)
 
void sys_comp_module_selector_interface_init (void)
 
void sys_comp_module_sound_dose_interface_init (void)
 
void sys_comp_module_src_interface_init (void)
 
void sys_comp_module_src_lite_interface_init (void)
 
void sys_comp_module_stft_process_interface_init (void)
 
void sys_comp_module_tdfb_interface_init (void)
 
void sys_comp_module_tone_interface_init (void)
 
void sys_comp_module_template_interface_init (void)
 
void sys_comp_module_tester_interface_init (void)
 
void sys_comp_module_volume_interface_init (void)
 
int comp_set_state (struct comp_dev *dev, int cmd)
 Component state transition handling.
 
static void component_set_nearest_period_frames (struct comp_dev *current, uint32_t rate)
 Set component period frames based on sample rate and period.
 
void comp_get_copy_limits (struct comp_buffer *source, struct comp_buffer *sink, struct comp_copy_limits *cl)
 Computes source to sink copy operation boundaries including maximum number of frames that can be transferred.
 
void comp_get_copy_limits_frame_aligned (const struct comp_buffer *source, const struct comp_buffer *sink, struct comp_copy_limits *cl)
 Computes source to sink copy operation boundaries including maximum number of frames aligned with requirement that can be transferred.
 
static int comp_get_state (const struct comp_dev *dev)
 Get component state.
 
static int comp_buffer_get_source_state (const struct comp_buffer *buffer)
 Provide state of a component connected to a buffer as a data provider.
 
static int comp_buffer_get_sink_state (const struct comp_buffer *buffer)
 Provide state of a component connected to a buffer as a data consumer.
 
int comp_verify_params (struct comp_dev *dev, uint32_t flag, struct sof_ipc_stream_params *params)
 Verify and set component audio parameters.
 
void comp_update_ibs_obs_cpc (struct comp_dev *dev)
 Update IBS, OBS, CPC, LL chunk size for component.
 
void comp_init_performance_data (struct comp_dev *dev)
 Initialize performance data fields if component has assigned slot in measurement window.
 
bool comp_update_performance_data (struct comp_dev *dev, uint32_t cycles_used)
 Update performance data entry for component and check for budget violation.
 
static int user_get_buffer_memory_region (const struct comp_driver *drv)
 Get memory region flag for component buffer allocations.
 
struct comp_dev * comp_new (struct sof_ipc_comp *comp)
 Instantiate a new component device from IPC3 descriptor.
 
static void comp_free (struct comp_dev *dev)
 Free component device via driver ops.
 
static int comp_params_remote (struct comp_dev *dev, struct sof_ipc_stream_params *params)
 Parameter initialization for component on remote core.
 
static int comp_params (struct comp_dev *dev, struct sof_ipc_stream_params *params)
 Configure audio stream parameters for component device.
 
static int comp_dai_get_hw_params (struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir)
 Retrieve DAI hardware parameters from component device.
 
static int comp_cmd (struct comp_dev *dev, int cmd, void *data, int max_data_size)
 Dispatch IPC3 command to component device.
 
static int comp_trigger_remote (struct comp_dev *dev, int cmd)
 Run trigger command on remote core for target component.
 
static int comp_trigger_local (struct comp_dev *dev, int cmd)
 Run trigger command locally on current core for target component.
 
static int comp_trigger (struct comp_dev *dev, int cmd)
 Dispatch trigger command to component (local or remote).
 
static int comp_prepare_remote (struct comp_dev *dev)
 Run prepare command on remote core for target component.
 
static int comp_prepare (struct comp_dev *dev)
 Prepare component device for streaming (local or remote).
 
int comp_copy (struct comp_dev *dev)
 Process and copy audio data through component.
 
static int comp_ipc4_get_attribute_remote (struct comp_dev *dev, uint32_t type, void *value)
 Retrieve component attribute from a remote core (IPC4).
 
static int comp_get_attribute (struct comp_dev *dev, uint32_t type, void *value)
 Get component attribute.
 
static int comp_set_attribute (struct comp_dev *dev, uint32_t type, void *value)
 Set component attribute.
 
static int comp_reset_remote (struct comp_dev *dev)
 Run reset command on remote core for target component.
 
static int comp_reset (struct comp_dev *dev)
 Reset component and free runtime resources (local or remote).
 
static int comp_dai_config (struct comp_dev *dev, struct ipc_config_dai *config, const void *spec_config)
 Configure DAI component.
 
static int comp_position (struct comp_dev *dev, struct sof_ipc_stream_posn *posn)
 Retrieve stream position from component.
 
void sys_comp_init (struct sof *sof)
 Allocates and initializes audio component list.
 
static int comp_is_single_pipeline (struct comp_dev *current, struct comp_dev *previous)
 Checks if two component devices belong to the same parent pipeline.
 
static int comp_is_active (struct comp_dev *current)
 Checks if component device is active.
 
static int comp_get_requested_state (int cmd)
 Returns component state based on requested command.
 
static int comp_get_endpoint_type (struct comp_dev *dev)
 Returns endpoint type of given component.
 
static bool comp_is_scheduling_source (struct comp_dev *dev)
 Called to check whether component schedules its pipeline.
 
static void comp_make_shared (struct comp_dev *dev)
 Called to mark component as shared between cores.
 
static struct comp_driver_list * comp_drivers_get (void)
 Get the global component driver list.
 
static int comp_ipc4_bind_remote (struct comp_dev *dev, const struct bind_info *bind_data)
 Send bind message to component on remote core (IPC4).
 
static int comp_bind (struct comp_dev *dev, const struct bind_info *bind_data)
 Bind component to downstream/upstream component or buffer.
 
static int comp_ipc4_unbind_remote (struct comp_dev *dev, const struct bind_info *unbind_data)
 Send unbind message to component on remote core (IPC4).
 
static int comp_unbind (struct comp_dev *dev, const struct bind_info *unbind_data)
 Unbind component from downstream/upstream component or buffer.
 
static uint64_t comp_get_total_data_processed (struct comp_dev *dev, uint32_t stream_no, bool input)
 Retrieve total data processed by component.
 
static bool comp_same_dir (struct comp_dev *comp, enum sof_ipc_stream_direction dir)
 Returns true if the component's pipeline matches the specified direction.
 

Standard Component Stream Commands

TODO: use IPC versions after 1.1

Most component stream commands match one-to-one IPC stream trigger commands. However we add two PRE_ and two POST_ commands to the set. They are issued internally without matching IPC commands. A single START IPC command is translated into a sequence of PRE_START and START component commands, etc. POST_* commands aren't used so far.

enum  {
  COMP_TRIGGER_STOP , COMP_TRIGGER_START , COMP_TRIGGER_PAUSE , COMP_TRIGGER_RELEASE ,
  COMP_TRIGGER_RESET , COMP_TRIGGER_PREPARE , COMP_TRIGGER_XRUN , COMP_TRIGGER_PRE_START ,
  COMP_TRIGGER_PRE_RELEASE , COMP_TRIGGER_POST_STOP , COMP_TRIGGER_POST_PAUSE , COMP_TRIGGER_NO_ACTION
}
 

Component registration

int comp_register (struct comp_driver_info *drv)
 Registers the component driver on the list of available components.
 
void comp_unregister (struct comp_driver_info *drv)
 Unregisters the component driver from the list of available components.
 
int comp_set_adapter_ops (const struct comp_driver *drv, const struct module_interface *ops)
 Set adapter ops for a dynamically created driver.
 
const struct comp_driver * comp_driver_find (const struct sof_uuid *uuid, uint32_t type)
 Look up a registered SOF component driver by UUID or driver type.
 

XRUN handling.

static void comp_underrun (struct comp_dev *dev, struct comp_buffer *source, uint32_t copy_bytes)
 Called by the component device when underrun is detected.
 
static void comp_overrun (struct comp_dev *dev, struct comp_buffer *sink, uint32_t copy_bytes)
 Called by component device when overrun is detected.
 

Audio Component States

#define COMP_STATE_NOT_EXIST   0
 Component does not exist.
 
#define COMP_STATE_INIT   1
 Component being initialised.
 
#define COMP_STATE_READY   2
 Component inactive, but ready.
 
#define COMP_STATE_SUSPEND   3
 Component suspended.
 
#define COMP_STATE_PREPARE   4
 Component prepared.
 
#define COMP_STATE_PAUSED   5
 Component paused.
 
#define COMP_STATE_ACTIVE   6
 Component active.
 
#define COMP_STATE_PRE_ACTIVE   7
 Component after early initialisation.
 

Standard Component Control Commands

"Value" commands are standard ones, known to the driver while "Data" commands are opaque blobs transferred by the driver.

TODO: see also: ref to ipc data structures for commands.

#define COMP_CMD_SET_VALUE   100
 Set value to component.
 
#define COMP_CMD_GET_VALUE   101
 Get value from component.
 
#define COMP_CMD_SET_DATA   102
 Set data to component.
 
#define COMP_CMD_GET_DATA   103
 Get data from component.
 

MMAP IPC status

#define COMP_CMD_IPC_MMAP_RPOS   200
 Host read position.
 
#define COMP_CMD_IPC_MMAP_PPOS   201
 DAI presentation position.
 
#define COMP_CMD_IPC_MMAP_VOL(chan)   (216 + chan)
 Volume.
 

Component status

#define COMP_STATUS_STATE_ALREADY_SET   1
 Comp set state status.
 

Component attribute types

#define COMP_ATTR_COPY_TYPE   0
 Comp copy type attribute.
 
#define COMP_ATTR_HOST_BUFFER   1
 Comp host buffer attribute.
 
#define COMP_ATTR_COPY_DIR   2
 Comp copy direction.
 
#define COMP_ATTR_VDMA_INDEX   3
 Comp index of the virtual DMA at the gateway.
 
#define COMP_ATTR_BASE_CONFIG   4
 Component base config.
 
#define COMP_ATTR_IPC4_CONFIG   5
 Component ipc4 set/get config.
 

Trace macros

#define trace_comp_drv_get_id(drv_p)   (-1)
 Retrieves id (-1 = undefined) from the component driver.
 
#define trace_comp_drv_get_subid(drv_p)   (-1)
 Retrieves subid (-1 = undefined) from the component driver.
 
#define trace_comp_get_id(comp_p)   ((comp_p)->ipc_config.pipeline_id)
 Retrieves id (pipe id) from the component device.
 
#define trace_comp_get_subid(comp_p)   ((comp_p)->ipc_config.id)
 Retrieves subid (comp id) from the component device.
 
#define trace_comp_drv_get_tr_ctx(drv_p)   ((drv_p)->tctx)
 Retrieves trace context from the component driver.
 
#define trace_comp_get_tr_ctx(comp_p)   (&(comp_p)->tctx)
 Retrieves trace context from the component device.
 
#define comp_cl_err(drv_p, __e, ...)
 Trace error message from component driver (no comp instance)
 
#define comp_cl_warn(drv_p, __e, ...)
 Trace warning message from component driver (no comp instance)
 
#define comp_cl_info(drv_p, __e, ...)
 Trace info message from component driver (no comp instance)
 
#define comp_cl_dbg(drv_p, __e, ...)
 Trace debug message from component driver (no comp instance)
 
#define comp_err(comp_p, __e, ...)
 Trace error message from component device.
 
#define comp_warn(comp_p, __e, ...)
 Trace warning message from component device.
 
#define comp_info(comp_p, __e, ...)
 Trace info message from component device.
 
#define comp_dbg(comp_p, __e, ...)
 Trace debug message from component device.
 
#define comp_perf_info(pcd, comp_p)
 
#define comp_perf_avg_info(pcd, comp_p)
 

Component processing domains

#define COMP_PROCESSING_DOMAIN_LL   0
 Low latency processing domain.
 
#define COMP_PROCESSING_DOMAIN_DP   1
 Data processing / worker thread domain.
 

Detailed Description

Component driver interface, operations vtable, hardware abstraction, IPC binding, and state machines.

Macro Definition Documentation

◆ COMP_ATTR_BASE_CONFIG

#define COMP_ATTR_BASE_CONFIG   4

Component base config.

◆ COMP_ATTR_COPY_DIR

#define COMP_ATTR_COPY_DIR   2

Comp copy direction.

◆ COMP_ATTR_COPY_TYPE

#define COMP_ATTR_COPY_TYPE   0

Comp copy type attribute.

◆ COMP_ATTR_HOST_BUFFER

#define COMP_ATTR_HOST_BUFFER   1

Comp host buffer attribute.

◆ COMP_ATTR_IPC4_CONFIG

#define COMP_ATTR_IPC4_CONFIG   5

Component ipc4 set/get config.

◆ COMP_ATTR_VDMA_INDEX

#define COMP_ATTR_VDMA_INDEX   3

Comp index of the virtual DMA at the gateway.

◆ comp_buffer_list

#define comp_buffer_list (   comp,
  dir 
)
Value:
((dir) == PPL_DIR_DOWNSTREAM ? &(comp)->bsink_list : \
&(comp)->bsource_list)
#define PPL_DIR_DOWNSTREAM
Downstream playback/processing direction.
Definition pipeline.h:65

Retrieves the component device buffer list based on direction.

Parameters
[in]compComponent device pointer.
[in]dirDirection (PPL_DIR_DOWNSTREAM or PPL_DIR_UPSTREAM).
Returns
Pointer to sink list or source list.

◆ comp_cl_dbg

#define comp_cl_dbg (   drv_p,
  __e,
  ... 
)
Value:
drv_p, \
__e, ##__VA_ARGS__)
#define trace_comp_drv_get_subid(drv_p)
Retrieves subid (-1 = undefined) from the component driver.
Definition component.h:135
#define trace_comp_drv_get_tr_ctx(drv_p)
Retrieves trace context from the component driver.
Definition component.h:175
#define trace_comp_drv_get_id(drv_p)
Retrieves id (-1 = undefined) from the component driver.
Definition component.h:132
#define trace_dev_dbg(get_ctx_m, get_id_m, get_subid_m, dev, fmt,...)
Trace from a device on dbg level.
Definition trace-soflogger.h:411

Trace debug message from component driver (no comp instance)

◆ comp_cl_err

#define comp_cl_err (   drv_p,
  __e,
  ... 
)
Value:
drv_p, \
__e, ##__VA_ARGS__)
#define trace_dev_err(get_ctx_m, get_id_m, get_subid_m, dev, fmt,...)
Trace from a device on err level.
Definition trace-soflogger.h:393

Trace error message from component driver (no comp instance)

◆ comp_cl_info

#define comp_cl_info (   drv_p,
  __e,
  ... 
)
Value:
drv_p, \
__e, ##__VA_ARGS__)
#define trace_dev_info(get_ctx_m, get_id_m, get_subid_m, dev, fmt,...)
Trace from a device on info level.
Definition trace-soflogger.h:405

Trace info message from component driver (no comp instance)

◆ comp_cl_warn

#define comp_cl_warn (   drv_p,
  __e,
  ... 
)
Value:
drv_p, \
__e, ##__VA_ARGS__)
#define trace_dev_warn(get_ctx_m, get_id_m, get_subid_m, dev, fmt,...)
Trace from a device on warning level.
Definition trace-soflogger.h:399

Trace warning message from component driver (no comp instance)

◆ COMP_CMD_GET_DATA

#define COMP_CMD_GET_DATA   103

Get data from component.

◆ COMP_CMD_GET_VALUE

#define COMP_CMD_GET_VALUE   101

Get value from component.

◆ COMP_CMD_IPC_MMAP_PPOS

#define COMP_CMD_IPC_MMAP_PPOS   201

DAI presentation position.

◆ COMP_CMD_IPC_MMAP_RPOS

#define COMP_CMD_IPC_MMAP_RPOS   200

Host read position.

◆ COMP_CMD_IPC_MMAP_VOL

#define COMP_CMD_IPC_MMAP_VOL (   chan)    (216 + chan)

Volume.

◆ COMP_CMD_SET_DATA

#define COMP_CMD_SET_DATA   102

Set data to component.

◆ COMP_CMD_SET_VALUE

#define COMP_CMD_SET_VALUE   100

Set value to component.

◆ comp_dbg

#define comp_dbg (   comp_p,
  __e,
  ... 
)
Value:
trace_comp_get_subid, comp_p, __e, ##__VA_ARGS__)
#define trace_comp_get_id(comp_p)
Retrieves id (pipe id) from the component device.
Definition component.h:138
#define trace_comp_get_subid(comp_p)
Retrieves subid (comp id) from the component device.
Definition component.h:141
#define trace_comp_get_tr_ctx(comp_p)
Retrieves trace context from the component device.
Definition component.h:178

Trace debug message from component device.

◆ comp_dev_for_each_consumer

#define comp_dev_for_each_consumer (   _dev,
  _consumer 
)
Value:
for (_consumer = comp_dev_get_first_data_consumer(_dev); \
_consumer != NULL; \
_consumer = comp_dev_get_next_data_consumer(_dev, _consumer)) \
static struct comp_buffer * comp_dev_get_next_data_consumer(struct comp_dev *component, struct comp_buffer *consumer)
Get a pointer to the next comp_buffer object receiving data from the component.
Definition component.h:688
static struct comp_buffer * comp_dev_get_first_data_consumer(struct comp_dev *component)
Get a pointer to the first comp_buffer object receiving data from the component.
Definition component.h:676

Macro to iterate through component's list of consumer buffers.

Parameters
[in]_devTarget component device.
[out]_consumerBuffer pointer iterator variable.

◆ comp_dev_for_each_consumer_safe

#define comp_dev_for_each_consumer_safe (   _dev,
  _consumer,
  _next_consumer 
)
Value:
for (_consumer = comp_dev_get_first_data_consumer(_dev), \
_next_consumer = comp_dev_get_next_data_consumer_safe(_dev, _consumer); \
_consumer != NULL; \
_consumer = _next_consumer, \
_next_consumer = comp_dev_get_next_data_consumer_safe(_dev, _consumer))
static struct comp_buffer * comp_dev_get_next_data_consumer_safe(struct comp_dev *component, struct comp_buffer *consumer)
Safely get a pointer to the next comp_buffer object receiving data from the component.
Definition component.h:701

Safe macro to iterate through component's consumer buffers allowing buffer deletion.

Parameters
[in]_devTarget component device.
[out]_consumerBuffer pointer iterator variable.
[out]_next_consumerStorage pointer for next buffer.

◆ comp_dev_for_each_producer

#define comp_dev_for_each_producer (   _dev,
  _producer 
)
Value:
for (_producer = comp_dev_get_first_data_producer(_dev); \
_producer != NULL; \
_producer = comp_dev_get_next_data_producer(_dev, _producer))
static struct comp_buffer * comp_dev_get_first_data_producer(struct comp_dev *component)
Get a pointer to the first comp_buffer object providing data to the component.
Definition component.h:640
static struct comp_buffer * comp_dev_get_next_data_producer(struct comp_dev *component, struct comp_buffer *producer)
Get a pointer to the next comp_buffer object providing data to the component.
Definition component.h:652

Macro to iterate through component's list of producer buffers.

Parameters
[in]_devTarget component device.
[out]_producerBuffer pointer iterator variable.

◆ comp_dev_for_each_producer_safe

#define comp_dev_for_each_producer_safe (   _dev,
  _producer,
  _next_producer 
)
Value:
for (_producer = comp_dev_get_first_data_producer(_dev), \
_next_producer = comp_dev_get_next_data_producer_safe(_dev, _producer); \
_producer != NULL; \
_producer = _next_producer, \
_next_producer = comp_dev_get_next_data_producer_safe(_dev, _producer))
static struct comp_buffer * comp_dev_get_next_data_producer_safe(struct comp_dev *component, struct comp_buffer *producer)
Safely get a pointer to the next comp_buffer object providing data to the component.
Definition component.h:665

Safe macro to iterate through component's producer buffers allowing buffer deletion.

Parameters
[in]_devTarget component device.
[out]_producerBuffer pointer iterator variable.
[out]_next_producerStorage pointer for next buffer.

◆ comp_err

#define comp_err (   comp_p,
  __e,
  ... 
)
Value:

Trace error message from component device.

◆ comp_get_drvdata

#define comp_get_drvdata (   c)     (c->priv_data)

Retrieves driver private data from component device.

Parameters
[in]cComponent device.
Returns
Private data pointer.

◆ comp_info

#define comp_info (   comp_p,
  __e,
  ... 
)
Value:

Trace info message from component device.

◆ comp_perf_avg_info

#define comp_perf_avg_info (   pcd,
  comp_p 
)
Value:
comp_info(comp_p, "perf comp_copy samples %u period %u cpu avg %u peak %u %u",\
(uint32_t)((comp_p)->frames), \
(uint32_t)((comp_p)->period), \
(uint32_t)((pcd)->cpu_delta_sum), \
(uint32_t)((pcd)->cpu_delta_peak), \
(uint32_t)((pcd)->peak_mcps_period_cnt))
#define comp_info(comp_p, __e,...)
Trace info message from component device.
Definition component.h:227

◆ comp_perf_info

#define comp_perf_info (   pcd,
  comp_p 
)
Value:
comp_info(comp_p, "perf comp_copy peak plat %u cpu %u", \
(uint32_t)((pcd)->plat_delta_peak), \
(uint32_t)((pcd)->cpu_delta_peak))

◆ COMP_PROCESSING_DOMAIN_DP

#define COMP_PROCESSING_DOMAIN_DP   1

Data processing / worker thread domain.

◆ COMP_PROCESSING_DOMAIN_LL

#define COMP_PROCESSING_DOMAIN_LL   0

Low latency processing domain.

◆ comp_set_drvdata

#define comp_set_drvdata (   c,
  data 
)     (c->priv_data = data)

Assigns private data to component device.

Parameters
[in,out]cComponent device.
[in]dataPrivate data pointer.

◆ COMP_STATE_ACTIVE

#define COMP_STATE_ACTIVE   6

Component active.

◆ COMP_STATE_INIT

#define COMP_STATE_INIT   1

Component being initialised.

◆ COMP_STATE_NOT_EXIST

#define COMP_STATE_NOT_EXIST   0

Component does not exist.

◆ COMP_STATE_PAUSED

#define COMP_STATE_PAUSED   5

Component paused.

◆ COMP_STATE_PRE_ACTIVE

#define COMP_STATE_PRE_ACTIVE   7

Component after early initialisation.

◆ COMP_STATE_PREPARE

#define COMP_STATE_PREPARE   4

Component prepared.

◆ COMP_STATE_READY

#define COMP_STATE_READY   2

Component inactive, but ready.

◆ COMP_STATE_SUSPEND

#define COMP_STATE_SUSPEND   3

Component suspended.

◆ COMP_STATUS_STATE_ALREADY_SET

#define COMP_STATUS_STATE_ALREADY_SET   1

Comp set state status.

◆ comp_warn

#define comp_warn (   comp_p,
  __e,
  ... 
)
Value:

Trace warning message from component device.

◆ DECLARE_MODULE

#define DECLARE_MODULE (   init)

◆ SOF_DRV_UID_NAME

#define SOF_DRV_UID_NAME (   drv)    (drv)->tctx->uuid_p

◆ trace_comp_drv_get_id

#define trace_comp_drv_get_id (   drv_p)    (-1)

Retrieves id (-1 = undefined) from the component driver.

◆ trace_comp_drv_get_subid

#define trace_comp_drv_get_subid (   drv_p)    (-1)

Retrieves subid (-1 = undefined) from the component driver.

◆ trace_comp_drv_get_tr_ctx

#define trace_comp_drv_get_tr_ctx (   drv_p)    ((drv_p)->tctx)

Retrieves trace context from the component driver.

◆ trace_comp_get_id

#define trace_comp_get_id (   comp_p)    ((comp_p)->ipc_config.pipeline_id)

Retrieves id (pipe id) from the component device.

◆ trace_comp_get_subid

#define trace_comp_get_subid (   comp_p)    ((comp_p)->ipc_config.id)

Retrieves subid (comp id) from the component device.

◆ trace_comp_get_tr_ctx

#define trace_comp_get_tr_ctx (   comp_p)    (&(comp_p)->tctx)

Retrieves trace context from the component device.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
COMP_TRIGGER_STOP 

Stop component stream.

COMP_TRIGGER_START 

Start component stream.

COMP_TRIGGER_PAUSE 

Pause the component stream.

COMP_TRIGGER_RELEASE 

Release paused component stream.

COMP_TRIGGER_RESET 

Reset component.

COMP_TRIGGER_PREPARE 

Prepare component.

COMP_TRIGGER_XRUN 

XRUN component.

COMP_TRIGGER_PRE_START 

Prepare to start component stream.

COMP_TRIGGER_PRE_RELEASE 

Prepare to release paused component stream.

COMP_TRIGGER_POST_STOP 

Finalize stop component stream.

COMP_TRIGGER_POST_PAUSE 

Finalize pause component stream.

COMP_TRIGGER_NO_ACTION 

No action required.

◆ bind_type

enum bind_type

Component module binding endpoint type.

Enumerator
COMP_BIND_TYPE_SOURCE 

Bind to a data source.

COMP_BIND_TYPE_SINK 

Bind to a data sink.

◆ comp_copy_type

Type of next dma copy mode, changed on runtime.

Supported by host as COMP_ATTR_COPY_TYPE parameter to comp_set_attribute().

Enumerator
COMP_COPY_INVALID 

Invalid.

COMP_COPY_NORMAL 

Normal.

COMP_COPY_BLOCKING 

Blocking.

COMP_COPY_ONE_SHOT 

One-shot.

◆ comp_endpoint_type

Type of endpoint this component is connected to in a pipeline.

Enumerator
COMP_ENDPOINT_HOST 

Connected to host dma.

COMP_ENDPOINT_DAI 

Connected to dai dma.

COMP_ENDPOINT_NODE 

No dma connection.

Function Documentation

◆ comp_alloc()

static struct comp_dev * comp_alloc ( const struct comp_driver *  drv,
size_t  bytes 
)
inlinestatic

Allocates memory for the component device and initializes common part.

Parameters
[in]drvParent component driver.
[in]bytesSize of the component device in bytes.
Returns
Pointer to the allocated component device, or NULL on failure.

◆ comp_bind()

static int comp_bind ( struct comp_dev *  dev,
const struct bind_info *  bind_data 
)
inlinestatic

Bind component to downstream/upstream component or buffer.

Parameters
[in,out]devComponent device.
[in]bind_dataBinding information.
Returns
0 on success, negative error code on failure.

◆ comp_buffer_get_sink_state()

static int comp_buffer_get_sink_state ( const struct comp_buffer *  buffer)
inlinestatic

Provide state of a component connected to a buffer as a data consumer.

Parameters
[in]bufferInterconnect buffer to be checked.
Return values
COMP_STATE_NOT_EXISTIf there's no connected component.
Returns
State of the component.

◆ comp_buffer_get_source_state()

static int comp_buffer_get_source_state ( const struct comp_buffer *  buffer)
inlinestatic

Provide state of a component connected to a buffer as a data provider.

Parameters
[in]bufferInterconnect buffer to be checked.
Return values
COMP_STATE_NOT_EXISTIf there's no connected component.
Returns
State of the component.

◆ comp_cmd()

static int comp_cmd ( struct comp_dev *  dev,
int  cmd,
void *  data,
int  max_data_size 
)
inlinestatic

Dispatch IPC3 command to component device.

Parameters
[in,out]devComponent device.
[in]cmdCommand code.
[in,out]dataCommand data buffer.
[in]max_data_sizeMaximum acceptable size of returned data.
Returns
0 on success, negative error code on failure.

◆ comp_copy()

int comp_copy ( struct comp_dev *  dev)

Process and copy audio data through component.

Parameters
[in,out]devComponent device.
Returns
Number of copied frames, or negative error code on failure.

◆ comp_dai_config()

static int comp_dai_config ( struct comp_dev *  dev,
struct ipc_config_dai *  config,
const void *  spec_config 
)
inlinestatic

Configure DAI component.

Parameters
[in,out]devComponent device.
[in]configIPC DAI configuration.
[in]spec_configSpec-specific configuration data.
Returns
0 on success, negative error code on failure.

◆ comp_dai_get_hw_params()

static int comp_dai_get_hw_params ( struct comp_dev *  dev,
struct sof_ipc_stream_params *  params,
int  dir 
)
inlinestatic

Retrieve DAI hardware parameters from component device.

Parameters
[in]devComponent device.
[out]paramsStream parameters to populate.
[in]dirStream direction (enum sof_ipc_stream_direction).
Returns
0 on success, negative error code on failure.

◆ comp_dev_get_first_data_consumer()

static struct comp_buffer * comp_dev_get_first_data_consumer ( struct comp_dev *  component)
inlinestatic

Get a pointer to the first comp_buffer object receiving data from the component.

Parameters
[in]componentTarget component device.
Returns
Pointer to first consumer comp_buffer, or NULL if none.

◆ comp_dev_get_first_data_producer()

static struct comp_buffer * comp_dev_get_first_data_producer ( struct comp_dev *  component)
inlinestatic

Get a pointer to the first comp_buffer object providing data to the component.

Parameters
[in]componentTarget component device.
Returns
Pointer to first producer comp_buffer, or NULL if none.

◆ comp_dev_get_next_data_consumer()

static struct comp_buffer * comp_dev_get_next_data_consumer ( struct comp_dev *  component,
struct comp_buffer *  consumer 
)
inlinestatic

Get a pointer to the next comp_buffer object receiving data from the component.

Parameters
[in]componentTarget component device.
[in]consumerCurrent consumer buffer.
Returns
Pointer to next consumer comp_buffer, or NULL if none.

◆ comp_dev_get_next_data_consumer_safe()

static struct comp_buffer * comp_dev_get_next_data_consumer_safe ( struct comp_dev *  component,
struct comp_buffer *  consumer 
)
inlinestatic

Safely get a pointer to the next comp_buffer object receiving data from the component.

Parameters
[in]componentTarget component device.
[in]consumerCurrent consumer buffer, or NULL.
Returns
Pointer to next consumer comp_buffer, or NULL if none.

◆ comp_dev_get_next_data_producer()

static struct comp_buffer * comp_dev_get_next_data_producer ( struct comp_dev *  component,
struct comp_buffer *  producer 
)
inlinestatic

Get a pointer to the next comp_buffer object providing data to the component.

Parameters
[in]componentTarget component device.
[in]producerCurrent producer buffer.
Returns
Pointer to next producer comp_buffer, or NULL if none.

◆ comp_dev_get_next_data_producer_safe()

static struct comp_buffer * comp_dev_get_next_data_producer_safe ( struct comp_dev *  component,
struct comp_buffer *  producer 
)
inlinestatic

Safely get a pointer to the next comp_buffer object providing data to the component.

Parameters
[in]componentTarget component device.
[in]producerCurrent producer buffer, or NULL.
Returns
Pointer to next producer comp_buffer, or NULL if none.

◆ comp_driver_find()

const struct comp_driver * comp_driver_find ( const struct sof_uuid *  uuid,
uint32_t  type 
)

Look up a registered SOF component driver by UUID or driver type.

Scans the global SOF component driver registry to match either a specific 128-bit UUID (for audio processing modules) or a generic driver type (for host or DAI endpoints).

Parameters
uuidComponent UUID to match, or NULL to match by type.
typeSOF component driver type (SOF_COMP_HOST, SOF_COMP_DAI, etc.).
Returns
Pointer to matched comp_driver, or NULL if not registered.

◆ comp_drivers_get()

static struct comp_driver_list * comp_drivers_get ( void  )
inlinestatic

Get the global component driver list.

Returns
Pointer to the component driver list.

◆ comp_free()

static void comp_free ( struct comp_dev *  dev)
inlinestatic

Free component device via driver ops.

Parameters
[in,out]devComponent device to free.

◆ comp_free_device()

static void comp_free_device ( struct comp_dev *  dev)
inlinestatic

Frees memory allocated for component device.

This is a counterpart to comp_alloc() and not to be confused with comp_free().

Parameters
[in,out]devPointer to the component device to free.

◆ comp_get_attribute()

static int comp_get_attribute ( struct comp_dev *  dev,
uint32_t  type,
void *  value 
)
inlinestatic

Get component attribute.

Parameters
[in,out]devComponent device.
[in]typeAttribute type (COMP_ATTR_*).
[out]valuePointer to buffer where attribute value is returned.
Returns
0 on success, negative error code on failure.

◆ comp_get_copy_limits()

void comp_get_copy_limits ( struct comp_buffer *  source,
struct comp_buffer *  sink,
struct comp_copy_limits *  cl 
)

Computes source to sink copy operation boundaries including maximum number of frames that can be transferred.

Parameters
[in]sourceSource buffer.
[in]sinkSink buffer.
[out]clCurrent copy limits.

◆ comp_get_copy_limits_frame_aligned()

void comp_get_copy_limits_frame_aligned ( const struct comp_buffer *  source,
const struct comp_buffer *  sink,
struct comp_copy_limits *  cl 
)

Computes source to sink copy operation boundaries including maximum number of frames aligned with requirement that can be transferred.

Parameters
[in]sourceBuffer of source.
[in]sinkBuffer of sink.
[out]clCurrent copy limits.

◆ comp_get_endpoint_type()

static int comp_get_endpoint_type ( struct comp_dev *  dev)
inlinestatic

Returns endpoint type of given component.

Parameters
[in]devComponent device.
Returns
Endpoint type, one of comp_endpoint_type (COMP_ENDPOINT_*).

◆ comp_get_requested_state()

static int comp_get_requested_state ( int  cmd)
inlinestatic

Returns component state based on requested command.

Parameters
[in]cmdRequest command (COMP_TRIGGER_*).
Returns
Component state (COMP_STATE_*).

◆ comp_get_state()

static int comp_get_state ( const struct comp_dev *  dev)
inlinestatic

Get component state.

Parameters
[in]devComponent from which user wants to read status.
Return values
COMP_STATE_NOT_EXISTIf there's no connected component.
Returns
State of the component (COMP_STATE_*).

◆ comp_get_total_data_processed()

static uint64_t comp_get_total_data_processed ( struct comp_dev *  dev,
uint32_t  stream_no,
bool  input 
)
inlinestatic

Retrieve total data processed by component.

Parameters
[in]devComponent device.
[in]stream_noStream index.
[in]inputTrue for input data, false for output data.
Returns
Total processed data in bytes.

◆ comp_init()

static void comp_init ( const struct comp_driver *  drv,
struct comp_dev *  dev,
size_t  bytes 
)
inlinestatic

Initialize common part of a component device.

Parameters
[in]drvParent component driver.
[in,out]devComponent device.
[in]bytesSize of the component device in bytes.

◆ comp_init_performance_data()

void comp_init_performance_data ( struct comp_dev *  dev)

Initialize performance data fields if component has assigned slot in measurement window.

Parameters
[in,out]devComponent to init.

◆ comp_ipc4_bind_remote()

static int comp_ipc4_bind_remote ( struct comp_dev *  dev,
const struct bind_info *  bind_data 
)
inlinestatic

Send bind message to component on remote core (IPC4).

Parameters
[in,out]devComponent device.
[in]bind_dataBinding information.
Returns
0 on success, negative error code on failure.

◆ comp_ipc4_get_attribute_remote()

static int comp_ipc4_get_attribute_remote ( struct comp_dev *  dev,
uint32_t  type,
void *  value 
)
inlinestatic

Retrieve component attribute from a remote core (IPC4).

Parameters
[in,out]devComponent device.
[in]typeAttribute type (COMP_ATTR_*).
[out]valuePointer to buffer where attribute value is copied.
Returns
0 on success, negative error code on failure.

◆ comp_ipc4_unbind_remote()

static int comp_ipc4_unbind_remote ( struct comp_dev *  dev,
const struct bind_info *  unbind_data 
)
inlinestatic

Send unbind message to component on remote core (IPC4).

Parameters
[in,out]devComponent device.
[in]unbind_dataUnbinding information.
Returns
0 on success, negative error code on failure.

◆ comp_is_active()

static int comp_is_active ( struct comp_dev *  current)
inlinestatic

Checks if component device is active.

Parameters
[in]currentComponent device.
Returns
1 if active, 0 otherwise.

◆ comp_is_scheduling_source()

static bool comp_is_scheduling_source ( struct comp_dev *  dev)
inlinestatic

Called to check whether component schedules its pipeline.

Parameters
[in]devComponent device.
Returns
True if this is scheduling component, false otherwise.

◆ comp_is_single_pipeline()

static int comp_is_single_pipeline ( struct comp_dev *  current,
struct comp_dev *  previous 
)
inlinestatic

Checks if two component devices belong to the same parent pipeline.

Parameters
[in]currentComponent device.
[in]previousAnother component device.
Returns
1 if children of the same pipeline, 0 otherwise.

◆ comp_make_shared()

static void comp_make_shared ( struct comp_dev *  dev)
inlinestatic

Called to mark component as shared between cores.

Parameters
[in,out]devComponent device.

◆ comp_mod()

static struct processing_module * comp_mod ( const struct comp_dev *  dev)
inlinestatic

Module adapter associated with a component.

Parameters
[in]devComponent device.
Returns
Pointer to associated processing module, or NULL if none.

◆ comp_new()

struct comp_dev * comp_new ( struct sof_ipc_comp *  comp)

Instantiate a new component device from IPC3 descriptor.

Parameters
[in]compIPC3 component descriptor.
Returns
Pointer to new component device, or NULL on failure.

◆ comp_overrun()

static void comp_overrun ( struct comp_dev *  dev,
struct comp_buffer *  sink,
uint32_t  copy_bytes 
)
inlinestatic

Called by component device when overrun is detected.

Parameters
[in,out]devComponent device.
[in]sinkSink buffer.
[in]copy_bytesRequested size of free space in bytes.

◆ comp_params()

static int comp_params ( struct comp_dev *  dev,
struct sof_ipc_stream_params *  params 
)
inlinestatic

Configure audio stream parameters for component device.

Parameters
[in,out]devComponent device.
[in,out]paramsAudio (PCM) stream parameters to configure.
Returns
0 on success, negative error code on failure.

◆ comp_params_remote()

static int comp_params_remote ( struct comp_dev *  dev,
struct sof_ipc_stream_params *  params 
)
inlinestatic

Parameter initialization for component on remote core.

Parameters
[in,out]devComponent device.
[in]paramsStream parameters to be set.
Returns
0 if succeeded, error code otherwise.

◆ comp_position()

static int comp_position ( struct comp_dev *  dev,
struct sof_ipc_stream_posn *  posn 
)
inlinestatic

Retrieve stream position from component.

Parameters
[in,out]devComponent device.
[out]posnStream position structure to populate.
Returns
0 on success, negative error code on failure.

◆ comp_prepare()

static int comp_prepare ( struct comp_dev *  dev)
inlinestatic

Prepare component device for streaming (local or remote).

Parameters
[in,out]devComponent device.
Returns
0 on success, negative error code on failure.

◆ comp_prepare_remote()

static int comp_prepare_remote ( struct comp_dev *  dev)
inlinestatic

Run prepare command on remote core for target component.

Parameters
[in,out]devComponent device.
Returns
0 on success, negative error code on failure.

◆ comp_register()

int comp_register ( struct comp_driver_info *  drv)

Registers the component driver on the list of available components.

Parameters
[in,out]drvComponent driver to be registered.
Returns
0 if succeeded, error code otherwise.

◆ comp_reset()

static int comp_reset ( struct comp_dev *  dev)
inlinestatic

Reset component and free runtime resources (local or remote).

Parameters
[in,out]devComponent device.
Returns
0 on success, negative error code on failure.

◆ comp_reset_remote()

static int comp_reset_remote ( struct comp_dev *  dev)
inlinestatic

Run reset command on remote core for target component.

Parameters
[in,out]devComponent device.
Returns
0 on success, negative error code on failure.

◆ comp_same_dir()

static bool comp_same_dir ( struct comp_dev *  comp,
enum sof_ipc_stream_direction  dir 
)
inlinestatic

Returns true if the component's pipeline matches the specified direction.

Parameters
[in]compComponent device.
[in]dirStream direction (SOF_IPC_STREAM_PLAYBACK or SOF_IPC_STREAM_CAPTURE).
Returns
True if matching direction, false otherwise.

◆ comp_set_adapter_ops()

int comp_set_adapter_ops ( const struct comp_driver *  drv,
const struct module_interface *  ops 
)

Set adapter ops for a dynamically created driver.

Parameters
[in,out]drvComponent driver to update.
[in]opsModule interface operations.
Returns
0 or a negative error code.

◆ comp_set_attribute()

static int comp_set_attribute ( struct comp_dev *  dev,
uint32_t  type,
void *  value 
)
inlinestatic

Set component attribute.

Parameters
[in,out]devComponent device.
[in]typeAttribute type (COMP_ATTR_*).
[in]valuePointer to attribute value to set.
Returns
0 on success, negative error code on failure.

◆ comp_set_state()

int comp_set_state ( struct comp_dev *  dev,
int  cmd 
)

Component state transition handling.

Parameters
[in,out]devComponent device.
[in]cmdCommand, one of COMP_TRIGGER_...
Returns
0 if succeeded, error code otherwise.

This function should be called by a component implementation at the beginning of its state transition to verify whether the trigger is valid in the current state and abort the transition otherwise.

Typically the COMP_STATE_READY as the initial state is set directly by the component's implementation of _new().

COMP_TRIGGER_PREPARE is called from the component's prepare().

COMP_TRIGGER_START/STOP is called from trigger().

COMP_TRIGGER_RESET is called from reset().

◆ comp_trigger()

static int comp_trigger ( struct comp_dev *  dev,
int  cmd 
)
inlinestatic

Dispatch trigger command to component (local or remote).

Parameters
[in,out]devComponent device.
[in]cmdTrigger command (COMP_TRIGGER_*).
Returns
0 on success, negative error code on failure.

◆ comp_trigger_local()

static int comp_trigger_local ( struct comp_dev *  dev,
int  cmd 
)
inlinestatic

Run trigger command locally on current core for target component.

Parameters
[in,out]devComponent device.
[in]cmdTrigger command (COMP_TRIGGER_*).
Returns
0 on success, negative error code on failure.

◆ comp_trigger_remote()

static int comp_trigger_remote ( struct comp_dev *  dev,
int  cmd 
)
inlinestatic

Run trigger command on remote core for target component.

Parameters
[in,out]devComponent device.
[in]cmdTrigger command (COMP_TRIGGER_*).
Returns
0 on success, negative error code on failure.

◆ comp_unbind()

static int comp_unbind ( struct comp_dev *  dev,
const struct bind_info *  unbind_data 
)
inlinestatic

Unbind component from downstream/upstream component or buffer.

Parameters
[in,out]devComponent device.
[in]unbind_dataUnbinding information.
Returns
0 on success, negative error code on failure.

◆ comp_underrun()

static void comp_underrun ( struct comp_dev *  dev,
struct comp_buffer *  source,
uint32_t  copy_bytes 
)
inlinestatic

Called by the component device when underrun is detected.

Parameters
[in,out]devComponent device.
[in]sourceSource buffer.
[in]copy_bytesRequested size of data in bytes.

◆ comp_unregister()

void comp_unregister ( struct comp_driver_info *  drv)

Unregisters the component driver from the list of available components.

Parameters
[in,out]drvComponent driver to be unregistered.

◆ comp_update_ibs_obs_cpc()

void comp_update_ibs_obs_cpc ( struct comp_dev *  dev)

Update IBS, OBS, CPC, LL chunk size for component.

Parameters
[in,out]devComponent to update.

◆ comp_update_performance_data()

bool comp_update_performance_data ( struct comp_dev *  dev,
uint32_t  cycles_used 
)

Update performance data entry for component and check for budget violation.

Parameters
[in,out]devComponent to update.
[in]cycles_usedExecution time.
Returns
True if budget violation occurred, false otherwise.

◆ comp_verify_params()

int comp_verify_params ( struct comp_dev *  dev,
uint32_t  flag,
struct sof_ipc_stream_params *  params 
)

Verify and set component audio parameters.

Called by component in params() function in order to set and update some of downstream (playback) or upstream (capture) buffer parameters with PCM parameters.

Parameters
[in,out]devComponent device.
[in]flagSpecifies which parameter should not be updated.
[in,out]paramsPCM stream parameters.
Returns
0 on success, negative error code on failure.

◆ component_set_nearest_period_frames()

static void component_set_nearest_period_frames ( struct comp_dev *  current,
uint32_t  rate 
)
inlinestatic

Set component period frames based on sample rate and period.

Parameters
[in,out]currentTarget component device.
[in]rateSample rate in Hz.

◆ dev_comp_id()

static uint32_t dev_comp_id ( const struct comp_dev *  dev)
inlinestatic

Retrieves Component ID from device.

Parameters
[in]devComponent device.
Returns
Component ID.

◆ dev_comp_pipe_id()

static uint32_t dev_comp_pipe_id ( const struct comp_dev *  dev)
inlinestatic

Retrieves Component pipeline ID from device.

Parameters
[in]devComponent device.
Returns
Component pipeline ID.

◆ dev_comp_type()

static enum sof_comp_type dev_comp_type ( const struct comp_dev *  dev)
inlinestatic

Retrieves component type from device.

Parameters
[in]devComponent device.
Returns
Component type (enum sof_comp_type).

◆ sys_comp_dai_init()

void sys_comp_dai_init ( void  )

◆ sys_comp_host_init()

void sys_comp_host_init ( void  )

◆ sys_comp_init()

void sys_comp_init ( struct sof *  sof)

Allocates and initializes audio component list.

To be called once at boot time.

Parameters
[in,out]sofSOF global system context.

◆ sys_comp_kpb_init()

void sys_comp_kpb_init ( void  )

◆ sys_comp_module_aria_interface_init()

void sys_comp_module_aria_interface_init ( void  )

◆ sys_comp_module_asrc_interface_init()

void sys_comp_module_asrc_interface_init ( void  )

◆ sys_comp_module_copier_interface_init()

void sys_comp_module_copier_interface_init ( void  )

◆ sys_comp_module_crossover_interface_init()

void sys_comp_module_crossover_interface_init ( void  )

◆ sys_comp_module_dcblock_interface_init()

void sys_comp_module_dcblock_interface_init ( void  )

◆ sys_comp_module_demux_interface_init()

void sys_comp_module_demux_interface_init ( void  )

◆ sys_comp_module_dolby_dax_audio_processing_interface_init()

void sys_comp_module_dolby_dax_audio_processing_interface_init ( void  )

◆ sys_comp_module_drc_interface_init()

void sys_comp_module_drc_interface_init ( void  )

◆ sys_comp_module_dts_interface_init()

void sys_comp_module_dts_interface_init ( void  )

◆ sys_comp_module_eq_fir_interface_init()

void sys_comp_module_eq_fir_interface_init ( void  )

◆ sys_comp_module_eq_iir_interface_init()

void sys_comp_module_eq_iir_interface_init ( void  )

◆ sys_comp_module_gain_interface_init()

void sys_comp_module_gain_interface_init ( void  )

◆ sys_comp_module_google_ctc_audio_processing_interface_init()

void sys_comp_module_google_ctc_audio_processing_interface_init ( void  )

◆ sys_comp_module_google_rtc_audio_processing_interface_init()

void sys_comp_module_google_rtc_audio_processing_interface_init ( void  )

◆ sys_comp_module_igo_nr_interface_init()

void sys_comp_module_igo_nr_interface_init ( void  )

◆ sys_comp_module_level_multiplier_interface_init()

void sys_comp_module_level_multiplier_interface_init ( void  )

◆ sys_comp_module_mfcc_interface_init()

void sys_comp_module_mfcc_interface_init ( void  )

◆ sys_comp_module_mixer_interface_init()

void sys_comp_module_mixer_interface_init ( void  )

◆ sys_comp_module_mixin_interface_init()

void sys_comp_module_mixin_interface_init ( void  )

◆ sys_comp_module_mixout_interface_init()

void sys_comp_module_mixout_interface_init ( void  )

◆ sys_comp_module_multiband_drc_interface_init()

void sys_comp_module_multiband_drc_interface_init ( void  )

◆ sys_comp_module_mux_interface_init()

void sys_comp_module_mux_interface_init ( void  )

◆ sys_comp_module_nxp_eap_interface_init()

void sys_comp_module_nxp_eap_interface_init ( void  )

◆ sys_comp_module_phase_vocoder_interface_init()

void sys_comp_module_phase_vocoder_interface_init ( void  )

◆ sys_comp_module_rtnr_interface_init()

void sys_comp_module_rtnr_interface_init ( void  )

◆ sys_comp_module_selector_interface_init()

void sys_comp_module_selector_interface_init ( void  )

◆ sys_comp_module_sound_dose_interface_init()

void sys_comp_module_sound_dose_interface_init ( void  )

◆ sys_comp_module_src_interface_init()

void sys_comp_module_src_interface_init ( void  )

◆ sys_comp_module_src_lite_interface_init()

void sys_comp_module_src_lite_interface_init ( void  )

◆ sys_comp_module_stft_process_interface_init()

void sys_comp_module_stft_process_interface_init ( void  )

◆ sys_comp_module_tdfb_interface_init()

void sys_comp_module_tdfb_interface_init ( void  )

◆ sys_comp_module_template_interface_init()

void sys_comp_module_template_interface_init ( void  )

◆ sys_comp_module_tester_interface_init()

void sys_comp_module_tester_interface_init ( void  )

◆ sys_comp_module_tone_interface_init()

void sys_comp_module_tone_interface_init ( void  )

◆ sys_comp_module_volume_interface_init()

void sys_comp_module_volume_interface_init ( void  )

◆ sys_comp_selector_init()

void sys_comp_selector_init ( void  )

◆ user_get_buffer_memory_region()

static int user_get_buffer_memory_region ( const struct comp_driver *  drv)
inlinestatic

Get memory region flag for component buffer allocations.

Parameters
[in]drvComponent driver pointer.
Returns
Memory flag (SOF_MEM_FLAG_*).