dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Kodi on Bullseye RPiOS

Mon Nov 08, 2021 6:59 pm

Kodi 19.4 is now available from apt in RPiOS bullseye. That brings support for HDR (if supported by display) and deinterlace.

Install with

Code: Select all

sudo apt update
# recommended to upgrade other packages like ffmpeg and kernel
sudo apt full-upgrade
sudo apt install kodi
You can also install addons. E.g.

Code: Select all

sudo apt install kodi-screensaver-shadertoy kodi-pvr-hts
When you next launch kodi you will be prompted to enable the newly installed addons.

Launch with "kodi" (or use start menu). It will switch away from desktop if it is running.

This has hevc and h264 acceleration on pi4, and h264/mpeg4/mpeg2/vc1 (licence permitting) on Pi2/3. Not recommended on Pi0/1.
It is using the system ffmpeg (previously we used an embedded version).

On Pi4 to use hevc hardware decoder add to config.txt:

Code: Select all

dtoverlay=rpivid-v4l2
and if you want to play 4k hevc, then increase the cma allocation. e.g. edit kms line to:

Code: Select all

dtoverlay=vc4-kms-v3d,cma-512
If you want to output 4kp60 then add:

Code: Select all

hdmi_enable_4kp60=1
Don't increase gpu_mem above the default. This build will not use it, and it will be wasted.

You are strongly recommended to set gui hdmi mode to 1080p60 and use whitelist to enable 4k modes (see here).

Launching kodi from the desktop (especially when using mutter with 4K display) will leave significant cma memory allocated. You may need to increase cma allocation further, or change RpiOS to boot to console if you are seeing "cma: cma_alloc: alloc failed" in dmesg.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Mon Nov 08, 2021 7:01 pm

Here are instructions if you want to build your own kodi. If you just want to run kodi, then install from apt as described in previous post.

Note: this is version two of instructions. I've switched to using a form of rascas' build script which includes building addons and his updates to launcher script.

Building kodi from source isn't too hard on bullseye. It should work on 32-bit or 64-bit OS.
If building on 32-bit OS with 64-bit kernel then prepend the two build_rpi_debian_packages commands with "setarch armv7l " to avoid ffmpeg choosing the wrong target.
This should have hardware acceleration for hevc and h264.

This build is now available in the main raspberry pi repo. It installed and worked well for me on a clean bullseye image.

Note, if building on 64-bit bullseye, the directory build_armhf will become build_arm64.

Get required packages:

Code: Select all

sudo apt install -y autoconf automake autopoint gettext autotools-dev cmake curl gawk g++ libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libcdio++-dev libcec-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev libegl1-mesa-dev libenca-dev libflac-dev libfontconfig-dev libfmt-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libglu-dev libgnutls28-dev libgpg-error-dev libgtest-dev libiso9660-dev libjpeg-dev liblcms2-dev liblirc-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmariadb-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libsmbclient-dev libspdlog-dev libsqlite3-dev libssl-dev libtag1-dev libtiff-dev libtinyxml-dev libtool libudev-dev lsb-release meson nasm ninja-build python3-dev python3-pil rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev libgbm-dev libdrm-dev libinput-dev libxkbcommon-dev default-jdk libunistring-dev libflatbuffers-dev libdav1d-dev libavutil-dev libavformat-dev libavfilter-dev libavcodec-dev libswscale-dev libpostproc-dev libiso9660++-dev libxslt-dev libshairplay-dev libaacs-dev libcap-dev libpulse-dev default-libmysqlclient-dev libdvdread-dev debhelper libglm-dev libarchive-dev liblz4-dev libssh-dev libmodplug-dev libopenmpt-dev libwavpack-dev libsidplay2-dev libsidutils-dev libresid-builder-dev libmp3lame-dev libde265-dev libheif-dev libraw-dev libturbojpeg0-dev libz3-dev librtmp-dev libjsoncpp-dev libtinyxml2-dev nlohmann-json3-dev libhdhomerun-dev libpugixml-dev
Clone popcornmix bullseye kodi gbm matrix repo

