Expensive setParameter call


#1

Hi,

I am trying to send parameter changes from the default sliders to a third party library. The library method call is quite expensive and it is causing me trouble. Changing the parameter sporadically works however mostly crashes resulting in the following Thread 0:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x97c847d2 mach_msg_trap + 10 1 libsystem_kernel.dylib 0x97c83cb0 mach_msg + 68 2 com.apple.CoreGraphics 0x992fe074 _CGSFlushSurfaceInline + 234 3 com.apple.CoreGraphics 0x992fde3e CGSFlushSurfaceWithOptions + 438 4 com.apple.opengl 0x900862f9 0x90083000 + 13049 5 com.apple.AMDRadeonX3000GLDriver 0x111b4d19 gldPresentFramebufferData + 326 6 GLEngine 0x102ff171 glFlush_Exec + 211 7 libGL.dylib 0x9526ec8f glFlush + 24 8 com.ableton.live 0x0147fc7e std::out_of_range::~out_of_range() + 4735488 9 com.ableton.live 0x0148188f std::out_of_range::~out_of_range() + 4742673 10 com.ableton.live 0x01598482 std::out_of_range::~out_of_range() + 5884420 11 com.ableton.live 0x0159420c std::out_of_range::~out_of_range() + 5867406 12 com.ableton.live 0x014777cd std::out_of_range::~out_of_range() + 4701519 13 com.ableton.live 0x0147d480 std::out_of_range::~out_of_range() + 4725250 14 com.ableton.live 0x0147d51c std::out_of_range::~out_of_range() + 4725406 15 com.ableton.live 0x0147a03f std::out_of_range::~out_of_range() + 4711873 16 com.apple.Foundation 0x956bb914 __NSFireTimer + 117 17 com.apple.CoreFoundation 0x92f890d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22 18 com.apple.CoreFoundation 0x92f88a75 __CFRunLoopDoTimer + 709 19 com.apple.CoreFoundation 0x92f6d892 __CFRunLoopRun + 1730 20 com.apple.CoreFoundation 0x92f6cd6a CFRunLoopRunSpecific + 378 21 com.apple.CoreFoundation 0x92f6cbdb CFRunLoopRunInMode + 123 22 com.apple.HIToolbox 0x9743d8aa RunCurrentEventLoopInMode + 242 23 com.apple.HIToolbox 0x9743d545 ReceiveNextEventCommon + 162 24 com.apple.HIToolbox 0x9743d494 BlockUntilNextEventMatchingListInMode + 88 25 com.apple.AppKit 0x961eaa5a _DPSNextEvent + 724 26 com.apple.AppKit 0x961ea28c -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 119 27 com.apple.AppKit 0x961e06dc -[NSApplication run] + 855 28 com.ableton.live 0x0148503a std::out_of_range::~out_of_range() + 4756924 29 com.ableton.live 0x0147a7ac std::out_of_range::~out_of_range() + 4713774 30 com.ableton.live 0x0000303b 0x1000 + 8251 31 com.ableton.live 0x00002f69 0x1000 + 8041
What is causing me confusing is that if I change the parameter using Ableton clip automation, it always works and I have full control of the default slider. Is this because the parameter automation is calling setParameterNotifyingHost?
I am aware that setParameter can be called from the audio thread, so if code inside is intensive then errors can occur, but I am unsure how I can fix this as I need to have control from the default sliders. Perhaps I need to lock it?

Thanks,

Tom


#2

I have just noticed, as long as the Live is playing, the sliders work perfectly with no delays or crashes. The crashes only occur when the sequencer is not running which is rather bizarre. Perhaps I could just put in some control to stop parameter changes when it has stopped?


#3

Since the call stack doesn’t contain any plugin code, I’d say this is either an obscure ableton bug that you’re unlucky enough to be triggering, or you could be corrupting memory somewhere so that an unrelated bit of code fails later. Unfortunately there’s no easy answer to debugging this kind of thing, you’ll need to use trial-and-error and your powers of deduction…


#4

Had a closer look at the library call, fixed it up and all sorted now. Thanks