Causes of paramErr (-50) in AudioUnitRender
Causes of paramErr (-50) in AudioUnitRender
- Subject: Causes of paramErr (-50) in AudioUnitRender
- From: Chris Adamson <email@hidden>
- Date: Wed, 11 Aug 2010 17:25:12 -0400
I have an offline AUGraph that I want to pull samples through on demand by calling AudioUnitRender() on a generic output unit at the end of the graph.
When I call AudioUnitRender(), I get -50 (paramErr) every time.
There's a code sample, PlaySequence, that's somewhat similar to what I want to do in that it pulls through a graph via a generic output unit. I've set a breakpoint on its AudioUnitRender() and my own, and I'm poring over the params to that call (which succeeds), and mine (which doesn't). I'm not seeing any meaningful difference:
* Each has an AudioUnit (specifically a generic output unit)
* Each has an AudioUnitActionFlags value of 0
* The timestamp of each is totally 0'ed out (including the mSMPTETime fields) except for mFlags, which is 1 (kAudioTimeStampSampleTimeValid)
* Each has 0 for the bus number
* numFrames is 512 for PlaySequence, 1024 in my code (no, changing it doesn't help)
* The AudioBufferList in PlaySequence has mNumberBuffers==2, mNumberChannels==1, mDataByteSize==2048, mData=0x0. The AudioBufferList in my code has mNumberBuffers==1, mNumberChannels==2, mDataByteSize==8192, and mData==<some non-NULL address>.
I guess my question is if anyone knows which of these parameters gets tested, and how deeply, that could result in a paramErr? The docs simply indicate the return value is "a result code", so that's not much help diagnosing what causes the error.
Does the AudioUnit need to be in some certain state or have specific properties explicitly set?
There is a note that the AudioBufferList "must match the topology for the current audio format for the given bus", which I take to mean that its channel count should match the streamFormat.mChannelsPerFrame of the output unit's output on that bus (which I've verified it does)… maybe there's more to the "topology" than channel count?
Anyways, I've been banging my head against this all afternoon and wish I had more to go on that just the paramErr, to have some clue what I need to do to satify AudioUnitRender().
Thanks for any suggestions.
--Chris
_______________________________________________
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