Closed ricardomv closed 9 years ago
Does --vo=opengl:backend=x11
help?
yes it does. I had weston open and that had something to do with it. if i close weston it works without the backend option
So I guess trying to load the nvidia GLES drivers through EGL is what fails. EGL is currently only used by the wayland backend, so it works if you force X11. If you don't force a backend, wayland is tried first.
Well, not sure why the nvidia code seems to crash in X code. If this really is the wayland backend, X should not be involved, or the nvidia code somehow assumes X11.
Maybe you can compile mpv with debug infos, so we get a better backtrace?
i will try
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff17445d9 in XQueryExtension () from /usr/lib/libX11.so.6
(gdb) bt
#0 0x00007ffff17445d9 in XQueryExtension () from /usr/lib/libX11.so.6
#1 0x00007ffff1738392 in XInitExtension () from /usr/lib/libX11.so.6
#2 0x00007ffff2192d2f in XextAddDisplay () from /usr/lib/libXext.so.6
#3 0x00007fffe61d19c7 in ?? () from /usr/lib/libnvidia-glsi.so.337.25
#4 0x00007fffe6173e3c in _nv045glsi () from /usr/lib/libnvidia-glsi.so.337.25
#5 0x00007ffff067c7b8 in ?? () from /usr/lib/libEGL.so.1
#6 0x00007ffff0684682 in ?? () from /usr/lib/libEGL.so.1
#7 0x00000000004f56cf in egl_create_context (wl=0xda3cc0, ctx=0xda9070, enable_alpha=false) at ../video/out/gl_wayland.c:83
#8 0x00000000004f5992 in config_window_wayland (ctx=0xda9070, flags=16) at ../video/out/gl_wayland.c:158
#9 0x00000000004eb499 in mpgl_config_window (ctx=0xda9070, gl_caps=1073742857, flags=16) at ../video/out/gl_common.c:941
#10 0x00000000004f9fd8 in config_window (p=0xd86b10, flags=16) at ../video/out/vo_opengl.c:150
#11 0x00000000004faacf in preinit (vo=0xda0900) at ../video/out/vo_opengl.c:418
#12 0x00000000004f6d62 in vo_create (global=0x7cac20, input_ctx=0x816e30, osd=0x83bad0, encode_lavc_ctx=0x0, name=0x814f10 "opengl", args=0x0) at ../video/out/vo.c:188
#13 0x00000000004f6eaa in init_best_video_out (global=0x7cac20, input_ctx=0x816e30, osd=0x83bad0, encode_lavc_ctx=0x0) at ../video/out/vo.c:212
#14 0x0000000000494fe5 in reinit_video_chain (mpctx=0x7c8fb0) at ../player/video.c:189
#15 0x000000000048236b in play_current_file (mpctx=0x7c8fb0) at ../player/loadfile.c:1248
#16 0x0000000000482ed5 in mp_play_files (mpctx=0x7c8fb0) at ../player/loadfile.c:1456
#17 0x000000000048429d in mpv_main (argc=3, argv=0x7fffffffe9d8) at ../player/main.c:531
#18 0x0000000000516e5b in main (argc=3, argv=0x7fffffffe9d8) at ../player/main_fn.c:13
That confirms it. libEGL loads the nvidia GLES driver, which in turn does something with X. I'm not sure why the nvidia driver even crashes. Maybe it's because a wayland display is passed as X display to the nvidia driver. I'm not sure of the EGL API allows distinguishing between them. I feel like it should. So there's still a possibility that we somehow should declare the windowing system (wayland vs. X) at some point.
@giselher: do you know anything?
Sorry for the late response.
This should fix it, if you want to use it under wayland.
export EGL_PLATFORM=wayland
But I also have no idea why it crashes. This has to be on the driver side.
Wait. This is the proprietary nvidia driver and as far as I know it doesn't support wayland at all. How come you are running weston? Are you using the picman backend of weston?
I was using the x11 backend. The problem was that is was starting mpv outside weston with vo=openegl and that made mpv crash
Is your goal launching mpv in wayland or x11?
At the moment I can only guess what the problem is, but (from phoronix)
Support for the EGL API! EGL is needed for Mir and Wayland support. However, before getting too exciting, this EGL support right now is just for 32-bit platforms. Additionally, the EGL interface only works for OpenGL ES 1.1/2.0/3.0 and not OpenGL standard. The only window system back-end that the NVIDIA driver supports with EGL right now is X11. At least this is movement in the right direction for supporting Wayland and Mir.
I guess I have to implement some more checks to not crash mpv.
Any new info? I tagged it as not our bug since the Nvidia EGL driver doesn't even support wayland but still returns a non-null EGLDisploy from eglGetDisplay.
Sorry i can't test this anymore. I know Nvidia doesn't have support for wayland i just was not expecting mpv would crash if i had weston open
Is this a problem in nvidia implementation of opengl? Or is there something i need to install to get this working?