I have been getting some issues with my 64 bit VST in Adobe Premiere CS6 on Win7. (Curiously this issue isn’t reproducable on win8).
From the second time you open Premiere and try to open the interface of the plugin it deadlocks and freezes Premiere.
The problem seems to be caused because Premiere is caching a instance of the plugin on the 1st load. (also getting a leaked instance of ‘class JuceVSTWrapper’ in debug mode.)
When you change a value in adobes cache in the registry to ‘not’ cache the plugin at startup the problem is gone. This forces it to reload the plugin from disk. But you will need to do this every time before you start it. (Premiere auto sets it back on start up). So this isn’t a solution unfortunately.
This is the call stack when it deadlocks when you open the UI:
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
MyPLugin-x64.dll!juce::WaitableEvent::wait(const int timeOutMillisecs=20) Line 101 + 0x12 bytes C++
MyPLugin-x64.dll!juce::MessageManagerLock::init(juce::Thread * const threadToCheck=0x0000000000000000, juce::ThreadPoolJob * const job=0x0000000000000000) Line 286 + 0x1b bytes C++
MyPLugin-x64.dll!juce::MessageManagerLock::MessageManagerLock(juce::Thread * const threadToCheck=0x0000000000000000) Line 248 + 0x12 bytes C++
MyPLugin-x64.dll!JuceVSTWrapper::dispatcher(int opCode=13, int index=0, __int64 value=0, void * ptr=0x000000000012dc80, float opt=0.00000000) Line 1175 + 0xc bytes C++
MyPLugin-x64.dll!AudioEffect::dispatchEffectClass(AEffect * e=0x000000001598f800, int opCode=13, int index=0, __int64 value=0, void * ptr=0x000000000012dc80, float opt=0.00000000) Line 33 C++
Traced down to the “const MessageManagerLock” in the ‘effEditGetRect’ option of the dispatcher function in juce_VST_wrapper.cpp
else if (opCode == effEditGetRect)
const MessageManagerLock mmLock; // <-- deadlocks
With a search on ‘MessageManagerLock and deadlock’ on this forum I read :
Which seems to be the case here…
Jules answer was:
If this is true, should MessageManagerLock be replaced in the VST wrapper?
How should i do this? TBH im not that comfortable messing with the core files of juce.
Just to quickly check what happens; I commented out the ‘const MessageManagerLock mmLock’. The problem remains in premiere, but noticed the debug version breaks on CHECK_MESSAGE_MANAGER_IS_LOCKED in juce_Component.cpp. So i guess these should be replaced with a mutex that is stored in the vst wrapper…?
I hope someone can shed some light on this and help me in the right direction.