Page 1 of 1

Xruns? How to view? jackd

Posted: Tue Aug 29, 2023 1:53 pm
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!


Re: Xruns? How to view? jackd

Posted: Tue Aug 29, 2023 8:52 pm
by bluebell

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


Re: Xruns? How to view? jackd

Posted: Wed Aug 30, 2023 12:25 am
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 4471 times

Re: Xruns? How to view? jackd

Posted: Wed Aug 30, 2023 6:38 pm
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!


Re: Xruns? How to view? jackd

Posted: Thu Aug 31, 2023 12:39 pm
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.


Re: Xruns? How to view? jackd

Posted: Thu Aug 31, 2023 1:03 pm
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.


Re: Xruns? How to view? jackd

Posted: Thu Aug 31, 2023 1:40 pm
by ThatJackElliott

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