• 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
IOProc never called after AudioDeviceStart
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IOProc never called after AudioDeviceStart


  • Subject: IOProc never called after AudioDeviceStart
  • From: Mitch Jones <email@hidden>
  • Date: Mon, 27 Oct 2008 10:24:23 -0700

Hi all,

I've inherited some code that makes use of basic CoreAudio routines to setup a device and get it started to play sound. This has generally been working fine.

However, I've got a case where the AudioDeviceIOProc passed to AudioDeviceStart is never called. I know this because there's no sound, no logging occurs from my callback, and as a last resort, I tossed an abort() as the first thing in the callback, and the app never quits.

Given the nature of the code, I can't post it verbatim, but I can paraphrase it.

//this all happens on a secondary thread. everything returns noErr as the result
AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &theSize, &devID);


//in this case, this call fails because the requested sampleRate isn't supported. However, disabling it doesn't change the behavior.
AudioDeviceSetProperty(devID, NULL, 0, false, kAudioDevicePropertyNominalSampleRate, propSize, sampleRate);


AudioDeviceAddIOProc( devID, ioProc, userData );

//start and stop the device to deal with crashes we've seen on MacPros during wake
AudioDeviceStart(devID, NULL);
AudioDeviceStop(devID, NULL);


...

//another thread then calls this
AudioDeviceStart(devID, ioProc);

At this point, I see the HAL thread running and that it appears to be invoking the callback, at least based on its backtrace in thread viewer, but I never see it enter the callback.

I thought it might be involved with the threads run loops as that's something that isn't regularly run or even referenced from the threads in question. That didn't seem to make any difference and in fact, I created a small test app to see how CoreAudio responds when being called from multiple threads without explicit run loop execution and the ioproc was always called.

I've also tried the "throwing darts in the dark" approach by disabling parts of the code, like AudioDeviceStart/Stop, without any change.

I'm seeing this problem on both a MacPro and Macbook Pro running 10.5.5. The code is compiled targeted at the 10.4 sdk.

Any thoughts on what might be going wrong here would be really appreciated.

Thanks

--
Mitch Jones
email@hidden




_______________________________________________ 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
  • Follow-Ups:
    • Re: IOProc never called after AudioDeviceStart
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Re: How can I make Logic call my plug-in upon stop?
  • Next by Date: Re: IOProc never called after AudioDeviceStart
  • Previous by thread: Re: How can I make Logic call my plug-in upon stop?
  • Next by thread: Re: IOProc never called after AudioDeviceStart
  • Index(es):
    • Date
    • Thread