Wavelab 6 hangs when opening second plugin instance


#1

We have an other issue with PPMulator here, that is also reproducable with the JuceDemoPlugin from current git:

  • open wavelab 6
  • add JuceDemoPlugin to the first slot of the master section
  • remove the plugin
  • add JuceDemoPlugin again to the same slot
    -> wavelab hangs forever before the plugin appears

To put it mildly, Windows 7 / VS2005 / Wavelab 6 is a suboptimal combination for debugging. I tried for a while, but wasn’t able to properly attach the debugger to Wavelab to inspect this any further.

Did anyone else have similar problems in Wavelab 6 and was able to work around it? Since jules is pretty busy with the (exciting!) android stuff, we’re probably on our own with this issue for now.


#2

Hi .
The exact same issue for me.
The problem seems to be linked to a thread that is waiting and waiting…
I’m currently working on it.
If other people have any idea…

Julien


#3

Ok, there’s a Wavelab-specific function in JuceVSTWrapper that doesn’t take care of this case properly…

[code]static void checkWhetherMessageThreadIsCorrect()
{
if (getHostType().isWavelab() || getHostType().isCubaseBridged())
{
static bool messageThreadIsDefinitelyCorrect = false;

        if (! messageThreadIsDefinitelyCorrect ) 
        {
            MessageManager::getInstance()->setCurrentThreadAsMessageThread();

            class MessageThreadCallback  : public CallbackMessage
            {
            public:
                MessageThreadCallback (bool& triggered_) : triggered (triggered_) {}

                void messageCallback()
                {
                    triggered = true;
                }

            private:
                bool& triggered;
            };

            (new MessageThreadCallback (messageThreadIsDefinitelyCorrect))->post();
        }
    }
}[/code]

Look at the static bool messageThreadIsDefinitelyCorrect. it’s false before any instance of the plugin is opened and becomes true with the first instance, and, importantly, remains true even after that first instance is deleted. So I added a static instance counter that is incremented in the wrapper constructor and decremented in the destructor, and changed the crucial line to

if ((!messageThreadIsDefinitelyCorrect) || (instances==1) ), which fixes this issue and, as far as I can see, doesn’t introduce any new ones (you never know with Wavelab :evil: ).


#4

Gah… Wavelab…

Thanks very much for the detective-work there, I’ll sort something out!


#5

Thanks so much for sharing your solution - I had given up on this one!


#6

Just a quick question,

Is this issue now fixed with the latest Tip? Thanks!


#7

Yes, jules fixed it right away in January:
http://juce.git.sourceforge.net/git/gitweb.cgi?p=juce/juce;a=commit;h=4f0c2c0fb8d8b72a1db86a4f41ff0748499b724b