I am in the process of cleaning up some of my code as I work on porting it to intel/10.6. Previously, I had been sloppy about setting kAudioUnitProperty_MaximumFramesPerSlice for my audiounits... I was setting it to a value about % larger than the max pull buffer. Now, I'm setting it exactly to my maximum pull buffer size. For some reason, this isn't working: If I set kAudioUnitProperty_MaximumFramesPerSlice to 512 for example, When I pull 511 samples from the AU with AudioUnitRender, all is fine. When I pull 512 samples, I get a -50 error. This seems to be the case regardless of the AU... filters, deferred render, etc. I'm ultimately using a HALOutputUnit, with sample rate conversion, to pull the chain, also set to 512 kAudioUnitProperty_MaximumFramesPerSlice, so it bounces around between 511 and 512 sample pulls, but never exceeds 512, as expected.
I could just set kAudioUnitProperty_MaximumFramesPerSlice slightly larger, as I was doing before, but I want to limit the AU's pull to down chain AUs, so they can all be set the the same kAudioUnitProperty_MaximumFramesPerSlice values with out fear: one MaxFrames value for the whole chain.
Any advice? Ethan... |