Re: Problems when changing sample rate on a aggregate device
Re: Problems when changing sample rate on a aggregate device
- Subject: Re: Problems when changing sample rate on a aggregate device
- From: Jeff Moore <email@hidden>
- Date: Tue, 4 Dec 2007 08:49:50 -0800
Your main problem appears that you are not waiting for the
notifications from the HAL before blindly continuing your
configuration code. Basically, you are assuming what you set actually
took without actually making sure by waiting for the notifications
from the HAL to finish shaking out. This is probably causing your
configuration code to run while the HAL is still updating it's
internal state, which is giving you an incoherent view of the device.
You should _never_ assume any call to change device configuration has
succeeded successfully until you get _all_ the notifications. For an
aggregate device, this can take a while given that there are many
devices whose state is changing.
On Dec 4, 2007, at 6:18 AM, Stéphane Letz wrote:
Thanks, this solved part of the problem, but we still have some
weird behavior related to SR changes when using the AUHAL. Our code
does the following scheme, so that is can be used with input,
output, or duplex devices:
This works correctly when starting device with SR = 44100. As soon
as using other SR (like 48, or 96 k that are supported by the
devices) problems occurs:
- when application is started with 48k or 96k and input or output
only device => distorded sound
- when application is started with 48k or 96k an duplex device ==>
works OK
- when SR is changed externally (using AMS) ==> AUHAL audio
callback not be called anymore
- when SR is changed externally (using AMS) ==> distorded sound
Basically is seems that the problems is in the "Setup stream
converters" part. In some parameter choices we get error in
AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output, 1, &dstFormat,
sizeof(AudioStreamBasicDescription)); line but not always... and
things still do not work, correctly even in the absence of errors..
--
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