• 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: Proper way to fail performAudioeEngineStart
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper way to fail performAudioeEngineStart


  • Subject: Re: Proper way to fail performAudioeEngineStart
  • From: Matt Gonzalez <email@hidden>
  • Date: Fri, 25 Apr 2003 17:39:05 -0700

I've just been working on this very problem. I opened a support incident with DTS; apparently there's not a good solution. Here's what I got from DTS:

------------------------

"This is a bug in performAudioEngineStart(). You should be able to work around this by overriding IOAudioEngine::incrementActiveUserClients() like this:

IOReturn IOAudioEngine::incrementActiveUserClients()
{
IOReturn result = kIOReturnSuccess;

numActiveUserClients++;

setProperty(kIOAudioEngineNumActiveUserClientsKey, numActiveUserClients, sizeof(UInt32)*8);

if (numActiveUserClients == 1) {
result = startAudioEngine();
}

if (result != kIOReturnSuccess) {
decrementActiveUserClients();
}

return result;
}

Otherwise IOAudioFamily thinks that your engine is still around which is why it never works again. This will remove the engine when it fails to start."

------------------------

I tried that and it still didn't work. I then received this information:

"I just got off the phone with engineering and the problem looks like it's a bug in the Audio HAL. If the Audio HAL gets a error when it tries to start a device, it never tries that device again until that device has be closed and re-opened.

As a workaround, you can just return silence when the breakout box is disconnected. "


I am planning to try running a timer as a fallback; if I can't run the engine for real, I figure that I can at least use the timer to fake the timestamps.

Hope that helps. I will be filing a bug report for this; just haven't gotten to it yet.

Matt

BlazeAudio Developer wrote:

What is the proper way to fail performAudioEngineStarte() in an
AudioEngine?

If I fail it once, it seems like CoreAudio (or the client applications)
simply "give up" on this engine for ever - until reboot.

We have a case where two audio-engines contend for some resource - and
once the resource is granted to one, the other engine may not start - and
so we fail the call.

Is this kind of a scheme to be implemented in some other manner?

Thanks.
Devendra.
_______________________________________________
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.

References: 
 >Re: AudioUnit: Open Times are too long (From: "Michael Olsen" <email@hidden>)
 >Proper way to fail performAudioeEngineStart (From: BlazeAudio Developer <email@hidden>)

  • Prev by Date: Re: Clock Sources
  • Next by Date: Re: SDK Available
  • Previous by thread: Proper way to fail performAudioeEngineStart
  • Next by thread: Re: AudioUnit: Open Times are too long
  • Index(es):
    • Date
    • Thread