Can't get HEVC to work on Kodi on Dietpi

Creating a bug report/issue

Required Information

  • DietPi version | 8.14.2
  • Distro version | bullseye
  • Kernel version | Linux DietPi 5.15.84-v8+ #1613 SMP PREEMPT Thu Jan 5 12:03:08 GMT 2023 aarch64 GNU/Linux
  • SBC model | Rpi4 4Gb RAM
  • Power supply used | 5V 3A
  • SD card used | SanDisk ultra)=

Hi, I can’t get Kodi to play HEVC files on Rpi4. I tried both vc4-kms-v3d and vc4-fkms-v3d as the display option, I applied the memory split advised for video de/encoding.
I found no way to get this to work. Here is my Kodi log:

The error seems to be the following:

2023-02-28 00:50:23.633 T:2930    ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Cannot allocate memory (-12)
2023-02-28 00:50:23.634 T:2922    ERROR <general>: ffmpeg[(nil)X]: [hevc] v4l2_request_hevc_start_frame: Failed to get dst buffer
2023-02-28 00:50:23.634 T:2922    ERROR <general>: ffmpeg[(nil)X]: [hevc] v4l2_request_hevc_end_frame: Failed to get dst buffer
2023-02-28 00:50:23.634 T:2922    ERROR <general>: ffmpeg[(nil)X]: [hevc] hardware accelerator failed to decode picture

Thanks in advance for any help, have a great day

hardware decoder is on chip…it can play files, it doesn’t encode (sucks becuase I wanted to run Tdarr and encode HEVC)

It looks like some people have been rebuilding ffmpeg with special parameters to get hardware encoding
https://forums.raspberrypi.com/viewtopic.php?t=283301#p1718217

This looks like it might be a fix for 64bit kernels and the like
https://www.willusher.io/general/2020/11/15/hw-accel-encoding-rpi4

But he only want’s to decode / play H265 files. No encoding needed.

Did you try to enable the rpivid-v4l2 overlay?

Hi, Thanks for your answer.
I’m not sure what you are talking about, but I found this in my config.txt:

dtoverlay=rpivid-v4l2
dtoverlay=vc4-fkms-v3d

So I guess it is already enabled. what is it supposed to do ?
Thanks in advance for any answer.