Re: AU hosting and AU life cycle management
Re: AU hosting and AU life cycle management
- Subject: Re: AU hosting and AU life cycle management
- From: William Stewart <email@hidden>
- Date: Mon, 8 Feb 2010 14:59:00 -0800
On Feb 8, 2010, at 11:58 AM, Paul Davis wrote:
We (Ardour/Mixbus) are having trouble with some details of hosting a
few specific AU plugins, particularly those from Universal Audio. Most
(an overwhelming majority) of AU plugins are well behaved in our host,
but several will dramatically misbehave (massive output spikes, noise
and worse) in specific circumstances, most of which are related to I/O
reconfiguration or the need to flush the current state of the plugin
for one reason or another.
I suspect the problem is with the AU "life cycle". The documentation
about Reset is tricky: AudioUnitReset() requires a scope and an
element, but the docs for AU developers say thing like "When you
develop an audio unit’s DSP code, you implement a Reset method to
return the DSP state of the audio unit to what it was when the audio
unit was first initialized. Host applications call the Reset method as
needed.". This doesn't really make it very clear what the relationship
is between the concept of a global reset, as show in the first diagram
here:
http://developer.apple.com/mac/library/DOCUMENTATION/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnit/TheAudioUnit.html
and the actual API. Should a host call all N possible resets? (3
scopes, N elements at each scope)? As it stands, there is no clear
"Reset" method in the API, just a way to reset various parts of the
AU.
What we had imagined using reset for, and how it ends up being
implemented is quite different; initially we had thought that we
should provide a way for a host app to just reset particular buses,
rather than the entire AU. That has not proved to be interesting in
practice.
There has however, never been any confusion or change about the basic
meaning of calling Reset in the global scope (resets the entire AU's
render state). This has never been any other way or expectations about
this usage.
The host locating to a different point on the timeline seems like a
tremendously common case, yet its very hard to find out what a host
should do the an AU plugin when this occurs.
Call AudioUnitReset. I think for most reliable behaviour, I would do
so in a state where the AU will not also be rendering in another thread.
Bill recently confirmed
that it is not intended that host calls Initialize() after a reset,
yes (well, more accurately "re-confirmed" as we haven't changed any
expectations here since the first release of the AU API in 10.0).
but there are strong hints (e.g. from discussions on a KVR thread a
year ago) that plugin deveopers are also confused over the
relationship between Reset and Initialize.
I don't know why. We've not changed our basic message of what Reset
does and is intended to do. Nor have we changed our basic premise of
Initialisation.
Furthermore it would be helpful know if other host developers have
made special accomodations for the hardware-based plugins such as
Universal Audio, or will they "just work" once we get the life cycle
right?
I'm not sure exactly what the "life-cycle" problem is that you are
having. (I'm not sure that your confusion can be generalised to
everyone's confusion as you are seeming to imply). You have some
individual cases of AUs misbehaving in your app, but as you state,
most behave correctly. I would follow up with the individual companies
that you are having difficulties with and see if you can get to the
bottom of those problems with them. If you would like to involve us
(Apple) in that conversation, I am more than happy to be included.
Another testing bed that can used for reference is AULab. When the
user mutes (or solos) a track and then unmutes it, Reset will be
called on the AU before it is enabled back into the render chain (so
we don't get a tail from its previous render activity). So there is
definitely an example "best-case" usage out there (since 10.4). Logic
also uses Reset in a similar way (including its use when changing time-
line positions).
Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden