[rpi 4 8gb] Can't start Kodi

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
MichaIng
Site Admin
Posts: 3514
Joined: Sat Nov 18, 2017 6:21 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by MichaIng »

@igor
On the 64-bit image, when you run the following from console (outside of a desktop session):

Code: Select all

kodi --standalone
It fails the same way, doesn't it?
igor
Posts: 7
Joined: Thu Oct 07, 2021 8:32 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by igor »

MichaIng wrote: Sun Oct 24, 2021 7:43 pm @igor
On the 64-bit image, when you run the following from console (outside of a desktop session):

Code: Select all

kodi --standalone
It fails the same way, doesn't it?
@MichaIng

I haven't tested it. I only have one card at the moment. I have been running DietPi v7.7.3 with the plex as a workaround.
When I tested it on the 64-bit image, either the startkodi command or autostart using Kodi worked.

Code: Select all

root@rpi:~# startkodi
failed to open zone.tab
error: XDG_RUNTIME_DIR not set in the environment.
libva info: VA-API version 1.10.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
terminate called after throwing an instance of 'std::runtime_error'
  what():  eglSwapBuffers failed
Aborted
Crash report available at /root/kodi_crashlog-20211024_142105.log
root@rpi:~# nano kodi_crashlog-20211024_142105.log
  GNU nano 5.4                                                                                          kodi_crashlog-20211024_142105.log
