AudioUnits and AU Host threading
AudioUnits and AU Host threading
- Subject: AudioUnits and AU Host threading
- From: James Coker <email@hidden>
- Date: Fri, 1 Aug 2008 15:14:26 -0600
I have recently discovered that a surprising number of Audio Units
*require* that they be initialized on the main (i.e. UI thread) of their
host application, or they do not behave properly. In some cases
the AU pops up a demo dialog that fails to draw, or the plugin's
editor fails to respond to events properly, or it just crashes. As
soon as I started calling AudioUnitInitialize on the UI thread, all
those
problems went away.
Although the SDK does not state specifically that this is not allowed,
it seems to clearly violate the spirit of it. As the AU SDK states:
"Initialization of an Audio Unit can be an expensive operation,
as it can involve the acquisition of assets (e.g. a sound bank for
a MusicDevice), allocation of memory buffers required for the
processing involved within the unit, and so forth."
To me, this clearly indicates that AudioUnitInitalize should be called
on
a background non-realtime thread, to avoid blocking the UI; particularly
when loading projects that contain many 'large' AudioUnits.
While it's clearly too late to modify the spec now, I was wondering if I
could at least get a statement from the CoreAudio team as to whether
this is officially sanctioned, merely tolerated, or highly discouraged.
Perhaps sometime later (for a 64-bit version of the AU spec), this can
be properly addressed in the spec itself.
Thanks,
Jim
_______________________________________________
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