Xruns on Kubuntu/KX

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Xruns on Kubuntu/KX

Post by Blindekinder »

Hi,
I make sound on Linux since 2006, and since 10 years I work with it (live concert, theater...). So I need a stable system. I used Ubuntu, Ubuntu Studio, CCRMA, Musix, KX Studio AVLinux and others...
I had to buy a new computer last spring, not because of power or system too old, but it had some hardware weakness (USB port, battery dead, touchpad). I installed AVL-MX21, but the new computer is too new and some hardware was not well recognized (internal soundcard (!) and graphic cards). So I turned back to my favorites: Kubuntu with KX repositories. (not Ubuntu Studio, which never worked good for me).

Everything seems to work, but I have a lot of Xruns (~100 a minute, audible). This happens when Jack and an app are started, even not connected (Bitwig, Ardour). The proc usage is under 10%, and it happens even under 4%, memory is sufficient, all lowlatency settings are done (audio group, rtirq installed and working), and I use the official lowlatency-kernel. I happens with all my soundcards (RME fireface, different other class-compliant devices, all USB). I tried with latency like 64-1024/3 period @ 96K/48K, all the same.
Here is my system:

Code: Select all

Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-47-lowlatency (64-bit)
Graphics Platform: X11
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics
I use jack2 from Ubuntu repo. When this happened in the past, I compiled jack or installed from extra KX repo which doesn't exist anymore. Compiling is difficult for me: I can't uninstall repo-version without breaking the system, I can't find some -dev packages needed, I don't know which options are necessary and how to activate them.

I really need this to be solved, I can't work anymore.
Thank you for your help!!!
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
User avatar
LAM
Established Member
Posts: 992
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 140 times
Been thanked: 348 times

Re: Xruns on Kubuntu/KX

Post by LAM »

First two things to try:
- boot with the normal kernel
- try to disable WiFi

Further things:
- disable HyperThreading if present
- make sure your CPU is on performance mode

in mix, nobody can hear your screen

Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by Blindekinder »

Thank you LAM,

-I already tried with both kernels
-same for WIFI
then:
-I disabled HyperThreading
-I switched to performance mode with CPU-powergui (any clue how to make this permanent?)

Maybe a bit less Xruns, but still unusable...
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
User avatar
GMaq
Established Member
Posts: 2774
Joined: Fri Sep 25, 2009 1:42 pm
Has thanked: 520 times
Been thanked: 555 times

Re: Xruns on Kubuntu/KX

Post by GMaq »

Hi,

I'm curious if you updated Kernels on AV Linux? Also from time to time there are many 'AHS' Advanced Hardware firmware updates that also improve the function on newer systems and there have been many recently. You may find an AV Linux install upgraded to Liquorix 5.19 from the MX Repos and the recent AHS updates will fix most of your issues..
Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by Blindekinder »

