Ecasound Early Input Stream Termination Explained
This article explains how Ecasound manages audio processing when an input stream terminates before others within the same chainsetup. It covers the engine's default sample-padding behavior, the criteria governing overall chainsetup termination across finite and real-time streams, and the operational impact on downstream chains, effects, and system resources.
Digital Silence Padding
When an input stream—such as an audio file—reaches its End-Of-File (EOF) before other inputs in the chainsetup, Ecasound does not immediately halt processing or disrupt the signal path. Instead, the exhausted input transitions into an inactive state where it continuously delivers zero-valued samples (digital silence) to its assigned chain.
This mechanism maintains stream synchronization across the engine. By substituting silence for missing data, Ecasound ensures that buffer sizes and sample rates remain aligned for any shared mixing stages, preventing buffer underruns or pipeline stalls.
Termination Behavior for Finite Inputs
If all inputs in the chainsetup are finite streams (such as WAV or FLAC files), the processing engine continues to run until the longest input file reaches EOF.
- The shorter inputs exhaust their data first and emit silence.
- The mix and any associated output chains continue receiving active audio from the remaining longer streams alongside the padded silence.
- Once the final active finite input reaches its end, Ecasound automatically triggers a global stop, closing all inputs, outputs, and chains cleanly.
Behavior with Real-Time Inputs
When a chainsetup mixes finite file inputs with continuous, real-time audio devices (such as ALSA, JACK, or line-in inputs), the termination dynamic changes:
- Because real-time inputs produce an indefinite stream of samples, they never signal EOF naturally.
- When a finite file stream finishes in this hybrid configuration, it will emit silence indefinitely while the real-time stream continues to run.
- The chainsetup will not terminate automatically; it requires an
explicit stop command from the user, a control script, or a predefined
length/time parameter (
-tor-tl).
Resource Consumption and Downstream Effects
Even after an input stream terminates and emits silence:
- Plugins and Effects: Any LADSPA plugins, filters, or internal effect operators placed on the chain of the terminated stream continue to process the incoming zero-samples. This means CPU cycles are still utilized to process silence unless the engine is stopped.
- Output Capture: Output targets (such as recorded files or live sound outputs) will continue capturing the mixed result of the active streams alongside the silenced stream until the entire engine reaches a full stop.