• 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: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation?


  • Subject: Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation?
  • From: Jeff Moore <email@hidden>
  • Date: Wed, 09 Jul 2008 15:35:06 -0700

It seems like you are hitting the bug I was referring to about newly created aggregates seeming to disappear. Also, I just remembered that there is another bug where private aggregate devices will also sometimes completely vanish into the ether. I suspect that this is what is killing you now so if you made a public aggregate, you should get farther.

On Jul 9, 2008, at 3:21 PM, Dan wrote:

Thanks for the correction. I'm on the PPC machine at the moment, and
seeing some strange behaviour, seemingly triggered by the
CFRunLoopRunInMode delay. Here's what happens:

The first thing I did was change the re-fetching of the aggregateID to
the following:

CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
s = CFStringCreateWithCString(NULL, "SCAggregate", kCFStringEncodingUTF8);
AudioValueTranslation translation2 = {&s, sizeof(s), &aggregateID,
aggregateSize};
size = sizeof(translation2);
err = AudioHardwareGetProperty(kAudioHardwarePropertyDeviceForUID,
&size, &translation2);
CFRelease(s);
scprintf("Audio device ID is %p\n", aggregateID);
if (err != kAudioHardwareNoError)
{
scprintf("get kAudioHardwarePropertyDeviceForUID error %s\n",
(char*)&err);
return false;
}



When run, this doesn't throw an error, but gave me an error later on (the error being "!obj" (bad object reference) thrown by the very next call, to kAudioAggregateDevicePropertyFullSubDeviceList). I also see that although the original aggregateID was not a null pointer, the re-fetched aggregateID is a null pointer.

However, I then discovered that the "!obj" error can be triggered
*purely* by the call to CFRunLoopRunInMode(). If I comment out *all*
of the above, except the CFRunLoopRunInMode() call, the "!obj" error
still appears.

* If I pull the delay value down to 0.01 seconds then the behaviour
goes away - the engine boots correctly, creates its aggregate and can
use it.

* If I push the delay value back up to 0.03 seconds or more then the
behaviour comes back (!obj every time).

* At delay of 0.02 seconds, the behaviour is intermittent: sometimes
boots successfully, sometimes !obj.

* At long delay (0.5) it's still constantly giving !obj.

* With the CFRunLoopRunInMode() call removed entirely, it boots successfully.

* With the CFRunLoopRunInMode() call removed and the re-fetching added
back in, it boots successfully.

(More specifics: in the tests above it's the CLI audio engine I'm
referring to, with my firewire box and the builtin audio as the
devices to aggregate. OS is 10.4.11)

Note that if I include the delay but don't include the re-fetching,
then aggregateID is not a null pointer (it's the same value as in the
successful trials, 0x112), so that's not the cause of the "!obj" in
that case. However, in the case of delay-and-refetch, the null pointer
obviously isn't pointing to the device.

Any clues? I'm puzzled by the fact that the delay seems in itself to
worsen the situation.



--

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
  • Follow-Ups:
    • Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation?
      • From: Dan <email@hidden>
References: 
 >Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation? (From: Dan <email@hidden>)
 >Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation? (From: Jeff Moore <email@hidden>)
 >Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation? (From: Jeff Moore <email@hidden>)
 >Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation? (From: Jeff Moore <email@hidden>)
 >Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation? (From: Dan <email@hidden>)

  • Prev by Date: Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation?
  • Next by Date: Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation?
  • Previous by thread: Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation?
  • Next by thread: Re: Programmatic Aggregate Device issue on Intel Mac, not always completing initialisation?
  • Index(es):
    • Date
    • Thread