XRUNS ... but why?

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

got it: I was missing the

Code: Select all

GRUB_CMDLINE_LINUX="threadirqs"
entry in grub.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

Oh man :shock:

I just saw that my internal intel onboard soundcard was running with RT priority of 90 (but was never used) compared to my interface which was running at 80.

I blacklisted the internal card and all my xrun issues disappeared! :D

-->

Code: Select all

echo -e "blacklist snd_hda_intel" | sudo tee -a /etc/modprobe.d/HDAblacklist.conf
User avatar
khz
Established Member
Posts: 1648
Joined: Thu Apr 17, 2008 6:29 am
Location: German
Has thanked: 42 times
Been thanked: 92 times

Re: XRUNS ... but why?

Post by khz »

With enough RAM installed, you don't want a swap partition, so no more swappiness.
This is my opinion, other opinions would be interesting.

At HTEP I am not really sure, I am a layman in computer technical knowledge. (That's why I took notes (signature), not to forget the complexities.)
There I would find it even more helpful to read other opinions.
lilith wrote:I just saw that my internal intel onboard soundcard was running with RT priority of 90 (but was never used) compared to my interface which was running at 80.
Among other things I switch off the onboard soundcard in the Bios.
. . . FZ - Does humor belongs in Music?
. . GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
  • I don't care about the freedom of speech because I have nothing to say.
User avatar
thetotalchaos
Established Member
Posts: 211
Joined: Mon Sep 29, 2014 8:29 pm
Has thanked: 53 times
Been thanked: 9 times
Contact:

Re: XRUNS ... but why?

Post by thetotalchaos »

You don't need to configure manually your system for audio performance. You just need to install kxstudio-default-settings. Just install it, reboot and check out if the realtimeconfigquickscan is all green. What else i can advice you? You don't need swap partition, but having a realtime linux is a huge benefit. You can test if your kernel is good with

Code: Select all

uname -a
If you have PREEMPT (or PREEMPT RT) you are fine.
What else? don't use 3D effects, dont use internet or pereferals like scanner or printer, while playing audio. Check your BIOS settings. You don't need a video acceleration, and the battery saver must be turned off, while you are on Ardour for example.
Additionally i am sharing some good manuals, including a topic i made, to make Cadence and Pulseaudio like each other more
https://librazik.tuxfamily.org/doc2/manuel
https://wiki.archlinux.org/index.php/Professional_audio
https://www.linuxmusicians.com/viewtopi ... 27&t=17780

PS (edited): I saw you fixed it, by giving good values for realtime and blacklisting your internal sound card. My advice is to disable it from BIOS itself, if you are allowed.
I will try to summarize the topic of realtime preemption in a few sentiencies. If your linux kernel does not have PREEMPT value (in the output of uname -a) , this whole realtime preemption does not work for you and your system is not optimised for audio performance, the way it can and should be. The realtime preemption value is from 0 to 100 if you have a true realtime kernel ( PREEMPT RT), but from 0 to 90 if you kernel is just PREEMPT (like linux-lowlatency or the default linux on Archlinux). The fun part is with values above 50. A values between 90 to 100 are giving these processes a capability to interrupt other processes. Your sound card, gets the highest value, often 99 or 95 (check your /etc/security/limits.conf or /etc/security/limits.d/audio.conf). The value for Jack should be second in the queue, after the soundcard. 89 is a good value for PREEMPT RT, but because on PREEMPT kernels the highest value is 89, its often recommended a value of 70 for Jack. Further below you can give values for your MIDI peripheral and other apps, by giving values that are -5 below. You can also give RT values to Wine and programs that run on Wine, but you need to use wine-rt on your system. I myself am using the prepared lines, that i am taking by running Festige and copying a well prepared execute lines for the VST plugins. It makes a difference, more that you can assume.

Happy hacking,
Totalchaos, a Linux Audio veteran
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
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

Thanks, I'll check these points again. I can't deactivate my internal card in the bios, that's why that's the best solution.
User avatar
Tenaba
Established Member
Posts: 228
Joined: Sat Dec 22, 2018 3:33 am
Has thanked: 32 times
Been thanked: 79 times

Re: XRUNS ... but why?

Post by Tenaba »

lilith wrote: Sat Feb 15, 2020 6:03 pm Oh man :shock:

I just saw that my internal intel onboard soundcard was running with RT priority of 90 (but was never used) compared to my interface which was running at 80.

I blacklisted the internal card and all my xrun issues disappeared! :D

-->

Code: Select all

echo -e "blacklist snd_hda_intel" | sudo tee -a /etc/modprobe.d/HDAblacklist.conf
Could you explain how you found the RT priorities and driver names of your devices please? I just disabled my internal soundcard after reading this (since I don't use it), but I would like to see if my graphics card's HDMI audio is problematic as well.

I make music as Tenaba! Bandcamp

User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

crownbird wrote: Fri Feb 28, 2020 4:01 pm
lilith wrote: Sat Feb 15, 2020 6:03 pm Oh man :shock:

I just saw that my internal intel onboard soundcard was running with RT priority of 90 (but was never used) compared to my interface which was running at 80.

I blacklisted the internal card and all my xrun issues disappeared! :D

-->

Code: Select all

echo -e "blacklist snd_hda_intel" | sudo tee -a /etc/modprobe.d/HDAblacklist.conf
Could you explain how you found the RT priorities and driver names of your devices please? I just disabled my internal soundcard after reading this (since I don't use it), but I would like to see if my graphics card's HDMI audio is problematic as well.
The command is

Code: Select all

/etc/init.d/rtirq status
And rtirq has to be install.

I get

Code: Select all

  PID CLS RTPRIO  NI PRI %CPU STAT COMMAND	
  153 FF      85   - 125  0.0 S    irq/16-ehci_hcd	
  182 FF      85   - 125  1.7 S    irq/28-xhci_hcd	
  190 FF      84   - 124  0.0 S    irq/23-ehci_hcd	
  197 FF      84   - 124  0.0 S    irq/29-xhci_hcd	
   42 FF      50   -  90  0.0 S    irq/9-acpi	
   68 FF      50   -  90  0.0 S    irq/8-rtc0	
  146 FF      50   -  90  0.0 S    irq/18-i801_smb	
  195 FF      50   -  90  0.0 S    irq/26-ahci[000	
  213 FF      50   -  90  0.1 S    irq/30-i915	
  380 FF      50   -  90  0.0 S    irq/31-mei_me	
  679 FF      50   -  90  0.2 S    irq/27-enp2s0	
    9 TS       -   0  19  0.1 S    ksoftirqd/0	
   17 TS       -   0  19  0.1 S    ksoftirqd/1	
   22 TS       -   0  19  0.1 S    ksoftirqd/2	
   27 TS       -   0  19  0.1 S    ksoftirqd/3	
korakios
Established Member
Posts: 85
Joined: Thu Feb 14, 2013 6:00 pm

Re: XRUNS ... but why?

Post by korakios »

lilith wrote: Sat Feb 15, 2020 6:03 pm Oh man :shock:

I just saw that my internal intel onboard soundcard was running with RT priority of 90 (but was never used) compared to my interface which was running at 80.

I blacklisted the internal card and all my xrun issues disappeared! :D

-->

Code: Select all

echo -e "blacklist snd_hda_intel" | sudo tee -a /etc/modprobe.d/HDAblacklist.conf
You could try disabling pulseaudio or set the profile of the configuration to 'off' in pavucontrol instead.
Check in home folder for .pulse/daemon.conf or .config/pulse/daemon.conf and remove "realtime-scheduling = yes"

Also if you don't want to bridge pulse with jack (that causes xruns too) remove completely "pulseaudio-module-jack"

The internal soundboard was running higher because rtirq scans for 'snd' devices, but I think you already changed the config file
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

Thanks, but deactivating pulse is not an option. With black listing the sound card the issue is solved.
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: XRUNS ... but why?

Post by bluebell »

lilith wrote: Sat Mar 07, 2020 4:10 pm Thanks, but deactivating pulse is not an option. With black listing the sound card the issue is solved.
If pulseaudio isnt't configured to use an audio adapter but jack then there are no interrupts generated by Pulseaudio and it is not very likely that it causes xruns. Maybe Pulseaudio used the internal soundcard. Blacklisting is one option to avoid those interrupts and I think it can't hurt blacklisting an unused internal soundcard. I did it as well.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

Strangely I'm getting xruns today and I don't know why. I wanted to start the xruncounter script, but it gives me segmentation fault.

Code: Select all

marco@marco:~/src$ ./xruncounter 

******************** SYSTEM CHECK *********************

Segmentation fault
It was working two weeks ago.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

Another strange observation:

I have Renoise running with some DIVA instance to get some DSP load. Renoise is not connected to the sound card output.
Pulse audio is bridged to Jack and I play a sine tone in the browser. Due to the high DSP load in Renoise I hear crackles, but they don't necessarily result in xruns as can be seen in Cadence:

https://www.youtube.com/watch?v=BL3jEQ6-vfc

Isn't this odd?
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

thetotalchaos wrote: Sun Feb 16, 2020 4:06 pm You don't need to configure manually your system for audio performance. You just need to install kxstudio-default-settings. Just install it, reboot and check out if the realtimeconfigquickscan is all green. What else i can advice you? You don't need swap partition, but having a realtime linux is a huge benefit. You can test if your kernel is good with

Code: Select all

uname -a
If you have PREEMPT (or PREEMPT RT) you are fine.
What else? don't use 3D effects, dont use internet or pereferals like scanner or printer, while playing audio. Check your BIOS settings. You don't need a video acceleration, and the battery saver must be turned off, while you are on Ardour for example.
Additionally i am sharing some good manuals, including a topic i made, to make Cadence and Pulseaudio like each other more
https://librazik.tuxfamily.org/doc2/manuel
https://wiki.archlinux.org/index.php/Professional_audio
https://www.linuxmusicians.com/viewtopi ... 27&t=17780

PS (edited): I saw you fixed it, by giving good values for realtime and blacklisting your internal sound card. My advice is to disable it from BIOS itself, if you are allowed.
I will try to summarize the topic of realtime preemption in a few sentiencies. If your linux kernel does not have PREEMPT value (in the output of uname -a) , this whole realtime preemption does not work for you and your system is not optimised for audio performance, the way it can and should be. The realtime preemption value is from 0 to 100 if you have a true realtime kernel ( PREEMPT RT), but from 0 to 90 if you kernel is just PREEMPT (like linux-lowlatency or the default linux on Archlinux). The fun part is with values above 50. A values between 90 to 100 are giving these processes a capability to interrupt other processes. Your sound card, gets the highest value, often 99 or 95 (check your /etc/security/limits.conf or /etc/security/limits.d/audio.conf). The value for Jack should be second in the queue, after the soundcard. 89 is a good value for PREEMPT RT, but because on PREEMPT kernels the highest value is 89, its often recommended a value of 70 for Jack. Further below you can give values for your MIDI peripheral and other apps, by giving values that are -5 below. You can also give RT values to Wine and programs that run on Wine, but you need to use wine-rt on your system. I myself am using the prepared lines, that i am taking by running Festige and copying a well prepared execute lines for the VST plugins. It makes a difference, more that you can assume.

Happy hacking,
Totalchaos, a Linux Audio veteran
Thanks for that! I just saw that the default where not installed on my system and it just solved some problems for me that started yesterday ... Maybe some update changed / overwritten some settings.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: XRUNS ... but why?

Post by lilith »

thetotalchaos wrote: Sun Feb 16, 2020 4:06 pm You don't need to configure manually your system for audio performance. You just need to install kxstudio-default-settings. Just install it, reboot and check out if the realtimeconfigquickscan is all green. What else i can advice you? You don't need swap partition, but having a realtime linux is a huge benefit. You can test if your kernel is good with

Code: Select all

uname -a
If you have PREEMPT (or PREEMPT RT) you are fine.
What else? don't use 3D effects, dont use internet or pereferals like scanner or printer, while playing audio. Check your BIOS settings. You don't need a video acceleration, and the battery saver must be turned off, while you are on Ardour for example.
Additionally i am sharing some good manuals, including a topic i made, to make Cadence and Pulseaudio like each other more
https://librazik.tuxfamily.org/doc2/manuel
https://wiki.archlinux.org/index.php/Professional_audio
https://www.linuxmusicians.com/viewtopi ... 27&t=17780

PS (edited): I saw you fixed it, by giving good values for realtime and blacklisting your internal sound card. My advice is to disable it from BIOS itself, if you are allowed.
I will try to summarize the topic of realtime preemption in a few sentiencies. If your linux kernel does not have PREEMPT value (in the output of uname -a) , this whole realtime preemption does not work for you and your system is not optimised for audio performance, the way it can and should be. The realtime preemption value is from 0 to 100 if you have a true realtime kernel ( PREEMPT RT), but from 0 to 90 if you kernel is just PREEMPT (like linux-lowlatency or the default linux on Archlinux). The fun part is with values above 50. A values between 90 to 100 are giving these processes a capability to interrupt other processes. Your sound card, gets the highest value, often 99 or 95 (check your /etc/security/limits.conf or /etc/security/limits.d/audio.conf). The value for Jack should be second in the queue, after the soundcard. 89 is a good value for PREEMPT RT, but because on PREEMPT kernels the highest value is 89, its often recommended a value of 70 for Jack. Further below you can give values for your MIDI peripheral and other apps, by giving values that are -5 below. You can also give RT values to Wine and programs that run on Wine, but you need to use wine-rt on your system. I myself am using the prepared lines, that i am taking by running Festige and copying a well prepared execute lines for the VST plugins. It makes a difference, more that you can assume.

Happy hacking,
Totalchaos, a Linux Audio veteran
I read somewhere (also here) that the latest kernels are fine for RT optimization even if they are not PREEMPT.
I have the default kernel from debian running: 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux

But I also don't need super low latency. I'm even fine with 20 ms most of the time.
User avatar
thetotalchaos
Established Member
Posts: 211
Joined: Mon Sep 29, 2014 8:29 pm
Has thanked: 53 times
Been thanked: 9 times
Contact:

Re: XRUNS ... but why?

Post by thetotalchaos »

lilith wrote: Sun Mar 08, 2020 4:54 pm But I also don't need super low latency. I'm even fine with 20 ms most of the time.
20ms you say. Check this screenshot from my Archlinux with gnome-shell. Think of this screenshot as a Linux Audio porn :lol: :lol:
Image
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