Re: kAudioDevicePropertyBufferFrameSize != inNumberFrames
Re: kAudioDevicePropertyBufferFrameSize != inNumberFrames
- Subject: Re: kAudioDevicePropertyBufferFrameSize != inNumberFrames
- From: Paul Davis <email@hidden>
- Date: Sat, 03 Sep 2011 10:45:03 -0400
On Sat, Sep 3, 2011 at 10:30 AM, Aristotel Digenis
<email@hidden> wrote:
> Thanks for the reply Brian!
> Your understanding of CoreAudio makes sense. It does seem unreasonable to
> expect all other audio units to adapt to the fixed frame count of my choice.
> I can certainly go down the path of allocating and catering for the worst
> buffer size case as you suggest but was hoping to avoid that if I can. I am
> working on an audio engine that works on other platforms that do guarantee
> constant buffer lengths (game consoles prefer constant performance, rather
> than super flexible but possibly spiky performance).
audio platforms that target pro-audio and music production tend not to
guarantee constant buffer lengths. ASIO does not, JACK does not. They,
like CoreAudio, will tell you the maximum buffer size your unit will
ever be called with, but it may be called with 1..maxsize for a
variety of reasons.
> the same consistent latency on OS X, without having to change the engine too
> much to cater for worst case buffer sizes.
you cannot determine latency in a generalized plugin context by
inspecting the buffer size passed to a calback. consistent latency has
absolutely nothing to do with a constant buffer size.
> The only other time I have fed audio to the sound card on OS X is through
> the use of PortAudio which does allow the user to specify the buffer size
> and sample rate and it all just magically works
if you check PortAudio carefully, you'll find that it also cannot
guarantee a fixed buffer size, but it goes to a few extra lengths over
the native APIs that it wraps to hide some of the variation.
> to use CoreAudio directly. My first approach was to use AudioQueue, but that
> meant I couldn't get bufferSize smaller than 125ms. That is why I turned to
> AUHAL. Do you think going directly to HAL (without the default Audio Unit),
> would allow me to achieve fixed size buffers?
it would get you closer, but on Lion there is still no guarantee since
it appears that a server now interposes between the hardware and even
the "HAL" (much like in JACK).
_______________________________________________
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