[linux-audio-dev] Arbitrary bufsizes in plugins requiring power of 2 bufsizes, Was: jack_convolve-0.0.10, libconvolve-0.0.3 released

Alfons Adriaensen fons.adriaensen at alcatel.be
Wed Jun 29 14:19:34 UTC 2005


On Wed, Jun 29, 2005 at 03:43:39PM +0200, Florian Schmidt wrote:

> This has a subtle bug afaict. Let's assume the host called several
> process() with numframes != 512 first, then one with numframes == 512, i.e.:
> 
> 1. 123
> 2. 432
> 3. 234
> 4. 512
> 
> The 4th process call disregards data already in the ringbuffer which has
> been put there by previous calls with numframes != 512. There needs to
> be an additional test for whether the ringbuffer is empty.

There's another subtle bug here in that the plugin assumes that
an output buffer of 512 samples is made available by the host,
even if the host is using a fixed smaller period size.

This is a hidden form of buffering at the output, and in fact,
when your plugin algo uses a fixed block size internally but you
want to call it with another value, fixed or not, you will always
need buffering at both the input and the output.

I wrote a convolver library / JACK app similar to Florian's at
about the same time (which is why it was never released).
Main differences are that the API is a bit more general, it's C++,
and it has the required I/O buffering built-in right into the data
structures of the convolver engine, so there is no extra overhead
in copying. The API it such that the extra delay can be easily
avoided if the conditions permit it.

-- 
FA






More information about the Linux-audio-dev mailing list