Chowdhury-DSP / ChowKick

Kick synthesizer based on old-school drum machine circuits
BSD 3-Clause "New" or "Revised" License
156 stars 16 forks source link

[BUG] GUI doesn't work for Linux using VST3 plugin #42

Open powerjungle opened 1 year ago

powerjungle commented 1 year ago

Describe the bug Opening the VST3 plugin in Renoise has no GUI and returns the following log:

Renoise LOG> Vst3Plugs: Instantiating: /home/music-plugins/vst3/ChowKick.vst3...
Renoise LOG> Vst3Plugs: Failed to apply initial controller state to controller (not critical)
Renoise LOG> Vst3Plugs: Failed to suggest speaker arrangement (not critical)
Renoise LOG> Vst3Window: Creating a new main window...
Renoise LOG> Vst3Window: Setting window properties...
Renoise LOG> Vst3Window: Creating plugin parent window...
Renoise LOG> Vst3Window: Mapping the window...
Renoise LOG> Vst3Window: Attaching the plugin to the plugin parent window...
Renoise LOG> Vst3Window: Plugin requested new Windowsize 850, 600
Renoise LOG> Vst3Window: Plugin window attached via _XEMBED_INFO
X ERROR: Returned 'BadValue (integer parameter out of range for operation)' for operation 'Unknown'

To Reproduce Steps to reproduce the behavior:

  1. Open Renoise
  2. Open ChowKick VST3
  3. See error above

Expected behavior To be able to open the plugin in Renoise and have a GUI.

Screenshots Screenshot_2022-12-15_10-20-43

Desktop (please complete the following information):

jatinchowdhury18 commented 1 year ago

Hi, thanks for the bug report!

My best guess as to the root cause of the issue is that their may be some compatibility issue with the plugin's OpenGL support, and the OpenGL support available on your system. It should be possible to turn off OpenGL support in the plugin, by commenting out the juce::juce_opengl and FOLEYS_ENABLE_OPEN_GL_CONTEXT=1 lines in modules/CMakeLists.txt. Definitely let me know if that strategy helps on your system!

powerjungle commented 1 year ago

Yep, after doing this it works, but seems to be using a lot of CPU power. Here's some information from nvidia-settings. OpenGL Version: 4.6.0 NVIDIA 470.161.03

jatinchowdhury18 commented 1 year ago

Ah okay, that's good to know. Frankly I'm not super familiar about the way JUCE's OpenGL renderrer interfaces with the system's OpenGL capabilities, so that may be a bit of a blocker as far as actually getting the plugin GUI working with OpenGL support on your system.

For the CPU usage, I'd first double check that you're compiling with all the proper "release build" flags. When compiling with Makefile-based CMake generators, I ususally do:

cmake -Bbuild -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build build/ --target ChowKick_VST3 --config Release
noisecode3 commented 1 year ago

Hi, The GUI works for me only if I update juce from 7.0.3 to 7.0.4 before building :) I had the same problem. I didn't edit any cmake file. Just rm -fr JUCE and git clone, did it. There was a commit for some opengl problem, maybe I was just lucky :)

https://github.com/juce-framework/JUCE/commit/bac51aba8f4d3dd189fd7967402cd83876637635

jatinchowdhury18 commented 1 year ago

Ooh! Thanks for mentioning that, I hadn't noticed that JUCE 7.0.4 was out, and that it included some OpenGL fixes for Linux. I pushed a commit a few minutes ago that has the Linux build use the same strategy for auto-detecting OpenGL support that the plugin uses on Windows. If any of you have a chance to try out the next nightly build (probably ready in an hour or so), that would be awesome!

noisecode3 commented 1 year ago

Hi, I noticed you upgraded the chowdsp_utils module and not JUCE. Note sure why, it wont build now. It did work yesterday if I just upgraded the JUCE module.

jatinchowdhury18 commented 1 year ago

Ah, that'll teach me not to be to trigger-happy with git push at 2am.

So it looks like all the plugins can build fine when linked with OpenGL, except the LV2 build, which fails when generating TTL files.I'm going to back out the change which linked with OpenGL by default on Linux, and hopefully that will improve the situation.

That's a bit of a bummer though... I think I'd prefer to stop shipping the LV2 format, but I think there's enough folks using it that I should stick with it for now.

noisecode3 commented 1 year ago

Okej, if you want you could make the build without LV2 if the user want Opengl and disable Opengl if the user want LV2. I know the TTL file generator could fail when there was some memory problem with initializing the plugin, could be on JUCE side also.

Dont stress it, take you're time, git push at 2am lol. No problem :) I get hyped about fixing a problem sometimes also forget to sleep...

jatinchowdhury18 commented 1 year ago

Okej, if you want you could make the build without LV2 if the user want Opengl and disable Opengl if the user want LV2.

Yeah, I might go with this strategy, I'll just have to work it out in my build scripts.

I know the TTL file generator could fail when there was some memory problem with initializing the plugin, could be on JUCE side also.

It's a bit hard to know where the problem is coming from... it definitely could be a JUCE thing, but another thought was that I usually build my plugins from a "headless" setup (whether at home or on a build server), and since the TTL generator needs to create the plugin UI that might be causing problems as well.