From 55bb647fe972319d76804eee0c9a132e2ff19510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Fri, 23 Feb 2024 14:34:46 +0100 Subject: [PATCH] WIP: Do something about audio crackling? --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 5 +++++ nixos-config/default.nix | 2 +- nixos-config/hosts/yui/default.nix | 8 +++++++- nixos-config/hosts/yui/games.nix | 5 ++++- 5 files changed, 38 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index be0023c4..c7a244b2 100644 --- a/flake.lock +++ b/flake.lock @@ -207,6 +207,26 @@ "type": "github" } }, + "musnix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702456985, + "narHash": "sha256-mnjCk8mINY4t5uIwP2eR19FOQXHTCO68+KsgKFTv1NI=", + "owner": "musnix", + "repo": "musnix", + "rev": "cf93a72da8ad677864045e9a5dd32170378d9a62", + "type": "github" + }, + "original": { + "owner": "musnix", + "repo": "musnix", + "type": "github" + } + }, "naersk": { "inputs": { "nixpkgs": [ @@ -465,6 +485,7 @@ "fenix": "fenix", "home-manager": "home-manager", "impermanence": "impermanence", + "musnix": "musnix", "nix-gaming": "nix-gaming", "nixos-anywhere": "nixos-anywhere", "nixos-hardware": "nixos-hardware", diff --git a/flake.nix b/flake.nix index 7ee8bcff..da9caed2 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,11 @@ }; }; + musnix = { + url = "github:musnix/musnix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # home-manager related inputs home-manager = { url = "github:nix-community/home-manager/release-23.11"; diff --git a/nixos-config/default.nix b/nixos-config/default.nix index 0f07dfaa..a744d338 100644 --- a/nixos-config/default.nix +++ b/nixos-config/default.nix @@ -65,7 +65,7 @@ boot = { tmp.cleanOnBoot = true; plymouth.enable = true; - kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest; + kernelPackages = pkgs.linuxKernel.packages.linux_xanmod; loader = { timeout = 0; diff --git a/nixos-config/hosts/yui/default.nix b/nixos-config/hosts/yui/default.nix index 939f9e73..0ee4663b 100644 --- a/nixos-config/hosts/yui/default.nix +++ b/nixos-config/hosts/yui/default.nix @@ -12,6 +12,7 @@ in { flake-inputs.nixos-hardware.nixosModules.common-pc-ssd flake-inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate flake-inputs.nixos-hardware.nixosModules.common-gpu-nvidia-nonprime + flake-inputs.musnix.nixosModules.musnix ./games.nix ./hardware-configuration.nix @@ -68,6 +69,11 @@ in { fileSystems."/nix".options = ["defaults" "noatime"]; + musnix = { + enable = true; + soundcardPciId = "09:00.4"; + }; + # Fix broken suspend on b550i motherboard # # The rule is a bit overzealous, as it disables wake from *either* @@ -86,5 +92,5 @@ in { # For random android-related things programs.adb.enable = true; - users.users.tlater.extraGroups = ["adbusers"]; + users.users.tlater.extraGroups = ["adbusers" "audio"]; } diff --git a/nixos-config/hosts/yui/games.nix b/nixos-config/hosts/yui/games.nix index 04742144..cfca1de0 100644 --- a/nixos-config/hosts/yui/games.nix +++ b/nixos-config/hosts/yui/games.nix @@ -11,7 +11,10 @@ environment.systemPackages = [pkgs.mangohud]; # Appears to resolve issues with crackling audio under high load - services.pipewire.lowLatency.enable = true; + services.pipewire.lowLatency = { + enable = true; + quantum = 128; + }; # Make steam controller work hardware.steam-hardware.enable = true;