set pipewire rate and quantum

hopefully will remove all that annoying crackling i get in some games
This commit is contained in:
xunuwu 2025-05-18 14:25:17 +02:00
parent fb1fc75908
commit 9faaddc232

View file

@ -1,6 +1,4 @@
{inputs, ...}: { {
imports = [inputs.nix-gaming.nixosModules.pipewireLowLatency];
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
@ -8,6 +6,38 @@
jack.enable = true; jack.enable = true;
pulse.enable = true; pulse.enable = true;
lowLatency.enable = true; extraConfig = let
rate = 48000;
min-quantum = 512;
max-quantum = 1024;
in {
pipewire."92-quantum"."context.properties" = {
"default.clock.rate" = rate;
"default.clock.quantum" = min-quantum;
"default.clock.min-quantum" = min-quantum;
"default.clock.max-quantum" = max-quantum;
};
pipewire-pulse."92-quantum" = let
qr = "${toString min-quantum}/${toString rate}";
in {
"context.properties" = [
{
name = "libpipewire-module-protocol-pulse";
args = {};
}
];
"pulse.properties" = {
"pulse.default.req" = qr;
"pulse.min.req" = qr;
"pulse.max.req" = qr;
"pulse.min.quantum" = qr;
"pulse.max.quantum" = qr;
};
"stream.properties" = {
"node.latency" = qr;
};
};
};
}; };
} }