Supercollider notes

So I've been wanting to mess around with Supercollider off and on for about a year now. When I first started out, I added JACK to audio configuration in nixos with relative ease. However, I got a bunch of "Warning: cannot raise thread priority" and similar errors and Supercollider would not output any audio. Back then I gave up as I couldn't find any posts of anyone having fixed it on nixos.

Today, I gave it another shot and ended up on a JACK documentation page on how to configure your system to allow JACK to use realtime scheduling. Here, the section titled "Systems using PAM" caught my attention as I'd set up a yubikey earlier today. From here, it was a matter of digging through the 'limits.conf(5)' manpage and translating the syntax from standard the PAM configuration file format to nix. Here's what I added that made the error go away and get Supercollider to output audio:

{
  security.pam.loginLimits = [
    { domain = "@audio";
      type = "-";
      item = "rtprio";
      value = 95;
    }

    { domain = "@audio";
      type = "-";
      item = "memlock";
      value = "unlimited";
    }
  ];
}
How do I configure my linux system to allow JACK to use realtime scheduling?

Hope this helps someone. If I manage to do anything with this, a longer article might follow on the http frontend.

Back