[LV2] plea to plugin UI devs

Filipe Coelho falktx at gmail.com
Wed Mar 16 14:20:55 PDT 2016


On 16.03.2016 20:21, Robin Gareus wrote:
> While we're at it..
>
> Since there are still new plugins with GTK and QT GUI popping up, and
> it's been at least 4 years since we last pointed this out, here's a
> friendly reminder:
>
>     **Please avoid big toolkit and be careful with C++**

I actually want to shout this instead:

  ** Please, please *never* use instance-access! **

Got it?
More on this below...


> gtk2 + gtk3 cannot exist in the same memory-space, likewise Qt4 + Qt5.
> This means a gtk2 host cannot load plugins with a gtk3 GUI, nor can
> you load a Qt4 plugin at the same time as plugin using a Qt5 GUI.

Actually, you can. And I have Carla as the proof of that.
But it has quite a few serious caveats..

If the UI does not use instance-access (this is important!!), the host 
is not required to run the DSP and UI in the same process.
A gtk2 host can start a new process for opening gtk3-based UIs, or maybe 
to open all UIs.
That will prevent symbol conflicts and actually improves the stability 
of the host (crashing or mis-behaving UIs cannot take down the host).
Carla does this for LV2 UIs by default, whenever possible.

That said, everything is not so simple.
If your plugin has both DSP and UI in the same binary, symbol conflicts 
will happen as soon as the host opens the shared object.
Running in a separate process means there's an extra IPC layer for 
UI<->DSP communication, which will make things slower.
Embedding is not always possible.
X11 is awesome by allowing Windows to embed into another process Window, 
and I believe Win32 API allows this too.
Making that work for gtk or Qt is not something a sane person would try 
to do..


> Unless you know what you're doing, at the time of writing the most
> sensible way is to use DPF or JUCE or directly openGL (via pugl). AVTK
> may become an option soonish.

Thanks for mentioning DPF. :)

I have to say a note about Juce.
Even though it has LV2 support (unofficial, made by yours truly), it has 
some very bad issues regarding LV2:
  - instance-access is required for UIs
  - port values are always bounded between 0 and 1
  - port units are not possible (because of the previous point)


As for DPF, it has a limited API but that's intentional.
It's only supposed to do the hard work regarding plugin APIs.
The UI code can use OpenGL or NanoVG, and as of recently you can have 
external UIs too.

And I might as well post a link to it:
https://github.com/DISTRHO/DPF

The bottom of the page has a list of plugins made with DPF.



More information about the Devel mailing list