Re: [Jack-Devel] A lot of Xrun Callbacks ... really xruns?

PrevNext  Index
DateWed, 20 Jun 2012 11:12:12 +0100
From John Rigg <[hidden] at jrigg dot co dot uk>
To"[hidden] at lists dot jackaudio dot org" <[hidden] at lists dot jackaudio dot org>
In-Reply-ToJohn Rigg Re: [Jack-Devel] A lot of Xrun Callbacks ... really xruns?
On Wed, Jun 20, 2012 at 10:43:19AM +0100, John Rigg wrote:
> My workaround has been to turn off xrun markers in Ardour and ignore the
> problem. Not very helpful I know, but I haven't had time to look into it
> further and it hasn't prevented me from getting work done.

One thing I did get time to do recently was add some printfs to
jackd/engine.c to try and work out what was happening. I reported the
results to this list a few weeks ago, but I don't think anyone had time
to look at it.

Here's a copy of that email (apologies for repeating it, but I couldn't
access the list archives to link to the original):

> I've been looking at the XRun detection code in jackd/engine.c 
> (jack 0.121.3) to see if I could find any clues to why JACK clients
> like Ardour2 report xruns in some situations, when nothing is apparently
> wrong with the audio and the alsa driver doesn't report any xruns.
> I encounter this regularly when using ALSA pcm_multi to combine several
> sound cards into one virtual device (as described here: 
> http://www.jrigg.co.uk/linuxaudio/ice1712multi.html).
> 
> Here's what appears to be the relevant section in jackd/engine.c starting
> at line 2071 (extra printfs added by me):
> 
> 
> static void
> jack_engine_delay (jack_engine_t *engine, float delayed_usecs)
> {
> 	jack_event_t event;
> 	
> 	engine->control->frame_timer.reset_pending = 1;
> 
> /*****************************************************************************/
> 	printf("xrun_delayed_usecs %f\n", engine->control->xrun_delayed_usecs);
> 	printf("max_delayed_usecs %f\n", engine->control->max_delayed_usecs);
> 	printf("delayed_usecs %f\n", delayed_usecs);
> /*****************************************************************************/
> 
> 	engine->control->xrun_delayed_usecs = delayed_usecs;
> 
> 	if (delayed_usecs > engine->control->max_delayed_usecs)
> 		engine->control->max_delayed_usecs = delayed_usecs;
> 
> 	event.type = XRun;
> 	
> 	jack_deliver_event_to_all (engine, &event);
> }
> 
> 
> The above code doesn't run when I use a single sound card. Running a pair
> of ice1712 based cards with pcm_multi produces a slew of printf messages
> like these, scrolling rapidly off the screen:
> 
> xrun_delayed_usecs 0.000000
> max_delayed_usecs 0.000000
> delayed_usecs 0.000000
> 
> The values are always zero.
> 
> xrun_delayed_usecs gets initialised to 0 on line 1997.
> max_delayed_usecs gets initialised to 0 on line 1998.
> 
> I couldn't find anywhere where these values get changed between
> initialisation and being used in the above code. Can this be correct?

John
PrevNext  Index

1340186705.6377_0.ltw:2,a <20120620101212.GA2797 at localhost0 dot localdomain>