Code: Select all

git clone -b gbm_matrix https://github.com/popcornmix/xbmc.git kodi_gbm
Build kodi:

Code: Select all

cd kodi_gbm
./build_rpi_debian_packages.sh
and install kodi with:

Code: Select all

cd build_armhf/packages/ && sudo dpkg -i kodi-bin_19*.deb kodi_19.*.deb kodi-addon-dev*.deb kodi-tools-texturepacker*.deb && cd -
Now build the addons you are interested in. You can see the complete list here

Code: Select all

ADDONS_TO_BUILD="inputstream.adaptive pvr.hts screensaver.shadertoy visualization.shadertoy" \
./build_rpi_debian_packages.sh -a
and install the addons:

Code: Select all

sudo dpkg -i build_armhf/addons_build/*.deb
Note you can pass "all" to ADDONS_TO_BUILD but it's not recommended to install everything.
Each addon installed as a deb will cause a "Do you want to enable <addon>" when you launch kodi, and you should only install a single pvr addons.

twilightened
Posts: 151
Joined: Fri Sep 03, 2021 12:31 am

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 12:06 am

I am getting an error after the cmake build command. Here is the log file:
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_67a7d/fast && /usr/bin/gmake -f CMakeFiles/cmTC_67a7d.dir/build.make CMakeFiles/cmTC_67a7d.dir/build
gmake[1]: Entering directory '/home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_67a7d.dir/src.c.o
/usr/bin/cc -Wall -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_67a7d.dir/src.c.o -c /home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_67a7d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_67a7d.dir/link.txt --verbose=1
/usr/bin/cc -Wall -DCMAKE_HAVE_LIBC_PTHREAD -fuse-ld=gold CMakeFiles/cmTC_67a7d.dir/src.c.o -o cmTC_67a7d
CMakeFiles/cmTC_67a7d.dir/src.c.o:src.c:function main: error: undefined reference to 'pthread_create'
CMakeFiles/cmTC_67a7d.dir/src.c.o:src.c:function main: error: undefined reference to 'pthread_detach'
CMakeFiles/cmTC_67a7d.dir/src.c.o:src.c:function main: error: undefined reference to 'pthread_cancel'
CMakeFiles/cmTC_67a7d.dir/src.c.o:src.c:function main: error: undefined reference to 'pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_67a7d.dir/build.make:106: cmTC_67a7d] Error 1
gmake[1]: Leaving directory '/home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_67a7d/fast] Error 2


Source file was:
#include <pthread.h>

void* test_func(void* data)
{
return data;
}

int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);

return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_3e04c/fast && /usr/bin/gmake -f CMakeFiles/cmTC_3e04c.dir/build.make CMakeFiles/cmTC_3e04c.dir/build
gmake[1]: Entering directory '/home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3e04c.dir/CheckFunctionExists.c.o
/usr/bin/cc -Wall -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_3e04c.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.18/Modules/CheckFunctionExists.c
Linking C executable cmTC_3e04c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3e04c.dir/link.txt --verbose=1
/usr/bin/cc -Wall -DCHECK_FUNCTION_EXISTS=pthread_create -fuse-ld=gold CMakeFiles/cmTC_3e04c.dir/CheckFunctionExists.c.o -o cmTC_3e04c -lpthreads
/usr/bin/ld.gold: error: cannot find -lpthreads
CMakeFiles/cmTC_3e04c.dir/CheckFunctionExists.c.o:CheckFunctionExists.c:function main: error: undefined reference to 'pthread_create'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_3e04c.dir/build.make:106: cmTC_3e04c] Error 1
gmake[1]: Leaving directory '/home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_3e04c/fast] Error 2



Performing C++ SOURCE FILE Test NFS_MOUNT_GETEXPORTS_TIMEOUT failed with the following output:
Change Dir: /home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_b13e6/fast && /usr/bin/gmake -f CMakeFiles/cmTC_b13e6.dir/build.make CMakeFiles/cmTC_b13e6.dir/build
gmake[1]: Entering directory '/home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_b13e6.dir/src.cxx.o
/usr/bin/c++ -Wall -DNFS_MOUNT_GETEXPORTS_TIMEOUT -o CMakeFiles/cmTC_b13e6.dir/src.cxx.o -c /home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp/src.cxx
/home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp/src.cxx: In function ‘int main()’:
/home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp/src.cxx:6:8: error: ‘mount_getexports_timeout’ was not declared in this scope; did you mean ‘mount_getexports_async’?
6 | mount_getexports_timeout(NULL, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| mount_getexports_async
gmake[1]: *** [CMakeFiles/cmTC_b13e6.dir/build.make:85: CMakeFiles/cmTC_b13e6.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/home/pi/kodi_gbm_build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_b13e6/fast] Error 2


Source file was:


#include <nfsc/libnfs.h>
int main()
{
mount_getexports_timeout(NULL, 0);
}

LTolledo
Posts: 6658
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 9:45 am

nah....I'll wait when its ready....and polished clean...
there is no rush (for me) to go to bullseye..... until all the dust has settled ;)
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 12:33 pm

You actually need the console output to see what (if anything) failed. CMakeError.txt is actually expected to contain some errors
(the configure process tries multiple ways of finding include files and libs, and remembers the way that worked, and avoids the ways that failed).

I suspect the error you actually had was:

Code: Select all

CMake Error at cmake/cpack/CPackConfigDEB.cmake:126 (string):
  string sub-command REPLACE requires at least four arguments.
The deb file check tries to include a changes log based on git commits from the last 30 days.
Unfortunately it doesn't handle no commits in the last 30 days. I've added a dummy commit to keep it happy.
Update the git tree and it should get further.

twilightened
Posts: 151
Joined: Fri Sep 03, 2021 12:31 am

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 4:35 pm

It took more than two hours to compile the whole thing but in the end, sudo apt install command did install something but not kodi. So i gave up. I will wait for the official release.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 4:46 pm

twilightened wrote:
Tue Nov 09, 2021 4:35 pm
It took more than two hours to compile the whole thing but in the end, sudo apt install command did install something but not kodi. So i gave up. I will wait for the official release.
Did you try running kodi-gbm?

twilightened
Posts: 151
Joined: Fri Sep 03, 2021 12:31 am

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 5:02 pm

dom wrote:
Tue Nov 09, 2021 4:46 pm
twilightened wrote:
Tue Nov 09, 2021 4:35 pm
It took more than two hours to compile the whole thing but in the end, sudo apt install command did install something but not kodi. So i gave up. I will wait for the official release.
Did you try running kodi-gbm?
Yes i did try. It was not installed. The interesting part is that when i gave the "install" command, it actually listed kodi under the "to be removed" section :)

Is there any way to install the older "buster" release? Would it work under bullseye?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 5:05 pm

twilightened wrote:
Tue Nov 09, 2021 5:02 pm
Is there any way to install the older "buster" release? Would it work under bullseye?
No. Can you just post the output you see when running the install commands?

User avatar
craigevil
Posts: 376
Joined: Wed Jan 27, 2021 5:22 am
Location: heaven

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 8:15 pm

Errors:

Code: Select all

gmake[2]: Leaving directory '/home/pi/Downloads/kodi/kodi_gbm_build'
[ 13%] Built target audioengine
gmake[1]: Leaving directory '/home/pi/Downloads/kodi/kodi_gbm_build'
gmake: *** [Makefile:156: all] Error 2
Raspberry PI 400 Raspberry Pi OS (Debian Sid) Kernel: 5.15.41-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 8:41 pm

craigevil wrote:
Tue Nov 09, 2021 8:15 pm
Errors:
Nothing useful there. Post the complete output to a paste site.

twilightened
Posts: 151
Joined: Fri Sep 03, 2021 12:31 am

Re: Building kodi on Bullseye RPiOS

Tue Nov 09, 2021 10:36 pm

dom wrote:
Tue Nov 09, 2021 5:05 pm
twilightened wrote:
Tue Nov 09, 2021 5:02 pm
Is there any way to install the older "buster" release? Would it work under bullseye?
No. Can you just post the output you see when running the install commands?
Sorry, didn't copy it. I went back to Buster instead. Kodi is a must for me. I also thought the new bullseye kinda ran a little bit laggy compared to buster. Anther deal breaker has been the lack of "show desktop/minimize all windows" icon to the corner of the taskbar, which i use a lot. I could not put it there like i could in buster. So i will wait a couple months/updates to see if things will settle.

greatquux
Posts: 11
Joined: Tue Aug 24, 2021 8:04 pm

Re: Building kodi on Bullseye RPiOS

Wed Nov 10, 2021 3:01 am

Here's what I get after a successful compile when I try to install the packages:

Code: Select all

pi@raspberrypi:~/kodi_gbm_build $ sudo dpkg -i packages/*.deb
dpkg: error processing archive packages/kodi-0.1.1-armv7l-Unspecified.deb (--install):
 parsing file '/var/lib/dpkg/tmp.ci/control' near line 18:
 missing 'Package' field
Selecting previously unselected package kodi.
(Reading database ... 142876 files and directories currently installed.)
Preparing to unpack .../kodi_19.3~git20211109.1430-17a4581b60-1~bullseye_all.deb ...
Unpacking kodi (2:19.3~git20211109.1430-17a4581b60-1~bullseye) ...
Preparing to unpack .../kodi-addon-dev_19.3~git20211109.1430-17a4581b60-1~bullseye_all.deb ...
Unpacking kodi-addon-dev (2:19.3~git20211109.1430-17a4581b60-1~bullseye) over (2:19.3~git20211109.1430-17a4581b60-1~bullseye) ...
Preparing to unpack .../kodi-bin_19.3~git20211109.1430-17a4581b60-1~bullseye_armhf.deb ...
Unpacking kodi-bin (2:19.3~git20211109.1430-17a4581b60-1~bullseye) over (2:19.3~git20211109.1430-17a4581b60-1~bullseye) ...
Preparing to unpack .../kodi-tools-texturepacker_19.3~git20211109.1430-17a4581b60-1~bullseye_armhf.deb ...
Unpacking kodi-tools-texturepacker (2:19.3~git20211109.1430-17a4581b60-1~bullseye) over (2:19.3~git20211109.1430-17a4581b60-1~bullseye) ...
dpkg: dependency problems prevent configuration of kodi:
 kodi depends on libnfs8 | libnfs4 | libnfs1; however:
  Package libnfs8 is not installed.
  Package libnfs4 is not installed.
  Package libnfs1 is not installed.

dpkg: error processing package kodi (--install):
 dependency problems - leaving unconfigured
Setting up kodi-addon-dev (2:19.3~git20211109.1430-17a4581b60-1~bullseye) ...
Setting up kodi-bin (2:19.3~git20211109.1430-17a4581b60-1~bullseye) ...
Setting up kodi-tools-texturepacker (2:19.3~git20211109.1430-17a4581b60-1~bullseye) ...
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for mailcap (3.69) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
 packages/kodi-0.1.1-armv7l-Unspecified.deb
 kodi
It doesn't appear that I can install any of the packages listed as a dependency:

Code: Select all

pi@raspberrypi:~/kodi_gbm_build $ sudo apt install libnfs8
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libnfs8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libnfs8' has no installation candidate
pi@raspberrypi:~/kodi_gbm_build $ sudo apt install libnfs4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libnfs4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libnfs12 libnfs13

E: Package 'libnfs4' has no installation candidate
pi@raspberrypi:~/kodi_gbm_build $ sudo apt install libnfs1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libnfs1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libnfs12 libnfs13

E: Package 'libnfs1' has no installation candidate

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Wed Nov 10, 2021 11:35 am

greatquux wrote:
Wed Nov 10, 2021 3:01 am
It doesn't appear that I can install any of the packages listed as a dependency:
You are not supposed to install the dependencies, apt does that if you follow next line of instructions

Code: Select all

sudo apt install -f

greatquux
Posts: 11
Joined: Tue Aug 24, 2021 8:04 pm

Re: Building kodi on Bullseye RPiOS

Wed Nov 10, 2021 2:04 pm

It cannot install those dependencies because they do not exist. So when you go to run the install command, it says it is will REMOVE kodi:

Code: Select all

pi@raspberrypi:~ $ sudo apt install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  kodi
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 43.8 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
pi@raspberrypi:~ $ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of kodi:
 kodi depends on libnfs8 | libnfs4 | libnfs1; however:
  Package libnfs8 is not installed.
  Package libnfs4 is not installed.
  Package libnfs1 is not installed.

dpkg: error processing package kodi (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 kodi

I didn't notice until I redid it though, that the kodi package is installed and actually runs. I just have to add tsched=0 to fix the crackly audio and I suppose get python2.7 installed so older addons will work (actually I need to read all about whether that's possible first, but I really only need YouTube and Twitch).

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Wed Nov 10, 2021 2:47 pm

greatquux wrote:
Wed Nov 10, 2021 2:04 pm
I suppose get python2.7 installed so older addons will work (actually I need to read all about whether that's possible first, but I really only need YouTube and Twitch).
No. This is kodi Matrix. Python 2 support has gone. You need addons that are written on Python 3 and support Matrix.
https://kodi.tv/article/kodi-broke-my-addons/

You'll have no issues with standard add-ons like YouTube and Twitch on Matrix. Everything in the Kodi repo will be supported.

greatquux
Posts: 11
Joined: Tue Aug 24, 2021 8:04 pm

Re: Building kodi on Bullseye RPiOS

Wed Nov 10, 2021 2:50 pm

dom wrote:
Wed Nov 10, 2021 2:47 pm
greatquux wrote:
Wed Nov 10, 2021 2:04 pm
I suppose get python2.7 installed so older addons will work (actually I need to read all about whether that's possible first, but I really only need YouTube and Twitch).
No. This is kodi Matrix. Python 2 support has gone. You need addons that are written on Python 3 and support Matrix.
https://kodi.tv/article/kodi-broke-my-addons/

You'll have no issues with standard add-ons like YouTube and Twitch on Matrix. Everything in the Kodi repo will be supported.
Okey dokey, that will work out fine. I can't install or remove any packages right now though due to the broken dependencies issue. Let me know what you think I should do about that. Thanks for working on this.

greatquux
Posts: 11
Joined: Tue Aug 24, 2021 8:04 pm

Re: Building kodi on Bullseye RPiOS

Wed Nov 10, 2021 4:01 pm

Something else I just noticed while doing some testing - HEVC (H.265) videos do not play correctly. There was no hardware acceleration in Kodi 18 for these, so they used a lot of CPU, but they did play fine for the most part. However now when PRIME is enabled, the video does not display at all (using EGL or Direct to Plane), and when it is disabled, a video displays but there is a grey bar in the middle and the colors are incorrect. Here's some log messages for when trying to play with PRIME enabled:

Code: Select all

2021-11-10 10:23:30.798 T:772      INFO <general>: VideoPlayer::OpenFile: /mymedia/Disk Sets/Movies/Lilo.And.Stitch.2002.1080p.BluRay.x265-RARBG.mp4
2021-11-10 10:23:30.799 T:960      INFO <general>: Creating InputStream
2021-11-10 10:23:30.863 T:786     ERROR <general>: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover
2021-11-10 10:23:30.942 T:960      INFO <general>: Creating Demuxer
2021-11-10 10:23:33.653 T:960      INFO <general>: Opening stream: 0 source: 256
2021-11-10 10:23:33.653 T:960      INFO <general>: [WHITELIST] Searching the whitelist for: width: 1816, height: 1080, fps: 23.976, 3D: false
2021-11-10 10:23:33.654 T:960      INFO <general>: Display resolution ADJUST : 3840x2160 @ 23.976025 Hz (25) (weight: 0.000)
2021-11-10 10:23:33.732 T:772      INFO <general>: VideoPlayer: OnLostDisplay received
2021-11-10 10:23:33.732 T:772   WARNING <general>: CDVDMessageQueue(audio)::Put MSGQ_NOT_INITIALIZED
2021-11-10 10:23:33.732 T:772   WARNING <general>: CDVDMessageQueue(video)::Put MSGQ_NOT_INITIALIZED
2021-11-10 10:23:33.733 T:772      INFO <general>: GLES: Maximum texture width: 4096
2021-11-10 10:23:33.733 T:960      INFO <general>: Creating video codec with codec id: 173
2021-11-10 10:23:33.733 T:960      INFO <general>: CDVDVideoCodecDRMPRIME::Open - using decoder HEVC (High Efficiency Video Coding)
2021-11-10 10:23:33.734 T:960      INFO <general>: Creating video thread
2021-11-10 10:23:33.735 T:967      INFO <general>: running thread: video_thread
2021-11-10 10:23:33.735 T:960      INFO <general>: Opening stream: 1 source: 256
2021-11-10 10:23:33.735 T:960      INFO <general>: Finding audio codec for: 86018
2021-11-10 10:23:33.739 T:960      INFO <general>: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
2021-11-10 10:23:33.739 T:960      INFO <general>: Creating audio thread
2021-11-10 10:23:33.739 T:968      INFO <general>: running thread: CVideoPlayerAudio::Process()
2021-11-10 10:24:00.108 T:772      INFO <general>: VideoPlayer: OnResetDisplay received
2021-11-10 10:24:01.351 T:963     ERROR <general>: CDVDVideoCodecDRMPRIME::GetFormat - unsupported pixel format
2021-11-10 10:24:01.459 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Operation not permitted (-1)
2021-11-10 10:24:01.538 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
2021-11-10 10:24:01.561 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2021-11-10 10:24:01.584 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
2021-11-10 10:24:01.776 T:968      INFO <general>: Skipped 6 duplicate messages..
2021-11-10 10:24:01.776 T:968      INFO <general>: CVideoPlayerAudio: display reset occurred, checking for passthrough
2021-11-10 10:24:01.779 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
2021-11-10 10:24:01.782 T:968      INFO <general>: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
2021-11-10 10:24:01.783 T:968      INFO <general>: Creating audio stream (codec id: 86018, channels: 6, sample rate: 48000, no pass-through)
2021-11-10 10:24:01.794 T:786      INFO <general>: CActiveAESink::OpenSink - initialize sink
2021-11-10 10:24:01.802 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
2021-11-10 10:24:02.008 T:786      INFO <general>: Skipped 8 duplicate messages..
2021-11-10 10:24:02.008 T:786      INFO <general>: CAESinkALSA::Initialize - Attempting to open device "default"
2021-11-10 10:24:02.012 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
2021-11-10 10:24:02.022 T:786      INFO <general>: CAESinkALSA::Initialize - Opened device "default"
2021-11-10 10:24:02.043 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
2021-11-10 10:24:06.996 T:772      INFO <general>: Skipped 215 duplicate messages..
2021-11-10 10:24:06.996 T:772      INFO <general>: [WHITELIST] Searching the whitelist for: width: 1816, height: 1080, fps: 23.976, 3D: false
2021-11-10 10:24:06.997 T:772      INFO <general>: Display resolution ADJUST : 3840x2160 @ 23.976025 Hz (25) (weight: 1080.000)
2021-11-10 10:24:07.001 T:967     ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
2021-11-10 10:24:10.412 T:772      INFO <general>: Skipped 108 duplicate messages..
2021-11-10 10:24:10.412 T:772      INFO <general>: VideoPlayer: OnLostDisplay received
2021-11-10 10:24:10.412 T:772      INFO <general>: GLES: Maximum texture width: 4096
I can do any additional debugging or get more information for you later or tonight.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Wed Nov 10, 2021 4:25 pm

DRM PRIME enabled and Direct to Plane is what we should be using.
I've added a commit to my kodi tree that accepts libnfs13. Rebuilding.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Wed Nov 10, 2021 7:25 pm

Build finished and "dpkg -i *.deb" worked without dependency errors. So "apt install -f" is not required.

hevc works for me but remember to add to config.txt:

Code: Select all

dtoverlay=rpivid-v4l2
and if you want to play 4k hevc then increase the cma allocation. e.g. edit kms line to:

Code: Select all

dtoverlay=vc4-kms-v3d,cma-512

RyanAtTanagra
Posts: 2
Joined: Thu Nov 11, 2021 12:04 am

Re: Building kodi on Bullseye RPiOS

Thu Nov 11, 2021 12:10 am

Recent update let me build and install the debs on my Pi3 Model B. Thanks for that. However, unable to run.

kodi-standalone[1211]: ERROR: Unable to create GUI. Exiting

All google search results seem to point to config.txt, but so far nothing has been useful. Tried your dtoverlay=rpivid-v4l2 as well.

Also, note for anyone else trying, my Pi did NOT like the -j8 :-). System load went up so high it never finished after 12 hours of trying to compile. -j2 seemed fine. 4 made a bit too unresponsive to want to let it try.

greatquux
Posts: 11
Joined: Tue Aug 24, 2021 8:04 pm

Re: Building kodi on Bullseye RPiOS

Thu Nov 11, 2021 1:10 am

dom wrote:
Wed Nov 10, 2021 7:25 pm
Build finished and "dpkg -i *.deb" worked without dependency errors. So "apt install -f" is not required.

hevc works for me but remember to add to config.txt:

Code: Select all

dtoverlay=rpivid-v4l2
and if you want to play 4k hevc then increase the cma allocation. e.g. edit kms line to:

Code: Select all

dtoverlay=vc4-kms-v3d,cma-512
Thank you!! Both fixes worked. I only now see that I missed what you wrote about hevc earlier.

Do you happen to know how I can install Inputstream Adaptive?

RyanAtTanagra
Posts: 2
Joined: Thu Nov 11, 2021 12:04 am

Re: Building kodi on Bullseye RPiOS

Thu Nov 11, 2021 6:33 am

As a follow-up to my previous post of kodi not being able to find a GUI, I got it working with:

dtoverlay=vc4-fkms-v3d,cma-265

thanks for all this info on getting it to compile on bullseye!

rsn8887
Posts: 3
Joined: Sat Feb 06, 2021 11:21 pm

Re: Building kodi on Bullseye RPiOS

Thu Nov 11, 2021 10:06 am

I just spend 20 minutes trying to understand this thread. I still don't get it.

Why can't I execute "sudo apt-get install kodi" on my RPi 3 running bullseye? It says "Package Kodi is not available".

But here it is shown as available in bullseye: https://packages.debian.org/stable/video/kodi

This is really frustrating. The update from Buster to Bullseye deleted my Kodi and nobody warned me.

Why did you even release a new Raspberry Pi OS without getting Kodi working first?

Some transparency of what is available on Raspberry Pi OS would be great. Clearly the Raspberry Pi OS packages are not identical to the Debian ones, because Kodi is available on Debian Bullseye, but not on Raspberry Pi OS Bullseye. Do you have a GitHub repo where the Raspberry Pi OS packages are listed, since they are not the same as the Debian ones?

There seems to be a lack of communication and transparency. Of course, the hype about Bullseye was communicated but nobody said "Be careful, your Kodi will stop working".

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6045
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Building kodi on Bullseye RPiOS

Thu Nov 11, 2021 11:59 am

rsn8887 wrote:
Thu Nov 11, 2021 10:06 am
Why did you even release a new Raspberry Pi OS without getting Kodi working first?
Kodi is not the only use case for Raspberry Pi OS (in fact if it's the main use case you'd be better off using LibreELEC).
It will be added to apt once it is fully working. Probably in the next week or two.

Note that there is no usable kodi for Pi in debian buster. The build that eventually was added to the Raspberry Pi repo came from rascas,
and wasn't available until long after the release of buster.

Return to “Media centres”