niksos/hosts/niks/pipewire.nix
jacekpoz 036c458038 chore: move rtkit to pipewire
it's really only used by that I think
2023-08-03 11:18:49 +02:00

47 lines
1.4 KiB
Nix

{
config,
pkgs,
...
}: {
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
security.rtkit.enable = true;
environment.etc = let
json = pkgs.formats.json {};
rate = "48000";
quantum = "128";
in {
"pipewire/pipewire.conf.d/92-low-latency.conf".text = ''
context.properties = {
default.clock.rate = ${rate}
default.clock.quantum = ${quantum}
default.clock.min-quantum = ${quantum}
default.clock.max-quantum = ${quantum}
}
'';
"pipewire/pipewire-pulse.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" {
context.modules = [
{
name = "libpipewire-module-protocol-pulse";
args = {
pulse.min.req = "${quantum}/${rate}";
pulse.default.req = "${quantum}/${rate}";
pulse.max.req = "${quantum}/${rate}";
pulse.min.quantum = "${quantum}/${rate}";
pulse.max.quantum = "${quantum}/${rate}";
};
}
];
stream.properties = {
node.latency = "${quantum}/${rate}";
resample.quality = 1;
};
};
};
}