Multiple Inputs on a Single Ecasound Chain
This article explains the input routing architecture of Ecasound and addresses whether a single processing chain can handle multiple concurrent audio inputs. You will learn the technical limitations of Ecasound chains, how the engine handles audio signal routing, and the standard methods used to mix multiple audio sources into a single processing path or output.
A single chain in Ecasound cannot accept audio from multiple concurrent inputs. In Ecasound's processing model, a chain represents a linear, single-stream signal path. Each individual chain is strictly limited to receiving audio from a single input source at any given moment. If you attempt to assign multiple input streams to the same chain identifier, Ecasound will reject the configuration or overwrite the previous input assignment.
To process multiple concurrent inputs in Ecasound, you must use multiple chains. The architecture is designed to handle mixing and concurrent processing at the output stage or via intermediate loop devices rather than inside a single chain.
The Standard Multi-Input Pattern
When you want to combine multiple audio inputs concurrently, assign each input stream to its own dedicated chain, and then route those separate chains to a common output. Ecasound automatically mixes the streams when multiple chains share the same output device or file.
For example, to play two separate audio files simultaneously through your sound card:
ecasound -a:1 -i input1.wav -a:2 -i input2.wav -a:1,2 -o alsaIn this setup:
- Chain
1processesinput1.wav. - Chain
2processesinput2.wav. - Both chains
1and2are routed to the ALSA output, where their audio signals are automatically summed.
Processing Combined Inputs with Effects
If your goal is to apply effects or signal processing to the combined
mix of multiple inputs using a single chain, you must use Ecasound's
virtual loop devices. Loop devices (loop,id) allow audio
from multiple chains to be mixed and then routed as a single combined
input into a downstream chain.
ecasound \
-a:input_a -i input1.wav -o loop,1 \
-a:input_b -i input2.wav -o loop,1 \
-a:master -i loop,1 -efl:1000 -o alsaIn this scenario:
- Chain
input_aand chaininput_breceive independent, concurrent inputs and send them to the virtual deviceloop,1. loop,1mixes the two streams together.- Chain
masteracceptsloop,1as its single input, applies a low-pass filter (-efl:1000), and sends the mixed, processed audio to the ALSA output.
By separating inputs into individual chains and combining them via shared outputs or loop devices, you achieve concurrent multi-input routing while adhering to Ecasound's single-input-per-chain design.