v19 Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster.
#46
Just a correction:
"It's a fresh install with updates that's it. I want 64 bit to use the extra ram, and so I can install some emulators and games along side it. They should perform better when compiled for 64 bit."
Raspbian (at least) 32 bit kernel has PAE enabled so it uses all the available RAM of the Pi 4 8GB.
Reply
#47
(2021-01-22, 19:49)rascas Wrote: Just a correction:
"It's a fresh install with updates that's it. I want 64 bit to use the extra ram, and so I can install some emulators and games along side it. They should perform better when compiled for 64 bit."
Raspbian (at least) 32 bit kernel has PAE enabled so it uses all the available RAM of the Pi 4 8GB.

Each process is still limited to a maximum of 4 GB of memory and you don't get the other benefits of a 64 bit processor. Like extra registers
Reply
#48
I have just tried this, and on RPiOS64 I was able to build kodi as a 64-bit app and hardware decode/direct to plane rendering is working
(both stateless v4l2 for hevc and stateful v4l2 for h264).
Reply
#49
I got stuck in the compile process:

I compiled ffmpeg aside of kodi (sucessfully, using https://pimylifeup.com/compiling-ffmpeg-raspberry-pi/) and now am facing the following issue while linking kodi:

/usr/bin/ld.gold: error: cannot find -lmmal_core
/usr/bin/ld.gold: error: cannot find -lmmal_util
/usr/bin/ld.gold: error: cannot find -lmmal_vc_client
/usr/bin/ld.gold: error: cannot find -lbcm_host
/usr/bin/ld.gold: error: cannot find -lmmal_core
/usr/bin/ld.gold: error: cannot find -lmmal_util
/usr/bin/ld.gold: error: cannot find -lmmal_vc_client
/usr/bin/ld.gold: error: cannot find -lbcm_host
libavformat/fifo.c:519: error: undefined reference to '__atomic_store_8'
libavformat/fifo.c:624: error: undefined reference to '__atomic_fetch_add_8'
libavformat/fifo.c:631: error: undefined reference to '__atomic_store_8'
libavformat/fifo.c:188: error: undefined reference to '__atomic_fetch_sub_8'
libavformat/fifo.c:457: error: undefined reference to '__atomic_load_8'
libavformat/fifo.c:597: error: undefined reference to '__atomic_fetch_add_8'

sudo ldconfig -p | grep mmal
    libmmal_vc_client.so (libc6,hard-float) => /opt/vc/lib/libmmal_vc_client.so
    libmmal_util.so (libc6,hard-float) => /opt/vc/lib/libmmal_util.so
    libmmal_core.so (libc6,hard-float) => /opt/vc/lib/libmmal_core.so
    libmmal_components.so (libc6,hard-float) => /opt/vc/lib/libmmal_components.so
    libmmal.so (libc6,hard-float) => /opt/vc/lib/libmmal.so

Does anybody has an idea? I started the process in turn to enable HW accelerated playback on the RPi 4.
Reply
#50
Kodi 19 doesn't use mmal on pi. It should be built for gbm with v4l2 as the video acceleration method.
Unfortunately ffmpeg doesn't have full support for v4l2 merged yet, so you do need to use custom trees.

This is the recommended tree for ffmpeg: https://github.com/jc-kynesim/rpi-ffmpeg...rm_prime_1
But you shouldn't have to build that directly as kodi typically uses an internal build of ffmpeg.
This branch has internal ffmpeg patched to support v4l2. https://github.com/popcornmix/xbmc/tree/gbm
Reply
#51
(2021-02-03, 19:33)popcornmix Wrote: Kodi 19 doesn't use mmal on pi. It should be built for gbm with v4l2 as the video acceleration method.
Unfortunately ffmpeg doesn't have full support for v4l2 merged yet, so you do need to use custom trees.

This is the recommended tree for ffmpeg: https://github.com/jc-kynesim/rpi-ffmpeg...rm_prime_1
But you shouldn't have to build that directly as kodi typically uses an internal build of ffmpeg.
This branch has internal ffmpeg patched to support v4l2. https://github.com/popcornmix/xbmc/tree/gbm
Thanks for pointing into the direction and sorry for my questions. kodi is quite a complex software architecture. I compiled your tree but cannot confirm that HW acceleration is used when running. It is still slow (and fails when PRIME support is enabled; http://paste.ubuntu.com/p/PqgTpZY9cT/). 

I'm using "cmake ../xbmc -DCMAKE_INSTALL_PREFIX=/usr/local -DX11_RENDER_SYSTEM=gles -DAPP_RENDER_SYSTEM=gles -DENABLE_INTERNAL_FMT=ON -DENABLE_INTERNAL_FLATBUFFERS=ON -DENABLE_INTERNAL_SPDLOG=ON -DWAYLAND=OFF -DCORE_PLATFORM_NAME="gbm"" for configuration.

When started, I get a message saying that va is not working:
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
Reply
#52
VA shouldn't work at all.
Disable it at configure time.
-DENABLE_VAAPI=OFF

I'm not sure if v4l acceleration is even supposed to work on X11 at this point. I think it is not.
You need to build kodi for gbm.
-DCORE_PLATFORM_NAME=gbm -DGBM_RENDER_SYSTEM=gles
Reply
#53
Try searching this forum for posts by graysky - he's gone through the same process as you. This is one, but there are several.
https://forum.kodi.tv/showthread.php?tid...ight=build
Reply
#54
(2021-02-02, 19:51)popcornmix Wrote: I have just tried this, and on RPiOS64 I was able to build kodi as a 64-bit app and hardware decode/direct to plane rendering is working
(both stateless v4l2 for hevc and stateful v4l2 for h264).

Care to share your cmake config command?
Reply
#55
Code:
cmake ../kodi_gbm -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=gbm -DAPP_RENDER_SYSTEM=gles -DENABLE_VAAPI=OFF -DENABLE_VDPAU=OFF -DENABLE_DEBUGFISSION=OFF -DENABLE_TESTING=OFF -DENABLE_INTERNAL_SPDLOG=ON -DENABLE_INTERNAL_FMT=ON
but you probably should read the previous threads as you won't get hw decode otherwise.
You'll need 5.10 kernel tree and headers from that installed. And you'll need to move drm_fourcc.h.
Reply
#56
(2021-02-05, 20:45)popcornmix Wrote:
Code:
cmake ../kodi_gbm -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=gbm -DAPP_RENDER_SYSTEM=gles -DENABLE_VAAPI=OFF -DENABLE_VDPAU=OFF -DENABLE_DEBUGFISSION=OFF -DENABLE_TESTING=OFF -DENABLE_INTERNAL_SPDLOG=ON -DENABLE_INTERNAL_FMT=ON
but you probably should read the previous threads as you won't get hw decode otherwise.
You'll need 5.10 kernel tree and headers from that installed. And you'll need to move drm_fourcc.h.
I tested this with your latest commit of gdm branch on rpi OS 64bit which is on a 5.10 kernel and still 4k h.265 content does not play. Only audio. Content that plays fine in libreELECT with kodi 18.  

Is there some other trick to it? I don't fully understand the kernel header's part. Is there some special rpi specific kernel headers I need to install?
Reply
#57
Hello, I try to compile xbmc / gbm from popcornmix, I use the rpi-5.10.y kernel 
Quote:You'll need 5.10 kernel tree and headers from that installed. And you'll need to move drm_fourcc.h.
I've compiled directly the kernel with my rpi4-64bits, sources in /usr/src/linux.
So headers needed are inside /opt/vc of raspberry pi firmware I only need this from the firmware If I understand correctly ? Do I need something from the userland project of raspberry pi ?
I didn't understood where I should move drm_fourcc.h.

Thanks for your help & amazing work @popcornmix .
Reply
#58
(2021-02-09, 11:21)Gonto Wrote: So headers needed are inside /opt/vc of raspberry pi firmware I only need this from the firmware If I understand correctly ? Do I need something from the userland project of raspberry pi ?

No. Kodi 19 has moved to completely standard linux interfaces for decode (v4l2) and display (drm).
There is no need for /opt/vc or any raspberrypi/userland libs anymore.
Quote:I didn't understood where I should move drm_fourcc.h.
https://forum.kodi.tv/showthread.php?tid...pid2965243 (although you should now be on 5.10 kernel).
Reply
#59
(2021-02-09, 14:24)popcornmix Wrote:
Quote:I didn't understood where I should move drm_fourcc.h.
https://forum.kodi.tv/showthread.php?tid...pid2965243 (although you should now be on 5.10 kernel).

I managed to get it to build fine by patching your patch.  Smile  Guessing that patch is changes from the drm branch you mentioned.  There are other places in that patch where it references it as "drm_fourcc.h", and the pkgconfig for libdrm-dev adds an include line -I${includedir}/drm that ffmpeg is using.
 
Code:
diff --git a/tools/depends/target/ffmpeg/ffmpeg-001-rpi.patch b/tools/depends/target/ffmpeg/ffmpeg-001-rpi.patch
index 81673ca32a..9f4043747d 100644
--- a/tools/depends/target/ffmpeg/ffmpeg-001-rpi.patch
+++ b/tools/depends/target/ffmpeg/ffmpeg-001-rpi.patch
@@ -52157,7 +52157,7 @@ index 32cbde82eb..9ba8b7b2dd 100644
  #include <unistd.h>

  #include <drm.h>
-+#include <drm/drm_fourcc.h>
++#include <drm_fourcc.h>
  #include <xf86drm.h>

  #include "avassert.h"
Reply
#60
(2021-02-09, 14:24)popcornmix Wrote:
(2021-02-09, 11:21)Gonto Wrote: So headers needed are inside /opt/vc of raspberry pi firmware I only need this from the firmware If I understand correctly ? Do I need something from the userland project of raspberry pi ?

No. Kodi 19 has moved to completely standard linux interfaces for decode (v4l2) and display (drm).
There is no need for /opt/vc or any raspberrypi/userland libs anymore.
Quote:I didn't understood where I should move drm_fourcc.h.
https://forum.kodi.tv/showthread.php?tid...pid2965243 (although you should now be on 5.10 kernel).

Thanks for the clarification,
I obtain an ERROR: Unable to create GUI.

I've used
Code:
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=gbm -DAPP_RENDER_SYSTEM=gles -DENABLE_VAAPI=OFF -DENABLE_VDPAU=OFF -DENABLE_DEBUGFISSION=OFF -DENABLE_TESTING=OFF -DENABLE_INTERNAL_FLATBUFFERS=ON -DENABLE_INTERNAL_FFMPEG=ON -DENABLE_INTERNAL_SPDLOG=ON -DENABLE_INTERNAL_FMT=ON

The kernel is
Code:
Linux 5.10.14-v8+ #1 SMP PREEMPT Mon Feb 8 17:51:54 CET 2021 aarch64 GNU/Linux
This in boot.txt
Code:

arm_64bit=1
enable_gic=1
armstub=armstub8-gic.bin
force_turbo=1
#over_voltage=6
#gpu_freq=600
#arm_freq=1500
disable_overscan=1
dtoverlay=vc4-kms-v3d-pi4,cma-256
dtoverlay=rpivid-v4l2
hdmi_enable_4kp60=1

Any idea of what I'm doing wrong ?
Reply

Logout Mark Read Team Forum Stats Members Help
Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster.0