Closed NickCulbertson closed 1 year ago
This render block is doing a lot so I'll leave this fix to someone with more experience in DSP.
This is an AVAudioUnitSampler
bug which should be added to AppleBugDemos. The error in the debugger isn't coming from anything AudioKit related.
2022-11-17 12:00:09.266429-0500 TestRenderBlock[12635:250156] VoiceZone.cpp:1244 VoiceZone::GetControlSource: invalid component ID: 0x7
2022-11-17 12:00:09.266748-0500 TestRenderBlock[12635:250156] [default] VoiceZone.cpp:1245 about to throw -10879: VoiceZone::GetControlSource: Invalid connection source
The only info we get is the error code -10879, kAudioUnitErr_InvalidProperty
. However, it's difficult to know what causes the connection source in the component to be invalid because we don't know what the sampler does in its internal method, loadInstrument(at instrumentURL: URL)
.
Yeah, I just didn't know if we needed to add a return somewhere in the render block to avoid trying to render a null object. Unfortunately, it is difficult to recreate the specific errors I was seeing from it in production but it usually centered around trying to play notes right before or soon after changing AVAudioUnitSampler instruments. I'll reopen it is I get more info.
macOS Version(s) Used to Build
macOS 12 Monterey
Xcode Version(s)
Xcode 13.4.1
Description
If noteOn events are called while loading AudioKit's AppleSampler() it can occasionally crash on line 121 of DSPBase.mm. Here is a test project to illustrate the crash: https://github.com/NickCulbertson/TestRenderBlock
This is the current AUInternalRenderBlock:
Just a thought, but this is Apple's generated render block in DSPKernel when making an AUv3. It might be useful for comparison: