How do i... remove ALL plugin cache / metadata?

I have LV2 plugins (guitarix’s gxAmp mono and stereo) to which i added features, and this changed the layout of ports (added a “trim” control) Since i did this Ardour sometimes crashes (X11 / BadGlyph errors - freezes for several seconds then either segfaults or exits on trap/assert) when i close the plugin’s UI window after it’s been open for a while. This happens with all Guitarix plugins, including my new version of gxAmp and the stock one. This doesn’t happen in other hosts (carla, jalv) or if Ardour is started with a new home dir / as a new user - so it’s definitely a bug in Ardour, probably the way it handles stale plugin metadata.

I removed everything i could find in ~/.cache and ~/.config/ardour* that looks like plugin cache/metadata, but if i run it as my normal user i’m still getting X11 related crashes with guitarix plugins when closing the window after it’s been open for a while - even after a full rescan of all pluigns (which takes several minutes) …How do i completely remove all plugin metadata to avoid this crash?

tl;dr: for LV2 plugins there is no cache that can be removed.

Those are for VST plugins. Since LV2 plugins directly provide meta-data there is no cache for them at all. Plugin scan is only required for VST2/3. LV2 plugins need no scan are automatically discovered and indexed add application start.

Ardour does not cache LV2 nor interact directly with them. liblilv handles all this.

  • Have you also modified the GUIs, to also respond to those changes?
  • Also note that you may only append control ports (not remove any or change the order), as since will break existing sessions (and can cause crashes when loading state).
  • Have you incremented lv2:microVersion or lv2:minorVersion – liblilv always picks the latest version of a plugin, but if you have two plugins with same URI and same version it may be random. So perhaps system-wide and local plugins get mixed

but really you should change the URI of the plugin if you customize it.

  • Have you also modified the GUIs, to also respond to those changes?

Yeah, i moved the controls to the left to make room for a ‘post-trim’ knob, and added said post-trim knob.

  • Also note that you may only append control ports (not remove any or change the order), as since will break existing sessions (and can cause crashes when loading state).

Check. I added my trim parameter/port as the last one. GxAmp-mono had two unused ports (in and out for the right channel) that were commented out, i’m suspecting left over from copy/pasting from the stereo version. I reinstated them as dummy/placeholders so that the ID of my trim knob would be consistent across mono and stereo versions of the plugin, and also to avoid any future problems in case those are actually needed.

  • Have you incremented lv2:microVersion or lv2:minorVersion – liblilv always picks the latest version of a plugin, but if you have two plugins with same URI and same version it may be random. So perhaps system-wide and local plugins get mixed

Yes, i had incremented minorVersion in the .ttl file - i just incremented the microVersion, let’s see if this fixes the crash. To double check, i just need to change them at one place (the .ttl file) for each plugin and that’s it, correct?

but really you should change the URI of the plugin if you customize it.

What about if/when my mods make it into mainstream guitarix - will they have to change the URI just because there’s one extra control port? Wouldn’t that break existing sessions that use these plugins - not just in ardour but in any other host as well?

Only if that port is not at the end, after all other ports.

And yes, the general way for this is to make a new plugin, and leave the old one alone.

For LV2 that’s even trivial since you can use the same DSP and make it respond to two URIs, with different behavior depending on the URI. So old sessions get the old plugin without the new feature.

Ah, that would be the best solution indeed. Can you point me to documentation that shows more detail about this? Thanks again for your help!

I don’t know much about guitarix internals but I expect this to be very similar to how mono/stereo versions are handled. Same plugin source with some flags that, which result in different behavior during connect_port and run.

 static LV2_Handle
 instantiate(const LV2_Descriptor*     descriptor,
             double                    rate,
             const char*               bundle_path,
             const LV2_Feature* const* features)
{
    if (!strcmp (descriptor->URI, "http://guitarix.sourceforge.net/plugins/gx_amp#foo")) {
      // set some flag
    } else if (!strcmp (descriptor->URI, "http://guitarix.sourceforge.net/plugins/gx_amp#bar")) {
      // set some other flag
    } else {
     // invalid URI, or default
    }
...