AudioPluginHost - startup conditions and issues (7.0.5+VS2022)

Hello again, I recently upgraded to JUCE 7.0.5 and VS2022. I had a need to debug a plugin, so I rebuilt AudioPluginHost to insure being up to date. I had some difficulties getting things going.

Initially I started up the host and got a gray screen (no menu bar), then it closed. I didn’t succeed in getting more info, but I made a lucky guess that I had last used it to run a plugin which had since been deleted.

Workaround #1 (failed): I created an EMPTY.filtergraph with nothing in it, and started the host with it. It came up with a menu bar just fine. “Plugins > Create Plug-In > Audio,MIDI Input,Output (Internal)” didn’t seem to do anything at all. (More investigation is needed.)

Workaround #2 (worked): I finally located a working .filtergraph file from earlier testing. I deleted the test plugin and saved a file INOUT.filtergraph (inputs and outputs only). I keep it in a safe place. Now I always start with INOUT and put it back to that state before shutting down.

Wish #1: It would be nice to have a startup argument which would start the host in a “safe” condition, ignoring previous runs. I will probably have a look. (I thought that the default startup state had inputs/outputs, but I don’t remember now.)

Wish #2: Although it is basically cosmetic, it would be nice (and seems easy) to fill in the About box. It would be nice to see at least the JUCE version it was built from. I saw the location in the code, and will probably have a go.

Update on the failure to create internal plugins. I’m attempting a deep dive into the AudioPluginHost code, with a debugger. What I have seen so far:

a. I rebuilt the 6.1.6 host with VS2022, just to see what would happen. It also fails to create internal plugins, same behavior as 7.0.5.

b. Looking in juce_KnownPluginList.cpp
int KnownPluginList::getIndexChosenByMenu (
const Array& types,
int menuResultCode)

auto i = menuResultCode - PluginTreeUtils::menuIdBase;

Something seems to be seriously broken with menu IDs.
PluginTreeUtils says
enum { menuIdBase = 0x324503f4 };

Trying to create an internal plugin by selecting from the Create menu gives a menuResultCode of 1…16. These aren’t above menuIdBase, so the method returns a failure and no plugin is created. When selecting external plugins, menuResultCode is in a range starting with menuIdBase, so the method returns a small offset and the plugin is created.

Not sure how much further I can go with this.

[[NOTE: the above is for 6.x. For 7.0.5, the code has been rearranged and the equivalent is
MainHostWindow.cpp:
int MainHostWindow::getIndexChosenByMenu (int menuID) const
but the issue is the same.]]

1 Like

Update #2.

a. If you execute “File > New”, you get a graph with the first 4 internal plugins (Audio in/out, MIDI in/out). I saw the code where this is done.

b. If you delete all plugins from the graph (either by the menu or by loading an empty filtergraph file), then try to add them back via the “Create Plugin” menu, you can’t. From what I see in the code, it’s impossible to add any internal plugin from the Create menu.

1 Like

Update #3. I eventually located the (Windows) file

Users\ [myUserid] \AppData\Roaming\Juce Audio Plugin Host\Juce Audio Plugin Host.settings

where AudioPluginHost state is persisted. I deleted it and let the host create a new one at the next run. It was good that I did, because the old one had most internal plugins duplicated - some indicated as “ROLI”. I guess that file had been around since Juce 5 days.

This would have been the preferred solution for the startup crash. (Nothing to do with menu issue.) In fact, it would probably be advisable to delete the file before the first run of a new host version, so it creates a fresh state.