diff options
author | Minijackson <minijackson@riseup.net> | 2024-08-02 22:26:55 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2024-08-02 22:26:55 +0200 |
commit | dc7948a0ef71dfaafb515f2ebc5d26789896503f (patch) | |
tree | ddfb123e2053ef1ba933b6a2c48834e78b5863d5 /usecases | |
parent | 034659f753518b03995ac6af54b6ec1b0bed7bf8 (diff) | |
download | nixos-config-reborn-dc7948a0ef71dfaafb515f2ebc5d26789896503f.tar.gz nixos-config-reborn-dc7948a0ef71dfaafb515f2ebc5d26789896503f.zip |
usecases/audio-production: configure low-latency pipewire
Diffstat (limited to 'usecases')
-rw-r--r-- | usecases/desktop/graphical/audio-production.nix | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/usecases/desktop/graphical/audio-production.nix b/usecases/desktop/graphical/audio-production.nix index dfbe2b2..94f7501 100644 --- a/usecases/desktop/graphical/audio-production.nix +++ b/usecases/desktop/graphical/audio-production.nix | |||
@@ -1,11 +1,7 @@ | |||
1 | inputs: { | 1 | inputs: |
2 | pkgs, | 2 | { pkgs, lib, ... }: |
3 | lib, | 3 | { |
4 | ... | 4 | imports = [ "${inputs.musnix}" ]; |
5 | }: { | ||
6 | imports = [ | ||
7 | "${inputs.musnix}" | ||
8 | ]; | ||
9 | 5 | ||
10 | musnix.enable = true; | 6 | musnix.enable = true; |
11 | 7 | ||
@@ -63,10 +59,10 @@ inputs: { | |||
63 | soundfont-ydp-grand | 59 | soundfont-ydp-grand |
64 | soundfont-fluid | 60 | soundfont-fluid |
65 | ]; | 61 | ]; |
66 | extraGroups = ["audio"]; | 62 | extraGroups = [ "audio" ]; |
67 | }; | 63 | }; |
68 | 64 | ||
69 | environment.pathsToLink = ["/share/soundfonts"]; | 65 | environment.pathsToLink = [ "/share/soundfonts" ]; |
70 | 66 | ||
71 | # TODO: upstream adding user-specific packages | 67 | # TODO: upstream adding user-specific packages |
72 | environment.variables = { | 68 | environment.variables = { |
@@ -77,4 +73,36 @@ inputs: { | |||
77 | VST_PATH = lib.mkForce "$HOME/.vst:$HOME/.nix-profile/lib/vst:/run/current-system/sw/lib/vst:/etc/profiles/per-user/$USER/lib/vst"; | 73 | VST_PATH = lib.mkForce "$HOME/.vst:$HOME/.nix-profile/lib/vst:/run/current-system/sw/lib/vst:/etc/profiles/per-user/$USER/lib/vst"; |
78 | VST3_PATH = lib.mkForce "$HOME/.vst3:$HOME/.nix-profile/lib/vst3:/run/current-system/sw/lib/vst3:/etc/profiles/per-user/$USER/lib/vst3"; | 74 | VST3_PATH = lib.mkForce "$HOME/.vst3:$HOME/.nix-profile/lib/vst3:/run/current-system/sw/lib/vst3:/etc/profiles/per-user/$USER/lib/vst3"; |
79 | }; | 75 | }; |
76 | |||
77 | # https://wiki.nixos.org/wiki/PipeWire#Low-latency_setup | ||
78 | services.pipewire.extraConfig = { | ||
79 | pipewire."92-low-latency" = { | ||
80 | "context.properties" = { | ||
81 | "default.clock.rate" = 48000; | ||
82 | "default.clock.quantum" = 128; | ||
83 | "default.clock.min-quantum" = 128; | ||
84 | "default.clock.max-quantum" = 128; | ||
85 | }; | ||
86 | }; | ||
87 | |||
88 | pipewire-pulse."92-low-latency" = { | ||
89 | "context.properties" = [ | ||
90 | { | ||
91 | name = "libpipewire-module-protocol-pulse"; | ||
92 | args = { }; | ||
93 | } | ||
94 | ]; | ||
95 | "pulse.properties" = { | ||
96 | "pulse.min.req" = "128/48000"; | ||
97 | "pulse.default.req" = "128/48000"; | ||
98 | "pulse.max.req" = "128/48000"; | ||
99 | "pulse.min.quantum" = "128/48000"; | ||
100 | "pulse.max.quantum" = "128/48000"; | ||
101 | }; | ||
102 | "stream.properties" = { | ||
103 | "node.latency" = "32/48000"; | ||
104 | "resample.quality" = 1; | ||
105 | }; | ||
106 | }; | ||
107 | }; | ||
80 | } | 108 | } |