Subject: Re: [linux-audio-dev] [ardour] custom graphics + MIDI control for LADSPA plugins
From: Paul Sladen (paul_AT_sladen.org)
Date: Fri Dec 01 2000 - 09:21:16 EET
On Fri, 1 Dec 2000, David Olofson wrote:
> On Thursday 30 November 2000 15:13, Steve Harris wrote:
> > On Thu, Nov 30, 2000 at 04:43:24AM +0100, David Olofson wrote:
>
> However, just dealing with the memory management isn't enough - truly
> hard RT instantiation capable plugins must also be able to do all
> init processing (create, init, prepare, start etc...) in about the
> same time as an average run()/process() call in the actual net. This
> might be a problem for plugins with large buffers or LUTs that are
> generated at init time, especially in very low latency settings. (A
> buffer could be 32 *bytes*...) This becomes very critical in systems
> that may occasionally instantiate lots of plugins during the same
> cycle.
>
> Now, one could "cheat" some, and accept that some plugins need one or
> more cycles to fully initialize, but that would require that the init
> code can be chopped up in arbitrary size bits. Possible but not
> beautiful...
For heavens sack, why(?) are you talking about doing initilisation in RT??
/*** non-RT: ***/
plug->set(FOO, 42);
plug->set(GAIN, 2.0); // can be set anytime
plug->set(BLOCK_SIZE, 32); // is fundemental, requiring LUT regeneration
plug->connect(IN, ibuffer);
plug->connect(OUT, obuffer);
plug->begin();
/*** RT: ***/
// on return, plugin expects to be in RT... don't do anything stupid!
// (like malloc() ;-)
plug->run();
plug->run();
plug->run();
//GAIN is "non-complex", and can be set anytime.
plug->set(GAIN, 1.5);
plug->run();
/*** non-RT: ***/
plug->end();
// changing the block size is a fundemental operation, for instance
// it may required a LUT recalc, which may require a malloc(); etc
plug->set(BLOCK_SIZE, 64);
plug->begin(); // into RT
plug->run();
plug->run();
plug->end(); // end RT
-*-
note however that begin(), and end() are different from the functions to
allocate a new instance of the plug. (which also would be done outside of
RT because it is likely to require calls to black-boxes like malloc.
if(!(plug = groovy_foo_modulating_amp_new()))
die("couldn't create new plugin instance);
plug->init();
plug->set(FOO, 42);
plug->set(...);
plug->connect(...);
plug->begin();
plug->run(); // (from RT thread)
plug->run(); // (from RT thread)
plug->end();
plug->destory();
groovy_foo_modulating_amp_delete(plug);
-*-
Paul
-- e: paul_AT_sladen.org t: 0115 922 7162
This archive was generated by hypermail 2b28 : Fri Dec 01 2000 - 10:04:40 EET