oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
audio_device.h
1/* SPDX-License-Identifier: GPL-3.0-or-later */
2
17#ifndef OVE_AUDIO_DEVICE_H
18#define OVE_AUDIO_DEVICE_H
19
20#include "ove/audio.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/* ── Transport types ────────────────────────────────────────────── */
27
38
39/* ── Device configuration ───────────────────────────────────────── */
40
51 unsigned int num_buffers;
52 unsigned int thread_priority;
53 unsigned int thread_stack_size;
55 union {
57 struct {
58 unsigned int input_device;
59 unsigned int slot_mask;
60 } i2s;
62 struct {
63 unsigned int decimation;
64 unsigned int clock_freq;
65 } pdm;
67 struct {
68 const char *device_name;
69 } sdl2;
70 };
71};
72
73/* ── Device node factories ──────────────────────────────────────── */
74
75#ifdef CONFIG_OVE_AUDIO
76
93 const struct ove_audio_device_cfg *cfg,
94 const char *name);
95
113 const struct ove_audio_device_cfg *cfg,
114 const char *name);
115
116#endif /* CONFIG_OVE_AUDIO */
117
118#ifdef __cplusplus
119}
120#endif
121
/* end of ove_audio_device group */
123
124#endif /* OVE_AUDIO_DEVICE_H */
int ove_audio_device_sink(struct ove_audio_graph *g, const struct ove_audio_device_cfg *cfg, const char *name)
Add a hardware audio sink node to the graph.
ove_audio_transport
Audio hardware transport type.
Definition audio_device.h:33
int ove_audio_device_source(struct ove_audio_graph *g, const struct ove_audio_device_cfg *cfg, const char *name)
Add a hardware audio source node to the graph.
@ OVE_AUDIO_TRANSPORT_PDM
PDM microphone interface.
Definition audio_device.h:35
@ OVE_AUDIO_TRANSPORT_I2S
I2S / TDM serial bus (e.g. codec, DAC, ADC).
Definition audio_device.h:34
@ OVE_AUDIO_TRANSPORT_SDL2
SDL2 audio (host PC simulation or testing).
Definition audio_device.h:36
Configuration descriptor for a hardware audio device node.
Definition audio_device.h:48
unsigned int slot_mask
TDM slot bitmask; 0 = all slots.
Definition audio_device.h:59
enum ove_audio_transport transport
Hardware transport selection.
Definition audio_device.h:49
struct ove_audio_fmt fmt
Desired audio stream format.
Definition audio_device.h:50
unsigned int clock_freq
PDM clock frequency in Hz.
Definition audio_device.h:64
unsigned int input_device
Input device selector (e.g. line-in, DMIC index).
Definition audio_device.h:58
unsigned int num_buffers
DMA buffer count; 0 = backend default.
Definition audio_device.h:51
unsigned int decimation
PDM decimation factor.
Definition audio_device.h:63
const char * device_name
SDL2 audio device name; NULL = system default.
Definition audio_device.h:68
unsigned int thread_stack_size
Driver thread stack size in bytes; 0 = backend default.
Definition audio_device.h:53
unsigned int thread_priority
Driver thread priority; 0 = backend default.
Definition audio_device.h:52
Complete audio stream format descriptor.
Definition audio_node.h:68
Audio processing graph instance.
Definition audio.h:93