I call createPluginInstance from AudioPluginFormatManager object 3 times to load another plugin. But they have strange work. 2 times it called from AudioProcessor::setStateInformation and from the GUI menu are both ok. But when i reload preset it also call createPluginInstance but the PT hangs.
I debugge. With the time calling from preset createPluginInstance -----> format->createInstanceFromDescription -----> createPluginInstanceAsync (desc, initialSampleRate, initialBufferSize, eventSignaler.release()) ------------> (new InvokeOnMessageThread (this, description, initialSampleRate, initialBufferSize, callback))->post(); but it never call back void messageCallback() override to create plugin object handle. Then the PT on window hangs.
Do you have any solution with this case.
If you like you can remote my pc(via teamviewer) to check it.
this may happen because you are restoring your plug-ins on other non message-main thread, we had something like in AGENT, check before creating those plug-ins that you are on the main message thread, if not do an asyncupdate so it ends up being called from it.
As i debugged. The process to call Create Plugin all same on all 3 times. But the time from the Preset. It also creates plugin. (new InvokeOnMessageThread (this, description, initialSampleRate, initialBufferSize, callback))->post(); will be called but never call void messageCallback() override to create plugin. I think all cases come from the GUI. This bug occur when I reload preset from GUI.
If you have time. I ll show you on my pc.
If yes please give me time when you are available.
Yes i did it, and as i said above, It hangs on this function: (new InvokeOnMessageThread (this, description, initialSampleRate, initialBufferSize, callback))->post();
Can you check whether the JUCE message thread has been initialized (MessageManager::getInstanceWithoutCreating() != nullptr)?
I remember that in PT the JUCE message thread is only initialized after the GUI has been opened.
It should be right, i dont know why i cant invoke to message thread anymore after editor show on. I tried to invoke but when call post method. Plugin waiting … and hang.
But the post method will be call if use act to the GUI. and the pos work well in that case.
You’re probably not getting any answers because your posts are confusing and hard to understand. Maybe clearly explain what you’re doing and exactly what you’re seeing happen.
I want to load another plugin in my plugin. Every thing is ok except I load other plugin via loading preset on Pro Tool. It make pro tool hang, I check the message handling does not work any more after i load plugin via changing preset (After post() function call ).
After i debug, i found the reason is “Pro tool can’t post message to load another plugin”:
when i change preset of pro tool: I load other plugin using this function createPluginInstance -----> format->createInstanceFromDescription -----> createPluginInstanceAsync (desc, initialSampleRate, initialBufferSize, eventSignaler.release()) ------------> (new InvokeOnMessageThread (this, description, initialSampleRate, initialBufferSize, callback))->post()
It never call call back function input to load another plugin.
When i load plugin via preset that thread is no Message thread then the code need to invoke to message thread to load another plugin.
More: But i load another plugin from a button on my plugin is ok.
My question:
Why need to invoke Message thread when you load plugin.
Please explain me why it hands .
The plugin must be created on the message thread because on Windows there are certain things the plugin may want to do which must be done on that thread.
As to why your code hangs, obviously nobody here can magically know what’s going on in your code, you’d need to debug it yourself and see what threads are locked to figure out what’s going on.