Getting Jack xrun errors - over/underrun?

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: 25
Joined: Sat May 16, 2020 8:24 pm

Re: Getting Jack xrun errors - over/underrun? [SOLVED]

Post by kyle_1974 »

Hi Lad

So I just did a one hour show with the settings from last night and guess what...

I forgot to jump back into the low latency kernel... So I am hoping that maybe... it's sorted. It sounds weird using my headphones directly but I will learn to cope. Also I don't have to faff with two headsets, one from the PC and one plugged in the mixer to hear callers and things. So hugely better I think.

Thank you for all the help! I will come back if it breaks again! :)

Kyle

Image
Last edited by kyle_1974 on Tue May 19, 2020 8:23 pm, edited 1 time in total.

lad
Established Member
Posts: 22
Joined: Thu Aug 16, 2018 8:31 pm

Re: Getting Jack xrun errors - over/underrun?

Post by lad »

Glad to hear it's working better for you! Nice!
OS: Debian 10 kernel: Liquorix

kyle_1974
Established Member
Posts: 25
Joined: Sat May 16, 2020 8:24 pm

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

kyle_1974 wrote:
Tue May 19, 2020 8:10 pm
Hi Lad

So I just did a one hour show with the settings from last night and guess what...

I forgot to jump back into the low latency kernel... So I am hoping that maybe... it's sorted. It sounds weird using my headphones directly but I will learn to cope. Also I don't have to faff with two headsets, one from the PC and one plugged in the mixer to hear callers and things. So hugely better I think.

Thank you for all the help! I will come back if it breaks again! :)

Kyle

Image

kyle_1974
Established Member
Posts: 25
Joined: Sat May 16, 2020 8:24 pm

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

Sigh

It was all going so well.

Tuesday night, live show - no issue
Thursday - live show, no issue

Friday (just now) - 24 (4823) x run errors knocking the radio stream off intermittently. Three times on my two hour show and every song on my friends one hour show.

I wish I had never upgraded my PC. Set up as described. Jack using USB mixer as in and out, headphones plugged into mixer to hear output.

I have totally run out of ideas at this point, save shifting back to my old PC or using JACK to input from mixer and output from PC soundcard - or living with the glitch every half hour or so as only I hear it (not listeners)

Image

lad
Established Member
Posts: 22
Joined: Thu Aug 16, 2018 8:31 pm

Re: Getting Jack xrun errors - over/underrun?

Post by lad »

Did you set your CPU governor to performance before the broadcast? Setting this is highly recommended.
Can you make sure that all desktop effects are disabled in your desktop environment settings.
"Disable WiFi and close any programs that do not need to be open when recording such as browsers. Many have reported disabling WiFi has led to more reliable JACK performance." - Do you use ethernet or wifi?
Do you happen to have bluetooth service enabled and running? Disable it if so.

Please paste output of:
cat /proc/interrupts
and
cat /etc/security/limits.d/audio.conf

Did anything jack settings change between the shows? Please, keep a log (on paper or text doc) of your jack settings each show. You're going to have to experiment with periods/buffer size/sample rate to get something that works for you.
But you have to do some detective work::

- boot w/ low-latency kernel
- set cpu governor to performance
- with various jack settings, start test broadcast (just as you do a real show) and proceed as follows:

Try to see xrun count with jack settings: 3 periods/256 buffer size@48000. Test your settings by trying to make xruns happen... really push your system! For example, try to change songs every second or as fast as you can to see if you can force xruns. If you can force xruns, your settings need to be adjusted. Adjust the buffer size to 512 and try to force xruns again... and so on until you find a setting w/ lowest # of xruns. Make sense?


To better understand your system, you'll want to benchmark it. There is a tool that will artificially load your system to generate xruns. You can run different to tests to try to pin down optimal jack settings.
You'll have to download and build the tool in terminal like this:
git clone https://github.com/Gimmeapill/xruncounter.git
cd xruncounter/
sudo apt-get install libjack-jackd2-dev
gcc -Wall xruncounter.c -lm `pkg-config --cflags --libs jack` -o xruncounter
./xruncounter -m
OS: Debian 10 kernel: Liquorix

kyle_1974
Established Member
Posts: 25
Joined: Sat May 16, 2020 8:24 pm

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

