Skip to main content

Crate aether_core

Crate aether_core 

Source
Expand description

§aether-core

Hard real-time modular DSP engine — lock-free graph scheduler, generational arena, and zero-allocation buffer pool.

64-sample buffer | 48 kHz | ≤1.33 ms deadline | Zero allocations | Lock-free

§Architecture

Control thread                    RT audio thread
──────────────                    ───────────────
AudioGraph (add/remove nodes)     Scheduler::process_block()
    │                                 │
    │  CommandRing (SPSC)             ├─ drain CommandRing
    └────────────────────────────────►│
                                      ├─ iterate sorted NodeArena
                                      ├─ borrow buffers from BufferPool
                                      └─ call DspNode::process() per node

§Real-time guarantees

RuleEnforcement
No heap allocationPre-allocated arena + buffer pool
No locksSPSC ring buffer (ringbuf)
No I/OAll I/O on control/tokio threads
Bounded executionFlat topo-sorted array, ≤32 commands/tick

§Quick start

See node::DspNode to implement a processing node, [graph::AudioGraph] to build a patch, and scheduler::Scheduler to drive the RT loop.

Modules§

arena
Generational arena allocator.
buffer_pool
Pre-allocated audio buffer pool.
command
Lock-free command protocol between the control thread and the RT audio thread.
graph
Directed Acyclic Graph (DAG) for DSP routing.
hotreload
Hot reload support for DSP nodes.
node
Node abstraction for the DSP graph.
param
Sample-accurate parameter automation.
preset
Preset system for saving and loading DSP graph configurations.
scheduler
Real-time audio scheduler.
schema
JSON Schema validation for presets and configurations.
state
State continuity framework.

Constants§

BUFFER_SIZE
Audio buffer size in samples. Hard real-time constraint: 64 samples @ 48kHz = 1.33ms deadline.
COMMAND_RING_CAPACITY
Command ring buffer capacity.
MAX_BUFFERS
Maximum number of audio buffers in the pool.
MAX_COMMANDS_PER_TICK
Maximum commands processed per audio callback. Bounds mutation cost.
MAX_INPUTS
Maximum number of inputs per node. Kept small to fit in cache lines.
MAX_NODES
Maximum number of nodes in the arena. Pre-allocated at startup.