Page 1 of 1

Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 3:51 am
by wirenoise
I'm having very intrusive consistent xruns. ~50 over a couple minutes of playing back a simple loop.
I have a very beefy build. 5900x and 32gb of ram at 3600mhz, which should be more than capable of playing back a single loop without xruns. I also have very generous jack settings. 48khz sample size, buffer size of 256, and 3 periods/buffer. I have tried disabling wireless with `nmcli radio wifi off` but xruns persist. The realtime configuration script verifies that all of my settings are correct and nothing returns as 'bad'. (https://github.com/raboof/realtimeconfigquickscan). I'm totally lost. I have good hardware with a very low footprint environment and everything configured properly but I am suffering extreme xruns trying to do something incredibly simple...

What's the recommended order of operations from here?

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 6:40 am
by Toejam76
Your computer is certainly fast enough. You can get pretty decent latency out of a Raspberry Pi. If you are using an USB interface try another port.
My Scarlett Solo works without xruns connected as a single device connected to USB 2.0 hub, but not on an USB 3 hub for some reason. Maybe some IRQ is shared and causes problems. I have also disabled the compositor in KDE. Just guessing here, but maybe that helps.

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 6:56 am
by LAM
One thing I "discovered" recently to drastically reduce Xruns on my system is having Hyperthreading (aka SMT in kernel speaking) disabled.

If your system uses it you can disable it:

In the BIOS, look for Hyperthreading options in your CPU settings
or
At boot adding "nosmt" to the Grub commandline (https://www.kernel.org/doc/html/latest/ ... eters.html)
or
At runtime with

Code: Select all

echo off | sudo tee /sys/devices/system/cpu/smt/control

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 3:26 pm
by wirenoise
Toejam76 wrote: Thu Oct 21, 2021 6:40 am Your computer is certainly fast enough. You can get pretty decent latency out of a Raspberry Pi. If you are using an USB interface try another port.
My Scarlett Solo works without xruns connected as a single device connected to USB 2.0 hub, but not on an USB 3 hub for some reason. Maybe some IRQ is shared and causes problems. I have also disabled the compositor in KDE. Just guessing here, but maybe that helps.
Thanks for the reply! I'll try another port in general, but currently it is the only one on its bus, so it's not sharing with anything else, and that hub is 2.0 :/

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 3:34 pm
by wirenoise
LAM wrote: Thu Oct 21, 2021 6:56 am One thing I "discovered" recently to drastically reduce Xruns on my system is having Hyperthreading (aka SMT in kernel speaking) disabled.

If your system uses it you can disable it:

In the BIOS, look for Hyperthreading options in your CPU settings
or
At boot adding "nosmt" to the Grub commandline (https://www.kernel.org/doc/html/latest/ ... eters.html)
or
At runtime with

Code: Select all

echo off | sudo tee /sys/devices/system/cpu/smt/control
I already had it disabled but I went back and double checked, also disabling it as a kernel parameter, but nothing helped. I can't even switch to pipewire just yet so I am stuck in this limbo of xruns.

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 3:52 pm
by merlyn
I've got a Ryzen 3900x and my system is working well. I got it earlier this year and over the time I've had it the performance has improved. My explanation is that it's kernel updates and updates to amd-ucode. The 3900x came out in 2019. That implies it has taken the Linux kernel two years to fully accommodate a 3900x. I'm on kernel 5.14.14.

If you could say some more about your system like distro, kernel, soundcard we may be able to suggest things to try.

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 4:04 pm
by wirenoise
merlyn wrote: Thu Oct 21, 2021 3:52 pm I've got a Ryzen 3900x and my system is working well. I got it earlier this year and over the time I've had it the performance has improved. My explanation is that it's kernel updates and updates to amd-ucode. The 3900x came out in 2019. That implies it has taken the Linux kernel two years to fully accommodate a 3900x. I'm on kernel 5.14.14.

If you could say some more about your system like distro, kernel, soundcard we may be able to suggest things to try.
Ah yes. I am on Debian bullseye with a 3rd gen scarlett 4i4. I have tried using the stock debian kernel (5.10) as well as a 5.14 kernel I compiled so I could have access to the scarlett drivers, with some low latency tweaks. Same issue on both.

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 4:14 pm
by merlyn
If you have built in motherboard sound you could try starting JACK on that to rule out USB issues.

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 4:28 pm
by LAM
I would also suggest to start JACK with an higher RT priority (not too high!!!) like 50 or 60.

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 6:32 pm
by wirenoise
LAM wrote: Thu Oct 21, 2021 4:28 pm I would also suggest to start JACK with an higher RT priority (not too high!!!) like 50 or 60.
Jack is being started with RT priority of 60 already :/ ALso have audio group given unlimited memlock and rt prior max of 85 in /etc/security/limits.conf
merlyn wrote: Thu Oct 21, 2021 4:14 pm If you have built in motherboard sound you could try starting JACK on that to rule out USB issues.
Sadly, my motherboard does not have sound for headphones. Any advice on parsing through /proc/interrupts ? lsusb -tv shows this in regards to my soundcard.

Code: Select all

 /:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Audio, Driver=snd-usb-audio, 480M
        ID 1235:8212 Focusrite-Novation
    |__ Port 1: Dev 2, If 1, Class=Audio, Driver=snd-usb-audio, 480M
        ID 1235:8212 Focusrite-Novation
    |__ Port 1: Dev 2, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        ID 1235:8212 Focusrite-Novation
    |__ Port 1: Dev 2, If 3, Class=Vendor Specific Class, Driver=, 480M
        ID 1235:8212 Focusrite-Novation
    |__ Port 1: Dev 2, If 4, Class=Audio, Driver=snd-usb-audio, 480M
        ID 1235:8212 Focusrite-Novation
    |__ Port 1: Dev 2, If 5, Class=Audio, Driver=snd-usb-audio, 480M
        ID 1235:8212 Focusrite-Novation
Got this idea from the realtimequickconfigscan which ends with the message "** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks. Find your sound card's IRQ by looking at '/proc/interrupts' and lspci." But I can't determine which line is relevant to my soundcard in /proc/interrupts.

Re: Recommended order for XRuns Troubleshooting?

Posted: Thu Oct 21, 2021 9:27 pm
by sunrat
wirenoise wrote: Thu Oct 21, 2021 4:04 pmAh yes. I am on Debian bullseye with a 3rd gen scarlett 4i4.
There is a huge topic about development with your interface - viewtopic.php?f=6&t=20669
I also use Bullseye but with an old M-Audio 2496 PCI card. I found the Debian kernels, even the RT one, were fairly rubbish for audio. I get good results with Liquorix kernel - https://liquorix.net/ their current most recent is linux-image-5.14.0-13.1-liquorix-amd64 (you need to set threadirqs as a kernel parameter for best results).

Re: Recommended order for XRuns Troubleshooting?

Posted: Sat Oct 30, 2021 11:26 pm
by thetotalchaos
The proprietary NVidia drivers, can mess up your realtime priorities.
Also on Debian the stock kernel does not have the PREEMPT option enabled. You should use the Linux-RT or something that has the option.