XRUNS ... but why?

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

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 »

He uses

Code: Select all

lspci -nnk | grep -i VGA -A2
00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [8086:0412] (rev 06)
Subsystem: Micro-Star International Co., Ltd. [MSI] Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [1462:7817]
Kernel driver in use: i915
and the "firmware-linux-nonfree" installed.
. . . 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
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 »

merlyn wrote:Do you have an nvidia graphics card?
Nope i915 onboard intel chip.
edit: It's an Intel Haswell chip, i915 is the kernel graphic driver.
Last edited by lilith on Sat Mar 09, 2019 3:09 pm, edited 1 time in total.
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: XRUNS ... but why?

Post by merlyn »

Ok. Xeon as in Xeon server chip? Wow.

I had a problem with the scroll wheel causing Xruns in AVLinux, which was solved with nvidia proprietary drivers. Not applicable here.

There is an option in rtirq to force all other interrupts onto SCHED_OTHER, which might help because it seems the X server somehow has too high a priority.
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 »

lilith wrote:Sure, Midi VSTs is the problem here.
khz wrote:If audio is processed in real time and MIDI is not processed in real time - i.e. MIDI is processed at some point (jitter) - this could be the problem. Two different priorities for a task (music).
I guess MIDI is the real problem. It's the same with me.
lilith wrote:I didn't test it yet, but I'm pretty sure that I can record with 128 samples without any xruns..
Audio recording is apparently not the problem.
. . . 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
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 »

Suggestion: Test your ALSA/jack MIDI latency with the programs. viewtopic.php?p=99667#p99667
Possibly with adjustment of timers and JAMRouter.
. . . 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.
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: XRUNS ... but why?

Post by merlyn »

khz seems to have suggestions worth trying.

I remembered that disabling compositing helped on AVLinux, also Debian and XFCE based.
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 »

@khz, merlyn: Thanks, I will look into it. First I check if disabling compositing helps. I just activated it again some days ago, cause of glitches. But if it helps I can live with that. Not a big deal here with xruns as I can just run at 512 samples. I just wondered why I can't use smaller buffer sizes.
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 »

&&
All the software effects, instruments, channels (and mixing) must be calculated in real time. 10 - x Software synthesizers/effects require more computing power than an electric bass through hardware effects and software routing/recording.
viewtopic.php?p=99591#p99591 ;-)
. . . 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.
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: XRUNS ... but why?

Post by merlyn »

Here is my output of

Code: Select all

~$ /etc/init.d/rtirq status

  PID CLS RTPRIO  NI PRI %CPU STAT COMMAND
  491 FF      95   - 135  0.2 S    irq/20-snd_ice1
    3 TS       -   0  19  0.1 S    ksoftirqd/0
   32 TS       -   0  19  0.3 S    ksoftirqd/1
   37 TS       -   0  19  0.1 S    ksoftirqd/2
   42 TS       -   0  19  0.1 S    ksoftirqd/3
   53 TS       -   0  19  0.0 S    irq/9-acpi
   81 TS       -   0  19  0.0 S    irq/17-ehci_hcd
   82 TS       -   0  19  0.0 S    irq/19-ehci_hcd
   83 TS       -   0  19  0.0 S    irq/16-ohci_hcd
   84 TS       -   0  19  0.0 S    irq/16-ohci_hcd
   87 TS       -   0  19  0.0 S    irq/18-ohci_hcd
   88 TS       -   0  19  0.0 S    irq/18-ohci_hcd
   89 TS       -   0  19  0.0 S    irq/18-ohci_hcd
   91 TS       -   0  19  0.0 S    irq/12-i8042
   92 TS       -   0  19  0.0 S    irq/1-i8042
   93 TS       -   0  19  0.0 S    irq/8-rtc0
  162 TS       -   0  19  0.0 S    irq/44-ahci
  171 TS       -   0  19  0.0 S    irq/14-pata_ati
  172 TS       -   0  19  0.0 S    irq/15-pata_ati
  459 TS       -   0  19  0.0 S    irq/19-snd_hda_
 1294 TS       -   0  19  0.0 S    irq/43-eth0
 1387 TS       -   0  19  1.4 S    irq/45-nvidia
You can see only the soundcard is on the realtime scheduler
Jack Winter
Established Member
Posts: 381
Joined: Sun May 28, 2017 3:52 pm

Re: XRUNS ... but why?

Post by Jack Winter »

@lilith

Yes I think you have described and configured everything the right way.

One observation, the configuration for "nice" in limits.conf strictly isn't needed, but it also won't hurt. Just some old Internet lore that gets propagated. Also maybe best to set the limit of rtprio to 98, as there are some kernel threads running at 99, that you probably don't want to interfere with.

