NixOS and Linux (Pro) Audio

Maybe you cannot find your opengl libraries? LD_DEBUG=libs <your command> might help. Otherwise strace -f <command> might show if it tries to access some devices or so.

would be great if you could make a PR to have carla upstream.

Nixpkgs PR process is rather slow, so I’m going to make an overlay first.

By the way, this is a nix file for Helio (git): https://gist.github.com/suhr/1eb9b2d4d9539c130ff8a28e6beb3ba2

thanks for the info ! nd packages :loud_sound::loud_sound::loud_sound:

btw have you heard of musnix? RT audio in NixOS config ect.

2 Likes

i guess the overlay
could be added to NUR ?
link: Introducing NUR - the Nix User Repostory || Share all your nix expressions! - #9 by Mic92

could be added to NUR ?

If I figure out how to use it, then why not.

I created a nur repository with packages: GitHub - suhr/nur-packages

Also, there’s an issue for Carla: Carla in NixOS · Issue #813 · falkTX/Carla · GitHub. By the way, removing /run/current-system/sw/lib from LD_LIBRARY_PATH revealed an another issue: Carla cannot find libjack2.so.0.

1 Like

I’ve done audio production with Debian for at least a couple of decades, but I’m relatively new to NixOS and I’m having a very difficult time. I’ve had great success on Debian using classic jack, but I’ve never used jackdbus; I’ve always just killed pulseaudio when necessary, if I even ran it at all.

I’ve had very limited success following JACK - NixOS Wiki as best I can. I have been able to use a few jack clients, notably ardour5, but most apps fail to connect for me.

I also have trouble with ardour hanging up very regularly, usually (though not always) accompanied by:

kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 1 ep 1 with no TDs queued?

in my journal logs. I have no reason to expect this is related to my general jack woes, but I suppose it could be.

How are people generally going about this?

My inclination at this point is to go back to zero and try using jack1 without pulseaudio and see how things go. At least it would be simpler and more familiar.

Would anyone be willing to share a bit of your working config?

1 Like

This is quite strange. Do you still have this problem?
I just installed NixOS on an old macbook air with an audio config i copied over from an old laptop and it seems to work without any troubles. I‘ve only used Ardour + some Plugins tho. But I also got it working alongside pulseaudio with jack-sink. I can upload my config if you‘re interested

1 Like

Well, I did manage to get things working. Shortly after having posted the above. But jackd broken again soon after. I’m fine as long as I stay on the generation from March or so. But it’s broken for all builds since then.

Is it still working for you?

Hey folks. I put together gist with pulse + jack and pipewire based setups which work for me on recent nixos unstable.

Note that some parts of that config might not be even needed since nixos/jack,pulseaudio: fix pulse connection to jackd service by sorki · Pull Request #93431 · NixOS/nixpkgs · GitHub but I kept them in anyway.

Let me know if you have some difficulties setting this up still. I also think it would be awesome, in case that this works, if someone would update wiki page. Preferably someone other than me who knows more about pro audio and can english better than I. I’m not an expert on this sort of stuff but I’m happy to help to the extend I’m able to.

2 Likes

Referencing your sound-traditional.nix:

extraOptions = [ “-dalsa” “–device” “hw:1,0” ];

Is it necessary to hardcode the device in the configuration?

And regarding the pipewire config, I’m not sure what that was supposed to enable, but I couldn’t work with jack at all with that config. The jack daemon failed to start.

I’m struggling to get jack working at all anymore – with or without pulse. My music machine is running a version of nix from Feb 2020.

Any updates on this? Am I the only one attempting to do audio production on NixOS?

I’ve been using Reaper and some VST plugins on my NixOS-based Laptop to use it as a guitar amp. Running this on Pipewire and it worked pretty ok.

But it’s very much a side-project that I work on whenever I have some time. I don’t really understand your issue though (well, except that things don’t seem to work) and I doubt that I can say anything about a 2020 version of Nix since this is before I even started using it.

The relevant Pipewire config is in here: https://github.com/polygon/dotfiles/blob/964ade7bb58dfe03add4735ee9957f3e18554466/systems/nixbrett/nixbrett.nix

2 Likes

FWIW, I’m using ardour, qjackctl and a fair number of plugins on nixos (amd64 - ryzen) and basically only have

  musnix = {
    enable = true;
  };
  ...
  sound.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = false;
    pulse.enable = true;
    jack.enable = true;
  };

and it’s working pretty ok. I remember I tried some additional musnix optimisation settings (incl. rt kernel) about a year ago but failed due to build/boot etc. errors, so I kept it simple. But it does the job (I mainly use ardour with a Focusrite Scarlet 18i8 for recording and mixing) well enough.

I’m updating pretty frequently though, and find improvements generally outweigh the few regressions encountered; so I’d advise to get current first on that machine if there’s no compelling reason to keep it “2020”.

1 Like

Interesting. I have services.pipewire.enable = true but I haven’t set sound.enable = false … do you know what difference it makes, if any?

It’s advised in the docs, probably to switch off some (pulseaudio?) legacy stuff? (But omitting that attribute is the same as explicitly disabling it (see default), I have it because it makes the config more self-documenting.)

Thank you. Yes, self-documenting is great!

I’ve recently switched to pipewire, mainly because it doesn’t seem that pulse audio is getting much support now. It fixed a few things, but lots of things are still broken.

It’s a bit of a whack-a-mole situation. It’s not really practical to address these things individually. There really needs to be a central NixOS audio entity to look after things and to make it easier for us to help each other. I’m trying to get one established on the Matrix server now.

1 Like

OK, we have a room https://app.element.io/#/room/#audio:nixos.org

If anyone would care to join me in discussing audio concerns, please do!