[ardour-dev] 0.99.1 causing plugin crash?
fons.adriaensen at skynet.be
Sat Feb 11 09:46:24 PST 2006
On Sat, Feb 11, 2006 at 06:53:17PM +0200, Sampo Savolainen wrote:
> What happens was probably that the buffers are allocated right next to
> eachother, and the first channel overwrote the second channel. I suspect
> that it was in fact, the 2nd (or more precise: last channel) channel,
> which caused the crash.
> | buffers | buffers
> | for the 1st channel | for the 2nd channel
> | buf | buf | buf | buf | X
> buf[nbufs]+offset for channel 1 is at buf+offset for the 2nd channel.
> buf[nbufs]+offset for channel 2 is at X.
Not exactly. Input and outputs buffers are the same (i.e. in-place
processing). When the track was playing normally, we had
nbufs = 2, in_index = out_index = 0 for the first channel
nbufs = 2, in_index = out_index = 1 for the second channel
when the channel was muted, this became
nbufs = 1, in_index = out_index = 0 for the first channel
nbufs = 1, in_index = out_index = 1 for the second channel
so the second channel was using a buffer that was not initialised
(in this case, cleared).
During normal operation the min() ensures that if there are
less channels than plugin inputs, the last channel is copied
to the remaining inputs. I wonder if this will work correctly,
as the remaining inputs will see the output from the previous
channel instead of the normal input, unless the input signal
is copied again before the call.
Apparently it is also used during mute to make things work with
just one buffer. In this case it works because that buffer is
cleared before each call (by a loop in insert.cc)
> > What is the offset used for ?
> Ardour is capable of mid-process events. This means that automation
> events etc. are sample accurate. To do this right, ardour must be able
> to divide the current buffer into multiple parts. Offset is used for
> exactly this.
Oh, yes. Should have known that.
More information about the Ardour-Dev