Getting Jack xrun errors - over/underrun? [SOLVED - I think]

Still new to all of this? Feel free to post in any of the subforums on this site, but in this subforum newbie questions are especially encouraged!

Moderators: MattKingUSA, khz

kyle_1974
Established Member
Posts: 74
Joined: Sat May 16, 2020 8:24 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

lad wrote: Sun May 17, 2020 9:26 pm Hi Kyle_1974, Sounds like your setup is giving you some trouble.

I saw earlier that you two different devices for input and output for the jack device. This maybe isn't ideal. Are you familiar with the alsa_in and alsa_out commands? These commands will make it so you can patch audio between multiple soundcards while running jack. I can try to explain more if you haven't experience with it.
Hiya

Happy to try anything at this point - it's always been set up like that - I didn't know there was another way (although my main problem is the x run error). I can't get around my head around having my mixer running into the PC (albeit through JACK)

I should also say, I have done this for just over four years and I swear I have never had an issue until I changed the PC last week.

EDIT: To clarify since I sounded a bit vague, I mean I know I can get the mixer running into JACK the way I have been. Also, I know it might have seemed a weird approach but all these problems started with the new PC. Worked totally fine until then :(
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: Getting Jack xrun errors - over/underrun?

Post by merlyn »

It does seem strange that it worked before. The behaviour you're seeing now is what I would expect -- I don't think there's anything wrong with your new computer.

If you select the mixer as the input and the output device in QjackCtl, what is wrong with using the USB return fader?
kyle_1974
Established Member
Posts: 74
Joined: Sat May 16, 2020 8:24 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

merlyn wrote: Sun May 17, 2020 11:27 pm It does seem strange that it worked before. The behaviour you're seeing now is what I would expect -- I don't think there's anything wrong with your new computer.

If you select the mixer as the input and the output device in QjackCtl, what is wrong with using the USB return fader?
Ah no, from many many experiments last year and a three page discussion on a forum, it doesn't actually work the way the manual says it does. I thought that would be the ideal but sadly not. I'm happy to try again but I spent weeks last time.
lad
Established Member
Posts: 45
Joined: Thu Aug 16, 2018 8:31 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by lad »

I'm not an expert at this, but your machine should be able to get achieve much lower latency than 40ms, I would think! something ain't right, that's for sure. So you're going to need to do a little experimenting in my opinion you could try these things...

0. If you stick to the default kernel I think you would need to 1) install the package: rtirq-init and 2) enable the "threadirqs" kernel parameter, so that higher priority is given to your soundcards/ If you don't want to do that, then boot the real-time kernel, but suggested is the threadirqs parameter.
- https://wiki.linuxaudio.org/wiki/system ... the_kernel <-- look for heading: Using the threadirqs kernel option
- More info: https://wiki.ubuntu.com/UbuntuStudio/rtirq
1. Set the period size back to 2 or 3 (I know you found 4 worked better for you, but try anyways please) and
2. Try to set sample rate to 48000 if your soundcards support it and a buffer size that is a multiple of 48.... Try the value 480 to achieve 10ms latency, for example. If that stuff doesn't help:
3. Try to disable USB-3.0 in your BIOS
4. Change Jack setting and assign the mixer to the input/output. See if xrun shows up. If not, that's a clue maybe.
5. Experiment with Jack setting to assign the other soundcard as the input and output, see if the xrun shows up.
6. Is jack setup to run in real-time mode and what is the priority assigned?

Sorry it's not so straightforward, but hopefully the experimentation will lead to at least a hint?

Let us know what you find.
OS: Debian 11 kernel: Liquorix
...trying out AV Linux
Death
Established Member
Posts: 372
Joined: Sun Oct 11, 2015 1:43 pm
Been thanked: 32 times

Re: Getting Jack xrun errors - over/underrun?

Post by Death »

The CPU governor makes a huge difference. At least it always has in my experience. I used to just run Performance mode all the time. But yeh, that wastes a lot of power at times when your computer would normally be idling, underclocked & undervolted plus the potential extra fan noise from that. So what I do is trigger Feral's gamemode to run when I open my DAW and then close after. It changes to Performance mode and then back to schedutil when I close my DAW. Simple :) I use a Windows DAW which I installed via Lutris so it's as simple as just having gamemode installed from my repos and then turning on a switch to make it activate. The steps may be a little different for your setup though. Also, look into what tweaks gamemode makes because some of them might be bad for audio work. I haven't check to be honest :lol:
kyle_1974
Established Member
Posts: 74
Joined: Sat May 16, 2020 8:24 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

lad wrote: Mon May 18, 2020 6:30 am I'm not an expert at this, but your machine should be able to get achieve much lower latency than 40ms, I would think! something ain't right, that's for sure. So you're going to need to do a little experimenting in my opinion you could try these things...

0. If you stick to the default kernel I think you would need to 1) install the package: rtirq-init and 2) enable the "threadirqs" kernel parameter, so that higher priority is given to your soundcards/ If you don't want to do that, then boot the real-time kernel, but suggested is the threadirqs parameter.
- https://wiki.linuxaudio.org/wiki/system ... the_kernel <-- look for heading: Using the threadirqs kernel option
- More info: https://wiki.ubuntu.com/UbuntuStudio/rtirq
1. Set the period size back to 2 or 3 (I know you found 4 worked better for you, but try anyways please) and
2. Try to set sample rate to 48000 if your soundcards support it and a buffer size that is a multiple of 48.... Try the value 480 to achieve 10ms latency, for example. If that stuff doesn't help:
3. Try to disable USB-3.0 in your BIOS
4. Change Jack setting and assign the mixer to the input/output. See if xrun shows up. If not, that's a clue maybe.
5. Experiment with Jack setting to assign the other soundcard as the input and output, see if the xrun shows up.
6. Is jack setup to run in real-time mode and what is the priority assigned?

Sorry it's not so straightforward, but hopefully the experimentation will lead to at least a hint?

Let us know what you find.
Hi Lad

