Re: [linux-audio-dev] API design again

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] API design again
From: Paul Barton-Davis (pbd_AT_Op.Net)
Date: ke loka   06 1999 - 11:31:00 EDT


>The big advantage:
>==================
>
>Plugins can be written as ever without taking care of the applications
>implementation, be that fixed buffers, the events system,
>single sample (only for networks with recursions).
>
>The plugin programmer only has to take care that the plugin works
>with different block sizes down to 1.

Thanks.

David has raised concerns about efficiency, which I think probably
refers to the function call overhead associated with this
situation. Notice that:

           process the event

probably involves something like:

           pluginobj->notify (event)

for each (active?) plugin.

So you could end up calling 3N where N is the number of active plugins
instead of just N. Given that in some cases, the samples_to_process
might be very small, the function call overhead of this scheme is not
necessarily small, although most of the time, it probably will be
because the event density is so low.

However, the benefit of the plugin's own code being *independent* of
the API framework seems enormous. One of my concerns about David's
proposed event system is the amount of work it would take to port
existing DSP code to use it, because it has to be aware of the event
model.

By contrast, if we adopted this model, we could adopt, for example,
all or many of the Csound opcodes with "very little" effort. They all
currently rely on a global called nsmps. "All" we'd have to do to use
them would be to make nsmps the name of the buffer size argument (as
declared in their source), and presto - they'd do the right thing. Of
course, in reality, there would be more to it than that, but not
much. I imagine that many other examples of DSP code could be used in
a similar way.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:27:13 EST