Expand description
Lock-free, real-time safe signal buffers
§Signal Buffers for single-threaded signal processing
This module provides real-time safe buffers used by graph nodes inside
the signal thread. All buffers are single-threaded — they contain no
atomics or locks. Cross-thread communication goes through
rill_core::queues.
§Buffer Types
| Buffer | Description | Use Case |
|---|---|---|
PipeBuffer | Single-producer, single-consumer | Point-to-point node connections |
FanOutBuffer | One producer, multiple consumers | Broadcast signals to multiple nodes |
FanInBuffer | Multiple producers, one consumer | Mix multiple signals |
DelayLine | Circular buffer with delay | Effects like echo, reverb |
RingBuffer | Multi-producer, multi-consumer | Generic queue for any scenario |
TapeLoop | Heap-allocated circular buffer | Tape delay with large capacity |
§Features
- Real-time safe - No allocations, no blocking, no system calls
- Single-threaded - No atomics, no locks, minimal overhead
- Cache-line aligned - Prevents false sharing
- Statistically monitored - Track performance metrics
- Type-safe - Generic over
Transcendental(f32/f64)
Modules§
Structs§
- Atomic
Cell - Atomic cell with a fully safe API.
- Atomic
Stats - Atomic statistics for safe concurrent access
- Buffer
Registry - Registry of named buffers.
- Buffer
Stats - Buffer statistics snapshot for monitoring and debugging
- Delay
Line - Delay line for audio effects — single-threaded circular buffer.
- FanIn
Buffer - Buffer for mixing multiple producers to one consumer.
Single-threaded — use
rill_core::queuesfor cross-thread. - FanOut
Buffer - Buffer for broadcasting from one producer to multiple consumers.
Single-threaded — use
rill_core::queuesfor cross-thread. - Fixed
Buffer - Fixed-size buffer on the stack — default per-port buffer.
- Heap
Buffer - Heap-allocated buffer with runtime-determined size.
- Pipe
Buffer - Single-producer, single-consumer buffer for intra-graph node connections.
- Ring
Buffer - Fixed-size ring buffer (power-of-two size). Single-threaded.
- Tape
Loop - Heap-allocated ring buffer for tape delay — single-threaded.
Enums§
- Atomic
Cell Error - Errors that can occur when creating an
AtomicCell. - Buffer
Error - Buffer error types
Constants§
- CACHE_
LINE_ SIZE - Cache line size for alignment (64 bytes on x86_64)
- DEFAULT_
BUFFER_ SIZE - Default buffer size for most use cases
- MAX_
BUFFER_ SIZE - Maximum buffer size (2^16 = 65536 samples)
- MIN_
BUFFER_ SIZE - Minimum buffer size (must be at least 16 for most algorithms)
Traits§
- Buffer
- Common interface for audio buffers of arbitrary size.
- Signal
Buffer - Common trait for all signal buffers
Functions§
- array_
from_ fn - Helper function to create arrays without requiring
Copy
Type Aliases§
- Buffer
Result - Result type for buffer operations