[Slackbuilds-users] realtime capabilities for jack and its apps
yalhcru at gmail.com
Sat Aug 20 00:10:14 UTC 2011
Proposal: the doinst.sh for any audio synthesis or production package that
uses jack-audio-connection-kit should contain code in the doinst.sh like so:
setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/whatever
This gives the binary the ability to run with POSIX realtime scheduling
priority (SCHED_FIFO) and to lock its pages so they won't be swapped
The jack-audio-connection-kit README mentions this, and claims that
POSIX capabilities aren't supported on reiserfs, but this is outdated
(reiserfs in 13.37 does support them).
These capabilities make a noticeable difference in audio quality even
when using a stock Slack kernel without the realtime patch. Without
cap_sys_nice, it's possible for e.g. the cached samples in fluidsynth to
be swapped to disk, causing huge gaps in playback. Without cap_ipc_lock,
you get smaller gaps, but lots of them (known as x-runs, in jack
terminology). In fact, it's safe to say that these audio applications
are completely useless without the capabilities (meaning that every user
who installs any of them, has to manually run the above setcap command,
assuming they're aware they need to).
The caps have to be set in the doinst.sh because tar doesn't preserve
POSIX filesystem capability bits.
Comments, objections, discussion...?
More information about the SlackBuilds-users