Opengl hosted vst plugin editor problem :(

opengl

#1

Hello,

On OS X Mojave, JUCE 5.4.1, I’m trying to host differents VSTs and show the GUIs, but when opengl gets involved, the second window freezes everything the GUI thread.

The problem can be reproduced with the AudioPluginHost:

  • identify and install an opengl vst (I found roughrider2 here https://www.audiodamage.com/pages/free-downloads )
  • scan your VST
  • add two instances of the opengl vst
  • double click on 1st instance to display the gui => OK
  • double click on 2nd instance => window is created, and then everything freezes

If you break on Xcode, you can see some threads with opengl code waiting for a mutex somewhere.

Here is what I tried, without success so far:

  • debugging with osx opengl profiler (but it segfaults itself https://forums.developer.apple.com/thread/70141 )
  • passing an opengl context to the plugin windows and make them shared
  • tried various arrangements of the juce’s opengl context options.

I’ve tried to open roughrider plugin twice on REAPER DAW and it handles it, so I would say that it’s not an issue from OS X, but rather from the way JUCE handles VST Editors.

Did you already have a similar issue ?
Do you know haw to make the opengl profiler not crash on OS X ?
Do you have any advice on how to debug further ?

Best,
MartyLake

PS: Ok, I can reproduce this on OS X Mojave, JUCE 5.3.2
PPS: Ok, still can reproduce it on OS X Mojave, JUCE 5.0.0
PPPS: Still reproduce with “juce5” version of soundradix version OpenGL on message thread
PS: Ok, it WORKS on OS X El capitan, JUCE 5.3.2
PPS: related GH issue https://github.com/WeAreROLI/JUCE/issues/445


OpenGL on message thread
#4

I don’t know what’s going on here and, unfortunately, I can’t reproduce it.

What hardware are you using?
Have you changed any of the AudioPluginHost’s configuration (other than to opt-in to VST hosting)?
How are you compiling? Which version of Xcode?


#5

Hi t0m, thanks for your answer !

I’ve not changed anything. On my config, it reproduces with the xcodeproj from https://shop.juce.com/get-juce/download
compiling with Xcode 10.1, Legacy Build System (but New Build System reproduces as well), on a MacBook pro 15inch-2018 (MacBookPro15,1, Intel Core i7,2,6 GHz)

I have attached a backtrace of the locked threads, maybe it can help go further ?interlocked threads.txt (12.5 KB)


#6

I downloaded a fresh copy of JUCE, but I’m still unable to get a deadlock. I’ve not got exactly the same hardware as you but all the software should be identical.

The backtrace helps a little. However, without being able to experiment and jump around in the debugger it’s going to be very difficult to fix.


#7

Does this happen for you in Tracktion Waveform?

https://marketplace.tracktion.com/shop/free-trial?sku=trac120090


#8

Well, maybe it’s an issue with just my computer, but I cannot reproduce the issue with Reaper for example.

As you suggested, I downloaded the Tracktion Waveform, and I can’t reproduce the bug either.

My colleague got it’s computer at the same time as me (same model), and he can’t reproduce the bug either. It’s very strange !


#9

Well Waveform is a JUCE-based host, so that suggests it might not be a broader JUCE problem.


#10

The thing is, I can reproduce the problem with my application and AudioPluginHost example, which are both based on JUCE (one being a vanilla example from the vanilla zip of the official website). If that was a hardware fault, maybe none of the suggested options (Waveform, other DAWs) would function correctly. Here it suggests that something is fiddling with opengl, in certain cases.

As you said, it may not be JUCE itself.

Another strange thing is I can’t use the opengl profiler (it segaults itself). Is it something that only my computer has ? How do you guys debug opengl issues/deadlocks ?

Is there anything I can do to help further investigate this issue ?


#11

I’m currently looking into a few other OpenGL issues and I’ll keep my eyes open for potential deadlocks. This might get fixed as we change a few things.

I’ve never used the OpenGL profiler, usually the normal debugger is good enough to work out what’s going on.