I have a user plugin for Reaper that automates rendering and export of audio files. It builds and runs fine under JUCE 7, but updating the project to JUCE 8 has broken it. It builds successfully, but nothing happens within Reaper when I try to open the plugin. I see no error messages and I don’t know where to find any Reaper log files. I’ve attached VS2022 to the running Reaper process, but nothing shows up there as unusual, either. Is there some change from 7 to 8 that I need to account for in my project?
Upgrading to JUCE 8 should just work. Have you tried any of the example plugin projects? Do those work correctly when built with JUCE 8?
Are you talking about adding the plugin to a track, or displaying the plugin’s editor after it’s been added to a track?
In REAPER’s settings windows under Plug-ins->VST->Re-scan...->Plug-ins that failed ot scan, do you see your plugin in the list? If you click to add an insert effect on a track, can you see your plugin in the “Add FX” dialog window?
I think the poster is talking about Reaper API specific plugins, which don’t work via the normal plugin formats. They are extension modules to Reaper itself.
Might be more useful to instead run the Reaper process itself under the debugger. (Set the Reaper executable as the debugging command in Visual Studio.) If you attach after Reaper has already started, you will miss any start up related problems.
I installed a stripped down portable Reaper and told it not to scan for any VSTs. The various plugins that use Pace caused problems when I tried to launch Reaper as my debug process.
Setting reaper.exe as my debugging command is very useful. Immediately after the splash screen, but before the main window, it’s throwing this exception:
Exception thrown at 0x00007FFBD23C3FAA (ntdll.dll) in reaper.exe: 0xC0000005: Access violation writing location 0x0000000000000024.
The call stack seems to show it was going through my plugin just before it hit a few calls to ntdll. After that, it can’t continue.
If I launch my stripped-down portable Reaper install from the explorer, it launches fine, but my custom commands are not in the Actions browser. This has me thinking Reaper disabled it on its own, which it did not do with my other main installation.
You can’t run PACE protected plugins under a Debugger… so remove all the PACE protected plugins from the scan location if you need to run the host under a debugger
Have you initialized Juce in your plugin’s entry point function? Meaning basically that the message manager has to be running before you try to do anything with timers, GUI objects etc…
TBH, I have no idea. I inherited this project from someone who left the company and I’m trying to get it running again. It was running fine under JUCE 7, but I’m trying to bring everything up to date.
Actually looking closer at the call stack it looks like the Juce stuff is being touched by the dynamic initializer stuff which smells like some global or static variables are involved. You shouldn’t have things like Juce Components, Fonts etc as globals or statics because of the undetermined C++ variable initialization order thing.
Your code should also call initialiseJuce_GUI at the start of the plugin entry code and shutdownJuce_GUI when Reaper unloads the plugin. It may also be necessary to call juce::Process::setCurrentModuleInstanceHandle() at the start of the plugin code.
I can’t really suggest anything else but trying to figure out if you have Juce GUI objects like Components (and their subclasses) declared as globals/statics. If that is the case, maybe change those into unique pointers which you initialise only after the initialiseJuce_GUI function has been called.
Looking through the code, pretty much every UI element (ToggleButton, TextButton, etc.) is declared as a static. I think I have my work cut out for me.
I really appreciate the help you’ve given me. I now have a good idea of how to proceed.
I changed all of the static UI element variables to unique_ptrs and I initialize them after the initialise_Juce_GUI function is called. When I try to open my plugin now, I get stuck in a loop that overflows the stack. I put a breakpoint on the line that keeps getting called, so here is the stack after a couple of times through the loop. I can’t tell what exactly is unhappy and causing the loop. Maybe some callback isn’t set up correctly?
Is there a recent example of a GUI Reaper extension written with Juce 8 showing the proper way to manage elements like ToggleButton, TextButton, etc? I found an older thread with an example, but the link to the source was dead.