diff options
| author | Fuwn <[email protected]> | 2024-10-02 21:38:32 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-02 21:38:32 -0700 |
| commit | cc04a23252ecbddc165a26b66d7568cfca6de7b7 (patch) | |
| tree | c3734a400bd69ab2680bfedf68ad813e75ef54b8 /modules/pc/software | |
| parent | hosts: organise like modules (diff) | |
| download | nixos-config-cc04a23252ecbddc165a26b66d7568cfca6de7b7.tar.xz nixos-config-cc04a23252ecbddc165a26b66d7568cfca6de7b7.zip | |
pipewire: enable nix-gaming low latency
Diffstat (limited to 'modules/pc/software')
| -rw-r--r-- | modules/pc/software/multimedia/audio/default.nix | 3 | ||||
| -rw-r--r-- | modules/pc/software/multimedia/audio/pipewire.nix | 151 |
2 files changed, 4 insertions, 150 deletions
diff --git a/modules/pc/software/multimedia/audio/default.nix b/modules/pc/software/multimedia/audio/default.nix index f4e7f0a..62c1ce0 100644 --- a/modules/pc/software/multimedia/audio/default.nix +++ b/modules/pc/software/multimedia/audio/default.nix @@ -1,6 +1,9 @@ +{ config, lib, ... }: { imports = [ ./pipewire.nix # ./wireplumber.nix ]; + + security.rtkit.enable = lib.modules.mkForce config.services.pipewire.enable; } diff --git a/modules/pc/software/multimedia/audio/pipewire.nix b/modules/pc/software/multimedia/audio/pipewire.nix index 2824176..5266516 100644 --- a/modules/pc/software/multimedia/audio/pipewire.nix +++ b/modules/pc/software/multimedia/audio/pipewire.nix @@ -1,13 +1,3 @@ -# { lib, ... }: -# let -# inherit (lib.modules) mkBefore; -# inherit (lib.lists) singleton; -# inherit (builtins) toString; -# mapOptionDefault = lib.attrsets.mapAttrs (_: lib.modules.mkOptionDefault); -# quantum = toString 64; -# rate = toString 48000; -# qr = "${quantum}/${rate}"; -# in { services.pipewire = { enable = true; @@ -15,150 +5,11 @@ jack.enable = true; pulse.enable = true; audio.enable = true; + lowLatency.enable = true; alsa = { enable = true; support32Bit = true; }; - - extraConfig = { - pipewire = { - "10-logging" = { - "context.properties"."log.level" = 3; - }; - - # "10-defaults" = { - # "context.properties" = mapOptionDefault { - # "clock.power-of-two-quantum" = true; - # "core.daemon" = true; - # "core.name" = "pipewire-0"; - # "link.max-buffers" = 16; - # "settings.check-quantum" = true; - # }; - - # "context.spa-libs" = mapOptionDefault { - # "audio.convert.*" = "audioconvert/libspa-audioconvert"; - # "avb.*" = "avb/libspa-avb"; - # "api.alsa.*" = "alsa/libspa-alsa"; - # "api.v4l2.*" = "v4l2/libspa-v4l2"; - # "api.libcamera.*" = "libcamera/libspa-libcamera"; - # "api.bluez5.*" = "bluez5/libspa-bluez5"; - # "api.vulkan.*" = "vulkan/libspa-vulkan"; - # "api.jack.*" = "jack/libspa-jack"; - # "support.*" = "support/libspa-support"; - # "video.convert.*" = "videoconvert/libspa-videoconvert"; - # }; - # }; - }; - - # pipewire-pulse = { - # "10-defaults" = { - # "context.spa-libs" = mapOptionDefault { - # "audio.convert.*" = "audioconvert/libspa-audioconvert"; - # "support.*" = "support/libspa-support"; - # }; - - # "pulse.cmd" = mkBefore [ - # { - # cmd = "load-module"; - # args = "module-always-sink"; - # flags = [ ]; - # } - # ]; - - # "pulse.properties" = { - # "server.address" = mkBefore [ "unix:native" ]; - # }; - - # "pulse.rules" = mkBefore [ - # { - # matches = [ - # { "application.process.binary" = "teams"; } - # { "application.process.binary" = "teams-insiders"; } - # { "application.process.binary" = "skypeforlinux"; } - # ]; - - # actions.quirks = [ "force-s16-info" ]; - # } - # { - # matches = singleton { "application.process.binary" = "firefox"; }; - # actions.quirks = [ "remove-capture-dont-move" ]; - # } - # { - # matches = singleton { "application.name" = "~speech-dispatcher*"; }; - - # actions = { - # update-props = { - # "pulse.min.req" = "1024/48000"; # 21 milliseconds - # "pulse.min.quantum " = "1024/48000"; # 21 milliseconds - # }; - # }; - # } - # ]; - # }; - # }; - - # pipewire."92-low-latency" = { - # "context.properties" = { - # "default.clock.rate" = rate; - # "default.clock.quantum" = quantum; - # "default.clock.min-quantum" = quantum; - # "default.clock.max-quantum" = quantum; - # "default.clock.allowed-rates" = [ rate ]; - # }; - - # # "context.modules" = [ - # # { - # # name = "libpipewire-module-rtkit"; - - # # flags = [ - # # "ifexists" - # # "nofail" - # # ]; - - # # args = { - # # "nice.level" = -15; - # # "rt.prio" = 90; - # # "rt.time.soft" = 200000; - # # "rt.time.hard" = 200000; - # # }; - # # } - # # { - # # name = "libpipewire-module-protocol-pulse"; - - # # args = { - # # "server.address" = [ "unix:native" ]; - # # "pulse.min.quantum" = qr; - # # "pulse.min.req" = qr; - # # "pulse.min.frag" = qr; - # # }; - # # } - # # ]; - - # "stream.properties" = { - # "node.latency" = qr; - # "resample.quality" = 1; - # }; - # }; - - # pipewire-pulse."92-low-latency" = { - # "context.modules" = singleton { - # name = "libpipewire-module-protocol-pulse"; - - # args = { - # "pulse.min.req" = qr; - # "pulse.default.req" = qr; - # "pulse.max.req" = qr; - # "pulse.min.quantum" = qr; - # "pulse.max.quantum" = qr; - # }; - # }; - - # "stream.properties" = { - # "node.latency" = qr; - # "resample.quality" = 4; - # }; - # }; - }; }; } |