Re: proper way to disconnect AUs
Re: proper way to disconnect AUs
- Subject: Re: proper way to disconnect AUs
- From: William Stewart <email@hidden>
- Date: Mon, 24 Jul 2006 17:36:38 -0700
you'll need to profile this - I'd suggest the shark tool in /
Developer/Applications
On 20/07/2006, at 7:03 PM, Karim Morsy wrote:
Try the CAShow to make sure your graph is really in the state you
think it is.
ok, I've just verified this with CAShow. The time pitch is indeed
successfully disconnected. the node is no longer listed in the list
of connections that's printed with CAShow and it doesn't affect the
output of the graph. but the CPU load is much higher than it was
before I connected and disconnected time pitch. I'm getting those
results both with AUGraphGetCPULoad and the Activity Monitor.
what else could be the reason for this behavior ?
Karim
On Jul 21, 2006, at 3:42 AM, William Stewart wrote:
On 20/07/2006, at 6:30 PM, Karim Morsy wrote:
thanks for the quick reply.
Have you called AUGraphUpdate - disconnect (like connect) will
not take affect until the graph is updated.
yea, the output of the graph is completely fine. it's just those
side effects that I realized while monitoring the cpu usage.
The time pitch doesn't do any work outside of its render call,
so once its disconnected it won't do any work.
the increased cpu load doesn't occur in AULab where you are
obviously also removing the node when disconnecting.
Yes, but once its disconnected, it will no longer be part of the
render chain, so won't consume CPU.
Try the CAShow to make sure your graph is really in the state you
think it is.
but when I just disconnect time pitch, re-connect nodes and
update the graph, time pitch no longer affects the output of the
graph at all but the cpu usage remains higher than it should.
could this be a bug ?
In your code I think :-) Particularly if AULab is behaving itself
when you do similar things.
You could Uninitialise the AU after you've disconnected (and
update has done its work)
I guess that was my mistake. I've called update in a seperate
thread, so uninitialize might have been called before update has
done its work).
Shouldn't make any difference - you only need to call update when
you've changed some state of the graph while it is running - so
its probably better to do that in the same thread as your connect/
disconnect (this is what AULab does)..
Bill
Thanks,
Karim
On Jul 21, 2006, at 2:47 AM, William Stewart wrote:
On 20/07/2006, at 5:36 PM, Karim Morsy wrote:
Hi,
I'm connecting and disconnecting nodes in a running graph. I'm
trying to figure out what's the right way to do so, as I've
experienced some undesired behavior.
Just calling augraph(dis)connect and update does not seem to be
enough. for example, when I add and connect AUTimePitch (and
update the graph) the CPU load increases from 5% to 30%.
when I disconnect the AU, I thought it was no longer processing
any audio data as it has no connections on input or output
scope. however, when I disconnect AUTimePitch the CPU load
decreases to approximately 20% (should be 5% again, if it was
really no longer processing). a bypass on the disconnected AU
doesn't change anything either.
Have you called AUGraphUpdate - disconnect (like connect) will
not take affect until the graph is updated.
The time pitch doesn't do any work outside of its render call,
so once its disconnected it won't do any work.
You can also check on the status of the graph at any time by
using CAShow (myGraph) (CAShow is declared in <AudioToolbox/
AudioToolbox.h>
Also, AUNetSend keeps listening for connections even after it's
disconnected.
Yes - because all disconnection does is remove an AU from a
render chain. It doesn't necessarily change the state of the AU.
You could Uninitialise the AU after you've disconnected (and
update has done its work) - then before you reconnect it, just
Initialise it again.
Bill
only if I also remove the node (augraphremovenode()) I achieve
the desired result, but I was looking for a way to be able to
use a single instance of the au and keep connecting and
disconnecting it when needed. this does not seem to be possible
(is it ?), instead you have to destroy it and create/initialize
a whole new node for the au again, right ?
does the removenode call both unintialize the AU and close the
component ?
any information on this issue would be appreciated.
thanks,
Karim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
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
___________________________________________________________________
_______
--
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
_____________________________________________________________________
_____
--
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