|
Sound Open Firmware
|
Audio component operations. More...
#include <component.h>

Data Fields | |
| struct comp_dev *(* | create )(const struct comp_driver *drv, const struct comp_ipc_config *ipc_config, const void *spec) |
| Creates a new component device. | |
| void(* | free )(struct comp_dev *dev) |
| Called to delete the specified component device. | |
| int(* | params )(struct comp_dev *dev, struct sof_ipc_stream_params *params) |
| Sets component audio stream parameters. | |
| int(* | dai_get_hw_params )(struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir) |
| Fetches hardware stream parameters. | |
| int(* | dai_config )(struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai *dai_config, const void *dai_spec_config) |
| Configures attached DAI. | |
| int(* | trigger )(struct comp_dev *dev, int cmd) |
| Trigger, atomic - used to start/stop/pause stream operations. | |
| int(* | prepare )(struct comp_dev *dev) |
| Prepares component after params are set. | |
| int(* | reset )(struct comp_dev *dev) |
| Resets component. | |
| int(* | copy )(struct comp_dev *dev) |
| Copy and process stream data from source to sink buffers. | |
| int(* | position )(struct comp_dev *dev, struct sof_ipc_stream_posn *posn) |
| Retrieves component rendering position. | |
| int(* | get_attribute )(struct comp_dev *dev, uint32_t type, void *value) |
| Gets attribute in component. | |
| int(* | set_attribute )(struct comp_dev *dev, uint32_t type, void *value) |
| Sets attribute in component. | |
| int(* | dai_ts_config )(struct comp_dev *dev) |
| Configures timestamping in attached DAI. | |
| int(* | dai_ts_start )(struct comp_dev *dev) |
| Starts timestamping. | |
| int(* | dai_ts_stop )(struct comp_dev *dev) |
| Stops timestamping. | |
| int(* | dai_ts_get )(struct comp_dev *dev, struct timestamp_data *tsd) |
| Gets timestamp. | |
| int(* | bind )(struct comp_dev *dev, const struct bind_info *bind_data) |
| Bind, atomic - used to notify component of bind event. | |
| int(* | unbind )(struct comp_dev *dev, const struct bind_info *unbind_data) |
| Unbind, atomic - used to notify component of unbind event. | |
| int(* | get_large_config )(struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t *data_offset, char *data) |
| Gets config in component. | |
| int(* | set_large_config )(struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t data_offset, const char *data) |
| Set config in component. | |
| uint64_t(* | get_total_data_processed )(struct comp_dev *dev, uint32_t stream_no, bool input) |
| Returns total data processed in number bytes. | |
Audio component operations.
All component operations must return 0 for success, negative values for errors and 1 to stop the pipeline walk operation unless specified otherwise in the operation documentation.
Bind, atomic - used to notify component of bind event.
| dev | Component device. |
| data | Bind info |
Usually can be __cold.
| int(* comp_ops::copy) (struct comp_dev *dev) |
Copy and process stream data from source to sink buffers.
| dev | Component device. |
Usually shouldn't be __cold.
| struct comp_dev *(* comp_ops::create) (const struct comp_driver *drv, const struct comp_ipc_config *ipc_config, const void *spec) |
Creates a new component device.
| drv | Parent component driver. |
| ipc_config | Component parameters. |
| spec | Pointer to initialization data |
Any component-specific private data is allocated separately and pointer is connected to the comp_dev::private by using comp_set_drvdata() and later retrieved by comp_get_drvdata().
All parameters should be initialized to their default values. Usually can be __cold.
| int(* comp_ops::dai_config) (struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai *dai_config, const void *dai_spec_config) |
Configures attached DAI.
| dev | Component device. |
| dai_config | DAI configuration. |
Mandatory for components that allocate DAI. Usually can be __cold.
| int(* comp_ops::dai_get_hw_params) (struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir) |
Fetches hardware stream parameters.
| dev | Component device. |
| params | Receives copy of stream parameters retrieved from DAI hw settings. |
| dir | Stream direction (see enum sof_ipc_stream_direction). |
Mandatory for components that allocate DAI. Usually can be __cold.
| int(* comp_ops::dai_ts_config) (struct comp_dev *dev) |
Configures timestamping in attached DAI.
| dev | Component device. |
Mandatory for components that allocate DAI. Usually can be __cold.
| int(* comp_ops::dai_ts_get) (struct comp_dev *dev, struct timestamp_data *tsd) |
Gets timestamp.
| dev | Component device. |
| tsd | Receives timestamp data. |
Mandatory for components that allocate DAI. Usually shouldn't be __cold.
| int(* comp_ops::dai_ts_start) (struct comp_dev *dev) |
Starts timestamping.
| dev | Component device. |
Mandatory for components that allocate DAI. Usually can be __cold.
| int(* comp_ops::dai_ts_stop) (struct comp_dev *dev) |
Stops timestamping.
| dev | Component device. |
Mandatory for components that allocate DAI. Usually can be __cold.
| void(* comp_ops::free) (struct comp_dev *dev) |
Called to delete the specified component device.
| dev | Component device to be deleted. |
All data structures previously allocated on the run-time heap must be freed by the implementation of free(). Usually can be __cold.
Gets attribute in component.
| dev | Component device. |
| type | Attribute type. |
| value | Attribute value. |
Usually can be __cold.
| int(* comp_ops::get_large_config) (struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t *data_offset, char *data) |
Gets config in component.
| dev | Component device |
| param_id | param id for each component |
| first_block | first block of large block. |
| last_block | last block of large block. |
| data_offset | block offset filled by callee. |
| data | block data. |
Callee fills up *data with config data and save the config size in *data_offset for host to reconstruct the config Usually can be __cold.
| uint64_t(* comp_ops::get_total_data_processed) (struct comp_dev *dev, uint32_t stream_no, bool input) |
Returns total data processed in number bytes.
| dev | Component device |
| stream_no | Index of input/output stream |
| input | Selects between input (true) or output (false) stream direction |
Usually shouldn't be __cold.
| int(* comp_ops::params) (struct comp_dev *dev, struct sof_ipc_stream_params *params) |
Sets component audio stream parameters.
| dev | Component device. |
| params | Audio (PCM) stream parameters to be set. |
Infrastructure calls comp_verify_params() if this handler is not defined, therefore it should be left NULL if no extra steps are required. Usually shouldn't be __cold.
| int(* comp_ops::position) (struct comp_dev *dev, struct sof_ipc_stream_posn *posn) |
Retrieves component rendering position.
| dev | Component device. |
| posn | Receives reported position. |
Usually shouldn't be __cold.
| int(* comp_ops::prepare) (struct comp_dev *dev) |
Prepares component after params are set.
| dev | Component device. |
Prepare should be used to get the component ready for starting processing after it's hw_params are known or after an XRUN. Usually shouldn't be __cold.
| int(* comp_ops::reset) (struct comp_dev *dev) |
Resets component.
| dev | Component device. |
Resets the component state and any hw_params to default component state. Should also free any resources acquired during hw_params. Usually shouldn't be __cold.
Sets attribute in component.
| dev | Component device. |
| type | Attribute type. |
| value | Attribute value. |
Usually can be __cold.
| int(* comp_ops::set_large_config) (struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t data_offset, const char *data) |
Set config in component.
| dev | Component device |
| param_id | param id for each component |
| first_block | first block of large block. |
| last_block | last block of large block. |
| data_offset | block offset in large block. |
| data | block data. |
Host divides large block into small blocks and sends them to fw. The data_offset indicates the offset in the large block data. Usually can be __cold.
| int(* comp_ops::trigger) (struct comp_dev *dev, int cmd) |
Trigger, atomic - used to start/stop/pause stream operations.
| dev | Component device. |
| cmd | Command, one of COMP_TRIGGER_... |
Usually shouldn't be __cold.
Unbind, atomic - used to notify component of unbind event.
| dev | Component device. |
| data | unBind info |
Usually can be __cold.