• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is running an idle graph considered expensive?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is running an idle graph considered expensive?


  • Subject: Re: Is running an idle graph considered expensive?
  • From: Bill Stewart <email@hidden>
  • Date: Mon, 2 Jun 2003 17:15:13 -0700

On Sunday, June 1, 2003, at 11:17 AM, Daniel Jalkut wrote:

I have an AUGraph consisting of a synth music device and a default output unit.

Up to now, I've played notes through this device using the MusicSequence/Track/Player approach. This gave me a very clear concept of when and for how long notes would need to be played through the graph. Now, I'm adding a "piano keyboard" to my interface, which should allow the user to test the sound of the device at any time. When the user clicks a key, I send a StartNote call to the graph, and when they release, I send an EndNote.

I've noticed that I have to have the graph "running" in order to have these start and stop notes do anything. So my question is, should running the graph be something that is considered expensive, or is it entirely dependent on the amount of incoming data? The documentation says that AUGraphStart "starts rendering." If there is no input to the graph, is rendering essentially free, or is the default output device chugging away turning zeros into silence?

Yes - is this expensive - depends on what you have the graph actually doing...

This is one reason why we added and now support (even better) the silent hint in the render flags of an audio unit - so an upstream unit can tell its downstream ones that they are outputting silence, so there's no need to do any work on the data...

It's hard to get a good semantic understanding for how and when AUGraphStart/Stop should be called, because most of the sample code is packaged as "test code" where it's not clear whether performance is being considered.

Basically I want to know whether the "AUGraphStart" is more analogous to turning the power on a device (less expensive) or pushing play on the device (more expensive).

Its like pushing play - you can always profile this yourself by looking at the CPU load of your process. In Terminal:
% top

We've done some work here so that an "idling" DLSMusicDevice doesn't do a lot of work on nothing - so the usage you will see with a Jaguar system if more expensive than what you'll see in the future...

Ultimately you don't have much of a choice actually - if you want your interface to be really responsive to the user clicks, then you need to keep the graph running. If a little bit of slack is OK, then obviously its far more preferable to start and stop the graph as needed

Bill


Thanks!

Daniel
_______________________________________________
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.


-- 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
________________________________________________________________________ __
_______________________________________________
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.
  • Follow-Ups:
    • Re: Is running an idle graph considered expensive?
      • From: Daniel Jalkut <email@hidden>
References: 
 >Is running an idle graph considered expensive? (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: AudioCodec questions
  • Next by Date: Re: silence a chunk in Audio Unit render function
  • Previous by thread: Is running an idle graph considered expensive?
  • Next by thread: Re: Is running an idle graph considered expensive?
  • Index(es):
    • Date
    • Thread