Getting on with most of it now (all good advice and I understand (mainly!)

In terms of the first part you suggested, I booted with the normal kernel and checked and added the threadirqs section to boot and updated grub, as per the guide here: https://wiki.linuxaudio.org/wiki/system ... the_kernel. When I looked at the section which talks about

CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_PREEMPT_RT_FULL=y
CONFIG_PREEMPT=y

I didn't seem to have anything like those values?

Code: Select all


# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
# end of Timers subsystem

# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set


#Performance Monitoring
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250





Also the bit from here, https://wiki.ubuntu.com/UbuntuStudio/rtirq. Have I done this by following the instructions from the earlier link or do I need to do this as well?

Sorry for the questions :(

EDIT: I have also now got a full set of greens after following the instructions in realtimeconfigquickscan-master (apart from the RT kernel but I can see the guide you sent for that - that may be beyond me)

I have set the Sample rate to 48000, the frames/period to 512 (couldn't select a 480 option) and period/buffer back to 2. Will try changing input/output again. Last night if I set JACK to just the internal PC soundcard in/out, I didn't hear my mixer. Reversing it, ie, mixer > input, output > PC Soundcard/speakers - that all works.

Jack is ticked in realtime.
lad
Established Member
Posts: 45
Joined: Thu Aug 16, 2018 8:31 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by lad »

Please paste output of:
grep -e "CONFIG_IRQ_FORCED_THREADING=y" -e "CONFIG_PREEMPT=y" /boot/config-`uname -r`
and
cat /etc/default/grub | grep thread
and
uname -a
OS: Debian 11 kernel: Liquorix
...trying out AV Linux
kyle_1974
Established Member
Posts: 74
Joined: Sat May 16, 2020 8:24 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

lad wrote: Mon May 18, 2020 8:22 pm Please paste output of:
grep -e "CONFIG_IRQ_FORCED_THREADING=y" -e "CONFIG_PREEMPT=y" /boot/config-`uname -r`
and
cat /etc/default/grub | grep thread
and
uname -a
Details below - although I think I have fixed it after 13 hours. If I start Jack, even with super low values, it starts. I plug the mixer in and it works, no buzzing or glitches or x runs. Just tested a it a few different ways and that seems to work every time. Weird. I will keep checking but I think this is the answer - thank you so much for all the guidance and help this far though.

EDIT - Just started again :(

Code: Select all

 grep -e "CONFIG_IRQ_FORCED_THREADING=y" -e "CONFIG_PREEMPT=y" /boot/config-`uname -r` 
CONFIG_IRQ_FORCED_THREADING=y

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs"

Linux studio-Centurion-CQ9204 5.3.0-51-generic #44~18.04.2-Ubuntu SMP Thu Apr 23 14:27:18 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
kyle_1974
Established Member
Posts: 74
Joined: Sat May 16, 2020 8:24 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

Further to the above but (and this sounds mental), loads of x runs now, but they're not recording, going out on the radio stream or in my headphones? So I know it's not a perfect answer but I can with live this as it's not causing any problems.

Odd though.
lad
Established Member
Posts: 45
Joined: Thu Aug 16, 2018 8:31 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by lad »

No problem! This stuff makes one feel crazy tbh. :shock:

Based on the output, it doesn't look like your current kernel has the PREEMPT line that I would expect.
So do you still have the low latency kernel installed that you tried earlier? Please boot with that kernel if so.

Then paste the output of the commands from above again, please
OS: Debian 11 kernel: Liquorix
...trying out AV Linux
kyle_1974
Established Member
Posts: 74
Joined: Sat May 16, 2020 8:24 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

lad wrote: Mon May 18, 2020 10:26 pm No problem! This stuff makes one feel crazy tbh. :shock:

Based on the output, it doesn't look like your current kernel has the PREEMPT line that I would expect.
So do you still have the low latency kernel installed that you tried earlier? Please boot with that kernel if so.

Then paste the output of the commands from above again, please
You have way more patience than me!

Code: Select all

grep -e "CONFIG_IRQ_FORCED_THREADING=y" -e "CONFIG_PREEMPT=y" /boot/config-`uname -r`
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_PREEMPT=y

cat /etc/default/grub | grep thread 
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs"

uname -a 
Linux studio-Centurion-CQ9204 4.15.0-101-lowlatency #102-Ubuntu SMP PREEMPT Mon May 11 10:50:36 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


kyle_1974
Established Member
Posts: 74
Joined: Sat May 16, 2020 8:24 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

I spoke too soon (again!)

Put my fader up, no sound from mixer!

So rebooted, changed it back to 1024/2 and that seems to be working with only 1 xrun this far - and that was a very very slight clip and not as buzzy as it was before we started all this.

I have managed to destroy a USB port by pulling a lead out as well! So that's nice!
lad
Established Member
Posts: 45
Joined: Thu Aug 16, 2018 8:31 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by lad »

kyle_1974 wrote: Mon May 18, 2020 10:57 pm I spoke too soon (again!)

Put my fader up, no sound from mixer!

So rebooted, changed it back to 1024/2 and that seems to be working with only 1 xrun this far - and that was a very very slight clip and not as buzzy as it was before we started all this.

I have managed to destroy a USB port by pulling a lead out as well! So that's nice!
Dude! :(

So you're saying you don't get sound from your mixer under low latency kernel?
I'd recommend sticking with the low latency kernel as a rule pretty much. I believe it would give lower latency than generic kernel.
OS: Debian 11 kernel: Liquorix
...trying out AV Linux
kyle_1974
Established Member
Posts: 74
Joined: Sat May 16, 2020 8:24 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

lad wrote: Mon May 18, 2020 11:09 pm
kyle_1974 wrote: Mon May 18, 2020 10:57 pm I spoke too soon (again!)

Put my fader up, no sound from mixer!

So rebooted, changed it back to 1024/2 and that seems to be working with only 1 xrun this far - and that was a very very slight clip and not as buzzy as it was before we started all this.

I have managed to destroy a USB port by pulling a lead out as well! So that's nice!
Dude! :(

So you're saying you don't get sound from your mixer under low latency kernel?
I'd recommend sticking with the low latency kernel as a rule pretty much. I believe it would give lower latency than generic kernel.
The lesson is lad, don't buy a new fancy PC!

Anyway it kind of works to a fashion (!) I did just switch the input/output to be the mixer in JACK and that is finally feeding sound back (after 4 years!). So I think the plan is to stop using my headphones into the pc and rather go straight into the mixer and monitor it that way. Hopefully that was I can hear music from the PC so I know when to come in and it will be all recorded. I will try that tomorrow as I have been at it since 10am! Thank you again so much for being around for my pain!!!
lad
Established Member
Posts: 45
Joined: Thu Aug 16, 2018 8:31 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Getting Jack xrun errors - over/underrun?

Post by lad »

Okay, good luck! Will check back in tomorrow.
OS: Debian 11 kernel: Liquorix
...trying out AV Linux
Post Reply