v19 HEVC (10-bit) stuttering - Kodi Matrix
#1
Hi all,

Somehow I can't seem to get HEVC (10-bit/HDR) properly playing on Kodi Matrix (v19.4) out of the box. When i press play, the video starts and sound works well. However, the video stutters. I suppose it has something to do with the following error messages in my log:
Code:

2023-05-06 13:54:50.878 T:251170 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2023-05-06 13:54:50.881 T:251170 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Cannot allocate memory (-12)

Verified the movie is giving the same behaviour in VLC.

Details:
- Installed Kodi using the guide on the raspberry pi forum including the adjustments necessary to /boot/config.txt
- 64-bit OS (Bullseye)
- Pi 4b 8gb
- full log see https://pastebin.com/raw/kLYamyd4
- Verified video is playing fine through Plex, thus file is okay, has to do with decoding/mem. allocation
- Log mentions it is using HEVC decoder
- Verified HW acceleration is turned on (direct to plane) in settings;

Solutions tried:
- Reinstall Kodi (removed kodi incl. .kodi folders);
- Run Kodi as root;
- Increase buffer size/cache (see HOW-TO:Modify_the_video_cache (wiki), example 4)
- Explicitly increase GPU allocation in /boot/config.txt (should not be necessary)

I do not want to use LE as my Pi is running a lot of other servers etc. aswell.

Can't find any details of other people running into the same issue so really hope somebody can help me out!
Reply
#2
2023-05-06 13:54:23.160 T:251071 INFO <general>: Disabled debug logging due to GUI setting. Level 0.

Try enabling 'Debugging' so we get an even more detailed log file.

Kodi 19.4..? We're at 20.1 by now. Also RPi OS now has kernel 6.1 under its belt. Perhaps that works better for you.
Stretching the buffer isn't always better as write speeds of SDcards of typically crap.
Changing the GPU allocation is no longer recommended AFAIK for the RPi4.

(2023-05-09, 08:44)Rasp123 Wrote: Verified the movie is giving the same behaviour in VLC.

Erm... is your video file corrupted?
Reply
#3
Is this 4K hevc? Are you you up to date with apt?
What does
Code:
grep Cma /proc/meminfo
show?
Reply
#4
Yes, apt is up to date.

Below the export of 'grep Cma /proc/meminfo':
grep Cma /proc/meminfo:

Kodi closed:
CmaTotal:         524288 kB
CmaFree:          464572 kB

Kodi open:
CmaTotal:         524288 kB
CmaFree:          333760 kB

Movie playing:
CmaTotal:         524288 kB
CmaFree:            8968 kB

Also, verified the following of the file using ffprobe:
bitrate 14 mb/s
hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 24 tbc (default)

Cma seems quite low when playing the file. Does this mean the memory allocated to the GPU is to low? should it be increased even further?
Currently i have 'dtoverlay=vc4-kms-v3d,cma-512' in /boot/config.txt.
Reply
#5
Updated the log file in original post to include debug logging.
Kodi 19.4 is the default version installed by apt.
Do not have an SD card to write to, have an SSD attached to the Pi (Argon M.2 case) with boot set to SSD. Write speed should be fine.
Video file can't be corrupted, as the file works fine when streamed through Plex (thus only as bitstream - think TV decodes in that case?)
Reply
#6
Nvm, can't seem to edit original post. Hereby full log: evuwedayan.kodi (paste)

Also, appreciate the help so far. Thanks both.
Reply
#7
If you boot to desktop it will consume a reasonable amount of cma (which isn't released when kodi runs).
Booting to console will help.

You can increase cma. 512M is maximum using the cma-512 notation, but you can also use:
Code:
dtoverlay=vc4-kms-v3d,cma-size=671088640
for 640M.
Reply
#8
popcorn, you are an absolute legend. Increase cma fixed the issue (plenty of RAM so no issue for me).
Still wonder why nobody ever encountered this issue though. Are so many people running headless?
Reply

Logout Mark Read Team Forum Stats Members Help
HEVC (10-bit) stuttering - Kodi Matrix0