Ecasound File vs Hardware Inputs on Command Line

This article provides an overview of how Ecasound distinguishes between physical hardware interfaces and stored audio files when parsing command-line options. By understanding how the utility evaluates the -i (input) argument through device prefixes, file extensions, and device nodes, you can reliably route both file-based media and live audio streams in your processing chains.


Ecasound differentiates audio sources using a combination of explicit driver prefixes, filesystem paths, and recognized file format extensions provided to the -i parameter.

1. Driver and Subsystem Prefixes

Hardware audio inputs typically require a subsystem prefix that tells Ecasound which audio backend driver to use to communicate with the physical sound card. The syntax follows a type,parameter format:

When Ecasound encounters these prefixes, it bypasses the filesystem file reader and initializes the corresponding real-time audio subsystem driver.

2. Device Node Paths (OSS/Legacy)

For older interfaces such as Open Sound System (OSS), hardware devices are represented directly as filesystem nodes under /dev. Ecasound checks whether the path corresponds to a character device rather than a regular file:

If the targeted path is identified as a direct sound card interface node, Ecasound attaches to it as an input stream rather than attempting to read it as a standard audio file.

3. File Extensions and Regular Paths

When no subsystem prefix (like alsa or jack) is provided, Ecasound treats the input as a file. It determines how to decode the data by inspecting the filename's extension:

Summary of Parsing Priority

When resolving an input:

  1. Prefix Match: Ecasound checks if the string starts with a recognized audio I/O driver keyword followed by a comma (e.g., alsa,, jack,).
  2. Device Node Match: Ecasound checks if the argument points to an existing system hardware node (e.g., /dev/dsp).
  3. File Match: If neither condition is met, the argument is handled as a standard filesystem path and processed using the file extension to load the corresponding audio reader.