NixOS and music: Experiences?

What other apps and distros do you use to round out your studio?

Moderators: MattKingUSA, khz

Jamesf
Established Member
Posts: 35
Joined: Tue May 28, 2019 12:23 pm
Location: Madrid

Re: NixOS and music: Experiences?

Post by Jamesf »

s3ej3s wrote:Bumping this...

I've had great success on Debian for over 20 years, but I too have made the jump to NixOS and I'm having a very tough time.

Jamesf, could we compare notes?
Absolutely! It's a steep learning curve, so it's no surprise you're finding it rough.
I can't post my current configs because I'm at the office right now, but what issues are you having?

I'd say to PM me, but it's probably better that we leave a public record for others to find if they run into the same problems.
I'm slow, but I get there eventually.

User avatar
raboof
Established Member
Posts: 1726
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Contact:

Re: NixOS and music: Experiences?

Post by raboof »

Interesting! I've also been switching to NixOS lately and am pretty happy with their approach, though I haven't done any music stuff on this machine yet.

s3ej3s
Established Member
Posts: 8
Joined: Thu Jan 19, 2017 11:00 am
Contact:

Re: NixOS and music: Experiences?

Post by s3ej3s »

Jamesf wrote:
s3ej3s wrote:Bumping this...

I've had great success on Debian for over 20 years, but I too have made the jump to NixOS and I'm having a very tough time.

Jamesf, could we compare notes?
Absolutely! It's a steep learning curve, so it's no surprise you're finding it rough.
I can't post my current configs because I'm at the office right now, but what issues are you having?

I'd say to PM me, but it's probably better that we leave a public record for others to find if they run into the same problems.
Thanks. Yeah, public would be better for the next searcher.

So, I'm not having a lot of trouble with NixOS per se. But NixOS kind of prescribes jackdbus w/pulseaudio, which I've never done; I've always just used jack1 and killed pulseaudio. I roughly followed this (roughly, because, among other problems, the qjackctl version is quite different): https://nixos.wiki/wiki/JACK. I managed to get ardour5 working, but *most* jack clients fail to connect. Ardour is *extremely* unstable too, but I defer that question to avoid muddying already murky waters.

Maybe you could start by describing, at a high level, how you're running things.

Jamesf
Established Member
Posts: 35
Joined: Tue May 28, 2019 12:23 pm
Location: Madrid

Re: NixOS and music: Experiences?

Post by Jamesf »

s3ej3s wrote:So, I'm not having a lot of trouble with NixOS per se. But NixOS kind of prescribes jackdbus w/pulseaudio, which I've never done; I've always just used jack1 and killed pulseaudio. I roughly followed this (roughly, because, among other problems, the qjackctl version is quite different): https://nixos.wiki/wiki/JACK. I managed to get ardour5 working, but *most* jack clients fail to connect. Ardour is *extremely* unstable too, but I defer that question to avoid muddying already murky waters.

Maybe you could start by describing, at a high level, how you're running things.
Pulseaudio has always been a thorn in my side, too, honestly. I work around it by letting it have the onboard audio by default, and mostly use Jack in combination with the outboard interface. I'm on a laptop at the moment, though, so YMMV.
Physical setup: Dell XPS13 with Mackie Producer 2.2 interface via USB, plus the usual rat's nest of audio and MIDI cables - I'm actually round-tripping the MIDI through a BeatBuddy, then through an Amplifire, and back to the interface. Oh, and the Mackie comes in via a USB bus, because I ran out of sockets on the XPS (also because I'm lazy, and I'd rather plug/unplug 1 cable than 3).

Jack's been pretty solid for me; the biggest problem I've had lately has been that it typically doesn't exit with qjackctl, causing a few WTFs until I spotted the pattern. Ardour's been good as well, so our experiences are very different at the moment.
I'll post my Nixos configs tonight, when I'm at my personal machine and have ready access to them. One of the nice things about that OS is that it's about as deterministic as it gets, so comparing configs can get you a pretty long way.

