From 1995b036b4a3d8372663e952eca1e7f2a746420e Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sun, 21 Apr 2024 23:13:10 +0200 Subject: [PATCH] try better audio config to avoid pop on suspend --- common.nix | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/common.nix b/common.nix index f394575..49fcbcf 100644 --- a/common.nix +++ b/common.nix @@ -199,11 +199,50 @@ in services.desktopManager.plasma6.enable = true; # enable sound with PipeWire + sound.enable = true; + hardware.pulseaudio.enable = false; services.pipewire = { enable = true; - alsa.enable = true; - jack.enable = true; + alsa = { + enable = true; + support32Bit = true; + }; pulse.enable = true; + wireplumber.configPackages = [ + (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/alsa.conf" '' + monitor.alsa.rules = [ + { + matches = [ + { + device.name = "~alsa_card.*" + } + ] + actions = { + update-props = { + # Device settings + api.alsa.use-acp = true + } + } + } + { + matches = [ + { + node.name = "~alsa_input.pci.*" + } + { + node.name = "~alsa_output.pci.*" + } + ] + actions = { + # Node settings + update-props = { + session.suspend-timeout-seconds = 0 + } + } + } + ] + '') + ]; }; # allow realtime @@ -485,8 +524,6 @@ in optimize = "sudo nix --extra-experimental-features nix-command store optimise"; # ssh around in the local network - kuro = "ssh kuro.fritz.box"; - kuroroot = "ssh root@kuro.fritz.box"; mini = "ssh mini.fritz.box"; miniroot = "ssh root@mini.fritz.box"; neko = "ssh neko.fritz.box";