Ecasound Flag for Immediate Audio Processing

This article explains how to configure Ecasound for immediate audio processing without initial pre-buffering delays. It identifies the primary command-line flag responsible for altering buffer behavior, explains the underlying mechanics of Ecasound's buffering modes, and provides practical syntax examples for low-latency, real-time audio workflows.

The Immediate Processing Flag: -B:realtime

In Ecasound, the flag that forces immediate audio processing without pre-buffering is -B:realtime.

By default, Ecasound operates under -B:auto, where it analyzes the signal chain and often fills internal audio buffers prior to playback or recording to avoid dropouts (buffer underruns). Setting the buffering mode explicitly to realtime forces Ecasound to bypass this pre-buffering phase and begin streaming audio through the processing engine immediately.

How Buffering Modes Work in Ecasound

The -B option controls the overall buffering policy of the Ecasound engine. It accepts three main parameters:

Command-Line Usage and Syntax

To run an Ecasound session with immediate processing enabled, supply the flag at the start of your command:

ecasound -B:realtime -i:alsahw,0,0 -o:alsahw,0,0

In this setup:

Optimizing Latency with -b

While -B:realtime ensures processing begins without waiting to fill a pre-buffer queue, total round-trip latency is governed by the engine buffer size set by the -b flag:

ecasound -B:realtime -b:128 -i:jack -o:jack

Using a small buffer size (such as -b:128 or -b:256 frames) alongside -B:realtime ensures both an immediate start and minimal delay between input and output. Note that running without pre-buffering at very low buffer sizes requires adequate CPU performance and real-time system privileges (such as using the -r priority flag) to prevent buffer underruns (xruns).