Is there a pattern to the kind of thing that causes Ardour to crash for you? Maybe a pattern in the logs/messages it leaves behind? Similarly, is there a common message in the qjackctl messages panel when things fail to connect, assuming you're using that to manage it?
I'm slow, but I get there eventually.

s3ej3s
Established Member
Posts: 8
Joined: Thu Jan 19, 2017 11:00 am
Contact:

Re: NixOS and music: Experiences?

Post by s3ej3s »

Jamesf wrote: Pulseaudio has always been a thorn in my side, too, honestly. I work around it by letting it have the onboard audio by default, and mostly use Jack in combination with the outboard interface. I'm on a laptop at the moment, though, so YMMV.
That would be just fine. I'm using an Lexicon Lambda or sometimes an Omega with Jack. But I also have an Alpha that I could dedicate to pulseaudio (or just use the onboard card). I'm using a old desktop, but I plan on doing something similar with a laptop, for mobility.
Jamesf wrote: Jack's been pretty solid for me; the biggest problem I've had lately has been that it typically doesn't exit with qjackctl, causing a few WTFs until I spotted the pattern. Ardour's been good as well, so our experiences are very different at the moment.
I'll post my Nixos configs tonight, when I'm at my personal machine and have ready access to them. One of the nice things about that OS is that it's about as deterministic as it gets, so comparing configs can get you a pretty long way.
I look forward to seeing your config. The derivation for qjackctl depends on libjack2, so unless you've done something exceptional, I expect you're also on jack2. I agree about the determinism and easy comparison, but I'm currently doing a lot of things with nix-env which of course is more imperative and also external to configuration.tmux. I'm eyeing home-manager to see if I can bring some of that to my user-specific config.
Jamesf wrote: Is there a pattern to the kind of thing that causes Ardour to crash for you? Maybe a pattern in the logs/messages it leaves behind? Similarly, is there a common message in the qjackctl messages panel when things fail to connect, assuming you're using that to manage it?
Yes there is. Ardour isn't crashing, but it freezes up a lot. This is usually - though not always - accompanied by:

Code: Select all

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

Jamesf
Established Member
Posts: 35
Joined: Tue May 28, 2019 12:23 pm
Location: Madrid

Re: NixOS and music: Experiences?

Post by Jamesf »

I distribute my config across a few files and then import them. I've attached the main one,

Code: Select all

workstation_av.nix
, though I had to append a .txt extension because this forum asserted that .nix isn't a valid extension.

Other than that file, I do import

Code: Select all

pkgs.pulseaudioFull
and set

Code: Select all

hardware.pulseaudio.enable = true;
but that's about it. I do run Unstable, but that's for reasons unrelated to audio, and now I'm keeping an eye out for the right time to transition back to a stable channel.

That xhci_hcd error looks like a kernel bug; https://bbs.archlinux.org/viewtopic.php ... 8#p1748368 may or may not help.

home-manager looks like the right way to do some things, but in practice there's only one user of my machines, so I either apply it globally or confine it to a purpose-specific

Code: Select all

shell.nix
file.

Hopefully there's some value for you in here.
You do not have the required permissions to view the files attached to this post.
I'm slow, but I get there eventually.

s3ej3s
Established Member
Posts: 8
Joined: Thu Jan 19, 2017 11:00 am
Contact:

Re: NixOS and music: Experiences?

Post by s3ej3s »

Jamesf wrote:I distribute my config across a few files and then import them. I've attached the main one,

Code: Select all

workstation_av.nix
, though I had to append a .txt extension because this forum asserted that .nix isn't a valid extension.
Awesome. I really appreciate it.
Jamesf wrote: Other than that file, I do import

Code: Select all

pkgs.pulseaudioFull
and set

Code: Select all

