Re: Getting the PreferedHardwareIOBufferDuration
Re: Getting the PreferedHardwareIOBufferDuration
- Subject: Re: Getting the PreferedHardwareIOBufferDuration
- From: Mark's Studio <email@hidden>
- Date: Thu, 26 Feb 2009 19:13:22 +0100
Bug ID# 6626603
On 26/02/2009, at 18.15, Greg Chapman wrote:
Clearly we have to fix this bug. _Please_ write it up at
bugreporter.apple.com.
One last thought for a workaround... it seems like if you actually
go inactive, and then active again (in your log), you get your
bufferSize back.
This is the log from the code below, i get an error, if i switch the
active state.
bufferSize 0.005805
Session interrupted! 1--- Begin Interruption ---
routeChangeReason 3
kAudioSessionProperty_AudioCategory'plar'
kAudioSessionProperty_OtherAudioIsPlaying 0
bufferSize 0.023220
routeChangeReason 3
kAudioSessionProperty_AudioCategory'plar'
kAudioSessionProperty_OtherAudioIsPlaying 1
bufferSize 0.023220
routeChangeReason 2
kAudioSessionProperty_AudioCategory'plar'
kAudioSessionProperty_OtherAudioIsPlaying 1
Error: couldn't initialize the remote I/O unit ('!act')
Error: couldn't start unit ('!act')
bufferSize 0.005805
routeChangeReason 1
kAudioSessionProperty_AudioCategory'plar'
kAudioSessionProperty_OtherAudioIsPlaying 0
bufferSize 0.005805
there seem to be different ways of handling interrupt/routeChange
depending on what happens.
could this be a race thing where CoreAudio changes things in the back
and my code tries to change the same ?
As you can see i set the session active at least once but i still get
a kAudioSessionNotActiveError,
XThrowIfError(AudioSessionSetActive(true), "couldn't set audio
session active\n");
AudioSessionGetProperty
(kAudioSessionProperty_CurrentHardwareIOBufferDuration, &siz,
&bufferSize);
if(bufferSize > kPreferredBufferSize){
AudioSessionSetActive(false);
AudioSessionSetActive(true);
}
XThrowIfError(AudioComponentInstanceDispose(THIS->rioUnit),
"couldn't dispose remote i/o unit");
SetupRemoteIO(THIS->rioUnit, THIS->inputProc, THIS->thruFormat);
XThrowIfError(AudioOutputUnitStart(THIS->rioUnit), "couldn't start
unit");
Have you any workarounds
something like a
AudioSessionSetActive(false);
wait for session to be not active
AudioSessionSetActive(true);
wait for session to be active
You could try doing this by hand:
AudioSessionSetActive(false);
AudioSessionSetActive(true);
and see if that gets you past this.
Greg
On Feb 26, 2009, at 1:17 AM, Mark's Studio wrote:
Hi Greg,
i have tried a few things but can't get it to work. unless i make a
without making
here is my listener functions,
you should be able to paste them into the aurioTouchAppDelegate.mm
and remove the rioInterruptionListener() from the aurio_helper.cpp
snip...
On Feb 25, 2009, at 4:08 AM, Mark's Studio wrote:
I set kAudioSessionProperty_PreferedHardwareIOBufferDuration to
0.005
and kAudioSessionProperty_CurrentHardwareIOBufferDuration returns
0.005805,
so that is fine
But if the iPod app is started the buffer duration change to
0.023220
and when restarting my audio (i do this by starting an
AVAudioPlayer,so the iPod fades out) the buffer duration stay
there,
if i trigger another restart by removing the headset it goes back
to the prefered duration.
This seems like a bug... if you have interrupted the iPod app, you
should get all your hardware settings back (unless something else
weird is going on, like a phone call or something).
Can you write a bug please? If possible, include source code we
can build to reproduce the problem.
Is there anyway i can make sure i get the prefered duration ?
To try to work around the bug, you could try calling
AudioSessionSetActive(true) again before restarting; that might
get us to do the right thing. (I'm just guessing, though... I
don't know yet what the bug is.)
Greg
Peter Mark
Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078
Fax: +45 35366038
Mobile: +45 20416018
www.marks-studio.dk
email@hidden
Peter Mark
Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078
Fax: +45 35366038
Mobile: +45 20416018
www.marks-studio.dk
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