Re: Buffer size change property?
Re: Buffer size change property?
- Subject: Re: Buffer size change property?
- From: Jeff Moore <email@hidden>
- Date: Tue, 26 Mar 2013 10:42:00 -0700
On Mar 26, 2013, at 6:23 AM, Eric Gorouben <email@hidden> wrote:
> In the HAL plugin design, the buffer size changes used the kAudioDevicePropertyBufferFrameSize property.
> This property doesn't seem to exist in the new audio server plugin implementation.
That's correct. kAudioDevicePropertyBufferFrameSize represents the IO buffer size (in frames) for the client process. It is probably a non-intuitive thing, but this value actually has surprisingly little meaning for the server plug-in.
> AudioServerPlugin.h:
>> RequestDeviceConfigurationChange:
>> When a plug-in's device object needs to change its structure or change any state related to IO for any reason, it must begin this operation by invoking this Host method.(...)The sorts of changes that must go through this mechanism are anything that affects either the structure of the device or IO. This includes (...), changing the size of the ring buffer...
>
> While I can easily find the property associated with such changes in AudioHardwareBase.h (kAudioDevicePropertyNominalSampleRate, kAudioDevicePropertySafetyOffset
> , etc) I can't find the mechanism for the buffer size.
> How does in work?
Basically, your sever plug-in doesn't get to say anything about the IO buffer size for the client. That is by design as different clients can have different IO buffer sizes at the same time. For example, Logic might want an IO buffer size of 64 frames whereas iTunes is generally pretty happy with the default size of 512. The mix engine in the HAL handles dealing with the various buffer sizes and implementing the coloring algorithm to know when each client has actually provided the data for a given time segment.
The net effect is that the server plug-in has to be prepared for the fact that the HAL will call to read/write data of the various sizes that will come up as one client's IO cycle beats against another clients.
--
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