Jump to content

[GUIDE] Kodi on Orange Pi 5 with GPU Hardware Acceleration and HDMI Audio


Recommended Posts

Posted

@vandyman , were you able to resolve this? What was the workaround?
 

I can not get the kodi add-ons to work. 

Even the default add-ons that come with Kodi are missing. 

 

If I try to add an addon manually, kodi will reject the addon. 

 

 

Posted

AI. D

You need to add the common Kodi repository from the linux software/app store first. 

I forget what the default app store is for  Linux Armbian. (Snap, Flatpak, etc..) 

Posted

@Al.DYou could search these things with for example "apt search Kodi repo"

Then: sudo apt install .....

 

For Kodi Matrix you would need to compile one with gles2 support, on the GitHub of Kodi you could find instructions.

 

 

Posted (edited)

Hello,

 

I am attempting to compile version 20 of Kodi with the following command. 

 

cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=wayland -DAPP_RENDER_SYSTEM=gles -DENABLE_INTERNAL_FFMPEG=OFF -DWITH_FFMPEG=/usr/bin/ffmpeg -DENABLE_VAAPI=OFF -DENABLE_VDPAU=OFF -DENABLE_INTERNAL_FMT=ON -DENABLE_INTERNAL_FLATBUFFERS=ON -DENABLE_ALSA=ON -DENABLE_DBUS=ON -DENABLE_EVENTCLIENTS=ON -DENABLE_MICROHTTPD=ON -DENABLE_MYSQLCLIENT=ON -DENABLE_PULSEAUDIO=ON -DENABLE_SMBCLIENT=ON -DENABLE_UDEV=ON -DENABLE_XSLT=ON -DENABLE_EGL=ON -DENABLE_OPENGL=ON -DENABLE_DBUS=ON

 

I have the rkmpp version of ffmpeg install, which I am making sure to specify as part of the Kodi build process. 

 

/usr/bin/ffmpeg -version
ffmpeg version 4.4.2-0ubuntu0.22.04.1+rkmpp20230327 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1+rkmpp20230327 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdrm --enable-rkmpp --enable-version3 --disable-libopenh264 --disable-vaapi --disable-vdpau --disable-decoder=h264_v4l2m2m --disable-decoder=vp8_v4l2m2m --disable-decoder=mpeg2_v4l2m2m --disable-decoder=mpeg4_v4l2m2m --enable-shared
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100

 

When I attempt to play a file in Kodi, I get audio passthrough just fine, but the screen either goes black or stays on the library and plays until I hit escape, after which it goes black.  The logs are full of this message:

 

error <general>: ffmpeg[0x556f9ecb60]: [h264_rkmpp] Failed to send packet to decoder (code = -11)

 

I am planning to start from scratch, but any help would be approciated. 

 

Edited by hammsandwich21
removing log, it was incorrect.
Posted

@hammsandwich21 I would try without "-DWITH_FFMPEG=/usr/bin/ffmpeg -DENABLE_OPENGL=ON"  

 

HDR movies do only play on GBM (with the right settings in Kodi) so you might want to enable that one too. Although with the Mali blob driver I was able to play HDR on Wayland as SDR. 

 

ffmpeg: --enable-omx ???

Posted (edited)

@hammsandwich21 This one should build fine, I had Kodi build from the master repository of 4-11-23, had to edit one or a few things (not sure). In a few minutes I will add that link in this post.

 

FFmpeg 6

https://mega.nz/file/K5oESSoa#bbuzHfFCqqNYdbl8b2aZ32SAb3S89pTU3ZBQRYjJZbE

 

How I build it:

configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1+rkmpp20300327 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-opencl --enable-opengl --enable-sdl2 --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdrm --enable-rkmpp --enable-version3 --disable-libopenh264 --disable-vdpau --enable-shared --enable-version3 --disable-doc --enable-libaribb24 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient

 

 

Kodi 21a:

https://mega.nz/file/q4gFULjT#AgD0S-H0UCkoQKMAj0nV0W6ULWYNuBpSH3m9TJra87s

 

Not sure which options I chose but you could find them in the cmakecache

CMakeCache.txt

Edited by royk
Posted

@royk I was able to compile ffmpeg and kodi with the sources you uploaded.  Are you able to track what you changed in the sources so we can reproduce in updated versions as newer (patched) versions of ffmpeg and kodi are released?  I will be testing kodi shortly.   Thank you so much for your help.

Posted

After a full system rebuild, I was able to compile the ffmpeg 6.0 branch from source without issue, and Kodi also compiled just file from latest master.  

 

@royk - how do you tell Kodi to use the Mali blob driver so it can change HDR to SDR and still play?

Posted

Anyone know what can be changed in Batocera that comes with built-in Kodi to fix X265 & HDR playback on OrangePi 5B?

Would be great if someone could test it.

https://github.com/batocera-linux/batocera.linux/pull/9038/files

