Ecasound Signal Processing and Routing Architecture

Ecasound is a powerful command-line multitrack audio processing utility built on an efficient, modular signal processing engine. This article examines the internal architecture of Ecasound, detailing how it handles internal audio stream routing, the functional relationships between inputs, chains, operators, and outputs, and the sequential execution model that governs signal transformation.

The Chain-Based Routing Model

At the heart of Ecasound's internal signal processing pipeline is the concept of chains. A chain represents a linear signal path through which audio frames pass sequentially from an assigned input to an assigned output.

Rather than using a rigid matrix or a node-based visual graph, Ecasound structures its routing logic using three core elements:

A collection of chains configured to execute simultaneously is referred to as a chainset. Ecasound's routing engine processes chainsets synchronously inside an internal real-time loop.

Stream Splitting and Mixing

Ecasound achieves complex routing—including multitrack recording, bussing, and effects sends—through the relationships established between inputs, chains, and outputs.

One-to-Many Routing (Signal Splitting)

An audio input can be assigned to multiple chains simultaneously. When an input is shared among several chains, the internal engine duplicates the incoming audio buffer for each assigned chain at the beginning of each processing cycle. This allows a single microphone input, for example, to be split into one dry chain directed to disk and another wet chain routed through a reverb processor.

Many-to-One Routing (Summing and Mixing)

Multiple chains can be assigned to a single audio output. When this occurs, Ecasound acts as an automatic summing mixer. As each chain completes its processing tasks for a given buffer cycle, its resulting audio data is summed into the designated output buffer before being committed to the target device or file.

Multi-Channel Assignment and Channel Routing

Ecasound allows chains to have different channel counts from the inputs and outputs to which they connect. Channel routing operators (such as -erc, -erm, and -etd) can manipulate individual channel assignments within a chain. Audio channels can be copied, muted, mapped to different channel indices, or mixed down from multi-channel configurations (such as 5.1 or stereo) to mono before reaching downstream operators or endpoints.

Chain Operators and Signal Flow

Inside a chain, audio flows unidirectionally through zero or more chain operators (cops). These operators execute in the exact order they are defined:

  1. Input Ingestion: The chain fetches raw audio frames from its connected input buffer.
  2. Sequential Modification: The audio passes through the chain’s sequence of operators. Operators can include integrated filters, gain stages, dynamic processors, or external plugins via LADSPA or LV2 architectures.
  3. Controller Modulation: Internal controllers (such as LFOs, envelope followers, or automated linear interpolators) hook into specific parameters of chain operators, dynamically modulating attributes (e.g., filter cutoff, volume) on a frame-by-frame basis.
  4. Output Dispatch: The processed buffer is transferred to the connected output sink or added to an output accumulation buffer for mixing.

The Execution Engine and Buffer Management

Ecasound processes audio in discrete blocks called buffers. The internal execution cycle operates as follows: