SuperCollider: Couldn't set realtime scheduling priority 1: Operation not permitted

Hi,

Any ideas why am I getting this error any time I start scide (SuperCollider IDE):

Couldn't set realtime scheduling priority 1: Operation not permitted

Here are the relevant parts of my configuration.nix:

  1. I have enabled rtkit
  2. I have added my user to the audio group
{ config, pkgs, ... }:

let
  unstable = import <unstable> {};
in {
  imports =
    [
      ./hardware-configuration.nix
    ];

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.kernelParams = [
    "preempt=full"       
    "amdgpu.gfxoff=0"
    "amdgpu.dcfeaturemask=0"
  ];

  hardware.graphics.extraPackages = with pkgs; [
    libvdpau-va-gl
  ];

  services.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    jack.enable = true;
  };

  users.users."neex" = {
    isNormalUser = true;
    description = "neex";
    extraGroups = [ "networkmanager" "wheel" "kvm" "audio" "podman" "libvirtd"];
    shell = pkgs.fish;
  };

  environment.systemPackages = with pkgs; [
    supercollider-with-sc3-plugins
  ];

  system.stateVersion = "26.05";
}

Thanks in advance.

Adding these lines fixed the problem:

  security.pam.loginLimits = [
    { domain = "@audio"; type = "-"; item = "rtprio"; value = "95"; }
    { domain = "@audio"; type = "-"; item = "memlock"; value = "524288"; } # optional
  ];
2 Likes