Hello again!
I am trying to reduce audio latency in my system. Supposedly, the QJackCtl app lets me control JACK parameters via its GUI. (I’d be just as happy to use a config file but I can’t find one.) When I use QJackCtl to stop JACK, change the buffer size, and then restart JACK, the buffer size as revealed by the jack_bufsize
shell command is still 1024.
And yet QJackCtl definitely has some effect – it affects the signal graph, and it warns me if I try to close it while my DAW (Reaper) is running.
I’ve looked around and can find nothing about configuring the JACK buffer size from my NixOS config. I thought maybe I should look instead at configuring pipewire, because I think pipewire is controlling JACK, because my config looks like this:
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = false;
jack.enable = true;
};
But according to the wiki[1], pipewire’s default buffer sizes are already tiny – 32 out of 48000 samples per second.
[1] PipeWire - NixOS Wiki
If it helps, here are the avenues of investigation I have tried so far.
Does services.pipewire.extraConfig.jack
allow one to configure JACK via PipeWire?
The option exists on search.nixos.org[1]. It says to refer to the PipeWire wiki page[2] for examples, but that page gives no examples for extraconfig.jack
. I tried looking at the option’s declaration[3] but it is withcraft to me.
[1] NixOS Search
[2] PipeWire - NixOS Wiki
[3] nixpkgs/nixos/modules/services/desktops/pipewire/pipewire.nix at a73246e2eef4c6ed172979932bc80e1404ba2d56 · NixOS/nixpkgs · GitHub
Do I need to manually configure QJackCtl, in particular for DBus or JackDBus?
On the NixOS Wiki page for JACK[4], there’s a subsection titled “Configure QjackCtl”. It refers to things that don’t exist for me. For instance, the first image in that subsection says to choose jackdbus
for the server path, but that’s not an option for me. The next image says to enable the DBus interface. It does not mention JackDBus. My version of QJackCtl offers both. Hunting around online suggests they are alternatives – that is, one cannot use both at once.
That Wiki page talks a lot about PulseAudio, and only mentions PipeWire (which I believe is lately the default interface for NixOS) in the context in which Pipewire was installed without Nix. That leads me to think maybe it is out of date. Be that true or false, I haven’t figured out how to act on what it says.
[4] JACK - NixOS Wiki
Solved, with the help of Reddit user LithiumFrost. In brief, the solution was to configures JACK declaratively via Nix, under Pipewire, and to not ask for a latency below what my computer can handle (128/48000).
Note that this config renders exactly some of QJackCtl’s controls useless. In particular, QJackCtl still can control the signal graph, but it cannot control the buffer size. (This can be verified by running jack_bufsize
in the shell after supposedly changing it in QJackCtl.)
Here are the Reddit thread[1] and my config as of the commit that got it working[2].
[1] Reddit - Dive into anything
[2] nixos-experiments/config/configuration.nix at 27a5eef960229f095aa6c29f794d49bda0223d72 · JeffreyBenjaminBrown/nixos-experiments · GitHub