Getting the most out of your (cheap) hardware is always a challenge. Selling hardware is easier then supporting hardware.
The Raspberry Pi 4 has strong multimedia capabilities, it can playing 4K media 60fps, but getting it done isn’t a piece of cake. Even playing 1080HD content on YouTube can be a problem, but that’s probably because YouTube is more about tracking and selling adds than playing media.
A bold statement? Think about it this way. Any 1080p movie will play fine outside a browser in Kodi, any movie will play fine without DRM (Digital Rights Management). It chokes on the DRM en-/decryption. By definition: DRM is tracking.
Historically LibreElec is the best distribution for a Raspberry Pi as a multimedia device. LibreElec’s goal: just enough OS to support Kodi, and it is highly optimized for that.
Yes it’s powerful. You can install add-ons like MPD for music, or RetroPie-alike for games. Also docker containers are available for HomeAssistant, MQTT and Nginx. So a RPI with LibreElec can be pretty powerful.
Still LibreElec is limited, and the RPI4 is capable of doing more.
Kodi on Raspberry used to work pretty well, until big changes in the 5.10 kernel came. It more or less stopped working on Buster. Compiling it yourself was quite a hassle, that actually failed more than it succeeded. I wrote about that before and it failed in most cases for most users including myself, I must admit.
But now luckily RPI-engineers stepped up: Kodi in Rapsberry Pi OS is more or less supported again.
At least it’s easy again to install Kodi in Bullseye. But you still need a bit more tweaks to get it running smoothly.
To install Kodi in Bullseye
No OS can beat this 🙂 :
sudo apt install kodi
Install addons
Two important add-ons that can’t be installed from within Kodi like in LibreElec, but you have to resort to apt again:
TVHeadend-client (DVB-T tv)
sudo apt install kodi-pvr-hts
Only the client is installed with this command, this assumes a TV-Headend server is running on another local IP-address.
Inputstream-adaptive helper to play DRM protected (Widevine) content
sudo apt-get install kodi-inputstream-adaptive
The add-on then will extract (and update) the needed libs from internet automatically.
To enable HEVC HW decoding, you have to tweak /boot/config.txt
Add this line (only for RPI4)
dtoverlay=rpivid-v4l2
For 4K HEVC playback tweak this line:
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d,cma-512
Mount NFS shares
Somehow Kodi on Bullseye stopped discovering NFS by default. Don’t worry to much, just give it a little manual bump.
- Choose Browse for new share -> Add network location -> Protocol -> Network File System (NFS)
- Entering the your ip-address as Server address and Remote path manually, adding up to something like nfs://192.168.0.3:/path/to/mnt/
- Click OK, then it will list.
- Select and click OK.
Conclusion
Changes in `/boot/config.txt` require a reboot.
After all these steps, playing 4K HEVC content with HW-acceleration should work fine on a Raspberry Pi 4.
That’s all. Let me know if it’s working for you.