Recommended order for XRuns Troubleshooting?

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

Moderators: MattKingUSA, khz

Post Reply
wirenoise
Established Member
Posts: 7
Joined: Sun Sep 19, 2021 9:23 pm

Recommended order for XRuns Troubleshooting?

Post 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?
User avatar
Toejam76
Established Member
Posts: 138
Joined: Sat Jun 20, 2020 10:41 am
Has thanked: 15 times
Been thanked: 21 times

Re: Recommended order for XRuns Troubleshooting?

Post 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.
User avatar
LAM
Established Member
Posts: 992
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 140 times
Been thanked: 348 times

Re: Recommended order for XRuns Troubleshooting?

Post 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

in mix, nobody can hear your screen

wirenoise
Established Member
Posts: 7
Joined: Sun Sep 19, 2021 9:23 pm

Re: Recommended order for XRuns Troubleshooting?

Post 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 :/
wirenoise
Established Member
Posts: 7
Joined: Sun Sep 19, 2021 9:23 pm

Re: Recommended order for XRuns Troubleshooting?

Post 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.
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: Recommended order for XRuns Troubleshooting?

Post 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.
wirenoise
Established Member
Posts: 7
Joined: Sun Sep 19, 2021 9:23 pm

Re: Recommended order for XRuns Troubleshooting?

Post 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.
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: Recommended order for XRuns Troubleshooting?

Post by merlyn »

If you have built in motherboard sound you could try starting JACK on that to rule out USB issues.
User avatar
LAM
Established Member
Posts: 992
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 140 times
Been thanked: 348 times

Re: Recommended order for XRuns Troubleshooting?

Post by LAM »

I would also suggest to start JACK with an higher RT priority (not too high!!!) like 50 or 60.

in mix, nobody can hear your screen

wirenoise
Established Member
Posts: 7
Joined: Sun Sep 19, 2021 9:23 pm

Re: Recommended order for XRuns Troubleshooting?

Post 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.
User avatar
sunrat
Established Member
Posts: 907
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 151 times
Been thanked: 238 times

Re: Recommended order for XRuns Troubleshooting?

Post 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).
User avatar
thetotalchaos
Established Member
Posts: 211
Joined: Mon Sep 29, 2014 8:29 pm
Has thanked: 51 times
Been thanked: 9 times
Contact:

Re: Recommended order for XRuns Troubleshooting?

Post 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.
You can listen to my music at: https://totalchaos-music.bandcamp.com/

Take a journey to wonderland with The Butterfly Effect 2016
https://totalchaos-music.bandcamp.com/a ... fly-effect
Post Reply