Ecasound Audio Backend Environment Variables

Ecasound is a command-line multitrack audio processing utility for Unix-like operating systems that supports several audio subsystems, including ALSA, JACK, and OSS. While Ecasound primarily selects audio backends based on resource prefixes supplied to its input and output options (-i and -o), multiple environment variables directly and indirectly influence backend selection, server targets, and default hardware routing. This guide explains which environment variables impact Ecasound’s audio subsystem behavior and how to configure them.

The ECASOUND Variable

The primary environment variable provided directly by the application is ECASOUND.

When set, Ecasound reads the contents of the ECASOUND variable and parses them as default command-line parameters before processing arguments passed in the terminal. Because backend selection in Ecasound is defined through input and output specifiers, you can use this variable to force a default audio backend globally:

  • To set default ALSA playback: export ECASOUND="-o alsa"
  • To default to JACK: export ECASOUND="-o jack"
  • To route to a specific OSS device: export ECASOUND="-o oss,/dev/dsp"

Any parameter supplied via the command line when invoking the program will interact with or override the flags declared in ECASOUND.

JACK Backend Environment Variables

When using the JACK audio subsystem (-i jack or -o jack), Ecasound relies on the standard libjack client library. The following environment variables govern how Ecasound discovers, starts, and connects to the JACK daemon:

  • JACK_DEFAULT_SERVER: Specifies the name of the JACK server instance that Ecasound connects to. This is essential in multi-server environments.
  • JACK_START_SERVER: When set to 1, instructs the client library to automatically spawn the JACK server daemon if it is not currently running when Ecasound launches.
  • JACK_NO_START_SERVER: Prevents Ecasound from attempting to auto-launch JACK if it is unavailable, forcing an immediate connection failure instead.

ALSA Backend Environment Variables

When interacting with the Advanced Linux Sound Architecture (-i alsa or -o alsa), Ecasound communicates via alsa-lib. The underlying routing and default devices are affected by:

  • ALSA_CARD: Designates the default sound card number or string identifier for the system, altering which physical interface Ecasound accesses when using generic ALSA device names like default or hw:0.
  • ALSA_PCM_CARD and ALSA_PCM_DEVICE: Alter the target card index and device index for PCM streams when explicit hardware addresses are omitted in the Ecasound device chain.
  • ALSA_CONFIG_PATH: Points Ecasound's ALSA client directly to a customized asound.conf configuration file, which can remap generic ALSA endpoints to custom plugins, software bridges, or subdevices.

Sound Server Emulation Variables

For systems running sound servers like PulseAudio or PipeWire where legacy Open Sound System (OSS) compatibility is needed, wrapper variables modify how Ecasound targets audio hardware:

  • LD_PRELOAD: Commonly used alongside utilities like padsp or aoss (e.g., LD_PRELOAD=/usr/lib/libpulsedsp.so). This redirects Ecasound’s OSS backend calls (/dev/dsp) to PulseAudio or PipeWire transparently without modifying Ecasound source binaries.
  • PULSE_SERVER: When using PulseAudio wrapper libraries, this variable directs the audio stream to a local socket or remote PulseAudio server.