Re: problem w/ Matrix Mixer
Re: problem w/ Matrix Mixer
- Subject: Re: problem w/ Matrix Mixer
- From: Robert Grant <email@hidden>
- Date: Tue, 16 Dec 2003 10:04:53 -0500
Well - here we go again, rapid fire emails as I investigate this
problem... apologies if this pisses people off but when you work alone
it feels like I'm talking to someone... :-)
So I take a look inside AUInputElement::PullInput(...) and I find:
if (mInputType == kNoInput || mCritical)
return kAudioUnitErr_NoConnection;
Now mInputType got set to kNoInput when I disconnected the input. But
why is this worthy of yelling and screaming and causing the MatrixMixer
to stop rendering output? Why can't it just clear out the buffers and
return empty?
BTW this must be the reason why I said (way back when in the first
MatrixMixer go around) that you've got to connect to a MusicDevice
instead of just an effect because a MusicDevice is not going to be
connected to anything else and thus will never return this error code!
I now see the reason why the MatrixMixer stopped producing output (and
it's not related to the MusicDevice). The problem is that if you
connect an effect by itself to an enabled input of the MatrixMixer it's
going to produce NoConnection and the MatrixMixer will get depressed
and produce no output.
Or perhaps the other question is - how do we find out when the input is
really disabled and can safely disconnect the input so that we don't
cause the NoConnection error to be returned.
Interestingly - the problem doesn't seem to go away if I let the
MatrixMixer have time to disable the input. I'm not seeing a bunch of
NoConnection and then nothing once the input is disabled. It seems like
the input will never get disabled maybe because of the NoConnection
error?
Anyway lots to chew on here.
Thanks for listening,
Robert.
On Dec 16, 2003, at 9:33 AM, Robert Grant wrote:
Well to follow up on my earlier note....
I wrote a few days back about how to switch off a SetRenderCallback
because I was having trouble doing it and keeping the MatrixMixer
going (similar - if not identical - to James's issue I think). Well I
never tracked it down and so I was leaving things connected - and was
thus able to happily connected and "disconnect" (i.e. leave it
connected but just turn off the MatrixMixer input) things. This worked
well until my live audio input feature. This one I actually want to
disconnect because there's a delay before disabling a MatrixMixer
input takes effect and even though I was switching off the audio input
- render requests were still coming and eventually (OK, quickly) the
AudioDevice would blow up.
So I went back to figuring out how to disconnect the SetRenderCallback
- sleuthing through AUBase and AUInputElement (which I should have
done in the first place) showed that passing in an
AURenderCallbackStruct with inputProc set to null should do the trick.
And it does - except that I now get "NoConnection" errors up the wazoo
and the MatrixMixer (to bring it back to your issue James) produces no
output. And to make it weirder this connection was made at the bottom
end of a subgraph.
So how does one disconnect without ending up with a NoConnection error
and an unhappy MatrixMixer?
Thanks,
Robert.
On Dec 16, 2003, at 6:52 AM, Robert Grant wrote:
Hi James,
The only other time I got nothing coming out of the mixer was when I
had a broken connection. Are you checking the LastRender error
status?
Here's a suitable callback in case you're not:
void MyAudioUnitPropertyListenerProc(void *inRefCon, AudioUnit ci,
AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement
inElement)
{
OSStatus status;
static OSStatus lasterror = noErr;
UInt32 size = sizeof(lasterror);
OSStatus result = ::AudioUnitGetProperty(ci, inID, inScope,
inElement, &lasterror, &size);
if ((status == noErr) && (lasterror != noErr)) {
fprintf(stderr, "unit %p reported error %ld\n", ci, lasterror);
}
}
// Add the following to your graph construction code:
AudioUnitAddPropertyListener(outputUnit,
kAudioUnitProperty_LastRenderError, &MyAudioUnitPropertyListenerProc,
NULL);
Hope that helps,
Robert,
On Dec 16, 2003, at 12:53 AM, James Coker wrote:
I have a simple AU graph that looks like this:
A Matrix mixer w/ 64 stereo input busses, all disabled
but the first two. There is one stereo output buss, connected
to the default output AU.
A stereo synth is connected to the first matrix bus input.
A second stereo synth is connected to the second.
So there are 4 connections in the graph, and everything
sounds fine -- I can hear output from both synths.
if I disable the 2nd MatrixMixer input bus, then disconnect
the 2nd stereo synth, all output stops. Reconnecting and
enabling the 2nd synth restores audio output from both
synths.
I know there is an issue w/ the enable flag on MatrixMixer
inputs, but is there some other trick regarding connections
that I missed?
Thanks,
Jim
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.