Bind Ecasound to ALSA Hardware Using hw Prefix

Ecasound can directly interface with Advanced Linux Sound Architecture (ALSA) hardware devices using the standard hw: prefix syntax. This article explains how Ecasound integrates with ALSA hardware, outlines the required command-line syntax for input and output routing, and covers key considerations such as exclusive device access and format compatibility when bypassing software mixing layers.

Direct ALSA Binding in Ecasound

Ecasound natively supports ALSA devices through its ALSA I/O object type. By utilizing the hw: prefix, Ecasound establishes direct communication with the sound card's hardware buffer, completely bypassing ALSA's software mixing layer (dmix) and sample rate conversion plugins.

To bind to an ALSA hardware device, specify the audio format type as alsa followed by the target device string in Ecasound’s input (-i) or output (-o) parameters.

Command Syntax

The general syntax for addressing an ALSA device directly is:

-i alsa,hw:CARD,DEVICE
-o alsa,hw:CARD,DEVICE

Example Usage

To route input directly from the first hardware device of the first sound card to the first hardware device of the second card:

ecasound -f:s16_le,2,44100 -i alsa,hw:0,0 -o alsa,hw:1,0

You can identify available card and device numbers on your system using the standard ALSA utility:

arecord -l
aplay -l

Considerations When Using the hw Prefix