Dynamic LADSPA Plugin Removal in Ecasound

Ecasound allows the modification and removal of LADSPA plugins during an interactive session, but true dynamic unloading during active playback comes with specific operational constraints. While you do not need to exit the Ecasound Interactive Mode (EIAM) to remove a plugin, fully removing a LADSPA chain operator typically requires briefly stopping the audio processing engine. For uninterrupted real-time performance, dynamic deactivation is instead handled by bypassing the plugin rather than unlinking it completely while the engine is running.

The Interactive Mode (EIAM) Workflow

In Ecasound, LADSPA plugins are instantiated as chain operators (prefixed with -el: in chain setups). During an interactive session, commands are sent via standard input, a control socket, or Net-ECI.

To remove an active LADSPA plugin entirely from a chain setup, the session requires the following workflow:

  1. Halt processing: The real-time engine must be stopped using the stop command. Attempting structural changes to the processing graph while the engine is actively rendering audio can lead to buffer instabilities or state corruption.
  2. Select the target chain: Use c-select [chain_name] to focus on the chain containing the plugin.
  3. Select the operator: Use cop-select [operator_index] to target the specific LADSPA plugin instance.
  4. Remove the operator: Execute cop-remove to detach the LADSPA plugin from the chain.
  5. Resume processing: Restart the engine using the start command.

Because the session itself remains alive, this process allows reconfiguration without needing to restart Ecasound or reload audio files and drivers.

Dynamic Bypassing vs. Complete Removal

If audio playback must remain uninterrupted, complete operator removal is not the ideal mechanism. Instead, Ecasound provides dynamic bypassing, which can be toggled on the fly without stopping the engine:

When bypassed, the LADSPA plugin remains loaded in memory and allocated in the chain, but Ecasound routes audio around it, effectively dropping its CPU processing overhead without interrupting the audio stream or causing dropouts.

Memory and Shared Object Behavior

Executing cop-remove cleans up the specific plugin instance and frees its associated memory buffers within the chain. However, Ecasound does not necessarily unload the underlying LADSPA shared object (.so library file) from system memory via dlclose() immediately. The dynamic library typically remains mapped to the Ecasound process space for the remainder of the interactive session, ensuring fast re-instantiation if the plugin is added back later using cop-add.