After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791717 - lv2: GStreamer cache is not updated properly
lv2: GStreamer cache is not updated properly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.12.4
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-18 03:35 UTC by Wellington Wallace
Modified: 2017-12-22 15:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
lv2: Recursively monitor the lv2 plugin path (1002 bytes, patch)
2017-12-18 17:37 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
lv2: Try and reflect better lilv default path (1.92 KB, patch)
2017-12-18 19:50 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Wellington Wallace 2017-12-18 03:35:02 UTC
The output of gst-inspect-1.0 does not show Calf Studio LV2 plugins when they are installed after Gstreamer cache initialization(~/.cache/gstreamer-1.0). If we remove this folder in order to force the cache to be rebuilt then everything works fine and LV2 plugins are shown as expected.
Comment 1 Nicolas Dufresne (ndufresne) 2017-12-18 12:25:23 UTC
It should not be required.
Comment 2 Wellington Wallace 2017-12-18 13:05:50 UTC
Thank you for your feedback. I was not sure if this was indeed a bug or the expected behavior. I had to do this in my machines and the users of my application too as you can see in these issues:

https://github.com/wwmm/pulseeffects/issues/142
https://github.com/wwmm/pulseeffects/issues/136

Is there any more info I should provide?
Comment 3 Nicolas Dufresne (ndufresne) 2017-12-18 14:18:58 UTC
I don't think any extra information will be needed, we need someone to look at it now and reproduce.

How it works is that GST lv2 plugin should register each lv2 plugins and plugins directory. These will be added into the registry cache and looked up for update. The only downside is that you need not to reset back file timestamp in your package manager. So far this only happens with ostree/atomic. I don't think it's you case. Mostly newly added files need to be newer then the cache.

I have fixed this in frei0r a while ago, we need to look into lv2 to find out what it does and why it does not work. Then we should check ladspa, as lv2 is based on it.
Comment 4 Nicolas Dufresne (ndufresne) 2017-12-18 16:33:51 UTC
Did a quick try, which seems like needed, but it does not seem to fully fix the issues:

> diff --git a/ext/lv2/gstlv2.c b/ext/lv2/gstlv2.c
> index 2c8253dc8..181f3ca5f 100644
> --- a/ext/lv2/gstlv2.c
> +++ b/ext/lv2/gstlv2.c
> @@ -255,7 +255,8 @@ plugin_init (GstPlugin * plugin)
>    side_right_role = lilv_new_uri (world, LV2_PORT_GROUPS__sideRight);
>  
>    gst_plugin_add_dependency_simple (plugin,
> -      "LV2_PATH", GST_LV2_DEFAULT_PATH, NULL, > GST_PLUGIN_DEPENDENCY_FLAG_NONE);
> +      "LV2_PATH", GST_LV2_DEFAULT_PATH, NULL,
> +      GST_PLUGIN_DEPENDENCY_FLAG_RECURSE);
>  
>    /* ensure GstAudioChannelPosition type is registered */
>    if (!gst_audio_channel_position_get_type ())


I've removed a plugin, and then the plugin didn't go away and inspecting that plugin caused a crash. But I confirm it's totally buggy.
Comment 5 Nicolas Dufresne (ndufresne) 2017-12-18 16:49:39 UTC
So lilv also implement a cache, can clearly removing a plugin folder didn't trigger that cache to be updated. So yet, gst need some help, but apparently lilv cache is not better.
Comment 6 Nicolas Dufresne (ndufresne) 2017-12-18 17:08:11 UTC
Correction, my patch work, it's the path that is broken. Instead of reading the libdir from the lilv2 pkconfig, it gets the meson configure time libdir. That's fails for my case because I installed git master gstreamer in a prefix, while lilv has libdir=/usr/lib64/lv2 which is not included in the path.
Comment 7 Nicolas Dufresne (ndufresne) 2017-12-18 17:36:23 UTC
Ok, here's what we need to reproduce (Heiku OS excluded):

    # Set default LV2 path
    lv2_path = Options.options.default_lv2_path
    if lv2_path == '':
        if conf.env.DEST_OS == 'darwin':
            lv2_path = lilv_path_sep.join(['~/Library/Audio/Plug-Ins/LV2',
                                           '~/.lv2',
                                           '/usr/local/lib/lv2',
                                           '/usr/lib/lv2',
                                           '/Library/Audio/Plug-Ins/LV2'])
        elif conf.env.DEST_OS == 'haiku':
            lv2_path = lilv_path_sep.join(['~/.lv2',
                                           '/boot/common/add-ons/lv2'])
        elif conf.env.DEST_OS == 'win32':
            lv2_path = lilv_path_sep.join(['%APPDATA%\\\\LV2',
                                           '%COMMONPROGRAMFILES%\\\\LV2'])
        else:
            libdirname = os.path.basename(conf.env.LIBDIR)
            lv2_path = lilv_path_sep.join(['~/.lv2',
                                           '/usr/%s/lv2' % libdirname,
                                           '/usr/local/%s/lv2' % libdirname])

That explain why you cannot install both 32bit and 64bit plugin on Debian, they use two folders lib/arch, which is not supported by lilv build system. On our side, we hardcode /usr/lib, it should check the pkgconfig libdir basename instead. And then we are missing the .lv2 folder in user home directory. Finally, we just don't support Windows and OSX at all. While at it we should fix it properly.
Comment 8 Nicolas Dufresne (ndufresne) 2017-12-18 17:37:13 UTC
Created attachment 365713 [details] [review]
lv2: Recursively monitor the lv2 plugin path

Otherwise we might not update the cache when needed.
Comment 9 Nicolas Dufresne (ndufresne) 2017-12-18 19:50:56 UTC
Created attachment 365724 [details] [review]
lv2: Try and reflect better lilv default path

While keeping it simple, this patch tries and mimic lilv default path.
It does not matter if some path are duplicated due to symlink because in
the end it's lilv that will walk these paths. The worst case is that we
update our cache more often then strictly needed.
Comment 10 Nicolas Dufresne (ndufresne) 2017-12-18 19:51:22 UTC
Attachment 365713 [details] pushed as 8c850b3 - lv2: Recursively monitor the lv2 plugin path
Attachment 365724 [details] pushed as fbd9a62 - lv2: Try and reflect better lilv default path
Comment 11 Nicolas Dufresne (ndufresne) 2017-12-18 19:52:20 UTC
If needed (and if no issues are found) we can backport this to 1.12. Thanks for reporting.
Comment 12 Wellington Wallace 2017-12-18 21:37:43 UTC
Considering the time non rolling release distributions take to do major updates to GStreamer it would be good to have this backported to 1.12 if possible.

Thank you for the fix.
Comment 13 Nicolas Dufresne (ndufresne) 2017-12-18 21:58:38 UTC
Noted, let's make sure it's all stable for everyone though, I'll come back in a week or so.