blob: 280554720e03b769a6c20243dfafdc480750a713 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
{...}: {
# 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
# TODO: 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" = 128;
# "default.clock.min-quantum" = 32;
# "default.clock.max-quantum" = 256; # Maybe set this to a max of 128 or 256 (as advised by Jade)
# };
# };
#
# 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 = "256/48000"; # Maybe set this to a max of 128 or 256 (as advised by Jade)
# };
# }
# ];
# stream.properties = {
# node.latency = "32/48000";
# resample.quality = 1;
# };
# };
# };
};
}
|