37#ifdef CONFIG_OVE_AUDIO
42#define OVE_AUDIO_GRAPH_MAX_NODES 16
44#define OVE_AUDIO_GRAPH_MAX_EDGES 16
216#define OVE_AUDIO_GRAPH_STORAGE_BYTES(nodes, frames, channels, sample_bytes) \
217 ((size_t)(nodes) * (size_t)(frames) * (size_t)(channels) * (size_t)(sample_bytes))
236int ove_audio_graph_create_(
struct ove_audio_graph *g,
unsigned int frames);
266#define ove_audio_graph_create(pg, frames, nodes, channels, sample_bytes) \
267 ((void)(nodes), (void)(channels), (void)(sample_bytes), \
268 ove_audio_graph_create_((pg), (frames)))
292#define OVE_AUDIO_GRAPH_DEFINE(name, nodes, frames, channels, sample_bytes) \
293 static uint8_t name##_buf[OVE_AUDIO_GRAPH_STORAGE_BYTES( \
294 (nodes), (frames), (channels), (sample_bytes))] __attribute__((aligned(4))); \
295 static struct ove_audio_graph name
ove_audio_node_type
Role of a node within the audio graph.
Definition audio_node.h:183
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_process(struct ove_audio_graph *g)
Execute one processing cycle (app-driven mode).
int ove_audio_graph_start(struct ove_audio_graph *g)
Start the audio graph.
int ove_audio_graph_init(struct ove_audio_graph *g, unsigned int frames_per_period)
Initialise an audio graph.
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.
ove_audio_graph_state
Lifecycle state of an audio graph.
Definition audio.h:83
int ove_audio_graph_stop(struct ove_audio_graph *g)
Stop the audio graph.
int ove_audio_graph_set_buf_storage(struct ove_audio_graph *g, void *storage, size_t size)
Provide caller-owned storage for inter-node audio buffers.
#define OVE_AUDIO_GRAPH_MAX_EDGES
Maximum number of edges in a single audio graph.
Definition audio.h:44
int ove_audio_graph_connect(struct ove_audio_graph *g, unsigned int from, unsigned int to)
Connect two nodes with a directed edge.
void ove_audio_graph_deinit(struct ove_audio_graph *g)
Release all resources held by an audio graph.
#define OVE_AUDIO_GRAPH_MAX_NODES
Maximum number of nodes in a single audio graph.
Definition audio.h:42
int ove_audio_graph_build(struct ove_audio_graph *g)
Validate and compile the graph.
@ OVE_AUDIO_GRAPH_RUNNING
Graph is actively processing audio.
Definition audio.h:86
@ OVE_AUDIO_GRAPH_IDLE
Initial state; nodes may be added and connected.
Definition audio.h:84
@ OVE_AUDIO_GRAPH_READY
Build succeeded; graph may be started.
Definition audio.h:85
Audio buffer passed between nodes during graph processing.
Definition audio_node.h:102
Directed connection between two nodes in the audio graph.
Definition audio.h:53
unsigned int from
Index of the upstream (producer) node.
Definition audio.h:54
unsigned int to
Index of the downstream (consumer) node.
Definition audio.h:55
Runtime diagnostic counters for an audio graph.
Definition audio.h:66
unsigned int max_process_us
Worst-case cycle wall-clock time in microseconds.
Definition audio.h:71
unsigned int node_errors
Cumulative node process() failures.
Definition audio.h:70
unsigned int cycles
Number of completed processing cycles.
Definition audio.h:67
unsigned int avg_process_us
Rolling average cycle wall-clock time in microseconds.
Definition audio.h:73
unsigned int overruns
Source overflow events (source dropped frames).
Definition audio.h:69
unsigned int underruns
Sink starvation events (sink received no data).
Definition audio.h:68
Audio processing graph instance.
Definition audio.h:96
struct ove_audio_graph_stats stats
Accumulated runtime diagnostics.
Definition audio.h:117
size_t buf_storage_size
Size of caller-provided storage (0 = heap-allocated).
Definition audio.h:112
struct ove_audio_edge edges[OVE_AUDIO_GRAPH_MAX_EDGES]
Registered directed edges.
Definition audio.h:101
unsigned int frames_per_period
Frame count processed per graph cycle.
Definition audio.h:114
struct ove_audio_buf buffers[OVE_AUDIO_GRAPH_MAX_NODES]
Per-node intermediate audio buffers.
Definition audio.h:109
void * buf_storage
Heap block backing all buffer data arrays.
Definition audio.h:111
unsigned int node_count
Number of valid entries in nodes[].
Definition audio.h:99
unsigned int exec_count
Number of valid entries in exec_order[].
Definition audio.h:107
struct ove_audio_node nodes[OVE_AUDIO_GRAPH_MAX_NODES]
Registered node descriptors.
Definition audio.h:97
unsigned int exec_order[OVE_AUDIO_GRAPH_MAX_NODES]
Node indices in topological execution order.
Definition audio.h:106
enum ove_audio_graph_state state
Current lifecycle state.
Definition audio.h:115
unsigned int edge_count
Number of valid entries in edges[].
Definition audio.h:103
Virtual function table (vtable) for an audio processing node.
Definition audio_node.h:118
Descriptor for a single node in the audio graph.
Definition audio_node.h:195