Ecasound -z:intbuf Parameter Explained
The -z:intbuf parameter in Ecasound defines the size of
the internal processing buffer used by the audio engine, measured in
sample frames. Configuring this parameter directly influences the
balance between system latency and audio processing stability during
playback, recording, or effect chaining. This article breaks down the
technical function of -z:intbuf, how it affects real-time
audio performance, and how to select the right buffer size for your
workflow.
Purpose of -z:intbuf
In Ecasound, audio is processed in discrete blocks of frames rather
than individual samples. The -z:intbuf option specifies the
exact number of sample frames allocated to each internal processing
cycle.
The syntax for this option is:
-z:intbuf,framesFor example, running
ecasound -z:intbuf,512 -i input.wav -o alsa instructs
Ecasound to handle audio internally in 512-frame chunks.
Latency vs. Stability
The primary purpose of altering the internal buffer size is managing latency and system throughput:
- Lower Buffer Sizes (e.g., 64, 128, 256): Minimizes latency, making it ideal for live performance, interactive monitoring, or real-time synthesizer control. However, smaller buffers require the CPU to handle interrupts more frequently, which increases processing overhead and raises the risk of buffer underruns (xruns), audible dropouts, and clicks.
- Higher Buffer Sizes (e.g., 1024, 2048, 4096): Increases processing stability and reduces CPU load. Larger buffers are well-suited for non-real-time rendering, multitrack mixing, heavy digital signal processing (DSP), or running tasks on hardware with constrained CPU capabilities. The tradeoff is higher audio latency.
Interaction with External Buffers
Ecasound differentiates between internal processing buffers and
external I/O buffers (configured with -z:extbuf). While
-z:extbuf sets the buffer size for hardware input/output
subsystems like ALSA or OSS, -z:intbuf dictates how the
internal signal chain processes the data between those inputs and
outputs.
For the most predictable timing and to prevent unnecessary internal
queueing, setting -z:intbuf to match or divide evenly with
your external audio hardware period size is recommended. When integrated
with JACK audio server routing, Ecasound typically derives timing
automatically, but manual tuning with -z:intbuf remains
essential when interacting directly with ALSA devices or disk-based
workflows.