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

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

Post by kyle_1974 »

Hi all

First post here - hello!

I have posted this in the Linux Mint forum as well but have had no takers so after much googling, I have found you!

So I changed my PC last week for a much newer model and put my HDDs into the new PC.

Everything is working fine apart from Jack. I checked with Qjackctrl and I am getting x-run callback errors (I didn't previously), which is leading to slightly clipped audio and crackling noises (although oddly that does not broadcast out on my radio stream)

I did find information online but it confused me about whether I should be increasing latency. The current latency in jack is 46.4 ms. I have increased the buffer in qjackctrl to 4 rather than 2. I seem to have fewer problems but still some.

My old machine was 12 years old and this one is much newer with 16gb of memory so I thought it would be really fast.

I did wonder if I should try using low latency, as I did when I first started online radio but I cannot seem to find the right version.

I am currently on standard kernel 5.3.0-51. I have tried booting into a low-latency version but this does not fix the problem either. I have an excellent friend who understands Linux audio inside out but I do not want to keep troubling him, although he always knows the solutions. At his advice I did run realTimeConfigQuickScan.pl. After following the instructions, I only get one bit now it says is "not good and doesn't seem easily fixable. (He said the other 2 Not Goods would lead me to more problems, which are below)

Kernel with Real-Time Preemption... not found - not good (RT Kernel is not necessary, lowlatency kernel is good enough)

Checking CPU Governors... - not good (changing CPU governor to 'performance' is not a good idea as system will run at full power and fans may get noisy, JACK should run no problem with no need to change this)

So really I am after any advice to fix my x run error as it's making it difficult for me to do radio shows. Apologies if this is the wrong place to post this.

Thanks in advance
Kyle

Code: Select all

System:
  Host: studio-Centurion-CQ9204 Kernel: 5.3.0-51-generic x86_64 bits: 64 
  compiler: gcc v: 7.5.0 Desktop: MATE 1.22.2 wm: marco dm: LightDM 
  Distro: Linux Mint 19.3 Tricia base: Ubuntu 18.04 bionic 
Machine:
  Type: Desktop Mobo: ASRock model: B450M Pro4 serial: <filter> 
  UEFI [Legacy]: American Megatrends v: P3.90 date: 12/09/2019 
CPU:
  Topology: 6-Core model: AMD Ryzen 5 3600 bits: 64 type: MT MCP arch: Zen 
  L2 cache: 3072 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 86236 
  Speed: 2196 MHz min/max: 2200/3600 MHz Core speeds (MHz): 1: 2201 2: 2196 
  3: 2195 4: 2193 5: 2195 6: 2195 7: 2196 8: 2195 9: 2196 10: 2195 11: 2192 
  12: 2195 
Graphics:
  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X] 
  vendor: ASRock driver: amdgpu v: kernel bus ID: 06:00.0 chip ID: 1002:67df 
  Display: x11 server: X.Org 1.19.6 driver: amdgpu,ati 
  unloaded: fbdev,modesetting,radeon,vesa compositor: marco 
  resolution: 1920x1080~60Hz 
  OpenGL: renderer: Radeon RX 580 Series (POLARIS10 DRM 3.33.0 
  5.3.0-51-generic LLVM 9.0.0) 
  v: 4.5 Mesa 19.2.8 direct render: Yes 
Audio:
  Device-1: AMD Ellesmere [Radeon RX 580] vendor: ASRock 
  driver: snd_hda_intel v: kernel bus ID: 06:00.1 chip ID: 1002:aaf0 
  Device-2: AMD vendor: ASRock driver: snd_hda_intel v: kernel 
  bus ID: 08:00.4 chip ID: 1022:1487 
  Device-3: Nam Tai E&E Products or OmniVision Sony Playstation Eye 
  type: USB driver: ov534,snd-usb-audio bus ID: 3-3:3 chip ID: 1415:2000 
  Device-4: Texas Instruments PCM2902 Audio Codec type: USB 
  driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-8:4 chip ID: 08bb:2902 
  Sound Server: ALSA v: k5.3.0-51-generic 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASRock driver: r8169 v: kernel port: f000 bus ID: 04:00.0 
  chip ID: 10ec:8168 
  IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
  IF-ID-1: br-04d8b881601e state: up speed: N/A duplex: N/A mac: <filter> 
  IF-ID-2: docker0 state: down mac: <filter> 
  IF-ID-3: veth228c807 state: up speed: 10000 Mbps duplex: full 
  mac: <filter> 
  IF-ID-4: veth4bd5e3d state: up speed: 10000 Mbps duplex: full 
  mac: <filter> 
  IF-ID-5: veth5744010 state: up speed: 10000 Mbps duplex: full 
  mac: <filter> 
  IF-ID-6: vethda5f60b state: up speed: 10000 Mbps duplex: full 
  mac: <filter> 
