Juce InternalMessageQueue sometimes starts accumulating messages endlessly, without sending them

Hi, this is an issue that I can trigger with my VST3 plugin on Cakewalk, on Windows 10. When I double click on a note in the piano roll, change its velocity, 50% of the time, this will cause the juce timer thread of my plugin to stop delivering its messages.

All this happens without even showing the GUI of my plugin – I’m just loading the plugin in a single track project, and edit the velocity of one note in the piano roll.

Further inquiry shows that the messages accumulate in juce::InternalMessageQueue . The shouldTriggerMessageQueueDispatch is false because the queue is not empty. Replacing
shouldTriggerMessageQueueDispatch = messageQueue.isEmpty();
shouldTriggerMessageQueueDispatch = (messageQueue.size() % 16) == 0;
fixes the issue, but of course there is probably something better to fix in the InternalMessageQueue.

Hello jpo! I couldn’t reproduce this, by just changing velocity values. Admittedly I didn’t throw everything at it, I could.

Can you confirm whether this is still an issue with the current version of Cakewalk?

Hi Attila,

I just checked, with the latest develop version of JUCE, and after updating cakewalk to its latest version (2021.04), the issue is still here.

Thanks for checking. It turns out, that in my case it’s the “Zoom in Vertical” button on the Piano roll, that triggers the issue 100% of the time. I’ll keep looking into it.

great ! I was afraid you would not be able to reproduce it as it is probably related to some specific timing of events, something really tricky to reproduce

After closer inspection it seems that Cakewalk may be losing/misrouting some JUCE internal messages that are meant to keep the InternalMessageQueue going.

I created a ticket with Cakewalk about it, so they should be looking into this now.

1 Like

Cakewalk looked into the issue and the fix should be coming in their update this week.

1 Like

Awesome, that was great detective stuff !