Ecasound -i Option: Defining Inputs Across Chains
In Ecasound, the -i option specifies an audio input, but
its routing behavior across different processing chains depends entirely
on the active chain selection defined by the -a option.
This guide explains how Ecasound pairs inputs to individual or multiple
chains, enabling multi-track routing, signal splitting, and parallel
processing directly from the command line.
Chain Selection and Input Association
Ecasound processes audio using "chains." A chain is a single audio path through which sound travels from an input, passes through zero or more operators (effects, level adjustments), and routes to an output.
The -i option attaches an audio source (such as a
.wav file, an ALSA/JACK device, or a test generator) to
whichever chains are currently active. You select active chains using
the -a (chain select) option. Any -i flag
placed after a -a command applies to all chains listed in
that specific -a declaration.
Assigning Separate Inputs to Distinct Chains
To route different audio sources into separate processing chains,
declare the chain first with -a, followed immediately by
its corresponding input -i.
ecasound -a:1 -i:track1.wav -a:2 -i:track2.wav -a:all -o:alsaIn this setup:
-a:1selects Chain 1, and-i:track1.wavsets its input.-a:2switches the context to Chain 2, and-i:track2.wavsets its input.-a:all -o:alsaroutes both chains together into the default ALSA soundcard output.
Each chain runs independently, allowing you to apply distinct effects
or volumes to track1.wav and track2.wav before
they reach the output stage.
Sharing One Input Across Multiple Chains
You can also split a single input across multiple chains by grouping
chain names together in a comma-separated list after
-a.
ecasound -a:1,2 -i:stereo_mix.wav -a:1 -ea:200 -a:2 -efl:1000 -a:1,2 -o:alsaIn this command:
-a:1,2makes both Chain 1 and Chain 2 active.-i:stereo_mix.wavassigns the same audio file as the input for both Chain 1 and Chain 2 simultaneously.- Subsequent chain declarations apply distinct effects to each chain
(
-ea:200to Chain 1,-efl:1000to Chain 2) before routing the combined results to the output device.
Rules for the
-i Option Across Chains
- Positional Execution: Ecasound processes arguments
sequentially. An input always attaches to the chains defined by the most
recent
-aswitch preceding it. - Input Limits: A single chain can only have one primary input assigned to it. If you reassign an input to an already configured chain, Ecasound will either overwrite the previous input or generate an error depending on the chain setup.
- Global Scope: If you specify
-iwithout defining an-achain first, Ecasound attaches the input to thedefaultchain.