[PlanetCCRMA] jackfreq 0.2.0

Oleg Samarin osamarin68 at gmail.com
Sun Mar 1 11:25:20 PST 2020

Hi, All!

I'd like to add a new package 'jackfreq' to the CCRMA repository.

A lot of time ago Robin Gareus created jackfreqd: a daemon that changes
the CPU frequency based on the jack DSP load. It used the 'userspace'
cpu scaling governor.

Then the newer CPUs appeared. The newer Linux kernel started using the
'intel_pstate' cpu scaling driver that supports a lot of features of
the new cpus, including turbo bust. CPU frequency raises automaticaly
when CPU is loaded and it returns back to the minimal value (usually
800mhz) when CPU is idle.

But when using jack audio connection kit with several application
threads, these threads are spreading across cpu cores, and cpu load is
not sufficient for required rasing cpu frequency. It causes XRuns and
the sound distortion.

Unfortunately, the intel_pstate driver does not provide the 'userspace'
governor required by jackfreqd. provides only two cpu scaling
governors: 'powersave' - cpu itself selectss the frequency to work at -
and 'performance, that locks CPU frequency at the hihest value
available for 100% load on all cores. Most of linux audio tuning guides
recommend to set governor to 'performance' all the time.

But there are some disadvantages of this solution.
1. The cpu frequency is high even this is not necessary.
2. It causes high CPU voltage that lowers the CPU time to live.
3. It is unable to achieve tfor he maximum frequency for single-core
load, that is usually higher then all cores. It may be not desirable if
the computer is not dedicated for audio tasks and there are some
single-thread applications that are preferred to run at the higest
single-core frequency.

The resolution of this chalange: to set the 'powersave' governor when
no jack audio alpplications are active and switch it to 'performance'
when jack DSP load is exceeds a configured threshold (50% by default).

The new version of jackfreqd makes this automatically when the
'intel_pstate' driver is active. It continues to use the old
'userspace' governor for elder drivers.

The sourcecode of jackfreqd is available at 

Both rpm and source rpm packages are available rpm-based linux
distributions (I've tested it with Fedora 31).



Oleg Samarin.

More information about the PlanetCCRMA mailing list