How to Set Ecasound Audio Buffer Size

Ecasound is a powerful command-line multitrack audio processing utility for Unix-like operating systems. This guide explains which command-line option controls the internal audio engine buffer size, how to configure it to balance system latency and stability, and how to use it alongside related buffering modes.

The primary option that controls the audio engine buffer size in Ecasound is -b.

The -b Option Syntax

The syntax for setting the buffer size is:

-b:buffsize

Here, buffsize represents the size of the internal audio processing buffer measured in sample frames (not bytes).

For example, to set the engine buffer size to 512 sample frames, you run:

ecasound -b:512 -i somefile.wav -o alsa

Buffer Modes with -B

Ecasound also provides the -B option to set the buffering mode, which interacts directly with how the engine processes buffers:

  • -B:auto: Automatically selects buffer settings based on your input and output setup (default).
  • -B:nonrt: Optimized for non-realtime batch processing, allowing larger buffers for efficient disk rendering.
  • -B:rt: Configures the engine for standard real-time processing.
  • -B:rtlowlatency: Prioritizes ultra-low latency for real-time monitoring and performance.

Practical Considerations

  • Lower Buffer Sizes (e.g., 64, 128, 256): Dramatically reduce round-trip audio latency. However, very low values significantly increase CPU usage and raise the likelihood of buffer underruns or overruns (xruns/dropouts).
  • Higher Buffer Sizes (e.g., 1024, 2048): Increase stability during heavy processing or multitrack mixing by giving the CPU more headroom, but introduce noticeable audio delay.
  • External Sound Architectures: When using audio servers like JACK, Ecasound typically synchronizes its processing cycle with the JACK period size. Specifying -b allows you to define internal handling when interfacing with ALSA, OSS, or standalone files.