Menu

#138 VST plugin: Editor crashes when the plugin does not provide a panel

1.x
open
nobody
None
2021-07-11
2020-10-08
No

In void VSTPluginInstance::startEditing(HWND hWnd, short* width, short* height), rect is used without checking that the plugin has initialized it, which leads to a crash when clicking "Open panel" for the plugin.

Some plugins do not implement a GUI and rely on the host to set the parameters for them or have no parameters to set.

Discussion

  • Peter Verbeek

    Peter Verbeek - 2020-10-09

    Looking at the code (I'm not very experienced in c++) it probably crashes by these lines:

        effect->dispatcher(effect, effEditGetRect, 0, 0, &rect, 0.0f);
        effect->dispatcher(effect, effEditOpen, 0, 0, hWnd, 0.0f);
        effect->dispatcher(effect, effEditGetRect, 0, 0, &rect, 0.0f);
    

    If the plugin doesn't have a GUI these commands probably fail. Then these lines fail:

    effect->startEditing(hwnd, &width, &height);
    ui->frame->setFixedSize(width, height);
    effect->setSizeWindowFunc(bind(&VSTPluginFilterGUIDialog::onSizeWindow, this, _1, _2));
    

    I don't know how to check for a GUI being present in the plugin. It would be nice if the developer our someone else does have this knowledge.

     
  • Jaroslav Kazejev

    If the plugin does not have an editor, it will just not act on these commands, and rect will remain uninitialized.

     

    Last edit: Jaroslav Kazejev 2020-10-09
  • Peter Verbeek

    Peter Verbeek - 2020-10-10

    So the line before the StartEditing call could be something like this? Perhaps then an empty window will pop up.

    short width = 100, height = 100;
    effect->startEditing(hwnd, &width, &height);
    
     
  • Jaroslav Kazejev

    It would be correct to initialize rect to nullptr and check it after effEditGetRect. If it is null, then don't try to use it.

    The error lies in

        *width = rect->right - rect->left;
        *height = rect->bottom - rect->top;
    
    • it is not possible to use rect when it is null.

    In this case, the call to startEditing probably does not do anything.

     

    Last edit: Jaroslav Kazejev 2020-10-11
  • Peter Verbeek

    Peter Verbeek - 2020-10-12

    It's obvious you know what you're talking about. I hope the developer is taking over your suggestion. Unfortunately he isn't very actively involved on his project as he used to be. I don't expect this to be resolved any time soon unless someone else will change it.

     
  • Warren Hess

    Warren Hess - 2021-07-11

    Did anyone find a solution to this? Is there a way to just add the values to the config files? I use the RNN Noise plugin but it is also occurring for me on the Airwindows plugins.

     
    • Peter Verbeek

      Peter Verbeek - 2021-07-11

      We're waiting on a solution of the developer. Does both plugins, RNN Noise and Airwindows, have an interface?

      As all Equalizer APO audio changing features are just commands in config files, in principle you can simply change any value of a plugin command and save the config file to apply this change. Of course you need to figure out which value is related to which feature of the plugin.

      You could even make an interface yourself for these plugins. It would be nice to have a general plugin interface in the Peace equalizer. I mean, an interface which can be set up by the user to mimic/build a plugin interface.

       
      • Warren Hess

        Warren Hess - 2021-07-11

        This is not exactly my forte but when I open up the vst for Airwindows DeEss in Audacity a window pops up that allows you to control sliders with the values. What the values are actually called in the code I do not know and can't seem to find out. Well that is unfortunate because Equalizer APO is so great for real time mic eq and effects and not being able to add these types of vst plugins is rough. I seem to be entirely limited to reaper plugins so far.

         
        • Peter Verbeek

          Peter Verbeek - 2021-07-11

          Yes, not having the interface makes it difficult to determine which value corresponds with which dial on the interface. I've tried to find info on the chunkdata bit of the Equalizer APO AirWindows DeEss command. Unfortunately, I couldn't find how chunkdata is built up from parameters of a plugin, in this case the 5 sliders. I did find this webpage explaining how to get the chunkdata from a JSON file when using a VST plugin in OBS Studio. In principle it's a matter of copy/paste so if Audacity creates a (JSON) file somewhere then the chunkdata part can be copied and pasted.

           

Log in to post a comment.