Kodi 21 on Raspberry Pi 3 with H.264 decoding
I use a Raspberry Pi 3 computer as a media center and home server. Light on power consumption, it is still powerful enough to run Kodi, even after 10 years of good service. Watching movies and TV shows works well thanks to its Broadcom chip that decodes H.264 content. I also run Pi-hole, FreshRSS, and a bunch of selfware (household spendings, Read it later RSS feed).
However, I have been stuck with Kodi 18 for a while because the newer versions removed support for OMX and MMAL drivers. While it was OK for my limited usage, it started to become an issue for instance to play live TV that relies on Widevine CDM. Old versions have expired over time, and recent versions required a newer glibc that was not supported with the old version of Debian coming with OSMC/Kodi 18.
I recently took another shot at upgrading, convinced by AI that there was a path forward with Video4Linux2. I found it hard to find good information on the internet on this topic, hence my small attempt at sharing with this post. This article also convinced that Video4Linux2 would support it.
It turns out a brand new Kodi 21 (still using OSMC), configured with the proper modules worked perfectly. Video playback runs with a bit of CPU usage (<30%), but it is smooth, without lag or audio delay for 30 FPS files. So far, it did not show signs of overheating.
Here is my /boot/config-user.txt file to use the proper driver:
# Enable KMS graphics driver
dtoverlay=vc4-kms-v3d
# Allocates RAM for video decoding buffers
gpu_mem=256
You also need to make sure Allow hardware acceleration - DRM PRIME is enabled in the player settings on Kodi.
<guisettings>
...
<videoplayer>
<useprime-decoder>true</useprime-decoder>
<useprime-render>true</useprime-render>
<primerendermethod>0</primerendermethod>
</videoplayer>
...
</guisettings>
The rest is pretty much a standard OSMC installation. And now live TV works again, thanks to Slyguy.
Even though the Debian version used by OSMC is not the most recent one (bullseye as of now), it is still reassuring to know I’ll likely be able to keep upgrading this old Pi of mine and avoid buying a new one. They are quite expensive these days.