lad wrote:
Sat May 23, 2020 7:48 am
Did you set your CPU governor to performance before the broadcast? Setting this is highly recommended.
Can you make sure that all desktop effects are disabled in your desktop environment settings.
"Disable WiFi and close any programs that do not need to be open when recording such as browsers. Many have reported disabling WiFi has led to more reliable JACK performance." - Do you use ethernet or wifi?
Do you happen to have bluetooth service enabled and running? Disable it if so.

Please paste output of:
cat /proc/interrupts
and
cat /etc/security/limits.d/audio.conf

Did anything jack settings change between the shows? Please, keep a log (on paper or text doc) of your jack settings each show. You're going to have to experiment with periods/buffer size/sample rate to get something that works for you.
But you have to do some detective work::

- boot w/ low-latency kernel
- set cpu governor to performance
- with various jack settings, start test broadcast (just as you do a real show) and proceed as follows:

Try to see xrun count with jack settings: 3 periods/256 buffer size@48000. Test your settings by trying to make xruns happen... really push your system! For example, try to change songs every second or as fast as you can to see if you can force xruns. If you can force xruns, your settings need to be adjusted. Adjust the buffer size to 512 and try to force xruns again... and so on until you find a setting w/ lowest # of xruns. Make sense?


To better understand your system, you'll want to benchmark it. There is a tool that will artificially load your system to generate xruns. You can run different to tests to try to pin down optimal jack settings.
You'll have to download and build the tool in terminal like this:
git clone https://github.com/Gimmeapill/xruncounter.git
cd xruncounter/
sudo apt-get install libjack-jackd2-dev
gcc -Wall xruncounter.c -lm `pkg-config --cflags --libs jack` -o xruncounter
./xruncounter -m
Morning

PC was set to Governor as I have not changed it since all the fun and games earlier in the week.

No desktop effects enabled.

No wifi card even installed, I always use ethernet.

No bluetooth enabled.

Interrupts

Code: Select all

            CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       CPU8       CPU9       CPU10      CPU11      
   0:         35          0          0          0          0          0          0          0          0          0          0          0   IO-APIC    2-edge      timer
   7:          0          0          0          0          0          0          0          0          0          0          0          0   IO-APIC    7-fasteoi   pinctrl_amd
   8:          0          0          0          0          0          0          0          0          0          0          1          0   IO-APIC    8-edge      rtc0
   9:          0          0          0          0          0          0          0          0          0          0          0          0   IO-APIC    9-fasteoi   acpi
  25:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 22528-edge      PCIe PME
  26:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 51200-edge      PCIe PME
  28:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 116736-edge      PCIe PME, aerdrv
  29:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 133120-edge      PCIe PME, aerdrv
  30:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 135168-edge      PCIe PME, aerdrv
  31:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 137216-edge      PCIe PME, aerdrv
  38:          0      26597        150       1048        748       7341        100          0          0          0          0          0   PCI-MSI 524288-edge      xhci_hcd
  40:       1063      24471     244492       7942          0       1300          0          0      97815          0          0          0   PCI-MSI 4200448-edge      xhci_hcd
  41:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4200449-edge      xhci_hcd
  42:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4200450-edge      xhci_hcd
  43:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4200451-edge      xhci_hcd
  44:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4200452-edge      xhci_hcd
  45:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4200453-edge      xhci_hcd
  46:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4200454-edge      xhci_hcd
  47:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4200455-edge      xhci_hcd
  48:        760          0          0          0          0          0          0    1552590          0          0          0      13277   PCI-MSI 526336-edge      ahci[0000:01:00.1]
  50:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4718592-edge      ahci[0000:09:00.0]
  52:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 5242880-edge      ahci[0000:0a:00.0]
  53:          0     132326          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4202496-edge      snd_hda_intel:card1
  55:       2342          0       2160          0          0          0          0          0          0    6543666          0          0   PCI-MSI 3145728-edge      amdgpu
  58:          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4196353-edge      ccp-1
  61:          0          0          0         52          0          0          0          0          0          0          0          0   PCI-MSI 3147776-edge      snd_hda_intel:card0
  62:          0          0          0          0        568          0          0          0          0          0          0      31814   PCI-MSI 2097152-edge      enp4s0
 NMI:         10        177        152        196        225        214        158        148        159        199        205        216   Non-maskable interrupts
 LOC:    7698617    7356012    7371336    9995821    8865782    8663688    7319931    7420337    7678490    7354972    7909767    7114855   Local timer interrupts
 SPU:          0          0          0          0          0          0          0          0          0          0          0          0   Spurious interrupts
 PMI:         10        177        152        196        225        214        158        148        159        199        205        216   Performance monitoring interrupts
 IWI:          1          2          0          6         18          1          0          3          0          0         44          1   IRQ work interrupts
 RTR:          0          0          0          0          0          0          0          0          0          0          0          0   APIC ICR read retries
 RES:    9510157    6823452    6068639    6523764    6070658    7428823    8053737    6216592    8009544    4385172    6637209    4935339   Rescheduling interrupts
 CAL:     491303     466822     513776     662409     642894     646036     485469     515920     502674     622578     674326     625813   Function call interrupts
 TLB:    1528505    1583113    1605313    1730743    1685769    1703558    1602772    1503321    1631996    1701660    1725536    1689184   TLB shootdowns
 TRM:          0          0          0          0          0          0          0          0          0          0          0          0   Thermal event interrupts
 THR:          0          0          0          0          0          0          0          0          0          0          0          0   Threshold APIC interrupts
 DFR:          0          0          0          0          0          0          0          0          0          0          0          0   Deferred Error APIC interrupts
 MCE:          0          0          0          0          0          0          0          0          0          0          0          0   Machine check exceptions
 MCP:        213        212        212        212        212        212        212        212        212        212        212        212   Machine check polls
 HYP:          0          0          0          0          0          0          0          0          0          0          0          0   Hypervisor callback interrupts
 HRE:          0          0          0          0          0          0          0          0          0          0          0          0   Hyper-V reenlightenment interrupts
 HVS:          0          0          0          0          0          0          0          0          0          0          0          0   Hyper-V stimer0 interrupts
 ERR:          1
 MIS:          0
 PIN:          0          0          0          0          0          0          0          0          0          0          0          0   Posted-interrupt notification event
 NPI:          0          0          0          0          0          0          0          0          0          0          0          0   Nested posted-interrupt event
 PIW:          0          0          0          0          0          0          0          0          0          0          0          0   Posted-interrupt wakeup event

Code: Select all

cat /etc/security/limits.d/audio.conf
# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
#    dpkg-reconfigure -p high jackd

@audio   -  rtprio     95
@audio   -  memlock    unlimited
#@audio   -  nice      -19
Didn't change JACK settings between the four shows.

Being totally honest, I may have forgotten to switch into low latency on boot up yesterday afternoon.

I will change those settings and do tests all afternoon as I have time before Tuesday - it's just so weird that everything was ok for those first two. I checked the recordings last night expecting to do massive editing - but when loading the audio files, there were no glitches recorded oddly. (Even checking bits where I KNEW there was a glitch during one bit)

Going to get that xrun checker now.

Thank you so much again! (in anticipation!)

Kyle

kyle_1974
Established Member
Posts: 25
Joined: Sat May 16, 2020 8:24 pm

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

Hi Lad

So...

Using the tool you recommended, I can force xruns into the thousands - but I wasn't sure what else I was doing with program?

Altering the settings to lowest in JACK and gradually ramping them up, I can get
Sample rate - 48000
Period - 256
Buffer - 2

(If I go lower on the values, JACK won't even start)

I constantly swapped songs every second. moved from player to player and touch wood, no x-run errors. Leaving it running for an hour now to see what it does.

Image Image

ETA - Bugger, forgot I was not in Low-Latency

kyle_1974
Established Member
Posts: 25
Joined: Sat May 16, 2020 8:24 pm

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

Sigh, usual story, no problems for an an our 0 (000) then jumped to 1 (555)

Edit - ran for 6 hours in low latency - and no errors!

lad
Established Member
Posts: 22
Joined: Thu Aug 16, 2018 8:31 pm

Re: Getting Jack xrun errors - over/underrun?

Post by lad »

kyle_1974 wrote:
Tue May 26, 2020 1:09 pm
Sigh, usual story, no problems for an an our 0 (000) then jumped to 1 (555)

Edit - ran for 6 hours in low latency - and no errors!
Nice one! 8)
OS: Debian 10 kernel: Liquorix

kyle_1974
Established Member
Posts: 25
Joined: Sat May 16, 2020 8:24 pm

Re: Getting Jack xrun errors - over/underrun?

Post by kyle_1974 »

Thank you, I won’t mark it as solved until some more tests

Post Reply