[Ardour-Dev] ARDOUR::IO::ensure_limits()

John Emmas johne53 at tiscali.co.uk
Fri Jul 22 13:21:30 PDT 2011


On 22 Jul 2011, at 20:01, Paul Davis wrote:

> 
> its a remnant of older code, and is poor programming style.  i'll try
> to fix that up this afternoon.
> 
> btw, "DSP load" = JACK knows how long it has to process nframes of
> audio when it is woken by the JACK backend (e.g. ALSA, CoreAudio,
> ASIO/PortAudio etc). It measures how long the total execution of the
> graph (i.e. calling all clients' process() callback), and computes the
> percentage of the total time available. So, if there was 5.3msec
> available (because the buffer size used by the backend is 5.3msec),
> and calling the graph takes 2.65msec, the DSP load is 50%.

Excellent.  Thanks for the information Paul.  While you're at it, could you have a think about this section of code, also in libs/ardour/io.cc.  I've removed some lines just to make the problem clearer:-

int
IO::use_output_connection (Connection& c, void* src)
{
	uint32_t limit;	

	limit = c.nports();

	for (uint32_t n = 0; n < limit; ++n) {
			
		if (!_outputs[n]->connected_to ((*i))) {

			// some stuff
		}
	}

	return 0;
}

When loading some sessions (not all) this code fails in Mixbus because 'limits' is 2, whereas '_outputs.size()' is only 1.  I haven't been able to find out why this difference exists but the problem doesn't seem to happen if I build Ardour instead of Mixbus.  Needless to say, if I change the 'limits' line to look like this:-

	limits = _outputs.size ();

the crash goes away.  I don't know whether the fact that 'c.nports()' is greater than '_outputs.size()' is an indication of a problem but after making that change, Mixbus will load the errant sessions without any (apparent) problem.

Thanks,

John


More information about the Ardour-Dev mailing list