Synchronization/Render
Audio processing in quantums for temporal consistency and control
In I/O, audio-graph rendering is performed in blocks of sample-frames whose size remains constant throughout the lifetime of an AudioGraph. The number of frames in each block is called the render quantum size, and the block itself is the render quantum.
The default render quantum is 128, though it can be changed.
The AudioGraph render thread is driven by a system-level callback, invoked periodically at regular intervals. Operations executed atomically on a single thread can only occur when no other operation is in progress, preserving deterministic behavior across the rendering cycle.
During each callback, the system processes a variable-sized buffer measured in sample-frames, which must be computed before the next callback arrives. For every callback, a load value is computed by dividing the execution time by the buffer size.
The concept of callbacks and load values does not apply to OfflineAudioGraph.
The render quantum size determines system latency and stability: smaller values reduce delay but increase CPU demand, while larger blocks improve efficiency at the cost of higher latency.
Performance
Experience quality depends on low latency and the absence of interruptions.
Latency is the delay between an input event and the perceived sound, resulting from the sum of factors such as input-device latency, buffering, processing, output-device latency, and even the physical distance to the speakers.
Audio glitches—audible clicks or pops—are failures that interrupt the continuous flow of sound. They may arise from issues in audio threads (such as scheduling delays) or from processing loads that exceed CPU capacity resulting in dropped frames and/or disrupted playback.
Both issues require optimization to ensure determinism and stability.
In real-time audio, low latency and stability must be balanced. Reducing latency improves responsiveness, but increases the risk of glitches if processing exceeds CPU capacity. Maintaining a proper balance requires planning and precise control.
Last updated