aboutsummaryrefslogtreecommitdiff
path: root/hosts/herra
diff options
context:
space:
mode:
authorNatasha Moongrave <natasha@256phi.eu>2026-04-07 11:19:28 +0200
committerNatasha Moongrave <natasha@256phi.eu>2026-04-07 11:19:28 +0200
commitcdbe0f501a2ed6a1c59343b5f688ec6d72c38307 (patch)
treec690f729499657818dde9baf14d6c31cfca6a8e5 /hosts/herra
parent1706475bc4394b98b8eea88e8f6fd7dd1e4be3e0 (diff)
Updated herra's audio configuration and included base config for low audio latency
Diffstat (limited to 'hosts/herra')
-rw-r--r--hosts/herra/audio.nix43
1 files changed, 39 insertions, 4 deletions
diff --git a/hosts/herra/audio.nix b/hosts/herra/audio.nix
index 038f720..1afcc85 100644
--- a/hosts/herra/audio.nix
+++ b/hosts/herra/audio.nix
@@ -1,6 +1,41 @@
{...}: {
- services.pipewire.enable = true;
- services.pipewire.pulseaudio.enable = true;
- services.pipewire.alsa.enable = true;
- services.pipewire.jack.enable = true;
+ # rtkit is optional but recommended
+ security.rtkit.enable = true;
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ jack.enable = true;
+
+ # Lower audio latency
+ # NOTE: Every setup is different, and a lot of factors determine your final latency, like CPU speed, RT/PREEMPTIVE kernels and soundcards supporting different audio formats. That's why 32/48000 isn't always a value that's going to work for everyone. The best way to get everything working is to keep increasing the quant value until you get no crackles (underruns) or until you get audio again (in case there wasn't any). This won't guarantee the lowest possible latency, but will provide a decent one paired with stable audio.
+ 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;
+ };
+ };
+
+ pipewire-pulse."92-low-latency" = {
+ context.modules = [
+ {
+ name = "libpipewire-module-protocol-pulse";
+ args = {
+ 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;
+ };
+ };
+ };
}