|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
Build and execute a DAG of audio processing nodes. More...

Modules | |
| Audio device node factories | |
| Hardware-backed source and sink node factories for the audio graph. | |
| Audio node types and built-in factories | |
| Core types for audio nodes, formats, buffers, and built-in processor node factories. | |
Data Structures | |
| struct | ove_audio_edge |
| Directed connection between two nodes in the audio graph. More... | |
| struct | ove_audio_graph_stats |
| Runtime diagnostic counters for an audio graph. More... | |
| struct | ove_audio_graph |
| Audio processing graph instance. More... | |
Macros | |
| #define | OVE_AUDIO_GRAPH_MAX_NODES 16 |
| Maximum number of nodes in a single audio graph. | |
| #define | OVE_AUDIO_GRAPH_MAX_EDGES 16 |
| Maximum number of edges in a single audio graph. | |
Enumerations | |
| enum | ove_audio_graph_state { OVE_AUDIO_GRAPH_IDLE , OVE_AUDIO_GRAPH_READY , OVE_AUDIO_GRAPH_RUNNING } |
| Lifecycle state of an audio graph. More... | |
Functions | |
| int | ove_audio_graph_init (struct ove_audio_graph *g, unsigned int frames_per_period) |
| Initialise an audio graph. | |
| void | ove_audio_graph_deinit (struct ove_audio_graph *g) |
| Release all resources held by an audio graph. | |
| int | ove_audio_graph_add_node (struct ove_audio_graph *g, const struct ove_audio_node_ops *ops, void *ctx, const char *name, enum ove_audio_node_type type) |
| Register a new node in the graph. | |
| int | ove_audio_graph_connect (struct ove_audio_graph *g, unsigned int from, unsigned int to) |
| Connect two nodes with a directed edge. | |
| int | ove_audio_graph_build (struct ove_audio_graph *g) |
| Validate and compile the graph. | |
| int | ove_audio_graph_start (struct ove_audio_graph *g) |
| Start the audio graph. | |
| int | ove_audio_graph_stop (struct ove_audio_graph *g) |
| Stop the audio graph. | |
| int | ove_audio_graph_process (struct ove_audio_graph *g) |
| Execute one processing cycle (app-driven mode). | |
| int | ove_audio_graph_get_stats (const struct ove_audio_graph *g, struct ove_audio_graph_stats *stats) |
| Retrieve a snapshot of graph runtime statistics. | |
Build and execute a DAG of audio processing nodes.
The audio graph engine models audio processing as a directed acyclic graph (DAG) of typed nodes connected by edges:
The graph is static: configured at init, validated at build time via topological sort and format propagation, then started. Changes require stop, reconfigure, restart.
Execution modes:
Requires CONFIG_OVE_AUDIO.
| int ove_audio_graph_init | ( | struct ove_audio_graph * | g, |
| unsigned int | frames_per_period | ||
| ) |
Initialise an audio graph.
Sets up internal state and records the processing period size. Must be called before any other graph function.
| [in] | g | Graph instance to initialise. |
| [in] | frames_per_period | Number of audio frames processed per cycle. |
CONFIG_OVE_AUDIO. | void ove_audio_graph_deinit | ( | struct ove_audio_graph * | g | ) |
Release all resources held by an audio graph.
Frees the heap buffer storage and resets internal state. The graph must be stopped before calling this function.
| [in] | g | Initialised graph instance. |
CONFIG_OVE_AUDIO. | int ove_audio_graph_add_node | ( | struct ove_audio_graph * | g, |
| const struct ove_audio_node_ops * | ops, | ||
| void * | ctx, | ||
| const char * | name, | ||
| enum ove_audio_node_type | type | ||
| ) |
Register a new node in the graph.
Appends a node entry to the graph's node table. Nodes may only be added while the graph is in the OVE_AUDIO_GRAPH_IDLE state.
| [in] | g | Graph instance. |
| [in] | ops | Vtable providing the node implementation. |
| [in] | ctx | Opaque context pointer forwarded to every vtable call. |
| [in] | name | Human-readable node name for diagnostics. |
| [in] | type | Role of the node: source, processor, or sink. |
CONFIG_OVE_AUDIO. | int ove_audio_graph_connect | ( | struct ove_audio_graph * | g, |
| unsigned int | from, | ||
| unsigned int | to | ||
| ) |
Connect two nodes with a directed edge.
Adds an edge from the node at index from to the node at index to. Both nodes must already be registered. Edges may only be added while the graph is in the OVE_AUDIO_GRAPH_IDLE state.
| [in] | g | Graph instance. |
| [in] | from | Index of the upstream (producer) node. |
| [in] | to | Index of the downstream (consumer) node. |
CONFIG_OVE_AUDIO. | int ove_audio_graph_build | ( | struct ove_audio_graph * | g | ) |
Validate and compile the graph.
Performs a topological sort, propagates audio formats from sources to sinks by calling each node's configure callback, allocates the inter-node audio buffers, and transitions the graph to OVE_AUDIO_GRAPH_READY.
| [in] | g | Graph instance in the OVE_AUDIO_GRAPH_IDLE state. |
CONFIG_OVE_AUDIO. | int ove_audio_graph_start | ( | struct ove_audio_graph * | g | ) |
Start the audio graph.
Calls each node's start callback in topological order and transitions the graph to OVE_AUDIO_GRAPH_RUNNING. The graph must be in the OVE_AUDIO_GRAPH_READY state.
| [in] | g | Built graph instance. |
CONFIG_OVE_AUDIO. | int ove_audio_graph_stop | ( | struct ove_audio_graph * | g | ) |
Stop the audio graph.
Calls each node's stop callback in reverse topological order and transitions the graph back to OVE_AUDIO_GRAPH_READY.
| [in] | g | Running graph instance. |
CONFIG_OVE_AUDIO. | int ove_audio_graph_process | ( | struct ove_audio_graph * | g | ) |
Execute one processing cycle (app-driven mode).
Calls each node's process callback in topological order, passing inter-node buffers along the edges. Intended for test or offline use; in sink-driven mode the hardware callback drives processing instead.
| [in] | g | Running graph instance. |
CONFIG_OVE_AUDIO. | int ove_audio_graph_get_stats | ( | const struct ove_audio_graph * | g, |
| struct ove_audio_graph_stats * | stats | ||
| ) |
Retrieve a snapshot of graph runtime statistics.
Copies the current diagnostic counters from the graph into the caller-supplied stats structure.
| [in] | g | Graph instance (running or ready). |
| [out] | stats | Pointer to a caller-allocated structure that will receive the statistics snapshot. |
CONFIG_OVE_AUDIO.