Record Multitrack Audio with Ecasound

This guide provides a direct walkthrough for configuring Ecasound to record simultaneous, discrete tracks from a multichannel audio interface on Linux. By mapping hardware inputs to independent chains and routing specific channels to individual destination files, you can capture isolated multi-track sessions from the command line without the overhead of a graphical digital audio workstation (DAW).

1. Identify Your Multi-Channel Audio Device

Before building the Ecasound command, identify the ALSA card and subdevice index of your audio interface. Run the following command in your terminal:

arecord -l

Locate your interface in the output list. Note the card number and device number. For example, if your multi-input interface is listed as card 1: USB [Audio Interface], device 0: USB Audio, your ALSA device string will be hw:1,0.

2. Ecasound Multi-Track Architecture

Ecasound uses chains to process audio. To record multiple inputs to separate files:

  1. Define a set of active chains (one for each track).
  2. Assign the multi-channel ALSA hardware source to all chains simultaneously.
  3. Configure each chain to isolate its assigned channel.
  4. Output each chain to a distinct audio file.

3. The Multitrack Recording Command

Assume you are recording 4 simultaneous mono tracks from a 4-channel interface (hw:1,0) at 24-bit depth and a 48 kHz sampling rate. Use the following command:

ecasound \
  -f:s24_le,4,48000 -a:1,2,3,4 -i:alsa,hw:1,0 \
  -a:1 -f:s24_le,1,48000 -chorder:1 -o:track_01.wav \
  -a:2 -f:s24_le,1,48000 -chorder:2 -o:track_02.wav \
  -a:3 -f:s24_le,1,48000 -chorder:3 -o:track_03.wav \
  -a:4 -f:s24_le,1,48000 -chorder:4 -o:track_04.wav

Parameter Breakdown:

  • -f:s24_le,4,48000: Sets the audio format for the input to signed 24-bit little-endian, 4 channels, and a 48000 Hz sample rate. Adjust channel count and sample rate to match your hardware requirements.
  • -a:1,2,3,4 -i:alsa,hw:1,0: Connects the 4-channel ALSA input device to chains 1, 2, 3, and 4 simultaneously.
  • -a:1: Switches context to chain 1.
  • -chorder:X: Selects channel X from the multichannel stream and routes it as the primary channel for that specific chain.
  • -o:track_XX.wav: Writes the resulting mono signal from that chain to the designated file.

4. Running and Stopping the Session

Once executed, Ecasound will initialize the ALSA interface, report buffer configurations, and begin recording immediately.

  • To stop recording cleanly, press Ctrl+C. Ecasound will flush all write buffers and close the WAV file headers safely.
  • If running Ecasound in interactive mode (by adding -c to the invocation), type start to begin recording, stop to pause, and quit to exit.