Hi GMaq,
I installed last update with new Liquorix version one day before switching to Kubuntu. It did not solved my graphic cards issues, and I also had xruns on AVL (maybe it's a clue). Some years ago on my old 2014 Toshiba computer I could work at very low latencies, like 128@96K, with a lot of apps and plugins running, pure data patches etc, with no xrun, I hope I can reach that again...
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
Chibchan
Established Member
Posts: 64
Joined: Wed Jun 19, 2013 6:56 am
Location: Brooklyn
Has thanked: 1 time
Been thanked: 9 times

Re: Xruns on Kubuntu/KX

Post by Chibchan »

have you tried:
https://github.com/raboof/realtimeconfigquickscan
And seeing you have nvidia graphics, maybe track down drivers for it.
I find the opensource drivers works well for general things but can add to the xrun factor on AV/realtime systems.
Usually those two things I mentioned will rid my machine of xruns.

Good luck, Hope you nail it.
User avatar
sunrat
Established Member
Posts: 915
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 151 times
Been thanked: 242 times

Re: Xruns on Kubuntu/KX

Post by sunrat »

Try adding this to kernel boot parameters

Code: Select all

intel_idle.max_cstate=0 threadirqs
Also you will want the latest intel microcode and nvidia drivers. Investigate how to use Prime Render Offload for your Nvidia GPU.

Run the Quick Scan as mentioned above and do all suggested tweaks. It has now been updated to use Python instead of Perl and is called rtcqs - https://codeberg.org/rtcqs/rtcqs
Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by Blindekinder »

Chibchan wrote: Tue Sep 06, 2022 5:42 pm have you tried:
https://github.com/raboof/realtimeconfigquickscan
And seeing you have nvidia graphics, maybe track down drivers for it.
I find the opensource drivers works well for general things but can add to the xrun factor on AV/realtime systems.
Usually those two things I mentioned will rid my machine of xruns.

Good luck, Hope you nail it.
Thank you for your encouragement!
I had found realtimeconfigquickscan, but I stopped this path since git clone was blocked...
About GPUs: both are very new and I had problem on my first mint 20 install, with new kernel it seems to be solved, but I'm nor sure. On Kubuntu I tried with nvidia, on demand, and with no nvidia driver installed (intel option in prime settings is greyed).
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
Chibchan
Established Member
Posts: 64
Joined: Wed Jun 19, 2013 6:56 am
Location: Brooklyn
Has thanked: 1 time
Been thanked: 9 times

Re: Xruns on Kubuntu/KX

Post by Chibchan »

there is a green "code" tab on page. click on it and select "Download zip" or,
https://github.com/raboof/realtimeconfi ... master.zip
after dl, extract, follow instruction in the read me file. There is a python version as sunrat pointed out with a link.

I found this regarding your graphics. Maybe a start.
https://askubuntu.com/questions/1399272 ... uadro-t500
Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by Blindekinder »

Hi again,

I have been working hard on it last weeks, I spend entire days trying to solve the issue, with no success.
I must say I'm pretty upset with that, I thought GNU/Linux had overcome these issues since my first experiments before 2010. My computer is new, high-powered and certified with Ubuntu.

My report:
sunrat wrote: Tue Sep 06, 2022 11:41 pm latest intel microcode and nvidia drivers. Investigate how to use Prime Render Offload for your Nvidia GPU.
I have last package and firmware installed for both Nvidia (510) and Intel. To launch apps with Nvidia (like I do for Ardour and Bitwig, since I use a plugin that need acceleration). I tried with nvidia and Intel (Prime), also with only Nvidia (performance mode):

Code: Select all

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia MESA_GL_VERSION_OVERRIDE=3.2 appname
sunrat wrote: Tue Sep 06, 2022 11:41 pm Run the Quick Scan as mentioned above and do all suggested tweaks. It has now been updated to use Python instead of Perl and is called rtcqs - https://codeberg.org/rtcqs/rtcqs
I installed rtcqs_gui, thank you. I solved almost all the issue following the procedures:
https://wiki.linuxaudio.org/wiki/system_configuration
  • CPU freq scaling to performance, I made it permanent
  • power management
  • add threadirqs to grub

    Code: Select all

    /etc/default/grub
    ...
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=0 threadirqs mitigations=off"
    ...
    
what doesn't work, but might be of minor incidence:
  • Code: Select all

    Filesystem mount :
    The following mounts should be avoided for audio purposes: /run/user/1000/doc. See also https://wiki.linuxaudio.org/wiki/system_configuration#filesystems
    No idea what it is, but doesn't happens on each boot. No incidence on the xruns issue.
  • Spectre/Meltdown Mitigations : added mitigations=off to grub, but still a warning in rtcqs.
What I had already tried:
  • different kernels (lowlatency or not, some versions)
  • disabled HyperThreading
  • disabling desktop effects (composition)
  • disabling wifi
  • different soundcards
  • different softwares (Ardour and Bitwig) and plugins
    ...
I observed the following:
-Sometimes it doesn't happen, or after some times. No idea what initiate the problem
-I configured a custom system monitor, with temperatures, processes, graphs etc. System is at max 20% CPU, but xruns occur the same at 5%.
-in the process list, some processes have priority of 0, 2 or 3. Normally D-Bus is at 2 with a lot of other processes, Bitwig at 3, Ardour at 2, but sometimes all at 0.
-xruns are audible, and not shorts as a click, but long like a 300ms note freeze.

I hope you can help me...
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by Blindekinder »

Ok, something new here:

I tried to uninstall jackd2 i386, only dependent on wine-asio, just in case. And surprise, no more xruns. After one our running a multitrack session with some plugins at 48K@64s/3p, I noticed I forgot to plug the power supply... I plugged it and it started again.
Not totally sure it is the main/only cause, but it plays a big role, because it starts and stops each time I un/plug PS.

So what's the cause??
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
robisme
Established Member
Posts: 12
Joined: Tue Sep 20, 2022 6:50 am
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by robisme »

Hello,

I too have a lot of xruns with Kubuntu.
I have not installed any "music" app, but Pipewire and wine. The same occurs with the Xanmod kernel I'm now running. No way, always those xrun.
And I have a very powerfull Dell xps 13 plus (9320) with a 12th gen i7 and 32Go RAM, it can't be a matter of power.

I was previously on Fedora KDE : no xruns. But impossible to install Vital and Tracktion Biotek, that's why I'm giving Kubuntu a chance.
Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by Blindekinder »

artix_linux_user wrote: Sat Oct 01, 2022 2:05 pm Maybe do some cross tests with xorg or even an totally other linux distribution like Artix Linux without systemd.
I started using AVL-MX21on this computer. I had a little bit more xruns than on my old computer (a 2013 Toshiba), but no comparison. It was mostly not audible, and happened rarely and only on some actions (plugins load, closing apps).
About KDE: I use it with KX since 2014 with no problem. It is a perfect system for my needs when I work with sound, for thousand of reason. For my everyday-non-audio work I prefer Mint Cinnamon. Others desktops are probably outstanding too. IMHO KDE is not in cause, I'm more leaning toward Ubuntu itself. I always had very similar issues with Ubuntu Studio. Normally switching to regular and/or installing KX solved the problem.
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by Blindekinder »

artix_linux_user wrote: Tue Oct 04, 2022 12:48 pm Are you sure you are not on a KDE wayland session?
I had this extremly terrible experience with KDE, yes...but it was wayland session and I am suspecting wayland being the source of all evil in the world.
Wayland, and systemd and....ok that joke isn´t funny anymore...sorry
at least there are no 'wayland...' processes, but there are 'x11...' processes.

And about 'systemd', I don't think I can do without on Ubuntu, right?
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
Blindekinder
Established Member
Posts: 112
Joined: Sat Jan 26, 2013 11:42 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Xruns on Kubuntu/KX

Post by Blindekinder »

something new:
When I plug OR unplug PSU, an alsa-jack client appears shortly then disappears
xrun-PSU-alsa.jpg
xrun-PSU-alsa.jpg (182.56 KiB) Viewed 1940 times
Kubuntu 22.04
KX repositories
KDE Plasma Version: 5
Kernel Version: 5.15-lowlatency (64-bit)
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® Xe Graphics / Nvidia Quadro T500 Mobile
Jack2
Post Reply