Repository navigation
Description
Now that the kernel 5.10 has been set to default, I would like to point out that with Kodi v18 playback of HEVC videos with Raspberry Pi3 is no longer possible.
Used a kernel 5.10.10 with default settings (bcm2709_defconfig). A Raspberry Pi4 on the other hand plays them and the 5.4.x kernel also shows no problems.
Most of the time the playback starts, but the picture is much darker than usual, the sound is normal. but after a few seconds the playback stops and kodi restarts
The playback problem has already started with 5.7 or 5.8 kernel and has not improved until now.
This can be found in the log. Seems that there is some memory allocation problem with MMAL
Feb 2 15:51:20 kmxbilr2 2 15:51:20.088 T:1415569632 DEBUG: VideoPlayer::Sync - Audio - pts: 288000.000000, cache: 509577.709119, totalcache: 800000.011921
Feb 2 15:51:20 kmxbilr2 2 15:51:20.088 T:1415569632 DEBUG: VideoPlayer::Sync - Video - pts: 5000.000000, cache: 50000.000000, totalcache: 100000.000000
Feb 2 15:51:20 kmxbilr2 2 15:51:20.088 T:1423962336 DEBUG: CVideoPlayerVideo - CDVDMsg::GENERAL_RESYNC(-221577.709119)
Feb 2 15:51:20 kmxbilr2 2 15:51:20.089 T:1753329888 DEBUG: OnAVStarted: CApplication::OnAVStarted
Feb 2 15:51:20 kmxbilr2 2 15:51:20.089 T:1283715296 DEBUG: CVideoPlayerAudio - CDVDMsg::GENERAL_RESYNC(-221577.709119), level: 96, cache: 501168.959119
Feb 2 15:51:20 kmxbilr2 2 15:51:20.089 T:1283715296 DEBUG: CDVDAudio::Resume - resume audio stream
Feb 2 15:51:20 kmxbilr2 2 15:51:20.090 T:1423962336 ERROR: CMMALPool::GetBuffer - failed pool:0x56b18ca0 omvb:(nil) mmal:0x56bf9650 timeout:500
Feb 2 15:51:20 kmxbilr2 2 15:51:20.090 T:1423962336 ERROR: CDecoder::FFGetBuffer Failed to allocated buffer in time
Feb 2 15:51:20 kmxbilr2 2 15:51:20.090 T:1423962336 ERROR: ffmpeg[54DFF0E0]: [hevc_rpi] get_buffer() failed
Feb 2 15:51:20 kmxbilr2 2 15:51:20.091 T:1874850016 DEBUG: CRBP::AdjustHDMIClock(1.00000) = 1.00000
Feb 2 15:51:20 kmxbilr2 2 15:51:20.091 T:1874850016 DEBUG: ActiveAE - start sync of audio stream
Feb 2 15:51:20 kmxbilr2 2 15:51:20.091 T:1342464224 ERROR: ffmpeg[500460E0]: [hevc_rpi] thread_get_buffer() failed
Feb 2 15:51:20 kmxbilr2 2 15:51:20.091 T:1342464224 DEBUG: ffmpeg[500460E0]: [hevc_rpi] Error parsing NAL unit #0.
Feb 2 15:51:20 kmxbilr2 2 15:51:20.095 T:1423962336 ERROR: CMMALPool::GetBuffer - failed pool:0x56b18ca0 omvb:(nil) mmal:0x56bf9828 timeout:500
Feb 2 15:51:20 kmxbilr2 2 15:51:20.095 T:1423962336 ERROR: CDecoder::FFGetBuffer Failed to allocated buffer in time
Feb 2 15:51:20 kmxbilr2 2 15:51:20.095 T:1423962336 ERROR: ffmpeg[54DFF0E0]: [hevc_rpi] get_buffer() failed
Feb 2 15:51:20 kmxbilr2 2 15:51:20.096 T:1334071520 ERROR: ffmpeg[4F8450E0]: [hevc_rpi] thread_get_buffer() failed
Feb 2 15:51:20 kmxbilr2 2 15:51:20.096 T:1334071520 DEBUG: ffmpeg[4F8450E0]: [hevc_rpi] Error parsing NAL unit #0.
Feb 2 15:51:20 kmxbilr2 2 15:51:20.098 T:1423962336 ERROR: CMMALPool::GetBuffer - failed pool:0x56b18ca0 omvb:(nil) mmal:0x56bf9a00 timeout:500
Feb 2 15:51:20 kmxbilr2 2 15:51:20.098 T:1423962336 ERROR: CDecoder::FFGetBuffer Failed to allocated buffer in time
Feb 2 15:51:20 kmxbilr2 2 15:51:20.099 T:1423962336 ERROR: ffmpeg[54DFF0E0]: [hevc_rpi] get_buffer() failed
Feb 2 15:51:20 kmxbilr2 2 15:51:20.100 T:1325678816 ERROR: ffmpeg[4F0440E0]: [hevc_rpi] thread_get_buffer() failed
Feb 2 15:51:20 kmxbilr2 2 15:51:20.100 T:1325678816 DEBUG: ffmpeg[4F0440E0]: [hevc_rpi] Error parsing NAL unit #0.
Used firmware:
vcgencmd version
Jan 7 2021 18:34:00
Copyright (c) 2012 Broadcom
version fb345a0c2d5544957f4ba1a2b9e968970e3312c4 (clean) (release) (start_x)
Tried gpu_mem=192/384/512 without any difference
Maybe I missed something?
Activity
popcornmix commentedon Feb 2, 2021
I think this because /dev/vcsm no longer exists and so /dev/vcsm-cma is used instead. The former allocates from gpu_mem and the latter from cma (e.g add cma=256M to cmdline.txt).
Try reducing gpu_mem and increasing cma. I think that will get it playing.
But there is a performance hit to memory that is allocated from cma which isn't currently arm cacheable.
We need to decide what the best solution for that is.
mkreisl commentedon Feb 2, 2021
Yes, that was the solution
I vaguely remember the discussion with cma=256M, but I didn't have it on my mind anymore
Thanks a lot @popcornmix
mkreisl commentedon Feb 2, 2021
Oh yes, now I see what you mean.HEVC is currently unusable with kernel 5.10 and RPi3, so please find an acceptable solution quickly.
Thanks
Maltz42 commentedon Feb 13, 2021
I'm seeing this on a RPI4 running Kodi 18.7 as well. Since the kernel update, Kodi hangs shortly after HEVC videos begin to play.
amandamana commentedon Feb 13, 2021
Found a report of kernel 5.10.11 breaking h264 1080p/50 playback (and degrading 720p) on a RPI2.
Maltz42 commentedon Feb 25, 2021
Ok, so I've just set up a new RPi4 from scratch and ran into this same issue again. cma=256M did not solve the issue, but rolling back to a 5.4 kernel via rpi-update did.
Akrai commentedon Feb 25, 2021
yeah I've been unable to play h265 videos anymore since i updated the kernel like two or three weeks ago, i hope a fix comes soon 🙏
harristom commentedon Mar 1, 2021
I have the same problem - how did you do this?
timothyjward commentedon Mar 3, 2021
I would assume that it was
As far as I can tell this is the last version of the stable firmware branch using a 5.4 kernel
Franck-Berry commentedon Mar 4, 2021
FYI, I have the same problem on a Raspberry Pi 4: unable to play HEVC videos with Kodi 18.7 since the new Kernel 5.10 update. (After switching back to Kernel 5.4.83, everything works again.)
I described the problem on the raspberrypi.org forum and provided a Kodi log (which doesn't help much):
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=251645&hilit=kodi&sid=73f21dfa564d8f79c05ff5d2d08fee70&start=475#p1828887
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=251645&hilit=kodi&sid=73f21dfa564d8f79c05ff5d2d08fee70&start=475#p1829049
popcornmix commentedon Mar 4, 2021
Currently the only solution to get hevc working well on Pi2/3 is to downgrade kernel to 5.4 (e.g. #4112 (comment))
Maltz42 commentedon Mar 4, 2021
Is there a solution other than a kernel downgrade for Pi4? I'm wondering why you specified Pi2/3, since this is also a problem for Pi4.
popcornmix commentedon Mar 4, 2021
hevc should still work on Pi4. You may need to increase cma memory allocation.
e.g. remove the gpu_mem setting from config.txt and add a cma setting to the fkms overlay. e.g.
21 remaining items
harristom commentedon Mar 10, 2021
Thanks, this fixed it for me on my Pi 4
Akrai commentedon Mar 24, 2021
So I just tried the cma options and I can confirm using it (for example cma-512) does work for some easy normal bitrate 1080p movies, but it doesn't for higher res, high bitrate ones, the system still crashes
harristom commentedon May 24, 2021
Apt updated to the latest stable kernel and the problem still isn't fixed. Had to roll back to b7c8ef64ea24435519f05c38a2238658908c038e again.
In case it helps troubleshooting, I am on a Pi 4. Kodi crashes on some (but not all) HEVC files. Resolution doesn't seem to make a difference and anyway they are all 1080p or lower. Attaching my config.txt and cmdline.txt (basically at defaults, with 320M GPU memory added as required by Kodi).
config.txt
cmdline.txt
ZedeN1 commentedon May 31, 2021
My RPi4 would not let me downgrade after apt upgrade (latest firmware already installed message). I had to do this first:
sudo rm /boot/.firmware_revisionsudo BRANCH=stable rpi-update b7c8ef64ea24435519f05c38a2238658908c038epelwell commentedon Jun 8, 2021
[ Deleted off-topic comments ]
Octoton commentedon Oct 3, 2021
On a raspberry pi 4 with kernel 5.10 and kodi 18.4 and after lot of crash I was able to read my hevc by following popcornmix answer in https://forum.kodi.tv/showthread.php?tid=354154
I found this after looking at the console output of kodi as the log had no info whatsoever. The console was outputing: can't open /dev/argon-hevcmem