Kodi Community Forum
v19 popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166)
+---- Thread: v19 popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can (/showthread.php?tid=356924)

Pages: 1 2


popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-06

@popcornmix - I built popcornmix/gbm and am running it on a 4GB RPi4 running Arch ARM, but I think still missing something. I cannot play this 4k test video at all under my build, but if I boot to @HiassofT test build of LE, it plays back just fine.

Debug log on my build when I try playing it back: https://gist.github.com/graysky2/2ba8880eab32628b22c21fc336032b6a

Do any of those errors raise a particular red flag to you?  I would like to get this nailed down as I am maintaining the kodi builds for Arch ARM, so it's more than just a pet project Smile  Thanks!


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-07

I tried running kodi as root just to rule out a permission issue to /dev/something but got the same.


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - popcornmix - 2020-09-07

Works for me with my local build on RpiOS. No errors in log.
Do you have "Allow hardware acceleration with DRM PRIME" enabled?

If it's not that I think ffmpeg hasn't been built with the right acceleration
(which can happen if right headers aren't found).

Have a look here for a similar issue.


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-07

@popcornmix - Thanks for the reply.  Yes, "Allow hardware acceleration with DRM PRIME" is set.  I tried both "Direct to Plane" as well as "EGL" but got the same.  So I'm thinking your observation about ffmpeg not getting built right might be it.

I am at a loss however as to figuring out which headers are missing at the time of build.  Would the build logs offer a clue?  Here is the complete output of the build.  I did not see anything relating to "yuv420p10le" on a keyword search but perhaps there is something else for which to search?

EDIT: I am building now symlinking a number of headers provided by the Arch ARM kernel-headers including all under:
include/uapi/drm/
and
include/media/
Code:
...
   _kernel_release="$(pacman -Q linux-raspberrypi4-headers | grep -Eo "[^\ ]+$")-ARCH" 
  mkdir -p "$srcdir/uapi/drm"

  for i in /usr/lib/modules/$_kernel_release/build/include/uapi/drm/*.h; do
    ln -s "$i" "$srcdir/uapi/drm"
  done

  for i in /usr/lib/modules/$_kernel_release/build/include/media/*.h; do
    ln -s "$i" "$srcdir/uapi/media"
  done

  export CPPFLAGS+=" -I$srcdir/uapi"
...



RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - Nachteule - 2020-09-07

I am confused there for weeks. I can't find any HEVC patches for ffmpeg in popcornmix/gbm branch. are they not needed anymore or what's going on now? Sad I would be very grateful for some information on this. Thanks


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-07

(2020-09-07, 17:00)Nachteule Wrote: I am confused there for weeks. I can't find any HEVC patches for ffmpeg in popcornmix/gbm branch. are they not needed anymore or what's going on now? Sad iIwould be very grateful for some information in this regard

Unless you have some comments regarding the issue at hand, please open a new thread to keep this one on topic.  Right now the goal is to see if ffmpeg is not detecting all needed headers for hardware decoding on Arch ARM building popcornmix/gbm.  Symptoms no video playback and numerous lines in the log like:
Code:
ERROR <general>: CDVDVideoCodecDRMPRIME::GetFormat - unsupported pixel format
DEBUG <general>: ffmpeg[(nil)X]: [hevc] Error parsing NAL unit #1.
DEBUG <general>: ------ Window Init (DialogBusy.xml) ------
ERROR <general>: ffmpeg[(nil)X]: [hevc] Could not find ref with POC 0
ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Operation not permitted (-1)
ERROR <general>: ffmpeg[(nil)X]: [hevc] Duplicate POC in a sequence: 1.
DEBUG <general>: ffmpeg[(nil)X]: [hevc] Error parsing NAL unit #0.
DEBUG <general>: CVideoPlayer::SetCaching - caching state 2
DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
DEBUG <general>: CVideoPlayerVideo - video decoder returned error
ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
DEBUG <general>: CVideoPlayerVideo - video decoder returned error
ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - videoBuffer:nullptr format:yuv420p10le
DEBUG <general>: CVideoPlayerVideo - video decoder returned error



RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-07

Including the two I mentioned above at compilation did not fix it.  The strategy of cherry picking a single one worked well in the past.  I am unclear if the same strategy can be used with this issue.  I feel like I will need to discover which particular header file is required as it may be outside of the two dirs I tried.


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - popcornmix - 2020-09-08

(2020-09-07, 15:49)graysky Wrote: I am at a loss however as to figuring out which headers are missing at the time of build.  Would the build logs offer a clue?  Here is the complete output of the build.  I did not see anything relating to "yuv420p10le" on a keyword search but perhaps there is something else for which to search?

Did you check the values in config.h? You want:
Code:
#define CONFIG_V4L2_REQUEST 1
#define CONFIG_HEVC_V4L2REQUEST_HWACCEL 1



RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-08

(2020-09-08, 12:03)popcornmix Wrote: Did you check the values in config.h? You want:
Code:
#define CONFIG_V4L2_REQUEST 1
#define CONFIG_HEVC_V4L2REQUEST_HWACCEL 1

@popcornmix - Thank you for the tip. Indeed both of these were missing from ffmpeg's config.h on my build of your r55628 (commit 229a3c595bc20a7e76c8bb1665a9519adfdf0f84). Here is a link to it for reference.

However, I see you pushed some new commits recently. When I try to build r55799 (commit 18e29eee7ee436fd574c9fddd810eb286488ff6f), the config.h that gets generated there does contain both of these. Here is a link to it for reference.

The problem is that building r55799 ends in a new fatal error:
Code:
...
In file included from /build/kodi-rbp4-git/src/kodi-build/build/xbmc/CompileInfo.cpp:11:
/build/kodi-rbp4-git/src/xbmc-18e29eee7ee436fd574c9fddd810eb286488ff6f/xbmc/utils/StringUtils.h:34:10: fatal error: fmt/format.h: No such file or directory
34 | #include <fmt/format.h>
| ^~~~~~~~~~~~~~
compilation terminated.
frame 0 (delay: 0) ARGB (80,80 @ 25600 bytes)
distcc[5053] ERROR: compile /build/kodi-rbp4-git/src/kodi-build/build/xbmc/CompileInfo.cpp on localhost failed
make[2]: *** [CMakeFiles/compileinfo.dir/build.make:165: CMakeFiles/compileinfo.dir/build/xbmc/CompileInfo.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5503: CMakeFiles/compileinfo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
...

Here is the complete build.log and for reference, I am building like this:
Code:
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-L/opt/vc/lib -lvcsm" \
-DCMAKE_EXE_LINKER_FLAGS="-L/opt/vc/lib -lvcsm" \
-DCMAKE_CXX_FLAGS="-Wl,-L/opt/vc/lib -Wl,-lvcsm" \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DENABLE_EVENTCLIENTS=ON \
-DENABLE_INTERNAL_FFMPEG=ON \
-DENABLE_INTERNAL_FMT=ON \
-DENABLE_INTERNAL_CROSSGUID=ON \
-DENABLE_INTERNAL_FSTRCMP=ON \
-DENABLE_INTERNAL_FLATBUFFERS=ON \
-DENABLE_INTERNAL_SPDLOG=ON \
-DENABLE_EVENTCLIENTS=ON \
-DENABLE_VAAPI=OFF \
-DENABLE_VDPAU=OFF \
-DENABLE_OPENGL=OFF \
-DENABLE_MYSQLCLIENT=ON \
-Dlibdvdcss_URL="/libdvdcss-1.4.2-Leia-Beta-5.tar.gz" \
-Dlibdvdnav_URL="/libdvdnav-6.0.0-Leia-Alpha-3.tar.gz" \
-Dlibdvdread_URL="/libdvdread-6.0.0-Leia-Alpha-3.tar.gz" \
-DFFMPEG_URL="/ffmpeg-4.3.1-Matrix-Alpha1-1.tar.gz" \
-DFMT_URL="/fmt-6.1.2.tar.gz" \
-DCROSSGUID_URL="/crossguid-8f399e8bd4.tar.gz" \
-DFSTRCMP_URL="/fstrcmp-0.7.D001.tar.gz" \
-DFLATBUFFERS_URL="/flatbuffers-1.11.0.tar.gz" \
-DSPDLOG_URL="/spdlog-1.5.0.tar.gz" \
-DCORE_PLATFORM_NAME=gbm \
-DGBM_RENDER_SYSTEM=gles \
../"xbmc-18e29eee7ee436fd574c9fddd810eb286488ff6f"
make
make preinstall

Any thoughts on the cause of the new error?


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - popcornmix - 2020-09-08

Isn't that the error you had a couple of weeks back: https://forum.kodi.tv/showthread.php?tid=334983


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-08

(2020-09-08, 14:30)popcornmix Wrote: Isn't that the error you had a couple of weeks back: https://forum.kodi.tv/showthread.php?tid=334983

From that thread, the issue was that I was using fmt-5.0.1 but 3.0.1 was the version everything expected if I am not mistaken (it was from 2018 and older version).  Here I can successfully build 229a3c5 but not 18e29ee with the only change to the process being the upstream code.

Despite the error, I see the file in the build directory:
Code:
% find . -type f -name format.h
./kodi-build/build/include/fmt/format.h
./kodi-build/build/fmt/src/fmt/include/fmt/format.h



RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - asavah - 2020-09-08

fmt issue looks like a race condition to me. Seeing a full output might shed some light.


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-08

I started a bisect where the good commit seems to have been rebased away. 

Good: 229a3c595bc20a7e76c8bb1665a9519adfdf0f84
Bad: 18e29eee7ee436fd574c9fddd810eb286488ff6f

I found a commit that should be near 229a3c595b to use as a surrogate that is in the log: d120467fc1238a9c47a72c98cf460b5ebb9d6e6d

I will verify that the first good commit actually finishes 100%, then I will build each subsequent bisect build until I see an occurrence of "fatal error: fmt/format.h: No such file or directory" in the build log, rather than letting the entire build finish since that seems to be the show stopped for now.

Hopefully, @popcornmix or someone else may offer a more targeted approach, but I will continue the bisect.  A complete build on my hardware takes around 35 minutes so this could be tedious.


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-08

(2020-09-08, 17:14)asavah Wrote: fmt issue looks like a race condition to me. Seeing a full output might shed some light.
Here is a link to the complete build log.


RE: popcornmix/gbm branch unable to playback 4k HEVC 10-bit video but LE can - graysky - 2020-09-08

The bisect is complete.  I cannot speak to how a race condition may affect the results if it is indeed to blame, but here is what I found:
Code:
a2519274c3ebe61712e9269e3272bba8c3b7c196 is the first bad commit
commit a2519274c3ebe61712e9269e3272bba8c3b7c196
Author: howie-f <[email protected]>
Date:   Sat Aug 22 15:57:55 2020 +0200

    [addons] minor refactoring/cleanup

 CMakeLists.txt              |  2 +-
 xbmc/CompileInfo.cpp.in     | 27 +++++++++++++++++++++------
 xbmc/CompileInfo.h          |  8 +++++++-
 xbmc/addons/AddonRepoInfo.h | 23 +++++++++++++++++++++++
 xbmc/addons/AddonRepos.cpp  | 27 ++-------------------------
 xbmc/addons/AddonRepos.h    | 16 +++++-----------
 xbmc/addons/CMakeLists.txt  |  1 +
 7 files changed, 60 insertions(+), 44 deletions(-)
 create mode 100644 xbmc/addons/AddonRepoInfo.h

Here is what I did:
Code:
% git bisect good d120467fc1
% git bisect bad 18e29eee7e
Bisecting: 85 revisions left to test after this (roughly 7 steps)
[bc01e018094584dc094fae71757092aa097abed9] Merge pull request #17822 from matthuisman/quiet_addon_settings

% git bisect good          
Bisecting: 42 revisions left to test after this (roughly 6 steps)
[f2af2eb632efb57feec88948e6831e4a677a8855] [addons] fix: allow system dependencies for repositories

% git bisect bad
Bisecting: 21 revisions left to test after this (roughly 5 steps)
[93b32bca6423ddcc071e24263a68d043fadf14a1] [addons][screensaver] use ADDON_HARDWARE_CONTEXT and kodi::HardwareContext for void*

% git bisect bad
Bisecting: 7 revisions left to test after this (roughly 3 steps)
[1dad8cf4b8b8d9df48f16c9c48224cda2cddb53b] Merge pull request #18312 from howie-f/v19-zipinstall-repobrowse

% git bisect bad
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[a2519274c3ebe61712e9269e3272bba8c3b7c196] [addons] minor refactoring/cleanup

% git bisect bad
Bisecting: 2 revisions left to test after this (roughly 2 steps)
[35a931d1c9b9c6a9176d3b3f8a38143e12d63f10] [addons] if an addon has no repo it will at least update-check official repos

% git bisect good
Bisecting: 0 revisions left to test after this (roughly 1 step)
[6fe6be5daf64930dafd6a9a7df05f6a754463bd1] [addons] fix: set origin for optional system addons on sync

% git bisect good
a2519274c3ebe61712e9269e3272bba8c3b7c196 is the first bad commit
commit a2519274c3ebe61712e9269e3272bba8c3b7c196
Author: howie-f <[email protected]>
Date:   Sat Aug 22 15:57:55 2020 +0200

    [addons] minor refactoring/cleanup

CMakeLists.txt              |  2 +-
xbmc/CompileInfo.cpp.in     | 27 +++++++++++++++++++++------
xbmc/CompileInfo.h          |  8 +++++++-
xbmc/addons/AddonRepoInfo.h | 23 +++++++++++++++++++++++
xbmc/addons/AddonRepos.cpp  | 27 ++-------------------------
xbmc/addons/AddonRepos.h    | 16 +++++-----------
xbmc/addons/CMakeLists.txt  |  1 +
7 files changed, 60 insertions(+), 44 deletions(-)
create mode 100644 xbmc/addons/AddonRepoInfo.h