NVIDIA / egl-wayland

The EGLStream-based Wayland external platform
MIT License
275 stars 44 forks source link

libnvidia-egl-wayland.so doesn't export wl_eglstream_controller_interface anymore #14

Closed pp3345 closed 5 years ago

pp3345 commented 5 years ago

I might be missing something, but it seems that after https://github.com/NVIDIA/egl-wayland/commit/1fdde29286b39cb89f8c8f8e8fcc9ddc4b9f361e, libnvidia-egl-wayland.so isn't exporting the wl_eglstream_controller_interface symbol anymore. mutter looks for this symbol in https://gitlab.gnome.org/GNOME/mutter/blob/master/src/wayland/meta-wayland-egl-stream.c#L91. Using a branch that has all commits up to https://github.com/NVIDIA/egl-wayland/commit/1676d1d2bfe646fb3ecbba29a85db529dd399493 but excluding the meson fixes (newer commits cherry-picked), things work fine.

This short program may be used for testing (use -ldl):

#include <dlfcn.h>
#include <stdio.h>

void main() {
    void *lib = dlopen("libnvidia-egl-wayland.so.1", RTLD_NOW);
    if(lib == NULL) {
        printf("lib not found\n");
        return;
    }

    void *if_ptr = dlsym(lib, "wl_eglstream_controller_interface");
    if(if_ptr == NULL) {
        printf("wl_eglstream_controller_interface not found\n");
        return;
    }

    printf("ok\n");
}
fafryd1125 commented 5 years ago

Please try https://github.com/NVIDIA/egl-wayland/pull/15.patch

evelikov commented 5 years ago

From my chat with the Wayland people, their recommendation is that applications should generate/use the the interface locally.

The code in xserver is doing this exact thing (search for wayland-eglstream-protocols).

Perhaps mutter should be fixed and the "fix" reverted?

mvicomoya commented 5 years ago

From my chat with the Wayland people, their recommendation is that applications should generate/use the the interface locally.

The code in xserver is doing this exact thing (search for wayland-eglstream-protocols).

Perhaps mutter should be fixed and the "fix" reverted?

Actually, wayland-eglstream interfaces should be private, while wayland-eglstream-controller ones should be public. I'll prepare a patch to fix that both with autotools and meson.

We didn't want to make mutter depend on libnvidia-egl-wayland.so, so we deliberately made it dlsym() the required interface. If not found, mutter just keeps going as usual.