https://github.com/batocera-linux/batocera.linux/tree/master/package/batocera/kodi/kodi20

 

@hammsandwich21

Does the Kodi commit also need to be reverted here?

Need to switch to the latest mpp and ffmpeg https://github.com/hbiyik/FFmpeg?

Posted

@mo123 Perhaps using a newer version of MPP, as far as I can see Batocera uses a version from March. 

That Kodi commit is reverted eventually. Lately I had compiled Kodi with that FFmpeg version and somehow HDR didn't work. I didn't look further into it.

With FFmpeg from JeffyCN, latest version of Kodi and MPP, recent Armbian kernel, HDR does work here. AFAIK the rk3588 doesn't support HDR10+ and Dolby Vision. The ones I've tested are regular HDR and HLG.

Posted

Hi,
I followed the guide from this post, but I have one issue: as soon as I set the render method to direct to plane the video player UI disappears (play, pause, seek, etc.). The video plays fine, but I cannot exit or do anything else than play/pause by clicking the spacebar.

Switching to EGL solves the issue, but then HDR files won't play anymore (just black screen + audio).

 

Does anyone else have the same issue or a solution to the problem.

Thanks

Posted

@bottlelid Yes I do also have that problem from the moment I upgraded to the latest kernel. The video is in front of everything (until you press "X" or stop on the remote control). Another strange thing I found is that when the display is at 59.9hz instead of 60hz I've got no audio over HDMi, this was never a problem before.

But again I didn't have time yet to look at what could be the cause of these things.

Posted

Hello, 

 

since @amazingfate updated Kodi to 20.2 i can not use my PVR-Plugin (kodi-pvr-hts) and inputstream.adaptive anymore. I tried a few things with adding the official kodi ppa (ppa:team-xbmc/ppa) to install newer versions of those plugins. But the normal install commands only show  up withe the versions of the official ubuntu/armbian repository and thos won't work. 

 

Since im quite new to linux and armbian i searchd and found something about apt policy and pinnig of packages / ppa's but none of those things i got to work.  With apt policy the versions for jammy from the kodi ppa a doesn't show up. so at the moment im quite lost...

 

Has someone a little hint for me how to go on?

Posted
16 hours ago, numetaler said:

and inputstream.adaptive anymore.

You can't use the official Kodi ppa version of Kodi.  It doesn't include k35xx acceleration or a working widevine cdm for arm64.

Assuming that you are using amazingfate's ppa for Kodi and haven't updated Kodi from the Kodi official ppa, then updating or installing the inputstream.adaptive plugin from that ppa or from any Kodi repository will prompt you to update widevine. cdm,  The widevine cdm update that is installed doesn't currently work with arm64 Linux.  So most likely you have the wrong libwidevinecdm.so installed.  At the bottom of my notes below, you can follow how to manually copy the right one, assuming that you have it installed in amazingfate's Chromium.

If you have the wrong Kodi installed then remove it and remove the official ppa.

If my notes are correct these are the steps to get Chromium widevine cdm and Kodi installed (use at your own risk):

sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa

sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia

sudo apt update

sudo apt full-upgrade

sudo apt install libwidevinecdm

I might specifically have installed or reinstalled Chromium, but I don't have it in my notes.  It may have done it automatically with the upgrade.

Some DRM streamers check the Chromium user agent on arm64 and won't work unless they find a ChromeOs user agent.
Create a launcher for DRM-Chromium with the correct user agent for widevine (or just launch it like this from the command line):
chromium-browser --user-agent="Mozilla/5.0 (X11; CrOS aarch64 15236.80.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.125 Safari/537.36"

 

Check widevine DRM works in Chromium with
https://bitmovin.com/demos/drm


sudo apt install ubuntu-desktop kodi


Start Kodi and install your plugins.
Try to run one DRM video and when it errors, do an apt install for inputstream.adaptive as recommended by the error message.
Install widevine cdm as prompted.  This will create the directory structure for widevine and install the non-working version.

Copy libwidevinecdm.so from /lib/chromium-browser/WidevineCdm/_platform_specific/linux_arm64/ to /home/{username}/.kodi/cdm/

Restart Kodi.

If this doesn't work perhaps follow the thread where I had a similar issue:


A useful resource that explains the issues.
https://www.da.vidbuchanan.co.uk/blog/netflix-on-asahi.html

 

Posted

Hi,

 

in my case I've the following error:

The following packages have unmet dependencies:

kodi-inputstream-adaptive : Depends: kodi-api-inputstream (< 3.1.0)

 

I tried to reinstall kodi-api-inputstream:

"

sudo apt-get install --reinstall kodi-api-inputstream

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

Note, selecting 'kodi' instead of 'kodi-api-inputstream'

0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.

Need to get 38.4 kB of archives.

After this operation, 0 B of additional disk space will be used.

