[ardour-dev] 0.99.1 causing plugin crash?

Sampo Savolainen v2 at iki.fi
Sat Feb 11 08:53:17 PST 2006

On Sat, 2006-02-11 at 16:53 +0100, fons adriaensen wrote:
> On Sat, Feb 11, 2006 at 05:03:48PM +0200, Sampo Savolainen wrote:
> > The "+ offset" part was added by me between 0.99 and 0.99.1. For some
> > reason, I didn't look at the surrounding code and didn't notice that.
> > Taking the buffer offset into account must have triggered nasty results
> > from that.
> Apparently the second channel did get a valid buffer, but it wasn't
> cleared and contained the output from the previous cycle.

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[0]   | buf[1]   | buf[0]   | buf[1]   |   X

buf[nbufs]+offset for channel 1 is at buf[0]+offset for the 2nd channel.

buf[nbufs]+offset for channel 2 is at X.

> 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.

> BTW, there may be a similar issue in the VST_plugin class, same function.

Yes, I did that already and that fix is also included in the snapshot
(and CVS).

Sampo Savolainen <v2 at iki.fi>

More information about the Ardour-Dev mailing list