Files
nixos-config/modules/desktop/pulseaudio.nix
T
Lumpiasty c9e6ec7b23 add audio-rt module to fight xruns under cpu load
EasyEffects DSP plugins (rnnoise, deepfilternet, crystalizer) drop audio
when the system is under load. Layered workaround with per-optimization
toggles for bisecting impact:

- cgroup-based CPU partitioning: dedicated audio.slice with AllowedCPUs
  pinning, restricted app/session/background slices for everything else
- rlimits so PipeWire's module-rt sets SCHED_FIFO 88 directly instead of
  going through RTKit's priority-10 ceiling
- persistent watcher that re-applies performance governor on audio cores
  (gamemoded/PPD keep resetting it)
- ananicy rule pinning easyeffects to nice -12 for non-RT DSP threads
- znver4-tuned rebuilds of easyeffects and its DSP deps

Master switch + per-feature toggles via lumpiasty.audioRt.*; all enabled
by default on acer host. None of this fully eliminates dropouts on this
thermally constrained laptop but each layer is independently testable.
2026-05-18 17:20:21 +02:00

68 lines
1.9 KiB
Nix

{ config, lib, pkgs, modulesPath, ... }:
{
options.lumpiasty.enablePulseaudio = lib.mkEnableOption "Enable Plasma6 desktop";
config = lib.mkIf config.lumpiasty.enablePulseaudio {
# Enable sound with pipewire. Dont forget after 24.05
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
extraConfig.pipewire."99-quantum" = {
"context.properties" = {
"default.clock.quantum" = 1024;
"default.clock.min-quantum" = 1024;
"default.clock.max-quantum" = 8192;
};
};
wireplumber.configPackages = [
(pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/99-alsa-nova-3.conf" ''
monitor.alsa.rules = [
{
matches = [
{
node.name = "alsa_output.usb-SteelSeries_Arctis_Nova_7-00.analog-stereo"
}
]
actions = {
update-props = {
audio.format = "S24LE"
audio.rate = 96000
api.alsa.period-size = 1024
api.alsa.period-num = 8
api.alsa.disable-batch = false
}
}
}
]
'')
];
};
# hardware.pulseaudio = {
# enable = true;
# support32Bit = true;
# extraConfig = ''
# unload-module module-role-cork
# '';
# };
# hardware.alsa.enablePersistence = true; # not implemented in 24.05
# Remove me after 24.05
# sound.enable = true;
};
}