Routing Ecasound Through PulseAudio

Ecasound cannot route audio directly to PulseAudio through a native PulseAudio driver, as it lacks built-in client libraries for the PulseAudio sound server. However, users can still route audio streams reliably between Ecasound and PulseAudio by leveraging intermediate layers, such as ALSA compatibility plugins, standard UNIX pipes with PulseAudio command-line utilities, or JACK emulation bridges.

Native Support Limitations

Ecasound provides native support for specific sound architectures, including ALSA (alsa), OSS (oss), and JACK (jack), as well as file formats and standard streams. It does not include an explicit native object syntax (such as -i pulse or -o pulse) to connect directly to the PulseAudio daemon socket.

Method 1: The ALSA PulseAudio Plugin

The most transparent and common way to connect Ecasound to PulseAudio is through ALSA's pulse plugin. When configured, ALSA intercepts Ecasound's audio output and forwards it directly to PulseAudio.

To use the system default ALSA device pointing to PulseAudio, run:

ecasound -i somefile.wav -o alsa,default

If your default ALSA device does not automatically map to PulseAudio, specify the pulse plugin directly in your command:

ecasound -i somefile.wav -o alsa,pulse

For capturing audio from PulseAudio back into Ecasound, invert the routing parameters:

ecasound -i alsa,pulse -o output.wav

Method 2: UNIX Pipes with pacat and parec

PulseAudio provides command-line utilities—pacat (playback) and parec (record)—that can stream raw audio via standard input and standard output. This bypasses the ALSA layer completely.

To play an Ecasound stream through PulseAudio using stdout:

ecasound -i somefile.wav -f:s16_le,2,44100 -o stdout | pacat --playback --rate=44100 --channels=2 --format=s16le

To record an audio stream from PulseAudio into Ecasound using stdin:

parec --rate=44100 --channels=2 --format=s16le | ecasound -f:s16_le,2,44100 -i stdin -o recorded.wav

Method 3: JACK Emulation Bridges

For complex audio routing with low latency requirements, Ecasound can output directly to JACK (-o jack). If PulseAudio is running the module-jack-sink and module-jack-source modules, PulseAudio will register as an audio port within the JACK system, allowing Ecasound to interact with PulseAudio streams via JACK routing commands. Modern Linux distributions using PipeWire can achieve this identically, as PipeWire natively handles PulseAudio, ALSA, and JACK layers simultaneously.