• 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: Race condition in aggregate device?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Race condition in aggregate device?


  • Subject: Re: Race condition in aggregate device?
  • From: Jeff Moore <email@hidden>
  • Date: Wed, 24 May 2006 16:09:04 -0700

Well. I took a look at your code and I'm not sure that you are including the right code. What you say is going wrong is (and correct me if I'm wrong) is that after creating the aggregate, the calls to register and start an IOProc on the aggregate isn't resulting in the IOProc getting called. Since the code you are using to start the IOProc isn't included, I can't really explore what you are doing in that area.

At any rate, when I said "I'd go through your code with a fine toothed comb" what I really meant is that this is something I'd do if I were you. It's going to involve you putting in lots of assertions about state and being sure to do the right thing for errors. This is really going to be the only way to narrow down what's going on since you need to have your entire app on hand to do it.

On May 24, 2006, at 1:13 PM, Christoph Teschner wrote:

I've attached the file that contains all the relevant code.
if you can spot any suspicious lines, please let me know.

thanks a lot,
christoph


From: Jeff Moore <email@hidden>
To: CoreAudio API <email@hidden>
Subject: Re: Race condition in aggregate device?
Date: Wed, 24 May 2006 12:31:11 -0700

Without actually seeing code, it's hard to say what might be going on. The usual cause for this is that your IOProc didn't actually get registered or started like you expected for some reason. The usual cause for this is that you are using the wrong AudioDeviceID or something like that when you make an API call.

At any rate, I guess I'd go through your code with a fine toothed comb and make sure that all your assumptions are actually true at each step in the process. If you have any hard-coded values for anything that you can get from the HAL, I'd be suspicious of them.

You might also want to look at the device's telemetry with HALLab to make sure that it is actually running. In fact, you might just want to sample the process when it is supposed to be playing audio, just to be sure there aren't any hung threads anywhere.

On May 24, 2006, at 12:24 PM, Christoph Teschner wrote:

the aggregate device is always showing up in the device list and it is never missing sub-devices.
however, it appears that in 40% of all my test cases (without any modifications to my code) it is failing to call IOProcs . in any case, the created aggregate is functional. because I can use it in other apps like aulab and in subsequent launches of my own app and it's never failing to call IOProcs.
hope you can help.


thanks,
Christoph


From: Jeff Moore <email@hidden>
To: CoreAudio API <email@hidden>
Subject: Re: Race condition in aggregate device?
Date: Wed, 24 May 2006 11:49:53 -0700

You need to define what you mean by the aggregate device not working. Is it not showing up in the device list? Is it missing sub-devices? Is it failing to call IOProcs?

Please be as specific as you can be.

On May 24, 2006, at 11:45 AM, Christoph Teschner wrote:

I'm successfully creating an aggregate device that consists of the built-in and a the M-Audio FireWire 410 Multichannel.
I'm not getting any error messages and it appears just as expected in AMS.
I'm programmatically creating the aggregate device upon application launch. now, when I try to use this
the newly created device, it only works in about 40% of all cases, from which I assume that there might be an internal race condition
when creating the aggregate device. if in subsequent app launches I try to use the exact same device it always works without any problems.
I've tried any possible combination of inserting usleep()s in the creation of my aggregate device and in the setup of the AUGraph.
but the behavior still appears random to me, in the sense that sometimes I can use the created device right away and sometimes
no audio data is being processed (unless I use the device in subsequent app launches).
any help would be greaty appreciated.


--

Jeff Moore
Core Audio
Apple


_______________________________________________ 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
  • Prev by Date: Re: Race condition in aggregate device?
  • Next by Date: Getting started with AU developmentl
  • Previous by thread: Re: Race condition in aggregate device?
  • Next by thread: Getting started with AU developmentl
  • Index(es):
    • Date
    • Thread