From f5af1066c93b340e4c99d7598f3982cf33d41124 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 8 Mar 2022 13:47:49 +0100 Subject: sif: pipewire realtime --- hosts/sif/default.nix | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index 7cce8af0..4e099f38 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix @@ -337,6 +337,84 @@ in { jack.enable = true; media-session.enable = false; wireplumber.enable = true; + config.pipewire = { + "context.properties" = { + "link.max-buffers" = 16; + "log.level" = 2; + "default.clock.rate" = 192000; + "default.clock.quantum" = 1024; + "default.clock.min-quantum" = 32; + "default.clock.max-quantum" = 2048; + "core.daemon" = true; + "core.name" = "pipewire-0"; + }; + "context.modules" = [ + { + name = "libpipewire-module-rtkit"; + args = { + "nice.level" = -15; + "rt.prio" = 88; + "rt.time.soft" = 200000; + "rt.time.hard" = 200000; + }; + flags = [ "ifexists" "nofail" ]; + } + { name = "libpipewire-module-protocol-native"; } + { name = "libpipewire-module-profiler"; } + { name = "libpipewire-module-metadata"; } + { name = "libpipewire-module-spa-device-factory"; } + { name = "libpipewire-module-spa-node-factory"; } + { name = "libpipewire-module-client-node"; } + { name = "libpipewire-module-client-device"; } + { + name = "libpipewire-module-portal"; + flags = [ "ifexists" "nofail" ]; + } + { + name = "libpipewire-module-access"; + args = {}; + } + { name = "libpipewire-module-adapter"; } + { name = "libpipewire-module-link-factory"; } + { name = "libpipewire-module-session-manager"; } + ]; + }; + config.pipewire-pulse = { + "context.properties" = { + "log.level" = 2; + }; + "context.modules" = [ + { + name = "libpipewire-module-rtkit"; + args = { + "nice.level" = -15; + "rt.prio" = 88; + "rt.time.soft" = 200000; + "rt.time.hard" = 200000; + }; + flags = [ "ifexists" "nofail" ]; + } + { name = "libpipewire-module-protocol-native"; } + { name = "libpipewire-module-client-node"; } + { name = "libpipewire-module-adapter"; } + { name = "libpipewire-module-metadata"; } + { + name = "libpipewire-module-protocol-pulse"; + args = { + "pulse.min.req" = "32/192000"; + "pulse.default.req" = "1024/192000"; + "pulse.max.req" = "2048/192000"; + "pulse.min.quantum" = "32/192000"; + "pulse.max.quantum" = "2048/192000"; + "server.address" = [ "unix:native" ]; + }; + } + ]; + "stream.properties" = { + "node.latency" = "2048/192000"; + "resample.quality" = 1; + }; + }; }; hardware = { -- cgit v1.2.3