Kodi Community Forum

Full Version: Kodi 18.3 on Debian Testing only works within Wayland not Xorg because GL_VENDOR=null
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have been troubleshooting this problem for a while, but I can't seem to get kodi or kodi-standalone to work within Gnome-Xorg. It crashes with segfault after it fails to find a GL implementation in the log:

2019-08-31 16:15:01.596 T:139914794648000  NOTICE: GL_VENDOR = NULL
2019-08-31 16:15:01.596 T:139914794648000  NOTICE: GL_RENDERER = NULL
2019-08-31 16:15:01.596 T:139914794648000  NOTICE: GL_VERSION = NULL
2019-08-31 16:15:01.596 T:139914794648000  NOTICE: GL_SHADING_LANGUAGE_VERSION = NULL
Although glxinfo gives the proper driver i965GM on the same shell, somehow Kodi can't find it.

Under Wayland Gnome-shell DE, the output is:

2019-08-31 15:57:18.064 T:140496885096896  NOTICE: GL_VENDOR = VMware, Inc.
2019-08-31 15:57:18.064 T:140496885096896  NOTICE: GL_RENDERER = llvmpipe (LLVM 8.0, 128 bits)
2019-08-31 15:57:18.064 T:140496885096896  NOTICE: GL_VERSION = 3.1 Mesa 19.1.4

The reason I'm trying to do this is I want to start Kodi-standalone as a desktop replacement from the GDM login screen. Moving Kodi.desktop to /usr/share/wayland-sessions/ did not work. Otherwise it can only start in a window in Gnome which is not ideal.

System is:

# uname -a
Linux cenlap 4.19.0-5-amd64 #1 SMP Debian 4.19.37-6 (2019-07-18) x86_64 GNU/Linux

# lsb_release -a
No LSB modules are available.
Distributor ID:    Debian
Description:    Debian GNU/Linux bullseye/sid
Release:    testing
Codename:    bullseye

# lspci
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 03)

Output of glxinfo: ayadupiqor (paste)
Output of $ dpkg -l | grep 'libva\|va-driver\|mesa' : uhaqotowar (paste)
Full Kodi crash log (Gnome-xorg): cakalatate.kodi (paste)
Full Kodi success log (Wayland under Gnome): qibufuqaqu.kodi (paste)

Thanks in advance for any help or pointers.
Also here's the crash report showing the segfault location: ejevamilud.kodi (paste)
Kodi patched and packaged by debian is mostly unsupported and frowned upon here.
Debian mantainers patch Kodi in some funcky ways to comply with debian policies.

While this probably is  not related to your crash but it's just an example that tells alot about debian packaging:

2019-08-31 16:14:52.932 T:139914794648000 NOTICE: FFmpeg version/source: 4.2

This is unsupported, even Kodi master still uses a slightly patched ffmpeg 4.0.4 and bumping ffmpeg is a very sensible topic because Kodi heavily relies on ffmpeg api.

However your glxinfo clearly states that:
Code:
Extended renderer info (GLX_MESA_query_renderer): Vendor: VMware, Inc. (0xffffffff)
Device: llvmpipe (LLVM 8.0, 128 bits) (0xffffffff)
Version: 19.1.4 Accelerated: no
Video memory: 1984MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0

Your system currently lacks hardware accelerated opengl.
Check and fix your gfx stack (kernel/mesa) setup.

And it looks like your "gpu" is "slightly" outdated ...
Code:
Intel Corporation Mobile GM965/GL960
Thanks for the reply.
(2019-09-01, 02:11)asavah Wrote: [ -> ]Kodi patched and packaged by debian is mostly unsupported and frowned upon here.
Debian mantainers patch Kodi in some funcky ways to comply with debian policies.

Good to know. I'll try to build deb packages of Kodi 18.4 from the Ubuntu ppa. Or should I just download from source?
(2019-09-01, 02:11)asavah Wrote: [ -> ]While this probably is  not related to your crash but it's just an example that tells alot about debian packaging:

2019-08-31 16:14:52.932 T:139914794648000 NOTICE: FFmpeg version/source: 4.2

