From 3dffa4eb4bb13a888f130022fdd79953d666d748 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Thu, 28 Mar 2024 08:54:48 -0700 Subject: [PATCH] gaming audio --- extras/gaming.nix | 55 +++++++++++++++++++++++++++++++++++------- systems/NOcomputer.nix | 46 ----------------------------------- 2 files changed, 46 insertions(+), 55 deletions(-) diff --git a/extras/gaming.nix b/extras/gaming.nix index 0b56144..71c1a8a 100644 --- a/extras/gaming.nix +++ b/extras/gaming.nix @@ -1,13 +1,4 @@ {pkgs, ...}: { - # { pkgs, aagl, ... }: { - # imports = [ aagl.nixosModules.default ]; - # nix.settings = aagl.nixConfig; - # programs.honkers-railway-launcher.enable = true; - # nixpkgs.config.permittedInsecurePackages = [ - # "electron-24.8.6" - # # "electron-12.2.3" - # ]; - environment.systemPackages = with pkgs; [ # parsec-bin gamemode @@ -47,4 +38,50 @@ groups = ["wheel"]; } ]; + + # THE FINALS audio borked + services.pipewire.enable = false; + hardware.pulseaudio.enable = true; + hardware.pulseaudio.support32Bit = true; + services.pipewire.extraConfig = { + pipewire."99-low-latency" = { + context.properties = { + default.allowed-rates = [44100 48000 96000]; + default.clock.rate = 192000; + default.clock.quantum = 32; + default.clock.min-quantum = 32; + default.clock.max-quantum = 32; + }; + context.modules = [ + { + name = "libpipewire-module-rt"; + args = { + nice.level = -12; + rt.prio = 89; + rt.time.soft = 200000; + rt.time.hard = 200000; + }; + flags = ["ifexists nofail"]; + } + ]; + }; + pipewire-pulse."99-low-latency" = { + context.modules = [ + { + name = "libpipewire-module-protocol-pulse"; + args = { + pulse.min.req = "32/192000"; + pulse.default.req = "32/192000"; + pulse.max.req = "32/192000"; + pulse.min.quantum = "32/192000"; + pulse.max.quantum = "32/192000"; + }; + } + ]; + stream.properties = { + node.latency = "32/192000"; + resample.quality = 1; + }; + }; + }; } diff --git a/systems/NOcomputer.nix b/systems/NOcomputer.nix index 885fa0c..f9e638c 100644 --- a/systems/NOcomputer.nix +++ b/systems/NOcomputer.nix @@ -13,52 +13,6 @@ boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = "1"; - # THE FINALS audio borked - services.pipewire.enable = false; - hardware.pulseaudio.enable = true; - hardware.pulseaudio.support32Bit = true; - services.pipewire.extraConfig = { - pipewire."99-low-latency" = { - context.properties = { - default.allowed-rates = [44100 48000 96000]; - default.clock.rate = 192000; - default.clock.quantum = 32; - default.clock.min-quantum = 32; - default.clock.max-quantum = 32; - }; - context.modules = [ - { - name = "libpipewire-module-rt"; - args = { - nice.level = -12; - rt.prio = 89; - rt.time.soft = 200000; - rt.time.hard = 200000; - }; - flags = ["ifexists nofail"]; - } - ]; - }; - pipewire-pulse."99-low-latency" = { - context.modules = [ - { - name = "libpipewire-module-protocol-pulse"; - args = { - pulse.min.req = "32/192000"; - pulse.default.req = "32/192000"; - pulse.max.req = "32/192000"; - pulse.min.quantum = "32/192000"; - pulse.max.quantum = "32/192000"; - }; - } - ]; - stream.properties = { - node.latency = "32/192000"; - resample.quality = 1; - }; - }; - }; - # services.foldingathome = { # enable = true; # team = 223518;