Solved Kodi crashes on launch with Raspbian Buster (black screen, log attached)
#1
Hi everyone!

I encounter a weird crash on launch, and from the log it seems related to some graphical driver.
When launching Kodi, it remains stuck on a black screen with just the mouse pointer and the small white cursor. I then need to do a hard shutdown/reboot to regain control of my Pi (I guess there is a more "clean" way to do that, but I'm not aware of any. I'm willing to learn tho ). I found no easy fix (my system is fully updated/upgraded, I tried to remove .kodi home folder, and to reinstall Kodi from the APT GUI while autoremoving dependencies in between). Also Kodi used to work and I did not change a lot of things in the meantime (installing "iPlayer WWW" addon and changing folder of my library).

Getting around the web I found someone having the exact same issue recently, however without solution (they mention that it works sometimes when no file explorer or chromium running in the background, which doesn't work for me).

Here are my complete logs.
TL;DR I get several types of errors:
ERROR: CDRMUtils::InitDrm - failed to authorize drm magic: Permission denied
ERROR: CWinSystemGbm::InitWindowSystem - failed to initialize Atomic DRM
ERROR: eglSwapBuffers failed (EGL_BAD_ALLOC)

Does anyone have an idea?

For the records, I've also posted the issue on the RaspberryPi forum.
Reply
#2
Quote:ERROR: CDRMUtils::InitDrm - failed to authorize drm magic: Permission denied
ERROR: CWinSystemGbm::InitWindowSystem - failed to initialize Atomic DRM
ERROR: eglSwapBuffers failed (EGL_BAD_ALLOC)

Yeah, please investigate with your distribution. Kodi tries to become drm_master and fails, means something else is already running taking the display. You don't do stuff like running an XServer next to kodi do you?
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
(2020-02-23, 09:42)fritsch Wrote:
Quote:ERROR: CDRMUtils::InitDrm - failed to authorize drm magic: Permission denied
ERROR: CWinSystemGbm::InitWindowSystem - failed to initialize Atomic DRM
ERROR: eglSwapBuffers failed (EGL_BAD_ALLOC)

Yeah, please investigate with your distribution. Kodi tries to become drm_master and fails, means something else is already running taking the display. You don't do stuff like running an XServer next to kodi do you? 
It's quite close to a freshly installed desktop version of Raspbian: I've just added VLC, a VPN, and tweaked some keyboard shortcut. Apart from that nothing else is running from the startup.

The two things that come to my mind (but that would be weird): is that I tried to create another user from pi (without success for some functions I was looking for) and extended the wait during boot from 10s to 13s. I'll try to remove both of them.

Is there a command to run that would tell me what is taking the display?
Is it possible that the "thing" that takes it survives at each reboot?
Reply
#4
See: "Desktop" that's exactly the problem. Kodi on Rapsberry is not meant to run as a desktop but as an appliance.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#5
(2020-02-23, 10:22)fritsch Wrote: See: "Desktop" that's exactly the problem. Kodi on Rapsberry is not meant to run as a desktop but as an appliance.

What do you mean by appliance? How should I run it? And why did it successfully work before?
Reply
#6
Appliance: Not running from a desktop
For second: I have no idea what your distribution did to break it. Kodi's Leia is years old already, nothing fundamental is changed here -> check with your distribution for custom hacks and patches. Issue is still clear:

Quote:Thread 1 (Thread 0xb12e4c60 (LWP 1003)):
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0xb52b0230 in __GI_abort () at abort.c:79
#2  0xb545b8d8 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#3  0xb54595b0 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#4  0xb5459624 in std::terminate() () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#5  0xb5459990 in __cxa_throw () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#6  0x0068e7f4 in KODI::WINDOWING::GBM::CWinSystemGbmGLESContext::SetFullScreen(bool, RESOLUTION_INFO&, bool) ()

We cannot fix it for Raspbian.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#7
(2020-02-23, 14:09)fritsch Wrote: Appliance: Not running from a desktop
For second: I have no idea what your distribution did to break it. Kodi's Leia is years old already, nothing fundamental is changed here -> check with your distribution for custom hacks and patches. Issue is still clear:
Quote:Thread 1 (Thread 0xb12e4c60 (LWP 1003)):
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0xb52b0230 in __GI_abort () at abort.c:79
#2  0xb545b8d8 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#3  0xb54595b0 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#4  0xb5459624 in std::terminate() () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#5  0xb5459990 in __cxa_throw () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#6  0x0068e7f4 in KODI::WINDOWING::GBM::CWinSystemGbmGLESContext::SetFullScreen(bool, RESOLUTION_INFO&, bool) ()

We cannot fix it for Raspbian. 
I tried a fresh installed and re-did some of the change I made before, leading to the same issues. After a few trial and error, I found the root cause.

I post the result here if some unlucky guys do the same as I did:
I wanted to secure my Pi as described in Securing your Raspberry Pi, section "Make sudo require a password". This method manually edits the file /etc/sudoers.d/010_pi-nopasswd, which in the end doesn't break Kodi.
Bad luck from me, I found in the same time another method to edit the "sudo+app needs or doesn't need password" which uses "visudo" instead of manually editing the file. This method appeared safer to me as visudo checks the consistency of the file, so I used it. For whatever reason, this methods prevents Kodi from starting (but - apart from that - leads to the same result: sudo requires a password).

Problem solve then, thank you for the time you took looking at my issue Wink
Reply
#8
You should never run kodi as root user. If it's a permission issue to access the drm infrastructure, properly add your user to video group.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#9
Of course Wink
I run it only as regular user and I'm part of the video group (by default for the "pi" user).
Reply
#10
Thread marked solved.
Reply
#11
If you are running Raspbian on a Pi 4, the user that starts Kodi needs to be on the sudoers, which ia true for the default user "pi". That's because Kodi for the RPi 4 is compiled with GBM (which is a piece of sh*t by the away, reason why next) and that cannot be run on the same Virtual Terminal as the Desktop Environment, Xorg to be more precise. So Kodi startup script has a hack to change VT before Kodi is started, and another at exit to switch back to the previous VT. And to change Virtual terminals on Linux, by default you need to be root or on the sudoers. That are other solutions like the user which runs Kodi to be the owner of the chvt program, but that would break if there's an upgrage to package which contains chvt.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi crashes on launch with Raspbian Buster (black screen, log attached)0