Re: pros/cons of setting kAudioDevicePropertyBufferFrameSize?
Re: pros/cons of setting kAudioDevicePropertyBufferFrameSize?
- Subject: Re: pros/cons of setting kAudioDevicePropertyBufferFrameSize?
- From: Jeff Moore <email@hidden>
- Date: Tue, 23 Feb 2010 16:00:24 -0800
On Feb 23, 2010, at 3:47 PM, Simmons, Aaron wrote:
> When recording from a microphone in CoreAudio, what is kAudioDevicePropertyBufferFrameSize for? The docs say it's "A UInt32 whose value indicates the number of frames in the IO buffers". However, this doesn't give any indication of why you would want to set it.
This property controls the buffer size you see in your IOProc. As such it controls the rate your IOProc will get called. Since the IO buffer size is also a direct factor in the amount of latency in the system, it also serves as your app's main choke point for latency.
> The kAudioDevicePropertyBufferFrameSizeRange property gives you a valid minimum and maximum for the bufferframe size. Does setting the bufferframe size to the max slow things down?
It slows things down in the sense that your IOProc will get called fewer times per second.
> When would you want to set it to something other than the default?
An application that is looking for low latency IO should set this value as small as it can keep up with.
On the other hand, apps that don't have large interaction requirements or other reasons for low latency can increase this value to allow the data to be chunked up in larger chunks and reduce the number of times per second the IOProc gets called. Note that this does not necessarily lower the total load on the system. In fact, increasing the IO buffer size can have the opposite impact as the buffers are larger which makes them much less likely to fit in caches and what not which can really sap performance.
At the end of the day, the value an app chooses for it's IO size is really something that is dependent on the app and what it does.
--
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