Xruns? How to view? jackd

What other apps and distros do you use to round out your studio?

Moderators: MattKingUSA, khz

Post Reply
ThatJackElliott
Established Member
Posts: 57
Joined: Thu Jul 27, 2023 4:06 pm
Been thanked: 3 times

Xruns? How to view? jackd

Post by ThatJackElliott »

Hi all,

My little community FM radio broadcast audio project is coming along nicely, my thanks to all here who have offered insight into some of the quirks of JACK.

I have a couple of questions about jackd's verbose output.

Question 1: Where can I find descriptions of the various flavors of messages I see, such as:

"Jack: JackRequest::RegisterPort"
"Jack: JackSocketServerChannel::BuildPoolTable fSocketTable i = 12 fd = 47"
"Jack: JackDriver::ClientNotify ref = 1 driver = freewheel name = freewheel notify = 18"

Question 2: If an xrun were to occur (haven't seen any but want to watch for them) is this where jackd would print it?

Thank you!

-- Jack Elliott
They'll never take me alive

User avatar
bluebell
Established Member
Posts: 1927
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 113 times
Been thanked: 122 times

Re: Xruns? How to view? jackd

Post by bluebell »

One simple way is running Qjackctl even if you don't use it to start jackd. It displays xruns.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

tseaver
Established Member
Posts: 408
Joined: Mon Mar 13, 2017 6:07 am
Has thanked: 12 times
Been thanked: 102 times

Re: Xruns? How to view? jackd

Post by tseaver »

@ThatJackElliott asked:

If an xrun were to occur (haven't seen any but want to watch for them) is this where jackd would print it?

@bluebell replied:

One simple way is running Qjackctl even if you don't use it to start jackd. It displays xruns.

For those who might prefer a CLI answer, here is the Qjackctl configuration which is used to detect xruns:

Screenshot_2023-08-29_20-23-18.png
Screenshot_2023-08-29_20-23-18.png (178.19 KiB) Viewed 2295 times
Ubuntu, Mixbus32C; acoustic blues / country / jazz
ThatJackElliott
Established Member
Posts: 57
Joined: Thu Jul 27, 2023 4:06 pm
Been thanked: 3 times

Re: Xruns? How to view? jackd

Post by ThatJackElliott »

@@tseaver, that QjackCtl screencap you show doesn't look like a cli function I can use on the command line, it's in QjackCtl. But it looks to be a stdout thingy, yes? So is the -verbose output of jackd also going to show any x-runs? I could grep stdout for "xrun" yes? I'd prefer to not use QjackCtl to notify of xruns if at all possible. Only because this application is in a radio station airchain and the fewer bits running, the more stable the system is likely to be. Thank you!

-- Jack Elliott
They'll never take me alive

merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: Xruns? How to view? jackd

Post by merlyn »

tramp wrote an xrun counter.

Code: Select all

#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>

#include <jack/jack.h>

/*   gcc -Wall xruncounter.c -lm `pkg-config --cflags --libs jack` -o xruncounter */

jack_client_t *client;


void
jack_shutdown (void *arg)
{
   exit (1);
}

int jack_xrun_callback(void *arg) 
{
   /* count xruns */
   static int xruns = 0;
   xruns += 1;
   fprintf (stderr, "xrun %i \n", xruns);
   return 0;
}

void
signal_handler (int sig)
{
   jack_client_close (client);
   fprintf (stderr, " signal received, exiting ...\n");
   exit (0);
}

int
main (int argc, char *argv[])

{

   if ((client = jack_client_open ("xruncounter", JackNullOption, NULL)) == 0) {
      fprintf (stderr, "jack server not running?\n");
      return 1;
   }

   signal (SIGQUIT, signal_handler);
   signal (SIGTERM, signal_handler);
   signal (SIGHUP, signal_handler);
   signal (SIGINT, signal_handler);

   jack_set_xrun_callback(client, jack_xrun_callback, 0);
   jack_on_shutdown (client, jack_shutdown, 0);

   if (jack_activate (client)) {
      fprintf (stderr, "cannot activate client");
      return 1;
   }
   while (1) {
      usleep (100000);
   }

   jack_client_close (client);
   exit (0);
}

If you copy that and save it as xruncounter.c you can compile it with the command at the top of the file. This program is the basis of tramp's xruncounter testing tool.

tavasti
Established Member
Posts: 2059
Joined: Tue Feb 16, 2016 6:56 am
Location: Kangasala, Finland
Has thanked: 375 times
Been thanked: 209 times
Contact:

Re: Xruns? How to view? jackd

Post by tavasti »

ThatJackElliott wrote: Tue Aug 29, 2023 1:53 pm

Question 2: If an xrun were to occur (haven't seen any but want to watch for them) is this where jackd would print it?

Thank you!

Change you jack 16 frames/period, put some audio programs running and it will appear in logs.

Linux veteran & Novice musician

Latest track: https://www.youtube.com/watch?v=ycVrgGtrBmM

ThatJackElliott
Established Member
Posts: 57
Joined: Thu Jul 27, 2023 4:06 pm
Been thanked: 3 times

Re: Xruns? How to view? jackd

Post by ThatJackElliott »

tavasti, so yes -- jackd will print xrun errors to stdout. Thank you!

-- Jack Elliott
They'll never take me alive

Post Reply