Re: Disconnected AU causes crashes on AUGraphRun
Re: Disconnected AU causes crashes on AUGraphRun
- Subject: Re: Disconnected AU causes crashes on AUGraphRun
- From: William Stewart <email@hidden>
- Date: Tue, 4 Apr 2006 17:40:28 -0700
OK - so I ran your code that you'd included in the bug and saw the
crash. Thanks for that, very helpful.
So, the crash is caused by a problem in the Mixer Unit's metering
code. If there is no input and metering has been enabled, then there
are cases in the mixer where it will not check the result of the call
to get the input, and will proceed to try to meter a non-existent
input buffer!
So, I can see two alternatives to workaround this problem - it is a
problem that only exists for the stereo Mixer AU
(1) Don't enable metering
(2) If you want metering, make sure that all of the inputs to the
mixer will not return errors. So, for example in the code you
supplied me, this is your graph (CAShow(theGraph)):
AudioUnitGraph 0x200DA1C:
Member Nodes:
node 1: desc auou def appl, instance 0x810003 O I
node 2: desc aumx smxr appl, instance 0x810004 O I
node 3: desc aufx lpas appl, instance 0x810005 O I
node 4: desc aufx lpas appl, instance 0x810006 O I
node 5: desc augn afpl appl, instance 0x810007 O I
Connections:
node 5 bus 0 => node 3 bus 0
node 3 bus 0 => node 2 bus 0
node 4 bus 0 => node 2 bus 1
node 2 bus 0 => node 1 bus 0
Events to be updated:
CurrentState:
mLastUpdateError=0, eventsToProcess=F, isRunning=F
So, you could add a render callback that just returns silence, to
node 4. In this render callback, just memset the buffers to zero, and
set the render flags "is silence" bit.
Bill
On 04/04/2006, at 10:09 AM, Mark Coniglio wrote:
This is a more focused repost of my earlier question.
In an AU Graph, leaving one audio unit disconnected (i.e., with no
Generator) causes a crash after calling AUGraphRun. One would think
that, leaving an AU without a source would cause it to produce no
output, and wouldn't be a problem. But instead it seems to crash as
soon as you start the graph.
If anyone has insights on allowing these dangling AUs to exist, I'd
be really glad to hear them. It's important in my app, because I'm
creating a kind of "front end" for the AUGraph, and the user might
forget to connect some input to an AU, temporarily have the AU
input disconnected as they try things out, etc.
If its impossible to have this, I'm going to have to go through the
connetions and track down any AU's that don't have input
connections and not include them in the graph.
You can try my sample code to cause the crash at http://
www.troikatronix.com/files/show-augraph-crash.sitx
Steps To Reproduce:
0) Create an AUGraph
1) Create Default Output Unit
2) Create Stereo Mixer Unit with Two inputs
3) Create two Low Pass Filter Units
4) Create on Sound File Player Unit and set output format to match
that of source file
5) Connect Stereo Mixer output to Default Output unit input
6) Connect both Low Pass Filter outputs to Stereo Mixer inputs 1 and 2
7) Connect Sound File Player to Low Pass Filter #1
8) Do not connect anything to Low Pass Filter #2
9) Start the graph running using AUGraphRun
10) Crash
Best Wishes,
Mark
--
=====================================================================
Mark Coniglio, Artistic Co-Director | email@hidden
Troika Ranch Dance Theater | http://www.troikaranch.org
=====================================================================
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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