Drives:
  Local Storage: total: 912.90 GiB used: 252.50 GiB (27.7%) 
  ID-1: /dev/sda vendor: SanDisk model: SSD PLUS 480GB size: 447.14 GiB 
  speed: 6.0 Gb/s serial: <filter> 
  ID-2: /dev/sdb vendor: Western Digital model: WDS500G2B0A-00SM50 
  size: 465.76 GiB speed: 6.0 Gb/s serial: <filter> 
Partition:
  ID-1: / size: 431.43 GiB used: 252.50 GiB (58.5%) fs: ext4 dev: /dev/sda1 
Sensors:
  System Temperatures: cpu: 51.1 C mobo: N/A 
Use of uninitialized value $val2 in string eq at /usr/bin/inxi line 5759.
Use of uninitialized value $val2 in split at /usr/bin/inxi line 5764.
Use of uninitialized value $val2 in concatenation (.) or string at /usr/bin/inxi line 5766.
Use of uninitialized value $val2 in concatenation (.) or string at /usr/bin/inxi line 5767.
Use of uninitialized value $val2 in concatenation (.) or string at /usr/bin/inxi line 5768.
  Fan Speeds (RPM): N/A gpu: fan: 1348 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  No active apt repos in: /etc/apt/sources.list.d/additional-repositories.list 
  Active apt repos in: /etc/apt/sources.list.d/cfgnunes-ppa-bionic.list 
  1: deb http://ppa.launchpad.net/cfgnunes/ppa/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/cfgnunes/ppa/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/docker.list 
  1: deb [arch=amd64] https://download.docker.com/linux/debian buster stable
  Active apt repos in: /etc/apt/sources.list.d/flexiondotorg-audio-bionic.list 
  1: deb http://ppa.launchpad.net/flexiondotorg/audio/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/flexiondotorg/audio/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/gezakovacs-ppa-bionic.list 
  1: deb http://ppa.launchpad.net/gezakovacs/ppa/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/gezakovacs/ppa/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
  1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/jon-hedgerows-get-iplayer-bionic.list 
  1: deb http://ppa.launchpad.net/jon-hedgerows/get-iplayer/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/jon-hedgerows/get-iplayer/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/libreoffice-ppa-bionic.list 
  1: deb http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/mixxx-mixxx-bionic.list 
  1: deb http://ppa.launchpad.net/mixxx/mixxx/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/mixxx/mixxx/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/nilarimogard-webupd8-bionic.list 
  1: deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/obsproject-obs-studio-bionic.list 
  1: deb http://ppa.launchpad.net/obsproject/obs-studio/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/obsproject/obs-studio/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb http://www.mirrorservice.org/sites/packages.linuxmint.com/packages tricia main upstream import backport
  2: deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
  3: deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
  4: deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
  5: deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
  6: deb http://archive.canonical.com/ubuntu/ bionic partner
  Active apt repos in: /etc/apt/sources.list.d/skype-stable.list 
  1: deb [arch=amd64] https://repo.skype.com/deb stable main
  Active apt repos in: /etc/apt/sources.list.d/spotify.list 
  1: deb http://repository.spotify.com stable non-free
  Active apt repos in: /etc/apt/sources.list.d/stebbins-handbrake-releases-bionic.list 
  1: deb http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/team-xbmc-ppa-bionic.list 
  1: deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu bionic main
  2: deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/teamviewer.list 
  1: deb http://linux.teamviewer.com/deb stable main
  No active apt repos in: /etc/apt/sources.list.d/tvinternal.list 
Info:
  Processes: 554 Uptime: 2m Memory: 15.57 GiB used: 2.39 GiB (15.4%) 
  Init: systemd v: 237 runlevel: 5 Compilers: gcc: 7.5.0 alt: 7 Shell: bash 
  v: 4.4.20 running in: mate-terminal inxi: 3.0.32 
Last edited by kyle_1974 on Mon Jun 15, 2020 10:14 am, 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: Getting Jack xrun errors - over/underrun?

Post by merlyn »

kyle_1974 wrote:(changing CPU governor to 'performance' is not a good idea as system will run at full power and fans may get noisy, JACK should run no problem with no need to change this)
No offence to your friend, but that simply isn't the case. Try it and see.
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:41 am
kyle_1974 wrote:(changing CPU governor to 'performance' is not a good idea as system will run at full power and fans may get noisy, JACK should run no problem with no need to change this)
No offence to your friend, but that simply isn't the case. Try it and see.
Hi merlyn

Thank you for the reply - if I change it, is it easy to change back? This is the full output of the realtimeconfigscan (I did use the command he gave me to fix this error keeps returning the "not good" message still.)

Checking checking sysctl inotify max_user_watches... < 524288

Code: Select all

Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 5.3.0 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'ondemand' CPU 1: 'ondemand' CPU 10: 'ondemand' CPU 11: 'ondemand' CPU 2: 'ondemand' CPU 3: 'ondemand' CPU 4: 'ondemand' CPU 5: 'ondemand' CPU 6: 'ondemand' CPU 7: 'ondemand' CPU 8: 'ondemand' CPU 9: 'ondemand'  - not good
Set CPU Governors to 'performance' with 'cpupower frequency-set -g performance' or 'cpufreq-set -c <cpunr> -g performance' (Debian/Ubuntu)
See also: http://linuxmusicians.com/viewtopic.php?f=27&t=844
Checking swappiness... 1 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... < 524288 - not good
increase max_user_watches by adding 'fs.inotify.max_user_watches = 524288' to /etc/sysctl.conf and rebooting
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#sysctlconf
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
Checking the ability to prioritize processes with chrt... yes - good
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without 'threadirqs' parameter or real-time capabilities found
For more information, see https://wiki.linuxaudio.org/wiki/system_configuration#do_i_really_need_a_real-time_kernel
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good

Are all my other jack settings in qtrljack ok? (I've never changed the values apart from the latency one)

Kyle

PS) I just realised that this is a musicians place so I hope I am ok being here!Image Image
Last edited by kyle_1974 on Sun May 17, 2020 12:42 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: Getting Jack xrun errors - over/underrun?

Post by merlyn »

Yes, it's easy to change back. For normal desktop use turning the CPU frequency up and down is fine. Human reaction time is around 1/4 of a second, so it's quite easy to create the illusion of 'responsiveness'.

For realtime audio, though, the timings are much tighter, so you want the CPU to be available at all times, and not be turning its speed up and down.

EDIT : I just saw the screenshots. You have a different input and output device selected in QjackCtl. That is usually a problem.
Last edited by merlyn on Sun May 17, 2020 12:44 pm, edited 1 time in total.
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 12:42 pm Yes, it's easy to change back. For normal desktop use turning the CPU frequency up and down is fine. Human reaction time is around 1/4 of a second, so it's quite easy to create the illusion of 'responsiveness'.

For realtime audio, though, the timings are much tighter, so you want the CPU to be available at all times, and not be turning its speed up and down.
:( I'm not sure how I change it :( (Sorry, I have been a mint user for years but never had to change this)

Also, I edited my post before you replied as I didn't think you would be as fast replying!
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 12:42 pm Yes, it's easy to change back. For normal desktop use turning the CPU frequency up and down is fine. Human reaction time is around 1/4 of a second, so it's quite easy to create the illusion of 'responsiveness'.

For realtime audio, though, the timings are much tighter, so you want the CPU to be available at all times, and not be turning its speed up and down.

EDIT : I just saw the screenshots. You have a different input and output device selected in QjackCtl. That is usually a problem.
That's how I always have it set up - my external mixer for my mics /mixer into the PC and the onboard soundcard for output, it's worked fine for four or so years. Just this week it started giving me the errors. I have found some instructions on how to alter the CPU so will try that now.

Edit: I don't want to change the input/ouput as I did have problems with that years back, I will live with the crackling if the CPU fix doesn't work.
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 »

kyle_1974 wrote: Sun May 17, 2020 1:11 pm
merlyn wrote: Sun May 17, 2020 12:42 pm Yes, it's easy to change back. For normal desktop use turning the CPU frequency up and down is fine. Human reaction time is around 1/4 of a second, so it's quite easy to create the illusion of 'responsiveness'.

For realtime audio, though, the timings are much tighter, so you want the CPU to be available at all times, and not be turning its speed up and down.

EDIT : I just saw the screenshots. You have a different input and output device selected in QjackCtl. That is usually a problem.
That's how I always have it set up - my external mixer for my mics /mixer into the PC and the onboard soundcard for output, it's worked fine for four or so years. Just this week it started giving me the errors. I have found some instructions on how to alter the CPU so will try that now.

Edit: I don't want to change the input/ouput as I did have problems with that years back, I will live with the crackling if the CPU fix doesn't work.
Hi merlyn

So I followed this guide:

https://www.preprogrammer.com/how-to-pe ... -in-linux/

But at the last stage I get this error?

update-rc.d: error: cannot find a LSB script for ondemand

EDIT: There was a typo on the webpage. The system report is now saying "good" The load on my CPU is: Image

It's glitched once per song - but without the annoying crackle beforehand so I can probably cope with that?
Just had one glitch now
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 »

This is what it says when it glitches.

"16:11:41.760 XRUN callback (1).
Jack: JackClient::ClientNotify ref = 3 name = qjackctl notify = 3
Jack: JackClient::kXRunCallback
Sun May 17 16:11:41 2020: Jack: **** alsa_pcm: xrun of at least -230390.128 msecs
Sun May 17 16:11:41 2020: Jack: ALSA XRun wait_status = 0"

Thank you for looking into this for me, it's driving me mad!
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 »

Yes, that's the standard Xrun message.

You can see that hardly any CPU is being used, so this system does have a lot of potential. Setting up a new system may mean that you find new ways of doing things, like using the same device for input and output.

To see how that might work -- what software are you using, and what audio routing are you using that means using the internal soundcard is preferable?
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 3:56 pm Yes, that's the standard Xrun message.

You can see that hardly any CPU is being used, so this system does have a lot of potential. Setting up a new system may mean that you find new ways of doing things, like using the same device for input and output.

To see how that might work -- what software are you using, and what audio routing are you using that means using the internal soundcard is preferable?
Hiya

So my system is:

XLR condenser Mic into 286s processor
Out to Behringer USB mixer
That goes into PC (via USB)
I start JACK which lets me run Internet DJ Console for broadcasting or recording

In JACK I have to have the input as the mixer and the soundcard as the output - if I change the input from the mixer, then I don't get any sound relayed from it.

Also just been testing with JACK with sample rate at 44100 and Periods/Buffer at 4. Less xrun errors, perhaps every 4/5 songs now but still the crackling then the pop. It doesn't get broadcast, it's just on my headphones.

I have switched the govenor to performance for the moment.
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 »

A new computer should be able to stream audio with zero Xruns. I think the problem is using the mixer and the internal soundcard. I'm surprised you're getting as few Xruns as you are.

Can the mixer function as an output? Which Behringer model is it?
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 6:30 pm A new computer should be able to stream audio with zero Xruns. I think the problem is using the mixer and the internal soundcard. I'm surprised you're getting as few Xruns as you are.

Can the mixer function as an output? Which Behringer model is it?
The Behringer x1222 (not my best option but...). I only ever use it for outputting to PC, the return is not much good at all really. I had a long discussion on a forum last year and there was a work around of taking sound from the pc via a jack into the mixer but it wasn't worth hassle every show.

The x runs were once per a song, increasing the latency brought it about once every five songs. As I say, it's worked straight off out all the box for years, just now I made the mistake of swapping my PC.

All that said (phew!), someone recommended a slight change to my pulse default.pa file and that has not thrown me any errors for about 30 minutes...
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 »

Nope, the crackle is back but not as often at all so that's something
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 »

Just tried switching all the inputs and outputs in JACK, nope, as expected, no sound unless Mixer=Input and and PC=Output :(

EDIT - I will have to live with the crackle I think as I tried doing a show with the latency but I can't cope with the lag. I suppose I could always do the show with no headphones?!
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 »

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.
OS: Debian 11 kernel: Liquorix
...trying out AV Linux
Post Reply