2021-10-24 14:21:04.778 T:21114   ERROR <general>: Couldn't load font name: font23_narrow(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.779 T:21114   ERROR <general>: Couldn't load font name: font25_narrow(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.780 T:21114   ERROR <general>: Couldn't load font name: font27(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.784 T:21114   ERROR <general>: Couldn't load font name: font27_narrow(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.785 T:21114   ERROR <general>: Couldn't load font name: font37(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.791 T:21114   ERROR <general>: Couldn't load font name: font45(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.798 T:21114   ERROR <general>: Couldn't load font name: font60(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.805 T:21114   ERROR <general>: Couldn't load font name: font_clock(roboto-thin.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.811 T:21114   ERROR <general>: Couldn't load font name: font_flag(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.814 T:21114   ERROR <general>: Couldn't load font name: font20_title(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.818 T:21114   ERROR <general>: Couldn't load font name: font25_title(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.818 T:21114   ERROR <general>: Couldn't load font name: font30_title(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.819 T:21114   ERROR <general>: Couldn't load font name: font32_title(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.824 T:21114   ERROR <general>: Couldn't load font name: font36_title(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.828 T:21114   ERROR <general>: Couldn't load font name: font45_title(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.829 T:21114   ERROR <general>: Couldn't load font name: font52_title(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.834 T:21114   ERROR <general>: Couldn't load font name: font_MainMenu(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.834 T:21114   ERROR <general>: Couldn't load font name: WeatherTemp(notosans-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.842 T:21114   ERROR <general>: Couldn't load font name: Mono26(notomono-regular.ttf), trying to substitute arial.ttf
2021-10-24 14:21:04.848 T:21114    INFO <general>:   load new skin...
2021-10-24 14:21:04.849 T:21114    INFO <general>: Loading custom window XMLs from skin path /usr/share/kodi/addons/skin.estuary/xml
2021-10-24 14:21:04.856 T:21114    INFO <general>:   initialize new skin...
2021-10-24 14:21:04.856 T:21114    INFO <general>: Loading skin file: Custom_1109_TopBarOverlay.xml, load type: LOAD_ON_GUI_INIT
2021-10-24 14:21:04.871 T:21114    INFO <general>: Loading skin file: DialogVolumeBar.xml, load type: LOAD_ON_GUI_INIT
2021-10-24 14:21:04.873 T:21114    INFO <general>: Loading skin file: DialogBusy.xml, load type: LOAD_ON_GUI_INIT
2021-10-24 14:21:04.874 T:21114    INFO <general>: Loading skin file: Pointer.xml, load type: LOAD_ON_GUI_INIT
2021-10-24 14:21:04.875 T:21114    INFO <general>: Loading skin file: DialogExtendedProgressBar.xml, load type: LOAD_ON_GUI_INIT
2021-10-24 14:21:04.877 T:21114    INFO <general>: Loading skin file: DialogSeekBar.xml, load type: LOAD_ON_GUI_INIT
2021-10-24 14:21:04.892 T:21114    INFO <general>: Loading skin file: DialogNotification.xml, load type: LOAD_ON_GUI_INIT
2021-10-24 14:21:04.893 T:21114    INFO <general>: Loading skin file: DialogBusy.xml, load type: LOAD_ON_GUI_INIT
2021-10-24 14:21:04.896 T:21114    INFO <general>: Loading resource://resource.uisounds.kodi/sounds.xml
2021-10-24 14:21:04.927 T:21114    INFO <general>:   skin loaded...
2021-10-24 14:21:04.928 T:21114    INFO <general>: Loading skin file: Startup.xml, load type: LOAD_EVERY_TIME
2021-10-24 14:21:04.928 T:21114    INFO <general>: Loading skin file: Home.xml, load type: KEEP_IN_MEMORY
2021-10-24 14:21:05.021 T:21114 WARNING <general>: JSONRPC: Could not parse type "Setting.Details.SettingList"
2021-10-24 14:21:05.021 T:21114    INFO <general>: JSONRPC: Adding type "Setting.Details.SettingList" to list of incomplete definitions (waiting for "Setting.Details.Setting")
2021-10-24 14:21:05.022 T:21114    INFO <general>: JSONRPC: Resolving incomplete types/methods referencing Setting.Details.Setting
2021-10-24 14:21:05.047 T:21114    INFO <general>: JSONRPC v12.3.0: Successfully initialized
2021-10-24 14:21:05.135 T:21114    INFO <general>: Register - new keyboard device registered on application->keyboard: Keyboard (0000:0000)
2021-10-24 14:21:05.135 T:21114    INFO <general>: Register - new mouse device registered on application->mouse: Mouse (0000:0000)
2021-10-24 14:21:05.136 T:21114    INFO <general>: Loading player core factory settings from special://xbmc/system/playercorefactory.xml.
2021-10-24 14:21:05.137 T:21114    INFO <general>: Loaded playercorefactory configuration
2021-10-24 14:21:05.139 T:21114    INFO <general>: Loading player core factory settings from special://masterprofile/playercorefactory.xml.
2021-10-24 14:21:05.139 T:21114    INFO <general>: special://masterprofile/playercorefactory.xml does not exist. Skipping.
2021-10-24 14:21:05.139 T:21114    INFO <general>: removing tempfiles
2021-10-24 14:21:05.142 T:21114    INFO <general>: initialize done
2021-10-24 14:21:05.142 T:21134    INFO <general>: initializing python engine.
2021-10-24 14:21:05.142 T:21114    INFO <general>: Running the application...
2021-10-24 14:21:05.150 T:21114    INFO <general>: starting zeroconf publishing
2021-10-24 14:21:05.150 T:21136    INFO <general>: ES: Starting UDP Event server on port 9777
2021-10-24 14:21:05.151 T:21136    INFO <general>: UDP: Listening on port 9777 (ipv6 : false)
2021-10-24 14:21:05.154 T:21114    INFO <general>: JSONRPC Server: Successfully initialized
2021-10-24 14:21:05.620 T:21114   ERROR <general>: eglSwapBuffers failed (EGL_BAD_ALLOC)


############### END LOG FILE ################

############ END Kodi CRASH LOG #############

User avatar
MichaIng
Site Admin
Posts: 3514
Joined: Sat Nov 18, 2017 6:21 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by MichaIng »

Jep when using startkodi on the 64-bit image, it starts Kodi via X server, where this is not an issue. I can however be started as well via GBM on Bullseye, which seems to cause the issue as well with Debian's Kodi build.
User avatar
MichaIng
Site Admin
Posts: 3514
Joined: Sat Nov 18, 2017 6:21 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by MichaIng »

Topic opened on Raspberry Pi forum: https://forums.raspberrypi.com/viewtopic.php?t=322517

Did we actually test whether only changing the HDMI port doesn't work either? I remember I was asking this already and that it didn't help, but cannot find the comment anymore.
igor
Posts: 7
Joined: Thu Oct 07, 2021 8:32 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by igor »

@MichaIng

Actually, I ran some updates and tested "startkodi" again and it worked. My rpi is online for 2 weeks and I haven't touched the HDMI ports/cables. Very odd. If it stops working again I will check the HDMI.

Update command executed:

Code: Select all

sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean -y && sudo apt autoclean -y
User avatar
MichaIng
Site Admin
Posts: 3514
Joined: Sat Nov 18, 2017 6:21 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by MichaIng »

Very interesting. Could you share the following info, please:

Code: Select all

dpkg -l | grep kodi
grep kms /boot/config.txt
And you ran startkodi from console outside of a desktop/X session or from a terminal emulator?
User avatar
MichaIng
Site Admin
Posts: 3514
Joined: Sat Nov 18, 2017 6:21 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by MichaIng »

Btw, about the libva errors, this seems to be quite expected on RPi, generally on SBCs an non-Intel chip devices: https://forums.raspberrypi.com/viewtopic.php?t=321033

Probably there is a build flag for Kodi to skip VAAPI support in the first place to have the error muted.

Now I wonder whether enabling the RPi camera drivers (V4L2) and related kernel modules has benefits for video decoding performance on RPi. Can be done in dietpi-config Display Options + reboot. It loads the "extended" firmware then: /boot/start_x.elf + additional kernel modules.
igor
Posts: 7
Joined: Thu Oct 07, 2021 8:32 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by igor »

Code: Select all

root@rpi:~# dpkg -l | grep kodi
ii  kodi                                                        3:19.1-dietpi3                                            armhf        Open Source Home Theatre (executable binaries)
root@rpi:~# grep kms /boot/config.txt
dtoverlay=vc4-kms-v3d-pi4
root@rpi:~# startkodi
error: XDG_RUNTIME_DIR not set in the environment.
libva info: VA-API version 1.10.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
I enabled the camera, but I am not quite sure how to test decoding performance.

BTW. I changed to use vc4-kms-v3d-pi4 instead of cc4-fkms-v3d. CEC only works for me on vc4-kms-v3d-pi4. I am not sure why.

Code: Select all

root@rpi:~# cec-client -l
libCEC version: 6.0.2, compiled on Linux-4.19.0-14-armmp-lpae ... , features: P8_USB, DRM, P8_detect, randr, Exynos, Linux, AOCEC
Found devices: 1

device:              1
com port:            Linux
vendor id:           0000
product id:          0000
firmware version:    0
type:                Linux
User avatar
MichaIng
Site Admin
Posts: 3514
Joined: Sat Nov 18, 2017 6:21 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by MichaIng »

With vc4-fkms-v3d, Kodi shows up as well on foreground screen? Not sure why CEC doesn't work with the fake KMS driver, I'd have expected that this has no influence. I'll do some research about that, and about other downsides and upsides of fake KMS (fkms) vs full KMS (kms). Probably we'll simply apply the full KMS driver by default, at least on RPi 4.
EDIT: The following posts verifies what you say: https://forums.raspberrypi.com/viewtopi ... 9#p1895449
Only left question whether this is true for RPi 4 only or for all RPi models.


Does also cec-utils -l detect the device only when the full KMS driver is enabled?
EDIT: It seems that by default it only works on HDMI0 port, but it can be adjusted via hdmi_preferred_port=1 in config.txt:
- https://github.com/raspberrypi/firmware/issues/1342
- https://github.com/Pulse-Eight/libcec/issues/538
Not sure whether this is related to KMS vs fKMS, but definitely good to know. We may add some HDMI port selector and a CEC setting to dietpi-config :?.


Basically hardware accelerated video decoding can be compared with and without RPi camera enabled, how smooth high resolution videos play and the CPU usage while doing so.
igor
Posts: 7
Joined: Thu Oct 07, 2021 8:32 pm

Re: [rpi 4 8gb] Can't start Kodi

Post by igor »

Both drivers work.

It looks like a combination of kernel and raspberry pi model. I was running Dietpi buster without this issue. No swapping cables or HDMI connectors. I did a clean install of Bullseye, and this issue came up.

(vc4-fkms-v3d) cec-utils -l returns autodetect: failed

(hdmi_preferred_port=1) It might help.

BTW. I manually installed cec-utils. I don't know if it made any difference.
Post Reply