LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 10-07-2019, 11:59 AM   #1
tarnow
LQ Newbie
 
Registered: Sep 2019
Posts: 3

Rep: Reputation: Disabled
Raspberry Pi 4 + Slackware ARM -current + Kodi 18.4 + FFmpeg 4.2 with x265


Hello Everybody,

In case somebody wants to try the new Raspberry Pi 4 with Slackware and Kodi here is more information.
http://axes2solution.com/kodi-slackware.html
 
Old 10-08-2019, 12:15 PM   #2
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,142

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by tarnow View Post
Hello Everybody,

In case somebody wants to try the new Raspberry Pi 4 with Slackware and Kodi here is more information.
http://axes2solution.com/kodi-slackware.html
This is great. Thank you for sharing!
 
Old 10-08-2019, 04:33 PM   #3
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,217

Rep: Reputation: 640Reputation: 640Reputation: 640Reputation: 640Reputation: 640Reputation: 640
Nice work tarnow!

I'm not planning to get a Pi4, actually actively moving away from Raspberries (and ARM in general), but since I've spent some time optimizing, building and documenting the Kodi 17 & 18 releases for Raspberries up to Pi3B+, I have some questions/curiosities.

I took a look on both the xbmc.SlackBuild and the kodi.patch you provided and I'm wondering:

1. while patching the FFMPEG Makefile, are you sure you enabled the HW accelerated decoding for x264 & x265 (you forgot to do it for the MPEG2, but that was not activated anyways without a license on all the Raspberries - I had to buy such licences) with the configure switches: --enable-libx265 --enable-libx264 ?
In my last attempt to get FFMPEG working properly with the MMAL acceleration (without x265), I had to use specific configure switches and also to patch the FFMPEG code:
https://www.linuxquestions.org/quest...5/#post5958276
I also realized that the very efficient OMX decoding was broken and noticed that they don't really care about it anymore, dropped it already in Kodi 19. Frankly, this was also the point I started to loose interest in Raspberries.
I noticed you enabled it in the FFMPEG build with --enable-omx --enable-omx-rpi. Is it working OK? It was useless for me on PVR (DVB) streams in Kodi 18.1 - constantly interrupting.

2. in the xbmc.SlackBuild you provide the configure script the --with-platform=raspberry-pi4 directive. Wondering if in Kodi 18.4 the appropriate Rpi 4 optimization flags (for this target platform) are already available in cmake/scripts/linux/ArchSetup.cmake ?
I remember I had to patch that file:
https://www.linuxquestions.org/quest...5/#post5957433

3. Noticed in your kodi.patch that you're modifying (patching): VaapiEGL.cpp, EGLUtils.cpp, GLContextEGL.cpp, GLContextEGL.h (maybe missed one)
Is that really necessary? Where did you get the patches from?


The Pi4 is a powerful device and it could handle the video decoding even on SW level (not sure about 4K) and even without properly optimizing the code (both Kodi and FFMPEG) for its CPU capabilities (HW video decoding and NEON SIMD extension).
 
Old 10-10-2019, 12:35 AM   #4
tarnow
LQ Newbie
 
Registered: Sep 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
Many thanks for your interest abga.

1. According to https://www.raspberrypi.org/document...odeclicence.md MPEG2 and VC1 hardware codecs are permanently disabled in RPI4 in favor of software codecs. I have only tested H.264 and H.265 videos so I have no idea if other video decoding will work. Under FFmpeg, hardware acceleration can be enabled with configuration options "--enable-gpl" and "--enable-mmal", assuming that you have the required mmal header files. This is the only thing that I did, no source code patching there. The hardware acceleration usage can be seen either in Kodi System Information page or with glxinfo. Both of the omx flags I have left for backward compatibility and I have not tested OMX. On Kodi forum someone suggested to use popcornmix's FFmpeg 4.0.4 as it has some good HVEC optimisation for RPI4. Currently I am not happy with 4K HVEC test results (software decoding) so I will give it a try.

2. For the flag --with-platform=raspberry-pi4 I have not noticed any difference if it is set to pi3 or pi4. I guess for RPI4 this can be set to one of these two.

3. The kodi.patch is a collection of fixes for errors encountered during compilation. I have not done any optimization or improvements there. I wanted to make the compiler happy. Those patches are based on my experience and various code fixes found on the internet, thanks google

All in all, this is just a collection of ideas that I wanted to put together to make a working system, pack it up in a single slackbuild package and share it with you. Please feel free to modify it however you like it.

