[gmpi] Re: Topic 5: Threading

  • From: Chris Grigg <gmpi-public@xxxxxxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Thu, 10 Apr 2003 14:20:48 -0700

> Would there be any point to providing an output underflow
 notification callback (host calls plug)?  You've already 'gapped' at
 that point, of course.

The easiest way to provide the plugin with under/overrun information is to use a counter argument in the process function, but I'm not sure if this is useful.

--ms

I'm not sure either, which is why I'm asking. 8-) I was just thinking that perhaps there could be a minor efficiency/simplicity advantage to the callback approach.


In other words, if gmpi is going to rely on a counter argument for underrun checking, then the ::process() method of every gmpi plug (that cares about handling underruns) will have to compare the argument to an expected value every time it's called, and do the work of tracking an expected value. This code will be the essentially same for all gmpi plugs, yet every gmpi developer will have to provide their own implementation for this functionality. By contrast, with a callback approach, all gmpi developers could avoid all that code in ::process() -- i.e. you'd write ::process() without that check, assuming success -- and move all the error recovery stuff inside the if(){...} into the underflow callback handler method.

I mean, yes, essentially the same work would still have to be done on the host side, but a) it would simplify plug development, which IIRC is one of our goals, and b) it would give the host the option of either caring or not caring about underflow recovery (i.e.upon underflow, either call, or else don't call, the plugs' underflow callback handlers). I wouldn't even have mentioned it, except that underflow handling is something that many kinds of audio-output-generating plug arguably should gracefully deal with anyway (even if 'dealing' means just muting, or bypassing, or loop-and-fade, etc.). For example, graceful underflow handling in a plug-in used in internet streaming radio applications would be an important consideration, whereas in a MIDI/audio pro DAW any underflow should usually be regarded as fatal. (Though softening their own underflow clicks might be a nice thing for failing plugs to do [at the same time they signal failure to the host], just to save eardrums.)

Anyway, just an idea. Don't want to over-emphasize it.

-- Chris G.

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: