v19 Compiling Kodi 19 on RaspiOS RPI4 HW-decoding problems
#1
Unfortunately kernel 5.10 caused major regressions for the default Kodi (18.7) on Raspberry Pi OS on a RPI4. The Kodi version that is shipped in the default repository.

HEVC files don't play and MPEG4 videos play jerky

I too experience files that don't play in the default Kodi and Kernel 5.10 on RaspiOS. They worked fine before in kernel 5.4 and they work fine in LibreElec 10 beta.

So I decided to build Kodi 19 on RaspiOS, to see if that helps.

Using this version from popcornmix:
https://github.com/popcornmix/xbmc/tree/gbm_matrix

wget https://github.com/popcornmix/xbmc/archi...matrix.zip
unzip gbm_matrix.zip

cd xbmc-gbm_matrix
mkdir kodi-build
cd kodi-build

// workaround drm_fourcc.h error
mkdir /usr/include/drm/
ln -s /usr/include/libdrm/drm_fourcc.h /usr/include/drm/drm_fourcc.h

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

cmake --build . -- VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)

Building on a RPI400 takes around 2 hours.

Code:
// Changes config.txt
dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=rpivid-v4l2

I end up with a build that does start, does have HW support, but crashes at the moment I play an HEVC file with HW acceleration enabled.


Code:
groups pi
pi : pi adm dialout cdrom sudo audio video plugdev games users input render netdev spi i2c gpio lpadmin

Code:

// kodi.log
CDVDVideoCodecDRMPRIME::AddData - send packet failed: Cannot allocate memory (-12)

// terminal
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_allo

I tried to follow the advises in this thread, but I guess I missed something.
Reply
#2
Have you increased cma allocation? Try with:
Code:
dtoverlay=vc4-kms-v3d,cma-512
and remove any gpu_mem setting.
Reply
#3
(2021-04-06, 12:24)popcornmix Wrote: Have you increased cma allocation? Try with:
Code:
dtoverlay=vc4-kms-v3d,cma-512
and remove any gpu_mem setting.

Thank you, but that's exactly what I did, (quoted the config.txt settings in my OP)

I also tried with and without:
dtoverlay=rpivid-v4l2

I'm not sure if that is needed, but it doesn't make a difference.

Something with the ffmpeg version that is downloaded in the build process?

Reply
#4
(2021-04-06, 12:24)popcornmix Wrote: Have you increased cma allocation? Try with:
Code:
dtoverlay=vc4-kms-v3d,cma-512
and remove any gpu_mem setting.

Yes I've done that, but I must be doing something wrong, tried it all over today with a fresh RaspiOS image.

Compile steps:
build script

Changes /boot/config.txt
/boot/config.txt

Still getting these errors:

Code:
INFO <general>: CDVDVideoCodecDRMPRIME::Open - using decoder V4L2 mem2mem HEVC decoder wrapper
INFO <general>: CDVDVideoCodecDRMPRIME::Open - unable to open codec
INFO <general>: CDVDVideoCodecDRMPRIME::Open - using decoder HEVC (High Efficiency Video Coding)

ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Cannot allocate memory (-12)
Log file

What's wrong?
Reply



Logout Mark Read Team Forum Stats Members Help
Compiling Kodi 19 on RaspiOS RPI4 HW-decoding problems0
This forum uses Lukasz Tkacz MyBB addons.