XRUNS ... but why?

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

User avatar
lilith
Established Member
Posts: 921
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Contact:

XRUNS ... but why?

Postby lilith » Sun Dec 02, 2018 8:39 pm

Today I was trying with support from JackWinter to get rid of my xruns which I observe with low buffer sizes below 512 samples and rather large projects with lots of VSTs at DSP loads of around ~60%. My system is Debian Stretch with added KXrepositories. First thing we checked is if the right settings in

Code: Select all

cat /etc/security/limits.conf


@audio - rtprio 99
@audio - memlock unlimited
@audio - nice -10

where set, which is obviously the case. Next important thing is to optimize the priority of the interrupt handlers of the soundcard. When the KXrepos are added this is done via the Rtirq script (https://alsa.opensrc.org/Rtirq) automatically (more or less).

The interrupt handler of the soundcard can also be set manually higher by hand. First check the running processes with

Code: Select all

cat /proc/interrupts


and localize the process for which the interrupts are increasing the fastest (soundcard should have a lot to do, so let's run a big project in your DAW).

If you have localized the interrupt handler for the soundcard let's check it's PID with

Code: Select all

pgrep irq/xx
where xx is the number from the first column from

Code: Select all

cat /proc/interrupts
of the busiest process.

Setting the priority higher works with

Code: Select all

sudo chrt -f -p 95 yy
where yy is the output of the pgrep command.

Another thing which is important is to check that your audio interface connected to a USB bus where no other devices are connected. I my case it looks like:

Code: Select all

marco@fox:/etc$ lsusb
Bus 006 Device 002: ID 8087:8000 Intel Corp.
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 002: ID 04e8:61f5 Samsung Electronics Co., Ltd
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 004 Device 009: ID 046d:c069 Logitech, Inc. M-U0007 [Corded Mouse M500]
Bus 004 Device 008: ID 09e8:0076 AKAI  Professional M.I. Corp. LPK25 MIDI Keyboard
Bus 004 Device 007: ID 0835:8502 Action Star Enterprise Co., Ltd
Bus 004 Device 006: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 004 Device 005: ID 046a:0011 Cherry GmbH G83 (RS 6000) Keyboard
Bus 004 Device 004: ID 0835:8501 Action Star Enterprise Co., Ltd
Bus 004 Device 003: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 004 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 1686:014f ZOOM Corporation
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


This is ok as my interface from ZOOM is connected to Bus 002 and no other device is connected to that Hub.

After doing all the appropriate changes I still get xruns with buffer sizes below 512 at DSP loads of ~60-85%. And the strange thing is that I get more xruns when switching desktop windows or browsing in chromium. Especially using the scroll wheel of the mouse seems to trigger xruns. When using 512 samples everything works fine, but of course adding more vst instruments will cause problems even at this buffer size.

Does anyone know where this might come from or what else can I check?

@JackWinter: If I have written bogus somewhere please correct me.
https://soundcloud.com/lilith_93

_____________________________
Debian 9 (XFCE) & KXStudio repos

User avatar
d.healey
Established Member
Posts: 136
Joined: Fri Sep 22, 2017 8:33 pm

Re: XRUNS ... but why?

Postby d.healey » Sun Dec 02, 2018 9:11 pm

Are you using Cadence of QjackCtl? When I was using Cadence I always had xruns, I have hardly any with QjackCtl.

User avatar
lilith
Established Member
Posts: 921
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Contact:

Re: XRUNS ... but why?

Postby lilith » Sun Dec 02, 2018 9:23 pm

I'm using Cadence. I'll make a test with QjackCtl now :shock:
https://soundcloud.com/lilith_93

_____________________________
Debian 9 (XFCE) & KXStudio repos

User avatar
lilith
Established Member
Posts: 921
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Contact:

Re: XRUNS ... but why?

Postby lilith » Sun Dec 02, 2018 9:41 pm

No change with QjackCtl. On the other hand Cadence is also started when starting QjackCtl.
https://soundcloud.com/lilith_93

_____________________________
Debian 9 (XFCE) & KXStudio repos

User avatar
d.healey
Established Member
Posts: 136
Joined: Fri Sep 22, 2017 8:33 pm

Re: XRUNS ... but why?

Postby d.healey » Sun Dec 02, 2018 10:22 pm

lilith wrote:No change with QjackCtl. On the other hand Cadence is also started when starting QjackCtl.

I removed Cadence completely so no idea how well they'll run together.

stanlea
Established Member
Posts: 548
Joined: Wed Apr 25, 2012 9:49 pm

Re: XRUNS ... but why?

Postby stanlea » Mon Dec 03, 2018 7:24 am

Cadence and Qjackctl are mainly GUIs for jack services, so the problem is in the jack parameters under the hood.

User avatar
khz
Established Member
Posts: 1054
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: XRUNS ... but why?

Postby khz » Mon Dec 03, 2018 1:37 pm

If I only edit/route audio I have very few xruns. As soon as I work with MIDI I have much more xruns.
Can MIDI also be optimized for real-time?

Is that also the case with you that if you work with MIDI you have significantly more xruns?
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: 921
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Contact:

Re: XRUNS ... but why?

Postby lilith » Mon Dec 03, 2018 2:04 pm

khz wrote:If I only edit/route audio I have very few xruns. As soon as I work with MIDI I have much more xruns.
Can MIDI also be optimized for real-time?

Is that also the case with you that if you work with MIDI you have significantly more xruns?


Sure, Midi VSTs is the problem here. I didn't test it yet, but I'm pretty sure that I can record with 128 samples without any xruns. As soon a lot of VSTs come into play I get xruns at DSP loads of up to ~80% (on average).
https://soundcloud.com/lilith_93

_____________________________
Debian 9 (XFCE) & KXStudio repos

User avatar
khz
Established Member
Posts: 1054
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: XRUNS ... but why?

Postby khz » Mon Dec 03, 2018 2:09 pm

There are timers https://wiki.linuxaudio.org/wiki/system_configuration#timers but it seems that they are only available for ALSA.
Could the xrunś come from the fact that audio is processed in real time and MIDI is not, so MIDI will eventually be processed?
lilith wrote:Sure, Midi VSTs is the problem here.

It makes no difference whether it is LV2 or native VST MIDI, xruns generally occur with MIDI, no matter what MIDI.

Wish List: Is there a real-time optimization for jack MIDI?
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: 921
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Contact:

Re: XRUNS ... but why?

Postby lilith » Mon Dec 03, 2018 2:13 pm

I mean software synths, not midi with external synths. I think in the end it doesn't matter if the DSP load is caused by VST synths or by recording a lot of audio tracks. Fact is I get xruns at ~80% DSP load and this is not expected.
https://soundcloud.com/lilith_93

_____________________________
Debian 9 (XFCE) & KXStudio repos

User avatar
khz
Established Member
Posts: 1054
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: XRUNS ... but why?

Postby khz » Mon Dec 03, 2018 2:20 pm

Yes, software synthesizers controlled by MIDI.
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).
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: 368
Joined: Thu Oct 11, 2018 4:13 pm

Re: XRUNS ... but why?

Postby merlyn » Mon Dec 03, 2018 2:31 pm

So you're thinking that you should only get Xruns when the CPU gets to 100%? That does seem sensible.

I've noticed DSP load goes up and down, so the figure you see must be an average, which will take out short lived spikes.

I set my irq prority on AVLinux by editing /etc/default/rtirq. That file is in a different location on Arch, so might be in a different location on your system.

Code: Select all

/etc/init.d/rtirq status
is useful. Again rtirq may be in a different place on your system.

User avatar
khz
Established Member
Posts: 1054
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: XRUNS ... but why?

Postby khz » Mon Dec 03, 2018 2:36 pm

?
Source: http://jack-audio.10948.n7.nabble.com/Considering-JamRouter-a-low-jitter-MIDI-bridge-for-all-Jack-versions-td19580.html
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: 921
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Contact:

Re: XRUNS ... but why?

Postby lilith » Mon Dec 03, 2018 2:40 pm

merlyn wrote:So you're thinking that you should only get Xruns when the CPU gets to 100%? That does seem sensible.

I've noticed DSP load goes up and down, so the figure you see must be an average, which will take out short lived spikes.

I set my irq prority on AVLinux by editing /etc/default/rtirq. That file is in a different location on Arch, so might be in a different location on your system.

Code: Select all

/etc/init.d/rtirq status
is useful. Again rtirq may be in a different place on your system.


No, not 100%, but maybe 90% :D We optimized the IRQ priority yesterday, so there's no problem here. Strange is also, that switching windows and working with the mouse causes more xruns.
https://soundcloud.com/lilith_93

_____________________________
Debian 9 (XFCE) & KXStudio repos

merlyn
Established Member
Posts: 368
Joined: Thu Oct 11, 2018 4:13 pm

Re: XRUNS ... but why?

Postby merlyn » Mon Dec 03, 2018 2:47 pm

Do you have an nvidia graphics card?


Return to “System Tuning and Configuration”

Who is online

Users browsing this forum: bluebell and 3 guests