Also you might want to change the rtirq configuration a little bit, there is no need to change priority of any interrupt handling thread except for the soundcard one (on a modern system).

In this vein, is it possible to configure rtirq to only change the priority of say "irq/27-xhci_hcd"?

Possibly try blacklisting the xhci_hcd driver to see if using ehci will work better. Also try different usb ports. Though I suspect that this won't help one bit, but maybe worth trying :)

I wonder if it's cpu use that causes the xruns, maybe some priority inversion. If you run hackbench from the rt-tests package and leave the mouse and screen more or less idle, does that also cause xruns?

What happens if you start jackd manually instead of using cadence/qjackctl?

Have you tried using Ardour's ALSA backend instead of JACK, does that change anything?

Possibly the problem is with some plugin you are using. Maybe trying your project without any plugins at all, or replacing the virtual instruments with others could offer some insight.

Personally I don't understand why using the scrollwheel would cause xruns, this might offer a clue to the problem. Interested in hearing if disabling compositing will help, though I kind of doubt it.

One observation I've made in the past, is that I can quite easily make jackd xrun by pressing a lot of keys on my midi keyboard, but in an excessive manner, trying to press as many keys as I can quickly with both hands, not playing normally. Maybe jack does indeed have a problem with processing a lot of midi events. This happens with no clients connected to jack at all, and iirc happens with both jack1 and jack2. I've inquired about it a few times on irc, but as I don't really use midi at all, I've never bothered to pursue the problem.

You could also consider building jack2 with the --profiling option, see: http://www.grame.fr/ressources/publications/Timing.pdf

This might offer some insight into the problem, I suspect that it will only show you that ardour was late in finishing the graph, but who knows...:)
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux
Jack Winter
Established Member
Posts: 381
Joined: Sun May 28, 2017 3:52 pm

Re: XRUNS ... but why?

Post by Jack Winter »

A follow up question :)

When the xruns happen, is the midi inside of ardour only, or does it include a physical midi keyboard, other jack clients, etc?

Edit: What I'm getting at is, are the xruns caused by ardour or a plugin it hosts, or some external factor related to JACK? I'm not sure what modules are related to midi, but maybe blacklisting the modules containing midi in their name, check with "lsmod | grep midi". Though if you don't use other jack clients, nor the external keyboard while working that's probably not it..

You could try disconnecting your midi keyboard, who knows maybe it's constantly sending a lot of CCs or something like that. Maybe many midi msgs causes the same problem I have experienced. In fact try disconnecting all usb devices not needed and try different ports for your soundcard.
Last edited by Jack Winter on Mon Dec 03, 2018 7:01 pm, edited 1 time in total.
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux
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 »

. . . 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.
Jack Winter
Established Member
Posts: 381
Joined: Sun May 28, 2017 3:52 pm

Re: XRUNS ... but why?

Post by Jack Winter »

Another observation, I think you said that dsp load peaks at about 85% ?

If so, maybe you are just exceeding what is possible in ardour with the midi data and plugins you have chosen. Dsp load is an average reported by jack, which means that peaks could be higher.. IIRC one ought to not exceed 80-90%. I've always bemoaned that it doesn't return more information, like minimum and maximum execution time of the jack graph..

The dsp load reflects how much of the time limit given by buffer size/samplerate has actually been used up by the clients. At 100% it took too long to calculate an FX chain or the final output, and data wasn't available in time for the audio buffer, thus a xrun.

But you can get exact data on a lot of jack related timing rebuilding jack2 with the --profile option. It will show if it's the hardware or the software causing the problems. It can even export it's timing as jack audio so that you can record it into your daw or monitor it in realtime.
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux
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 for all the comments!! I'll look into the subjects tomorrow. :)
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 »

First test today directly solved the issue: I was running a rather big project with lots of VSTs in Ardour with ALSA and compared the result to Jack.

Jack: With 256 samples I see a quite constant DSP load of ~65% and Xruns every ~5s when transport is started.
Alsa: With 256 samples I see a DSP load of ~60% up to often exceeding 95% and reaching even 100%.

I asked at IRC (las, rgareus) and obviously the DSP load is calculated in a different way for Alsa and Jack. Jack shows the average of 60 values, while Alsa treats it different.

Here's a post from Robin: http://jack-audio.10948.n7.nabble.com/J ... 18671.html

So, even when the DSP load with Jack is ~60-70%, Alsa clearly shows that it can easily reach 100%. I still have to check the GPU stuff ...
Post Reply