XRUNS on startup when using Neural Amp Modeler

Hello all.

I have been continuing my experiments with MODEP on my Pi 4B. I’m running my UMC202HD at 48kHz, 128 samples and 2 periods. I am using the realtime kernel and the boot mode is set to “console autologin”.

I have pretty heavy patch that has two parallel paths . The first path has a single instance of NAM running a standard model going to an IR loader. The second path has a Guitarix amp model going into various time-based effects. The CPU usage used to hover right around 60-65%.

Earlier, everything worked fine and I was not getting any xruns. However now I have started getting a lot of xruns as soon as the Pi boots up and the CPU usage varies wildly. But the weird thing is that when I restart the modep-mod-ui, modep-mod-host and jack services, the problem goes away and I get no xruns at all! The CPU usage is stable at 60-65%. I’m running the following commands:

sudo systemctl stop modep-mod-ui modep-mod-host jack
sudo systemctl start jack modep-mod-host modep-mod-ui

After running the above commands, the CPU usage goes back around 60-65% and there are no xruns. I have made it into a script that runs at startup by calling the script in the .bashrc file. However, this does raise the time before I can start playing considerably. Also after the UI reloads, it takes an additional ~15s for it to actually make sound. The plugins do show up but NAM and the IR loaders seem to have wrong IRs loaded initially. After the delay, they load the correct files and then the sound output starts.

What could be the reason behind this? Is there any way I can avoid running this script at startup?

1 Like

Two questions:

  1. Are you using the bullseye or bookworm version of MODEP?
  2. Are you using buffered mode in nam?
  1. I am using the latest Bookworm version of Patchbox OS.
  2. I am not using the buffered mode in NAM. I did notice that it considerably lowers CPU usage. How does it exactly work?

@KAOSS I’m not exactly sure what it does, but it does decrease the CPU usage and with a trade off a slightly less sound quality. I was curious as to what OS version you were using, I’ve been running into some of the same scenarios when switching between pedalboards on bookworm using NAM. Sometimes it works fine but other times it makes the CPU “swell” (CPU usage goes up and down constantly, with the “up” being very high CPU usage)

“Swelling” is the perfect word to describe it! When that happens, the CPU usage jumps wildly from very low to very high. This is in contrast to the CPU usage % being rather stable when it doesn’t happen.

It does seem like the Pi 4B should be able to handle multiple instances of NAM standard models in parallel, even without using the buffered option. Adding new instances hardly seems to raise the CPU usage, when it is in “stable” mode. Also in my experience so far, once I’ve restarted those services, it doesn’t seem to do that “swell” thing again in the same run. When switching pedalboards, sometimes the CPU does go up and there are a few xruns. But once everything has loaded, the CPU gets stable again.