Get:1 https://ppa.launchpadcontent.net/liujianfeng1994/rockchip-multimedia/ubuntu jammy/main arm64 kodi arm64 2:20.2+dfsg-4+gles [38.4 kB]

Fetched 38.4 kB in 0s (120 kB/s)

(Reading database ... 163812 files and directories currently installed.)

Preparing to unpack .../kodi_2%3a20.2+dfsg-4+gles_arm64.deb ...

Unpacking kodi (2:20.2+dfsg-4+gles) over (2:20.2+dfsg-4+gles) ...

Setting up kodi (2:20.2+dfsg-4+gles) ...

Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...

Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...

Processing triggers for man-db (2.10.2-1) ...

Processing triggers for mailcap (3.70+nmu1ubuntu1) ...

"

 

 

Any idea on how to solve it?

 

Distribution: Armbian 23.02.2 Jammy

 

Thanks!

Posted

@Dbosco I had the same issue. To solve it I manually built the Inputstream adaptive and Tvheadend add-ons for Kodi Nexus.

I did only test Youtube, which afaik doesn't have DRM protection. So maybe there are additional steps needed to get DRM protected content working.

 

These should be the commands to compile both add-ons

sudo apt install git cmake gcc g++

cd ~
mkdir compile-addons
cd compile-addons

#Download Kodi, needed to compile add-ons
git clone --branch 20.2-Nexus https://github.com/xbmc/xbmc.git

#Inputstream adaptive
git clone --branch Nexus https://github.com/xbmc/inputstream.adaptive.git
mkdir inputstream.adaptive/build/
cd inputstream.adaptive/build/
cmake -DADDONS_TO_BUILD=inputstream.adaptive -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
make
cd ../../xbmc/addons
zip -r inputstream.adaptive.zip inputstream.adaptive
mv inputstream.adaptive.zip ~

#Tvheadend
cd ~/compile-addons
git clone --branch Nexus https://github.com/kodi-pvr/pvr.hts.git
cd pvr.hts && mkdir build && cd build
cmake -DADDONS_TO_BUILD=pvr.hts -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
make
cd ../../xbmc/addons
zip -r pvr.hts.zip pvr.hts
mv pvr.hts.zip ~

 

Afterwards you have two zip files in your home directory, which you can then install via the Kodi add-on manager.

Posted
[mention=206239]Dbosco[/mention] I had the same issue. To solve it I manually built the Inputstream adaptive and Tvheadend add-ons for Kodi Nexus.
I did only test Youtube, which afaik doesn't have DRM protection. So maybe there are additional steps needed to get DRM protected content working.
 
These should be the commands to compile both add-ons
sudo apt install git cmake gcc g++cd ~mkdir compile-addonscd compile-addons#Download Kodi, needed to compile add-onsgit clone --branch 20.2-Nexus https://github.com/xbmc/xbmc.git#Inputstream adaptivegit clone --branch Nexus https://github.com/xbmc/inputstream.adaptive.gitmkdir inputstream.adaptive/build/cd inputstream.adaptive/build/cmake -DADDONS_TO_BUILD=inputstream.adaptive -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addonsmakecd ../../xbmc/addonszip -r inputstream.adaptive.zip inputstream.adaptivemv inputstream.adaptive.zip ~#Tvheadendcd ~/compile-addonsgit clone --branch Nexus https://github.com/kodi-pvr/pvr.hts.gitcd pvr.hts && mkdir build && cd buildcmake -DADDONS_TO_BUILD=pvr.hts -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addonsmakecd ../../xbmc/addonszip -r pvr.hts.zip pvr.htsmv pvr.hts.zip ~

 
Afterwards you have two zip files in your home directory, which you can then install via the Kodi add-on manager.


Thanks! Will try it and let you know


Enviado desde mi iPhone utilizando Tapatalk
Posted (edited)

Hello,

 

Verry happy about your answers. I have removed the official kodi ppa and checked that i have installed the kodi version from @amazingfate. i Also had installed the chromium version from him including working libwidevinecdm. 

 

@schwar3katI go on with the steps you gave me to put widevine in the right place.

 

Regarding the addons i think the right way is to build them like @bottlelid did and install them as zip-file.

 

Many Thanks for the Hints and guide's!

Edited by numetaler
Posted

Hello,

 

I sucessfully built both addons and my Addon wich needs inputstrem.adaptive  works flawlessly. didn't have to copy widvine from chromium since the addon detectec aarch64 and downloaded the right cdm.

 

Thank you for your Help!

 

SInce i want to go on with using Armbian/Linux in general i want to learn how  or where do i get all the knowledge to build stuff from source (In this case these addons) yourself. I mean, i already  have been thinkin'

about building these addons myself but i never  had a clue wich options or whatever stuff i ned to tell cmake (e.g. -DADDONS_TO_BUILD=inputstream.adaptive -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons).

 

From where do i get such infos? is this writen in readmefiles of the source code? Maybe @bottlelid can tell me a little more?

 

Thanks!

Alex

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines