szx Posted December 30, 2022 Share Posted December 30, 2022 Hello, Is there a guide / tutorial on making Kodi run with hardware acceleration enabled on Armbian on Orange PI PC Plus? e.g. like how LibreELEC does it. I have found a bunch of information on different sites and forums, but I can't put it all together. What I know so far: * Apparently the HW-accelerated decoding is supposed to be done on Kodi's side via VDPAU API * The Kodi build in Armbian repos does not have built-in support for libvdpau (?) * ffmpeg, the video decoding library used by Kodi, doesn't support Allwinner GPU out of the box and needs patching * Kodi needs to be re-compiled with the patched ffmpeg version 0 Quote Link to comment Share on other sites More sharing options...
jernej Posted January 2, 2023 Share Posted January 2, 2023 Your understanding is incorrect: 1. VDPAU was used only with vendor kernel, which is obsolete for a long time. Armbian uses only mainline kernel. 2. No need to worry due to 1) 3. GPU doesn't do anything for video decoding. That's desktop PC concept. Embedded SoCs have dedicated VPUs (video processing unit). But it's true that ffmpeg need patching. More specifically, it needs v4l2 request api support. 4. That's not necessary if ffmpeg libraries are patched and installed system wide. Last but not least, v4l2 request video decoding support is tested only in Kodi GBM mode. This means that it must be started from console, when no desktop environment is running. Maybe wayland mode would work, but I don't know. Certainly it won't work under X11. You have to use software decoding there. 0 Quote Link to comment Share on other sites More sharing options...
szx Posted February 15, 2023 Author Share Posted February 15, 2023 (edited) OK, thank you for the clarifications, jernej. I've managed to compile FFmpeg-Cedrus (https://github.com/stulluk/FFmpeg-Cedrus) with the 4.4 release version of FFmpeg (same as used by Kodi) and installed the shared libraries (libav*) system-wide to a location used by Kodi (/lib/arm-linux-gnueabihf/ on my Armbian system). But the thing is, Kodi still uses SW decoding for some reason. And it appears to be already running in GBM mode as you mentioned. I'm using the version from the team-xbmc PPA for Ubuntu. /usr/lib/arm-linux-gnueabihf/kodi/kodi.bin --standalone --windowing=gbm Video decoder: ff-h264 (SW) FFmpeg configure flags: --enable-shared \ --enable-nonfree \ --enable-gpl \ --enable-version3 \ --enable-vdpau \ --enable-libx264 \ --enable-libmp3lame \ --enable-libpulse \ --enable-libv4l2 \ --enable-openssl Any clues? On LibreELEC the info panel shows: Video decoder: ff-h264-drm_prime (HW) Linux kernel version: 6.1.7-sunxi Edited February 15, 2023 by szx 0 Quote Link to comment Share on other sites More sharing options...
szx Posted February 16, 2023 Author Share Posted February 16, 2023 (edited) Compiled ffmpeg from a different repo - https://github.com/jernejsk/FFmpeg - and copied the shared libs to /lib/arm-linux-gnueabihf (where Kodi appears to be looking for them according to ldd) but no luck. I'm not sure what I'm doing wrong at this point. Any ideas? Edited February 16, 2023 by szx 0 Quote Link to comment Share on other sites More sharing options...
szx Posted February 16, 2023 Author Share Posted February 16, 2023 (edited) FFmpeg says that it can use `drm` hwaccel method, so this is not caused by it. Found an interesting condition inside Kodi settings XML definitions: <setting id="videoplayer.useprimedecoder" type="boolean" label="13430" help="36172"> <requirement>HAS_GLES</requirement> <visible>false</visible> <level>2</level> <default>false</default> <control type="toggle" /> </setting> It looks like in order to be able to use DRM PRIME, Kodi must be compiled with GLES support. #ifdef HAS_GLES m_simpleConditions.insert("has_gles"); #endif However, the version of Kodi from the official XBMC PPA was not. So basically, yes, Kodi must be recopiled to get HW acceleration to work. Update: Actually, it turns out that Team Kodi don't provide ARM builds in the PPA, all this time I was using the Debian build (lol). Edited February 16, 2023 by szx 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.