Re: Problem with Alesis MultiMix 8 USB 2.0 and kAudioDevicePropertyStreamConfiguration
Re: Problem with Alesis MultiMix 8 USB 2.0 and kAudioDevicePropertyStreamConfiguration
- Subject: Re: Problem with Alesis MultiMix 8 USB 2.0 and kAudioDevicePropertyStreamConfiguration
- From: Jeff Moore <email@hidden>
- Date: Wed, 29 Aug 2007 13:01:24 -0700
What you are doing is flat out wrong. This is, by far, the number one
mistake I see in applications.
Changing the format of the device (and in fact most other changes to
device state) is an asynchronous operation. Always has been. That's
why the HAL has so many notifications. You can't assume that an
operation has succeeded just because you didn't get an error when
setting the property. Your app has to pay attention to the
notifications in order to know when the change has actually taken
effect.
You've been skating by on luck to not get bit by this sooner.
On Aug 29, 2007, at 12:48 PM, Stefan Haller wrote:
Jeff Moore <email@hidden> wrote:
Here's what happens: we query the input side of the device for
kAudioDevicePropertyStreamConfiguration, it returns one buffer
with 10
channels, which is what we expect. Then we set the sample rate
(kAudioDevicePropertyNominalSampleRate, isInput = true), and after
that we query kAudioDevicePropertyStreamConfiguration again; this
time
it returns one buffer with 0 channels (and 0 mDataByteSize). This
strikes me as a driver bug; I can't quite imagine what we might be
doing
wrong here.
Then we start the device, and in the IO proc we get the expected
buffer list (one buffer with 10 channels), which doesn't match
what the
last query of kAudioDevicePropertyStreamConfiguration had returned.
Any ideas?
This sounds like you are asking the HAL for the stream configuration
in isolation and are getting an intermediate state of the device. Are
you waiting for the notifications from the HAL about things changing
or just assuming that your change took place after setting the sample
rate?
We are not waiting for notifications, we are simply making synchronous
calls from the main thread. (We don't get a notification for
kAudioDevicePropertyStreamConfiguration, btw.)
We never had any problems doing it this way with any other audio
device.
--
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