add pipewire module, add fixes for latency and stuttering

This commit is contained in:
Anthony Rodriguez 2024-09-08 15:29:44 +02:00
parent 89116b073a
commit c84c184119
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
5 changed files with 32 additions and 16 deletions

View file

@ -1,15 +0,0 @@
{ ... }:
{
hardware.pulseaudio.enable = false;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
}

View file

@ -4,7 +4,6 @@ _:
imports = [ imports = [
./core.nix ./core.nix
./boot.nix ./boot.nix
./audio.nix
./locale.nix ./locale.nix
./packages.nix ./packages.nix
./printing.nix ./printing.nix

View file

@ -37,6 +37,7 @@
modules.stylix.enable = true; modules.stylix.enable = true;
modules.nvidia.enable = true; modules.nvidia.enable = true;
modules.gaming.enable = true; modules.gaming.enable = true;
modules.pipewire.enable = true;
stylix.image = ../../wallpapers/lucy-edgerunners-wallpaper.jpg; stylix.image = ../../wallpapers/lucy-edgerunners-wallpaper.jpg;
} }

View file

@ -1,6 +1,7 @@
_: _:
{ {
imports = [ imports = [
./pipewire.nix
./nvidia.nix ./nvidia.nix
./gnome.nix ./gnome.nix
./gaming.nix ./gaming.nix

30
modules/pipewire.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, lib, ... }:
let
cfg = config.modules.pipewire;
in
{
options.modules.pipewire.enable = lib.mkEnableOption "pipewire module";
config = lib.mkIf cfg.enable {
hardware.pulseaudio.enable = false;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
services.pipewire.extraConfig.pipewire."92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.quantum" = 32;
"default.clock.min-quantum" = 32;
"default.clock.max-quantum" = 32;
};
};
};
}