Real-Time Processing Priority in Ecasound

This article explains how to enable real-time processing priority in Ecasound to achieve low-latency, glitch-free audio performance. You will learn the specific command-line parameter required to activate this mode, how to configure scheduling policies and priority levels, and the system permissions needed for real-time execution.

The Real-Time Parameter: -r

In Ecasound, the command-line parameter used to enable real-time processing priority is -r (or its long-form equivalent, --realtime).

When you pass this option, Ecasound requests real-time scheduling privileges from the operating system kernel. This prioritizes audio processing threads over standard system tasks, significantly reducing buffer underruns (xruns) and latency during playback, recording, or signal processing.

Syntax and Options

The -r option can be used as a standalone flag or with specific scheduling parameters:

Example Command

To launch an Ecasound session using the SCHED_FIFO policy with a priority level of 50:

ecasound -r:fifo,50 -i:somefile.wav -o:alsa,default

System Requirements and Permissions

To use real-time priority without running as the root superuser, your Linux user account must have appropriate resource limits configured.

Ensure your user belongs to the audio group and that /etc/security/limits.conf (or a file in /etc/security/limits.d/) grants real-time priority permissions:

@audio   -   rtprio     95
@audio   -   memlock    unlimited

If these limits are not properly set, Ecasound will display a warning or error indicating that it was unable to acquire real-time scheduling privileges, falling back to standard scheduling instead.