From 8b1dd4791d111001eae4d9480d55003105824d57 Mon Sep 17 00:00:00 2001 From: Joonas Rautiola Date: Sun, 25 Aug 2024 13:03:55 +0300 Subject: [PATCH] Try making pipewire more stable --- home-modules/easyeffects/default.nix | 14 +++++++++++- modules/desktop/sound.nix | 34 ++++++++++++++++++++-------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/home-modules/easyeffects/default.nix b/home-modules/easyeffects/default.nix index d10dfc2..8996d19 100644 --- a/home-modules/easyeffects/default.nix +++ b/home-modules/easyeffects/default.nix @@ -1,4 +1,4 @@ -{ +{pkgs, ...}: { imports = [ ./preset.nix ]; @@ -6,6 +6,18 @@ services.easyeffects = { enable = true; + # temp fix: https://github.com/NixOS/nixpkgs/issues/335551 + # waiting for: https://github.com/NixOS/nixpkgs/pull/335759 + package = pkgs.easyeffects.overrideAttrs (_: { + version = "v7.1.8"; + src = pkgs.fetchFromGitHub { + owner = "wwmm"; + repo = "easyeffects"; + rev = "v7.1.8"; + hash = "sha256-eDjtmr100WOCd0k0p3rUEtu6O9LlSGs43oaIXT07ikI="; + }; + }); + presets = [ { # Antlion Modmic Wireless diff --git a/modules/desktop/sound.nix b/modules/desktop/sound.nix index 7fa5b92..4ee4ea2 100644 --- a/modules/desktop/sound.nix +++ b/modules/desktop/sound.nix @@ -1,24 +1,40 @@ {pkgs, ...}: { services.pipewire = { enable = true; - alsa.enable = true; - alsa.support32Bit = true; pulse.enable = true; # https://www.reddit.com/r/linux/comments/1em8biv/psa_pipewire_has_been_halving_your_battery_life/ - wireplumber.extraConfig."10-disable-camera.conf" = { - "wireplumber.profiles".main."monitor.libcamera" = "disabled"; + wireplumber = { + enable = true; + extraConfig."10-disable-camera.conf" = { + "wireplumber.profiles".main."monitor.libcamera" = "disabled"; + }; + }; + + extraConfig.pipewire-pulse."92-low-latency" = { + "context.properties" = [ + { + name = "libpipewire-module-protocol-pulse"; + args = {}; + } + ]; + "pulse.properties" = { + "pulse.min.req" = "32/48000"; + "pulse.default.req" = "32/48000"; + "pulse.max.req" = "32/48000"; + "pulse.min.quantum" = "32/48000"; + "pulse.max.quantum" = "32/48000"; + }; + "stream.properties" = { + "node.latency" = "32/48000"; + "resample.quality" = 1; + }; }; }; security.rtkit.enable = true; - hardware.pulseaudio.daemon.config = { - default-sample-format = "float32le"; - }; - environment.systemPackages = with pkgs; [ - alsa-utils pulseaudio playerctl ];