Last edited by tarnow; 10-10-2019 at 12:36 AM.
 
1 members found this post helpful.
Old 10-10-2019, 04:30 PM   #5
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,217

Rep: Reputation: 640Reputation: 640Reputation: 640Reputation: 640Reputation: 640Reputation: 640
Thanks for your replies. I'm still running Kodi 17 on Pi Zero, wanted to upgrade to Kodi 18, documented the build process here in the forum and stopped when I realized that OMX is broken. Your fresh work just stimulated my curiosity and wanted to learn about the new developments, including the support for Pi4. BTW, thanks for the info about the MPEG2 and VC1 hardware acceleration deactivation, missed that one.

Based on your replies, I did some checks and realized that Pi4 is not yet officially supported in Kodi 18.4.
In your SlackBuild, in which you build Kodi a little different than the official recommended way (with the help of cmake), you're configuring the platform "--with-platform=raspberry-pi4 ". That platform apparently doesn't exist in tools/depends/configure.ac, but only:
Code:
  raspberry-pi)
...
  raspberry-pi2)
...
  raspberry-pi3)
Nor in the file I mentioned in my first reply, used in the officially recommended build method - cmake/scripts/linux/ArchSetup.cmake
At least now it contains optimizations for Pi2/ Pi3:
Code:
# temp until further cleanup is done
# add Raspberry Pi 2 and 3 specific flags
if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
  if(CPU MATCHES "cortex-a7")
    set(NEON_FLAGS "-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad")
  elseif(CPU MATCHES "cortex-a53")
    set(NEON_FLAGS "-fPIC -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad")
  endif()
endif()
On FFMPEG, noticed that they still use their own Kodi "specialized" version and not the mainstream one:
https://github.com/xbmc/FFmpeg/archi...ia-18.4.tar.gz
The configure options I referenced in an older post of mine: --enable-decoder=h264_mmal & --enable-decoder=mpeg2_mmal do not exist, but only (comments inline):
Code:
#Enabling MMAL acceleration:
FFmpeg-4.0.4-Leia-18.4# ./configure --help | grep mmal
  --enable-mmal            enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
# NEON is enabled by default, good!
FFmpeg-4.0.4-Leia-18.4# ./configure --help | grep neon
  --disable-neon           disable NEON optimizations
# And with these two options only the encoding is enabled:
FFmpeg-4.0.4-Leia-18.4# ./configure --help | grep libx26
  --enable-libx264         enable H.264 encoding via x264 [no]
  --enable-libx265         enable HEVC encoding via x265 [no]
I do (did) care and follow what popcornmix (Dom Cobley, Senior Principal Software Engineer @ Raspberry) and the folks at LibreELEC are doing, because popcornmix, due to his senior position, test capabilities and access to the Pi internals, can provide the best knowledge and LibreELEC the practical implementation of that knowledge.
Noticed that both are still heavily patching FFMPEG for the Raspberry target:
https://github.com/popcornmix/xbmc/t.../target/ffmpeg
https://github.com/LibreELEC/LibreEL...ffmpeg/patches

Building libx265 and enabling MMAL in FFMPEG, as you are doing, should be sufficient for providing HW acceleration. The only reliable way I found to check if it's really enabled is to monitor the CPU usage. That works for OMX all the time, not sure about MMAL, as the latter is not really efficient.

Popcornmix on MMAL:
https://github.com/popcornmix/omxpla...ment-513831534
And maybe looking into the LibreELEC build source code for their Rpi4 (still beta) release can shed some light about the platform optimizations and HW acceleration.
https://libreelec.tv/2019/09/libreelec-leia-9-2-beta1/

Last edited by abga; 10-10-2019 at 05:17 PM. Reason: abut=about (I'm not Canadian ;) )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] KODI Leia - 18.x MediaPlayer - Optimized for Raspberry Pi1/Zero/Pi2B/Pi3B(+) on Slackware ARM 14.2 SF & Slackware ARM - current HF abga Slackware - ARM 8 05-07-2019 04:55 PM
[SOLVED] KODI Krypton - 17.x MediaPlayer - Optimized for Raspberry Pi1/Pi2/Pi3 on Slackware ARM 14.2 SF & Slackware ARM - current HF abga Slackware - ARM 40 08-28-2018 08:50 PM
LXer: FFmpeg & Libav Add H.265 Encoder Via x265 LXer Syndicated Linux News 0 02-13-2014 09:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 07:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration