AUGraph stream format problems
AUGraph stream format problems
- Subject: AUGraph stream format problems
- From: Marc Poirier <email@hidden>
- Date: Mon, 6 Oct 2003 11:47:33 -0500 (CDT)
I submitted this with the AppleSeed bugreporter this morning (but it's
happening with non-seed versions of AUGraph, too), but I'm posting it
here, too, just because I'd like to confirm that my description is correct
and also see if anyone else has other ideas of solutions to the problem:
I'm finding a lot of problems with the way that AUGraph handles the
channel layouts of AUs when connecting different AUs together. First,
I'll give you an example scenario:
I have an AU that is strictly 2-out. I load it. Next in the graph chain,
I load an AU that is strictly 1-in/2-out (KTGranulator). Here's some
console.log stuff that illustrates what's happening (a few of the messages
are from KTGranulator, but the rest are from either the AUGraph library or
Numerology):
KTAUGranulator::ChangeStreamFormat(kAudioUnitScope_Input), new num channels = 2, old num channels = 1
AUEffectBase::Initialize() kAudioUnitErr_FormatNotSupported
NAudioMgr: .. graph update: osStatus: -10868
NAudioMgr : conn node 7 to mixer input: 0
AUEffectBase::Initialize() kAudioUnitErr_FormatNotSupported
AUBase::DoRender() -10868
ERROR STATUS: -10868 : NAudioMgr : update graph
**NAudioMgr, conn group to AU graph DONE
FGenAudModCtlr : audio Controller Update
AUBase::DoRender() -10868
AUBase::DoRender() -10868
AUBase::DoRender() -10868
etc.
So the result is that there are errors Initializing the AU, but the graph
still tries to render the, and render fails every time, resulting in
silent audio output.
The first mistake is that AUGraph is even attempting to set the number of
input channels to 2. AUGraph should look at the AU's response to the
kAudioUnitProperty_SupportedNumChannels property and then see that the AU
only supports 1-in/2-out. Then, after attempting to set that bogus
format, Initialize fails, of course. AUGraph seems to note the problem,
but continues to try to render anyway, which is the second mistake.
At the very least, if Initialize failed, I think that AUGraph should not
be including the AU in the render chain. I can't imagine that silence is
ever the desirable outcome.
But really AUGraph should look at the SupportedNumChannels and should pay
attention to when its stream format changes fail. Perhaps, in this
example scenario where the previous AU has stereo output and then next has
mono input, AUGraph should throw up a CFUserNotification for the user
explaining that the channel formats don't match and offering either to:
A) mix the first AU's output down to mono, or B) cancel loading the next
AU.
Marc
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.