Ah, OK. I can't vouch for "pro," but I've definitely been doing the "audio" part. It's never really _not_ worked for me, hence my bemusement.
Interesting.s3ej3s wrote: ↑Tue Dec 07, 2021 6:01 pm Before switching to NixOS, I had many years of success and relatively smooth sailing on Debian. When I moved to NixOS, things got hard. I was able to make pretty good progress until about February of 2020, at which point everything stopped working for me altogether. I'm still running at a pinned version of nix as a result. As it is, I'm unable to get anything working at all on an up-to-date version of nixos and it seems like a moving target. The particular problems I have depend on how new the nix version I'm working with is.
I switched from Ubuntu. Once I got past the initial learning curve for NixOS, the audio side was relatively smooth. Musnix makes it a little simpler, though I've learned to skip the realtime part. Firstly, a realtime kernel isn't really necessary, and secondly it's not compatible with running VirtualBox, which I use for a Windows VM on which I run apps to configure some of my outboard gear.
That's just weird. I'm using qjackctl and jackd, and the worst ongoing problem I have is that I have to manually use `kill -9 <pid>` to get jackd to actually stop running. I've yet to encounter jackdmp.s3ej3s wrote: ↑Tue Dec 07, 2021 6:01 pm One problem I'm having is that I can't even determine how it's *expected* to work under NixOS. Normally, I've run jackd as a user, starting and stopping it either with a script or qjackctl. The NixOS way is that it's part of the system config. I'm guessing that the service is continually running and meant to be controlled by user tools. I can't tell which though -- I seem to have a combination of Jack1 and Jack2 utilities, although I've only install jack2Full. At the old pinned version, qjackctl had a lot of controls greyed out. The newer version doesn't but they clearly have no effect on the running jackd (which is really jackdmp, apparently aliased to jackd). I've tried killing the jackd service and running it as a normal user. But I'm not privileged to do so, despite having added myself to the jackuser group. The way jackd is installed, that group itself is not privileged to execute it -- it's strictly root.
I'm using the packages jack2, qjackctl and a2jmidid, and it's doing exactly what I expect.
That's the even odder part: I'm on unstable, too. I've even added a tower-style workstation, and the same configuration is working on both.
That said, this configuration is the product of a series of changes over time, and I've had to read various manuals pretty closely. I've added the Musnix channel so as not to have to maintain a local git copy, and I do enable it to get access to its contents, but I also specifically set musnix.kernel.optimize and musnix.kernel.realtime to false. FWIW, this is the current content of /etc/nixos/musnix.nix, which I include from configuration.nix (my config is split over a bunch of files):
Code: Select all
{ config, pkgs, ... }:
{
imports = [
# Musnix = optimisations specific to music production
# See https://github.com/musnix/musnix
#/home/james/sourcery/musnix # Local copy
<musnix> # Channel
];
musnix = {
enable = true;
# Not using any of Musnix' inbuilt optimisations, because they depend on a
# realtime kernel, which is
# a) not required for sufficient responsiveness
# b) incompatible with running VMs via Virtualbox.
kernel = {
optimize = false;
realtime = false;
# Confirm _actual_ latest available kernel at:
# https://github.com/musnix/musnix/blob/master/modules/kernel.nix
#packages = pkgs.linuxPackages_5_9_rt;
};
};
# Kernel configuration
# Do it the hard way, because Musnix assumes the RT kernel is wanted
nixpkgs.overlays = [
(self: super: {
linuxDAW = pkgs.linuxPackagesFor (pkgs.linux_daw.override {
structuredExtraConfig = with pkgs.lib.kernel; {
PREEMPT = yes;
HPET_TIMER = yes;
};
#ignoreConfigErrors = true;
});
})
];
# As-yet unused, but potentially useful kernel configs:
# #IOSCHED_DEADLINE y
# MQ_IOSCHED_DEADLINE y
# CONFIG_1000_HZ y # Seems to be obsolete; was explicitly ignored last I tried it.
#boot.kernelPackages = pkgs.linuxPackages_5_10;
# Enable user `james` to use realtime audio
users.users.james.extraGroups = [ "audio" ];
# Enable the RealtimeKit system service,
# which hands out realtime scheduling priority to user processes on demand.
security.rtkit.enable = true;
# Use an appropriate CPU performance governor
# Often used values: "ondemand", "powersave", "performance"
powerManagement.cpuFreqGovernor = "performance";
# System limits for Ardour, esp. realtime scheduling.
# Seems obsolete as at 2020/03/28, but keeping this here for reference in case I was wrong.
#systemd.extraConfig = "DefaultLimitNOFILE=4096\nDefaultLimitMEMLOCK=4G:16G\nDefaultLimitRTPRIO=40";
systemd.extraConfig = "DefaultLimitNOFILE=4096\nDefaultLimitMEMLOCK=24G:16G\nDefaultLimitRTPRIO=40";
# JACK configuration
boot.kernelModules=["snd-seq" "snd-rawmidi" ];
hardware.pulseaudio.package = pkgs.pulseaudio.override { jackaudioSupport = true; };
hardware.pulseaudio.enable = true;
}
As far as plugins go, I use a bunch of processing ones - especially the ACM suite - but the only actual sound-generating one I regularly use is Surge. Most of it comes from external hardware, and Renoise is mostly there to drive the drum machines. I'm 99% sure I've successfully tried Guitarix and Carla in the last couple of months
Given NixOS's wonderful and occasionally butt-saving ability to roll back to a previous generation, I can recommend using git to manage the contents of /etc/nixos (because I do that myself) and using branches to experiment with changes. If a change works, its branch gets merged into main; if it doesn't, I roll back if necessary, delete the branch and try something else.
As the 21.11 branch/channel is now live, it might be worth trying that for something that's both up-to-date and reasonably stable in terms of its rate of change.