How to Create a 16-Input Stereo Mix in Ecasound

This guide explains how to configure Ecasound to sum a 16-channel audio interface down to an instantaneous, ultra-low-latency stereo monitor mix. By combining real-time buffering parameters (-B:rt) with Ecasound’s channel-routing operator (-erc), you can capture 16 independent hardware inputs and collapse them into a two-channel output destination in real time without the overhead of a graphical digital audio workstation.


The Command Configuration

To monitor 16 inputs live and route them to a stereo pair using ALSA, run:

ecasound -B:rt -b:128 -r:sched_fifo \
  -f:f32_le,16,48000 -i:alsa,hw:1 \
  -f:f32_le,2,48000 -o:alsa,hw:0 \
  -erc:1,1 -erc:2,2 \
  -erc:3,1 -erc:4,2 \
  -erc:5,1 -erc:6,2 \
  -erc:7,1 -erc:8,2 \
  -erc:9,1 -erc:10,2 \
  -erc:11,1 -erc:12,2 \
  -erc:13,1 -erc:14,2 \
  -erc:15,1 -erc:16,2

Parameter Breakdown

  • -B:rt -b:128 -r:sched_fifo: Sets the real-time processing engine. -B:rt enables real-time buffering, -b:128 sets the internal buffer size to 128 frames (reducing latency down to roughly 2.6 ms at 48 kHz), and -r:sched_fifo requests FIFO real-time process priority from the Linux kernel to eliminate audio dropouts.
  • -f:f32_le,16,48000 -i:alsa,hw:1: Configures the audio format and input device. It specifies 32-bit floating-point little-endian samples, 16 input channels, and a 48,000 Hz sample rate pulled directly from hardware card hw:1.
  • -f:f32_le,2,48000 -o:alsa,hw:0: Configures the monitor output format, reducing the channel count to 2 (stereo) and sending the stream to the monitoring device (hw:0).
  • -erc:from,to: The route/mix operator. In this configuration, odd input channels (1, 3, 5, etc.) are routed to output Channel 1 (Left), and even input channels (2, 4, 6, etc.) are routed to output Channel 2 (Right). Ecasound sums audio whenever multiple source channels are routed to the same destination channel.

Adding Gain and Centered Routing

If specific channels require individual level adjustments or center-panning (summed to both Left and Right simultaneously), route each channel across multiple chains:

ecasound -B:rt -b:128 \
  -a:ch1 -i:alsa,hw:1 -erc:1,1 -erc:1,2 -ea:70 \
  -a:ch2 -i:alsa,hw:1 -erc:2,1 -ea:100 \
  -a:ch3 -i:alsa,hw:1 -erc:3,2 -ea:100 \
  -a:all -f:f32_le,2,48000 -o:alsa,hw:0
  • -erc:1,1 -erc:1,2: Sends Channel 1 to both Left and Right output channels (phantom center).
  • -ea:value: Adjusts the linear amplitude percentage (e.g., -ea:70 reduces volume to 70%, preventing clipping when summing 16 hot signals together).