Re: AudioUnitRender results in kAudioUnitErr_TooManyFramesToProcess
Re: AudioUnitRender results in kAudioUnitErr_TooManyFramesToProcess
- Subject: Re: AudioUnitRender results in kAudioUnitErr_TooManyFramesToProcess
- From: Doug Wyatt <email@hidden>
- Date: Tue, 05 Jul 2016 11:48:06 -0700
Possibly the buffer list's mNumberBuffers is inconsistent with the output bus's format, or its mBuffers' mDataByteSize members are inconsistent with the supplied frame count.
The rule of thumb for AudioBufferList function parameters is: if the API is going to store something into the buffer list, on entry mDataByteSize expresses capacity, on exit, the number of valid frames. In the case of AudioUnitRender, however, it's slightly different (due to compatibility with V1) -- on entry, mDataByteSize must be exactly the frame count times the number of bytes per frame.
Doug
> On Jul 3, 2016, at 14:55 , Mazzaroth M. <email@hidden> wrote:
>
> I investigated this further and I added this code to increase the number of frames per timeslice:
>
> UInt32 numFrames = 4096; // 3756
> AudioUnitSetProperty(outputUnit, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, &numFrames, sizeof(numFrames));
>
> OSStatus status = AudioUnitRender(outputUnit, 0, timeStamp, 0, (UInt32)bufferLength, bufferList);
>
> I no longer get the -10874 status error. But now I get a different error, kAudio_ParamError(-50)
>
> The params appear OK so I'm not sure why this is happening.
>
> (lldb) po outputUnit
> 0x00000000809c806a
>
> (lldb) po timeStamp
> 0x00007fff5fbfeaa0
>
> (lldb) po bufferLength
> 3756
>
> (lldb) po bufferList
> 0x0000618000044e90
>
> (lldb) po self.engine
>
> ________ GraphDescription ________
> AVAudioEngineGraph 0x6100001c03c0: initialized = 1, running = 0, number of nodes = 4
>
> ******** output chain ********
>
> node 0x6080000a12c0 {'auou' 'ahal' 'appl'}, 'I'
> inputs = 1
> (bus0) <- (bus0) 0x6100000c8ff0, {'aumx' 'mcmx' 'appl'}, [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
>
> node 0x6100000c8ff0 {'aumx' 'mcmx' 'appl'}, 'I'
> inputs = 1
> (bus0) <- (bus0) 0x6000000c2a00, {'aufx' 'dist' 'appl'}, [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
> outputs = 1
> (bus0) -> (bus0) 0x6080000a12c0, {'auou' 'ahal' 'appl'}, [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
>
> node 0x6000000c2a00 {'aufx' 'dist' 'appl'}, 'I'
> inputs = 1
> (bus0) <- (bus0) 0x6100001804e0, {'augn' 'sspl' 'appl'}, [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
> outputs = 1
> (bus0) -> (bus0) 0x6100000c8ff0, {'aumx' 'mcmx' 'appl'}, [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
>
> node 0x6100001804e0 {'augn' 'sspl' 'appl'}, 'I'
> outputs = 1
> (bus0) -> (bus0) 0x6000000c2a00, {'aufx' 'dist' 'appl'}, [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
> ______________________________________
>
>
>
> (lldb) po self.engine.outputNode
> <AVAudioOutputNode: 0x600000000a00>
>
> (lldb) po self.engine.outputNode.audioUnit
> 0x00000000809c806a
>
> regards,
> Michael
>
> On Sat, Jul 2, 2016 at 4:37 PM, Mazzaroth M. <email@hidden> wrote:
> I'm trying to covert some Objective-C offline render code from iOS 8 to macOS 10.11. However I'm getting a kAudioUnitErr_TooManyFramesToProcess(-10874) error when I call AudioUnitRender()
>
> The error does not occur on iOS.
>
> The (broken) code is available here.
>
> https://bitbucket.org/sidha/offline-render-mac/src/cc3ba589565bf97d3700e91ef7b1e7806c6c9298/OfflineRender/ViewController.m?at=master&fileviewer=file-view-default#ViewController.m-229
>
> Any ideas?
> Michael
>
>
> _______________________________________________
> 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
_______________________________________________
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