hardware.pulseaudio.enable = true;
but that's about it. I do run Unstable, but that's for reasons unrelated to audio, and now I'm keeping an eye out for the right time to transition back to a stable channel.
Interesting. You just let pulseaudio go on about it's business. No interop with Jack. That sounds ideal. I'll dive into your config before I ask any more questions. But I hope that taking PA out of the equation will at least simplify my problem space.

I *do* know that there are a class of problems that have to do with the fact that NixOS is in some ways a very atypical distro. Sometimes things are looking for resources in places they are not to be found. For example, I had to set LADSPA_PATH and LV2_PATH in my env so that Ardour could find my plugins. That manifests in different ways sometimes.
Jamesf wrote: That xhci_hcd error looks like a kernel bug; https://bbs.archlinux.org/viewtopic.php ... 8#p1748368 may or may not help.
Haha. I'm here because I think I *just* resolved this one. I moved my Lambda from a USB 3.0 port to a USB 2.0 port :/ One, I figured it had to do with some flakiness in the xhci code. Two, it occurred to me that the device was 2.0 based anyway. Bonus is that it freed up those ports for things that can actually benefit from 3.0. At the risk of jinxing myself, I'm calling that one done. :)
Jamesf wrote: home-manager looks like the right way to do some things, but in practice there's only one user of my machines, so I either apply it globally or confine it to a purpose-specific

Code: Select all

shell.nix
file.

Hopefully there's some value for you in here.
That is an excellent point; I'm inclined to agree. However, there's still too much config and state floating around in various dot files and so on. So I think I'll still be having a closer look at home manager.

Anyway, I'll have a look at your config. Thanks again very much!

Jamesf
Established Member
Posts: 35
Joined: Tue May 28, 2019 12:23 pm
Location: Madrid

Re: NixOS and music: Experiences?

Post by Jamesf »

s3ej3s wrote:nteresting. You just let pulseaudio go on about it's business. No interop with Jack. That sounds ideal.
It works pretty well in practice. Jack just kicks PA off the requested device as long as it's idle, so whatever they changed there, worked.
s3ej3s wrote:I *do* know that there are a class of problems that have to do with the fact that NixOS is in some ways a very atypical distro. Sometimes things are looking for resources in places they are not to be found. For example, I had to set LADSPA_PATH and LV2_PATH in my env so that Ardour could find my plugins. That manifests in different ways sometimes.
This is an odd one. I used to need a shell.nix to set those, but that problem went away. It's possible that I updated .bashrc or the Ardour global configs in the right way, and then clean forgot, so I'll check.
s3ej3s wrote:That is an excellent point; I'm inclined to agree. However, there's still too much config and state floating around in various dot files and so on. So I think I'll still be having a closer look at home manager.
That was purely "this is what I do and why" - please don't take that as discouragement, or "here's why not to." If you do get it to work for you and you're willing to share, I'd be interested in taking a fresh look at whether to adopt it.
I'm slow, but I get there eventually.

s3ej3s
Established Member
Posts: 8
Joined: Thu Jan 19, 2017 11:00 am
Contact:

Re: NixOS and music: Experiences?

Post by s3ej3s »

Well, decoupling jack from pulseaudio lost me RT and did nothing to help with clients that could not connect; no benefit that I can discern.

I think I need to compile a matrix of jack clients and determine which ones are problematic and which ones are not. Off-hand, I know:
  • I can use ardour, hydrogen, bristol, zynaddsubfx, patchage.
  • Ingen, guitarix, catia, and ecasound are examples of apps that can't connect. They tell me there *is* no jack running when it clearly is.
Re: pkgs in configuration.nix, the main reason I'm not doing that atm is that I run stable there, but unstable in my user's config. I'm looking into pinning options.

s3ej3s
Established Member
Posts: 8
Joined: Thu Jan 19, 2017 11:00 am
Contact:

Re: NixOS and music: Experiences?

Post by s3ej3s »

Well, catia, at least, is an open issue: https://github.com/NixOS/nixpkgs/issues/55574

Post Reply