This is unsupported, even Kodi master still uses a slightly patched ffmpeg 4.0.4 and bumping ffmpeg is a very sensible topic because Kodi heavily relies on ffmpeg api.

This may explain the choppy playback on some mkv files. Although no other video player on the system is complaining about this.
(2019-09-01, 02:11)asavah Wrote: [ -> ]However your glxinfo clearly states that:
Code:
Extended renderer info (GLX_MESA_query_renderer): Vendor: VMware, Inc. (0xffffffff)
Device: llvmpipe (LLVM 8.0, 128 bits) (0xffffffff)
Version: 19.1.4 Accelerated: no
Video memory: 1984MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0

Your system currently lacks hardware accelerated opengl.
Check and fix your gfx stack (kernel/mesa) setup.

Again, everything else works fine. I cannot find any package that was missing or misconfigured. Xorg finds the kernel and mesa drivers on boot. DRM and DRI are properly initialized. What should I check for? The above was because some xorg-*-vmware package was pulled in as a dependency. Now that it's removed the output above lists the Intel driver, but Kodi's behavior doesn't change. Is Kodi supposed to segfault when no hardware acceleration found?
(2019-09-01, 02:11)asavah Wrote: [ -> ]And it looks like your "gpu" is "slightly" outdated ...
Code:
Intel Corporation Mobile GM965/GL960

 It's an old laptop used to drive a 720p TV and has been doing fine for other programs like MPlayer or streaming inside Kodi.

Can Kodi-standalone run directly on Wayland? I can try harder to get the wayland-xsession to work. Is there something that needs to be started before Kodi-standalone can run?
Yes, weston.
(2019-09-01, 21:59)fritsch Wrote: [ -> ]Yes, weston.
Thanks, that actually worked. I created my own kodi.desktop file:

Code:

[Desktop Entry]
Name=Kodi
Comment=This session will start Kodi media center in Wayland/Weston
Exec=/home/zzz/bin/weston-kodi
Type=Application

And the contents of weston-kodi is:

Code:

#!/bin/bash
weston &
sleep 5s
#.  /etc/profile.d/weston.sh # this doesn't work anymore, so set env manually
export WAYLAND_DISPLAY=wayland-0
export DISPLAY=:1
exec kodi-standalone >> /tmp/kodi-output # to see logs

Weston configuration required xwayland. I wonder if I could have skipped weston altogether and run Xwayland directly?

I'll post the issue to Debian upstream since it seems more appropriate.
if you use a wayland enabled kodi (kodi-wayland is the binary and package name on our ppa), then you do not need xwayland
(2019-09-04, 16:47)wsnipex Wrote: [ -> ]if you use a wayland enabled kodi (kodi-wayland is the binary and package name on our ppa), then you do not need xwayland
Ok, we just got the kodi-wayland executable into Debian-experimental and it seems to work without xwayland. However, weston is still needed. So does kodi have a kodi.desktop file for this purpose? I had to create my own as seen above.

Also, Chrome Launcher requires X, so I had to enable xwayland in the end.
(2019-09-07, 19:30)cengique Wrote: [ -> ]
(2019-09-04, 16:47)wsnipex Wrote: [ -> ]if you use a wayland enabled kodi (kodi-wayland is the binary and package name on our ppa), then you do not need xwayland
However, weston is still needed. 
Yes. Weston is a Wayland compositor. You need to a Wayland compositor to run Wayland applications.
(2019-09-07, 20:14)yasij Wrote: [ -> ]Yes. Weston is a Wayland compositor. You need to a Wayland compositor to run Wayland applications.
Yes, but I'm still using the above clunky script to start weston and then kodi by setting DISPLAY manually. Does Weston have a script like ~/.xinitrc to handle this automatically?

Also, going back to kodi-x11, it still segfaults on my system at a strlen call because it finds no GL drivers, even though I fixed the issue with glxinfo:
glxinfo output
kodi-x11 --debug crashlog

My Kodi is now updated to 18.4 and they have repackaged it on Debian Multimedia (unstable) to provide the kodi-x11 and kodi-wayland binaries separately.