Kernel 5.10 - RPI3 - Kodi 18.x does not play HEVC videos anymore

Open
#4,112 40 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, linux, raspberry-pi

Research direction

Start with the Raspberry Pi 3 kernel 5.10 configuration using bcm2709_defconfig and the MMAL buffer-allocation path implicated by CMMALPool::GetBuffer. Reproduce HEVC playback with Kodi 18.x, compare it with kernel 5.4.x and a Raspberry Pi 4, and use the supplied allocation errors and playback failure as the regression signal.

Written by the indexing model from the issue text.

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?

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.