LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 04-23-2020, 07:24 PM   #16
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Original Poster
Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929

@Geremia

Note that I'm also building a separate FFMPEG, properly optimized for the vc4 GPU and I'm subtituting and blacklisting (from updates) the one that comes with Slackware ARM. FFMPEG is the workhorse for the Kodi "overlay".
I'm also using this optimized FFMPEG for other players and if you follow my instructions for building it please note that I made a mistake related to a ./configure switch, actually disabling ffplay, corrected by @lazardo here:
https://www.linuxquestions.org/quest...ml#post6058232
- use the --enable-sdl switch

@tarnow presented another way of building Kodi, optimized for the Pi4. He found a way to link the Kodi build with the mesa libs in /opt/vc and is patching and building FFMPEG statically inside the Kodi build (as designed). I haven't tried his instructions, but only commented/corrected some steps:
https://www.linuxquestions.org/quest...65-4175662156/

Slackware ARM is not focusing on Raspberry optimizations, but built to run on many ARM boards and for the Raspberry you need specially optimized mesa libs (/opt/vc) and FFMPEG.
 
Old 04-23-2020, 07:47 PM   #17
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Original Poster
Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Quote:
Originally Posted by Geremia View Post
I didn't follow your instructions, so I did have Mesa installed when I built.

What's the point of removing it? The configuration step still says "-- Platform: X11". There doesn't seem to be a way to disable X11.
-DENABLE_X11 was removed in the latest Kodi's CMakeLists.txt.
Kodi will statically link to the mesa libs from /usr/lib, if they are available (dumb decision at Kodi HQ):
https://forum.kodi.tv/showthread.php?tid=305791

Didn't know about the removal of -DENABLE_X11, at least Kodi 18.1 was OK (the last one I built & played with) and didn't require X, maybe use that version instead.

Now, I don't want to push you away from using Slackware, quite the contrary, I'm happy to keep you a happy Slacker, but if you feel that building and using Kodi on Slackware ARM is too complicated & time consuming. And, if you plan to dedicate your Raspberry board just for Kodi, then LibreELEC could be a good alternative. I've also used it and the latest versions provide all the goodies and customizations one would require (it wasn't the case with older versions), including firewall, openvpn, etc:
https://libreelec.tv/

As for me, I'm still using Kodi 17.4 on Pi Zero boards, running Slackware ARM 14.2, and I'm really happy with it, no need for Netflix & other crap, but only playing DVB streams (another Pi Zero runs tvheadend and streams DVB-S2 & DVB-C), add-on streams, IP-TV streams, online radio, local media, you name it ...

Last edited by abga; 04-23-2020 at 07:55 PM. Reason: typo
 
Old 04-24-2020, 01:15 PM   #18
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 516

Rep: Reputation: 50
My issue is entirely with X, though; xorgsetup doesn't produce an xorg.conf.

Kodi runs just fine when I start it from within an xterm in Fluxbox. I tried this with TigerVNC, but Kodi doesn't start when I want it to go through the HDMI to the TV.

Last edited by Geremia; 04-24-2020 at 01:28 PM.
 
Old 04-24-2020, 09:41 PM   #19
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Original Poster
Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Quote:
Originally Posted by Geremia View Post
My issue is entirely with X, though; xorgsetup doesn't produce an xorg.conf.

Kodi runs just fine when I start it from within an xterm in Fluxbox. I tried this with TigerVNC, but Kodi doesn't start when I want it to go through the HDMI to the TV.
Try to rebuild it by following my instructions to "hide" the mesa libs that are officially provided by Slackware ARM - uninstall and reinstall them (the package) back after you got the Kodi built - and point the Kodi build scripts to use the ones in /opt/vc/
Then, use the glx & glkodi scripts I mentioned to switch the symlinks in /usr/lib, for the case when you use X and then for when you use Kodi.
When using the Slackware provided mesa libs and not switching the libs I get an "ERROR: Unable to create GUI. Exiting" error and not a "X11 Error: No Display found"
Make sure sure you have proper settings in your /boot/config.txt (reboot is needed after any modifications):
Code:
#comment out:
#dtoverlay=vc4-fkms-v3d
# set the minimum amount of GPU RAM (at least 128 MB)
gpu_mem=128
framebuffer_depth=24
#or if you have eagle eyes and not limited like all other humans to 24 bit color depth (useless)
#framebuffer_depth=32
#framebuffer_ignore_alpha=1
Or, raise the issue with the Kodi devs in the Kodi Forum. Although I couldn't find a record with the removal of -DENABLE_X11 in the commits history (might have missed it):
https://github.com/xbmc/xbmc/commits/Leia

1 year ago, -DENABLE_X11 was discussed and considered not required for the Raspberry target:
https://forum.kodi.tv/showthread.php...304#pid2845304

I'm sorry, I don't have the time & space to start building Kodi 18 again. Other than helping you, I also have no interest in using it, since the OMX engine is broken and it's useless on my Raspberry Pi Zero boards. I'm keeping Kodi 17.4 running until Slackware ARM 14.2 is still maintained, after which I might move to a stripped down version of Gentoo ARM (already prepared). I can't use LibreELEC, because they use the broken Raspberry firmware (analogue audio) and the Kodi 17.x releases that have the OMX engine working are unmaintained.

Last edited by abga; 04-24-2020 at 11:00 PM. Reason: typo
 
Old 04-25-2020, 03:16 PM   #20
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 516

Rep: Reputation: 50
Quote:
Originally Posted by abga View Post
glx & glkodi scripts I mentioned to switch the symlinks in /usr/lib, for the case when you use X and then for when you use Kodi.
Quote:
Originally Posted by abga View Post
Code:
#! /bin/sh
cd /usr/lib
rm libEGL.so
ln -s /opt/vc/lib/libEGL.so libEGL.so
rm libGLESv2.so
ln -s /opt/vc/lib/libGLESv2.so libGLESv2.so
didn't help with video choppiness in Kodi or Mplayer.

Also, I don't have a /boot/config.txt file to put gpu_mem=252 or 512, but there is a /boot/config-armv7-5.4.31 file. Is there a new way to set GPU memory?
 
Old 04-25-2020, 04:19 PM   #21
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Original Poster
Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Quote:
Originally Posted by Geremia View Post
didn't help with video choppiness in Kodi or Mplayer.

Also, I don't have a /boot/config.txt file to put gpu_mem=252 or 512, but there is a /boot/config-armv7-5.4.31 file. Is there a new way to set GPU memory?
The video choppiness could be caused by FFMPEG, if that wasn't properly optimized and directed to use the mesa libs in /opt/vc.
It could be also caused by the broken OMX, disable OMX acceleration and enable only MMAL in Kodi's settings (GUI Menu > Settings > Video Player)
Or, it could be because of the default Advanced Deinterlacing Method, switch it to MMAL Bob as instructed in the end of this older post:
https://www.linuxquestions.org/quest...2/#post5759079

You should have a /boot/config.txt, that's the firmware (BIOS) conf file, create it if it's not there and /boot/config-armv7-5.4.31 should be the kernel config file. Don't know how you installed Slackware ARM, I'm only able to help you if you followed the standard manual setup as I don't have experience with any other method:
https://docs.slackware.com/howtos:ha...rm:raspberrypi
 
Old 04-27-2020, 07:32 PM   #22
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 516

Rep: Reputation: 50
Quote:
Originally Posted by abga View Post
The video choppiness could be caused by FFMPEG, if that wasn't properly optimized and directed to use the mesa libs in /opt/vc.
What FFMPEG libs need to link to libs in /opt/vc?
I'm simply using ffmpeg-4.2.2-arm-1 from http://ftp.arm.slackware.com/slackwa...rearm-current/ :
Code:
PACKAGE NAME:     ffmpeg-4.2.2-arm-1
COMPRESSED PACKAGE SIZE:     7.8M
UNCOMPRESSED PACKAGE SIZE:     27M
PACKAGE LOCATION: ./ffmpeg-4.2.2-arm-1.txz
PACKAGE DESCRIPTION:
ffmpeg: ffmpeg (software to record, convert and stream audio and video)
ffmpeg:
ffmpeg: FFmpeg is the leading multimedia framework, able to decode, encode,
ffmpeg: transcode, mux, demux, stream, filter and play pretty much anything
ffmpeg: that humans and machines have created. It supports the most obscure
ffmpeg: ancient formats up to the cutting edge. It includes libavcodec, the
ffmpeg: leading audio/video codec library. 
ffmpeg:
ffmpeg: Homepage: https://ffmpeg.org/
ffmpeg:
ffmpeg:
FILE LIST:
./
install/
install/doinst.sh
install/slack-desc
usr/
usr/bin/
usr/bin/ffmpeg
usr/bin/ffplay
usr/bin/ffprobe
usr/doc/
usr/doc/ffmpeg-4.2.2/
usr/doc/ffmpeg-4.2.2/COPYING.GPLv2
usr/doc/ffmpeg-4.2.2/COPYING.GPLv3
usr/doc/ffmpeg-4.2.2/COPYING.LGPLv2.1
usr/doc/ffmpeg-4.2.2/COPYING.LGPLv3
usr/doc/ffmpeg-4.2.2/CREDITS
usr/doc/ffmpeg-4.2.2/Changelog
usr/doc/ffmpeg-4.2.2/INSTALL.md
usr/doc/ffmpeg-4.2.2/LICENSE.md
usr/doc/ffmpeg-4.2.2/MAINTAINERS
usr/doc/ffmpeg-4.2.2/README.md
usr/doc/ffmpeg-4.2.2/RELEASE
usr/doc/ffmpeg-4.2.2/RELEASE_NOTES
usr/doc/ffmpeg-4.2.2/VERSION
usr/doc/ffmpeg-4.2.2/html/
usr/doc/ffmpeg-4.2.2/html/developer.html
usr/doc/ffmpeg-4.2.2/html/faq.html
usr/doc/ffmpeg-4.2.2/html/fate.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-all.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-bitstream-filters.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-codecs.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-devices.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-filters.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-formats.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-protocols.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-resampler.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-scaler.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg-utils.html
usr/doc/ffmpeg-4.2.2/html/ffmpeg.html
usr/doc/ffmpeg-4.2.2/html/ffplay-all.html
usr/doc/ffmpeg-4.2.2/html/ffplay.html
usr/doc/ffmpeg-4.2.2/html/ffprobe-all.html
usr/doc/ffmpeg-4.2.2/html/ffprobe.html
usr/doc/ffmpeg-4.2.2/html/general.html
usr/doc/ffmpeg-4.2.2/html/git-howto.html
usr/doc/ffmpeg-4.2.2/html/libavcodec.html
usr/doc/ffmpeg-4.2.2/html/libavdevice.html
usr/doc/ffmpeg-4.2.2/html/libavfilter.html
usr/doc/ffmpeg-4.2.2/html/libavformat.html
usr/doc/ffmpeg-4.2.2/html/libavutil.html
usr/doc/ffmpeg-4.2.2/html/libswresample.html
usr/doc/ffmpeg-4.2.2/html/libswscale.html
usr/doc/ffmpeg-4.2.2/html/mailing-list-faq.html
usr/doc/ffmpeg-4.2.2/html/nut.html
usr/doc/ffmpeg-4.2.2/html/platform.html
usr/include/
usr/include/libavcodec/
usr/include/libavcodec/ac3_parser.h
usr/include/libavcodec/adts_parser.h
usr/include/libavcodec/avcodec.h
usr/include/libavcodec/avdct.h
usr/include/libavcodec/avfft.h
usr/include/libavcodec/d3d11va.h
usr/include/libavcodec/dirac.h
usr/include/libavcodec/dv_profile.h
usr/include/libavcodec/dxva2.h
usr/include/libavcodec/jni.h
usr/include/libavcodec/mediacodec.h
usr/include/libavcodec/qsv.h
usr/include/libavcodec/vaapi.h
usr/include/libavcodec/vdpau.h
usr/include/libavcodec/version.h
usr/include/libavcodec/videotoolbox.h
usr/include/libavcodec/vorbis_parser.h
usr/include/libavcodec/xvmc.h
usr/include/libavdevice/
usr/include/libavdevice/avdevice.h
usr/include/libavdevice/version.h
usr/include/libavfilter/
usr/include/libavfilter/avfilter.h
usr/include/libavfilter/buffersink.h
usr/include/libavfilter/buffersrc.h
usr/include/libavfilter/version.h
usr/include/libavformat/
usr/include/libavformat/avformat.h
usr/include/libavformat/avio.h
usr/include/libavformat/version.h
usr/include/libavresample/
usr/include/libavresample/avresample.h
usr/include/libavresample/version.h
usr/include/libavutil/
usr/include/libavutil/adler32.h
usr/include/libavutil/aes.h
usr/include/libavutil/aes_ctr.h
usr/include/libavutil/attributes.h
usr/include/libavutil/audio_fifo.h
usr/include/libavutil/avassert.h
usr/include/libavutil/avconfig.h
usr/include/libavutil/avstring.h
usr/include/libavutil/avutil.h
usr/include/libavutil/base64.h
usr/include/libavutil/blowfish.h
usr/include/libavutil/bprint.h
usr/include/libavutil/bswap.h
usr/include/libavutil/buffer.h
usr/include/libavutil/camellia.h
usr/include/libavutil/cast5.h
usr/include/libavutil/channel_layout.h
usr/include/libavutil/common.h
usr/include/libavutil/cpu.h
usr/include/libavutil/crc.h
usr/include/libavutil/des.h
usr/include/libavutil/dict.h
usr/include/libavutil/display.h
usr/include/libavutil/downmix_info.h
usr/include/libavutil/encryption_info.h
usr/include/libavutil/error.h
usr/include/libavutil/eval.h
usr/include/libavutil/ffversion.h
usr/include/libavutil/fifo.h
usr/include/libavutil/file.h
usr/include/libavutil/frame.h
usr/include/libavutil/hash.h
usr/include/libavutil/hdr_dynamic_metadata.h
usr/include/libavutil/hmac.h
usr/include/libavutil/hwcontext.h
usr/include/libavutil/hwcontext_cuda.h
usr/include/libavutil/hwcontext_d3d11va.h
usr/include/libavutil/hwcontext_drm.h
usr/include/libavutil/hwcontext_dxva2.h
usr/include/libavutil/hwcontext_mediacodec.h
usr/include/libavutil/hwcontext_qsv.h
usr/include/libavutil/hwcontext_vaapi.h
usr/include/libavutil/hwcontext_vdpau.h
usr/include/libavutil/hwcontext_videotoolbox.h
usr/include/libavutil/imgutils.h
usr/include/libavutil/intfloat.h
usr/include/libavutil/intreadwrite.h
usr/include/libavutil/lfg.h
usr/include/libavutil/log.h
usr/include/libavutil/lzo.h
usr/include/libavutil/macros.h
usr/include/libavutil/mastering_display_metadata.h
usr/include/libavutil/mathematics.h
usr/include/libavutil/md5.h
usr/include/libavutil/mem.h
usr/include/libavutil/motion_vector.h
usr/include/libavutil/murmur3.h
usr/include/libavutil/opt.h
usr/include/libavutil/parseutils.h
usr/include/libavutil/pixdesc.h
usr/include/libavutil/pixelutils.h
usr/include/libavutil/pixfmt.h
usr/include/libavutil/random_seed.h
usr/include/libavutil/rational.h
usr/include/libavutil/rc4.h
usr/include/libavutil/replaygain.h
usr/include/libavutil/ripemd.h
usr/include/libavutil/samplefmt.h
usr/include/libavutil/sha.h
usr/include/libavutil/sha512.h
usr/include/libavutil/spherical.h
usr/include/libavutil/stereo3d.h
usr/include/libavutil/tea.h
usr/include/libavutil/threadmessage.h
usr/include/libavutil/time.h
usr/include/libavutil/timecode.h
usr/include/libavutil/timestamp.h
usr/include/libavutil/tree.h
usr/include/libavutil/twofish.h
usr/include/libavutil/tx.h
usr/include/libavutil/version.h
usr/include/libavutil/xtea.h
usr/include/libpostproc/
usr/include/libpostproc/postprocess.h
usr/include/libpostproc/version.h
usr/include/libswresample/
usr/include/libswresample/swresample.h
usr/include/libswresample/version.h
usr/include/libswscale/
usr/include/libswscale/swscale.h
usr/include/libswscale/version.h
usr/lib/
usr/lib/libavcodec.so.58.54.100
usr/lib/libavdevice.so.58.8.100
usr/lib/libavfilter.so.7.57.100
usr/lib/libavformat.so.58.29.100
usr/lib/libavresample.so.4.0.0
usr/lib/libavutil.so.56.31.100
usr/lib/libpostproc.so.55.5.100
usr/lib/libswresample.so.3.5.100
usr/lib/libswscale.so.5.5.100
usr/lib/pkgconfig/
usr/lib/pkgconfig/libavcodec.pc
usr/lib/pkgconfig/libavdevice.pc
usr/lib/pkgconfig/libavfilter.pc
usr/lib/pkgconfig/libavformat.pc
usr/lib/pkgconfig/libavresample.pc
usr/lib/pkgconfig/libavutil.pc
usr/lib/pkgconfig/libpostproc.pc
usr/lib/pkgconfig/libswresample.pc
usr/lib/pkgconfig/libswscale.pc
usr/man/
usr/man/man1/
usr/man/man1/ffmpeg-all.1.gz
usr/man/man1/ffmpeg-bitstream-filters.1.gz
usr/man/man1/ffmpeg-codecs.1.gz
usr/man/man1/ffmpeg-devices.1.gz
usr/man/man1/ffmpeg-filters.1.gz
usr/man/man1/ffmpeg-formats.1.gz
usr/man/man1/ffmpeg-protocols.1.gz
usr/man/man1/ffmpeg-resampler.1.gz
usr/man/man1/ffmpeg-scaler.1.gz
usr/man/man1/ffmpeg-utils.1.gz
usr/man/man1/ffmpeg.1.gz
usr/man/man1/ffplay-all.1.gz
usr/man/man1/ffplay.1.gz
usr/man/man1/ffprobe-all.1.gz
usr/man/man1/ffprobe.1.gz
usr/man/man3/
usr/man/man3/libavcodec.3.gz
usr/man/man3/libavdevice.3.gz
usr/man/man3/libavfilter.3.gz
usr/man/man3/libavformat.3.gz
usr/man/man3/libavutil.3.gz
usr/man/man3/libswresample.3.gz
usr/man/man3/libswscale.3.gz
usr/share/
usr/share/ffmpeg/
usr/share/ffmpeg/examples/
usr/share/ffmpeg/examples/Makefile
usr/share/ffmpeg/examples/README
usr/share/ffmpeg/examples/avio_dir_cmd.c
usr/share/ffmpeg/examples/avio_reading.c
usr/share/ffmpeg/examples/decode_audio.c
usr/share/ffmpeg/examples/decode_video.c
usr/share/ffmpeg/examples/demuxing_decoding.c
usr/share/ffmpeg/examples/encode_audio.c
usr/share/ffmpeg/examples/encode_video.c
usr/share/ffmpeg/examples/extract_mvs.c
usr/share/ffmpeg/examples/filter_audio.c
usr/share/ffmpeg/examples/filtering_audio.c
usr/share/ffmpeg/examples/filtering_video.c
usr/share/ffmpeg/examples/http_multiclient.c
usr/share/ffmpeg/examples/hw_decode.c
usr/share/ffmpeg/examples/metadata.c
usr/share/ffmpeg/examples/muxing.c
usr/share/ffmpeg/examples/qsvdec.c
usr/share/ffmpeg/examples/remuxing.c
usr/share/ffmpeg/examples/resampling_audio.c
usr/share/ffmpeg/examples/scaling_video.c
usr/share/ffmpeg/examples/transcode_aac.c
usr/share/ffmpeg/examples/transcoding.c
usr/share/ffmpeg/examples/vaapi_encode.c
usr/share/ffmpeg/examples/vaapi_transcode.c
usr/share/ffmpeg/ffprobe.xsd
usr/share/ffmpeg/libvpx-1080p.ffpreset
usr/share/ffmpeg/libvpx-1080p50_60.ffpreset
usr/share/ffmpeg/libvpx-360p.ffpreset
usr/share/ffmpeg/libvpx-720p.ffpreset
usr/share/ffmpeg/libvpx-720p50_60.ffpreset

Last edited by Geremia; 04-27-2020 at 07:36 PM.
 
Old 04-28-2020, 04:22 AM   #23
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,551

Rep: Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314
As the mesa build script for ARM includes a larger set of drivers than the x86 build, it may be feasible to update the ffmpeg build script (which is equivalent to the x86 build) to use them.
If that's the case, let me know!
Any additional drivers need to have an appropriate licence permitting distribution though.

Last edited by drmozes; 04-28-2020 at 04:46 AM.
 
Old 04-28-2020, 05:06 PM   #24
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Original Poster
Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Quote:
Originally Posted by Geremia View Post
What FFMPEG libs need to link to libs in /opt/vc?
I'm simply using ffmpeg-4.2.2-arm-1 from http://ftp.arm.slackware.com/slackwa...rearm-current/ :[code]PACKAGE NAME: ffmpeg-4.2.2-arm-1
...
Just trying (again) to explain the whole picture with the specific mesa libs and FFMpeg that you need for Kodi.

You have the generic mesa libs provided by Slackware ARM, that nowadays do support the Broadcom vc4 GPU acceleration (wasn't the case some 1-2 years ago and I'm still not sure to what extent the video HW decoding is), and that are the generic mainstream version. This mesa package is the one Slackware ARM provides for all supported devices and is not specifically designed, optimized and containing all the extra implementations for the Raspberry boards.
These mesa libs are the ones that the whole Slackware ARM is linked against (the programs that depend on mesa), including X and the provided FFMpeg.

Then you have the specific mesa libs, optimized by the Raspberry team, that are part of the "greater" userland package, found in /opt/vc and used as the main mesa libs in the Raspberry specific Raspbian distro.
These are also constantly fine tuned by the Raspberry Team according to the changes they perform to their firmware and maybe vc driver and I'm not sure how much of these changes are then upstreamed in the generic mesa libs, thus, I've always used these and didn't care about the generic mesa from Slackware ARM for my multimedia needs on Raspberry boards.
Overview:
https://elinux.org/Raspberry_Pi_VideoCore_APIs
For instance, these are the only ones containing the kronos OpenMAX libs -> on an up to date Slackware ARM -current system:
Code:
# find / -name OMX_Core.h -noleaf
/opt/vc/include/IL/OMX_Core.h
/opt/vc/include/interface/vmcs_host/khronos/IL/OMX_Core.h
https://en.wikipedia.org/wiki/Openmax
(Anyways, OMX is broken now in Kodi 18.x, what a pity.)
You can either extract these in binary form from the official Raspbian images, or build them yourself from github:
https://github.com/raspberrypi/userland
Build process documented in this older post:
https://www.linuxquestions.org/quest...7/#post5751491
- section ___VC-USERLAND___START

These are the two mesa libs that you'll need to have and make use of on your Slackware ARM system running on Raspberry, and that you need to switch between, according to your needs (running X or using Kodi&FFMpeg). It sucks, but it works. "Hiding" (uninstalling/reinstalling) the generic mesa libs was the only way I was able to build and use Kodi 18.x, because its build scripts automatically links it to the generic Slackware mesa libs if they are available. This sucks too, but it also works.

Now, as already mentioned, FFMpeg is the workhorse behind the Kodi Mediaplayer and it's the FFMpeg that needs to make use of all the Raspberry specific optimizations in order to provide good results. In your case, you got video choppiness presumably because the generic FFMpeg you're using, the one provided by Slackware ARM, doesn't use these Raspberry specific optimizations , in other words, it was built against the generic mesa libs. Which is normal.

For building a Raspberry optimized FFMpeg, you'll need to link it to the userland libs in /opt/vc for proper HW video playback acceleration, enable these Raspberry accelerations during the FFMpeg build with specific ./configure options and also make use of platform specific (SoC) optimizations - using the NEON SIMD (single instruction multiple data) architecture extension - FFMpeg contains assembler code for NEON
First, you'll need the userland in /opt/vc, then uninstall the Slackware ARM official FFMpeg, then grab the FFMpeg source code that was choose by the Kodi team for the Kodi 18.6 release - here you have a short HowTo
https://www.linuxquestions.org/quest...7/#post5781476
It looks to be 4.0.4-Leia-18.4 - but better check in the source code of your Kodi 18.6 tree:
https://github.com/xbmc/xbmc/blob/Le...FFMPEG-VERSION
and finally build and install it according to either:
1. the way I did it on my own (might be obsolete):
https://www.linuxquestions.org/quest...ml#post5956641
- don't forget:
https://www.linuxquestions.org/quest...ml#post6058232
2. the way the Kodi devs are doing it (might be also obsolete):
https://www.linuxquestions.org/quest...5/#post5958276
- don't forget:
https://www.linuxquestions.org/quest...ml#post6058232
3. check the Kodi 18.6 build scripts and learn/adapt if there are any changes in the way the Kodi team is building FFMpeg.

Then perform a "ldconfig", try to launch Kodi and check if it works with the new FFMpeg (it should, it's the 4.x version that is also provided by Slackware). If not, start to build Kodi again, it'll link automatically against this optimized FFmpeg.
Maybe Mplayer (and other apps that require FFMpeg) will also work with this FFMpeg version, if not, well, recompile them too.
Note that this is the "improper" way I managed to get FFMpeg build for Kodi, as shared and not built in inside Kodi, more background here:
https://www.linuxquestions.org/quest...7/#post5781540
I've already mentioned in post #16 that @tarnow found a way to build FFMpeg inside Kodi (statically) and link the whole compilation against /opt/vc. That's an elegant solution, also the "designed" way, and you can still keep the Slackware ARM provided FFMpeg and won't need to switch between the mesa libs. Try to follow his process.
I'm fine with my way, I'm using these Raspberries headless (no X) and the ones for multimedia only running Kodi.
 
Old 04-29-2020, 05:34 PM   #25
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Original Poster
Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
I dug a little in the mainstream mesa vc4 support for h264 HW accelerated decoding through MMAL, considering that maybe only the OpenMAX (OMX) engine is unique and included only in the Raspberry Userland collection and stumbled upon these Raspberry Forum posts:
https://www.raspberrypi.org/forums/v...16804#p1333585
https://www.raspberrypi.org/forums/v...16804#p1333631
- last one referencing these implementations:
https://github.com/6by9/drm_mmal
https://github.com/anholt/drm_mmal/tree/x11

I also tried to see if the mainstream mesa code for vc4 has some MMAL related records (implementations) and failed so far to find something conclusive:
https://cgit.freedesktop.org/mesa/me...?qt=grep&q=vc4
However, I could find these:
https://cgit.freedesktop.org/mesa/me...24a1fc400e0f99
https://cgit.freedesktop.org/mesa/me...a801885efc5a22
Not even sure if a MMAL HW accelerated decoding implementation (libs) should be part of mesa.

The FFMpeg package I built specific for Kodi 18.1 RC1, back in Feb 2019, and was mentioned (documented) in this thread looks linked to the following /opt/vc libs:
Code:
# ldd /usr/local/bin/ffmpeg | grep opt
        libmmal_core.so => /opt/vc/lib/libmmal_core.so (0x752c7000)
        libmmal_util.so => /opt/vc/lib/libmmal_util.so (0x752a6000)
        libmmal_vc_client.so => /opt/vc/lib/libmmal_vc_client.so (0x7528b000)
        libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x75264000)
        libvcos.so => /opt/vc/lib/libvcos.so (0x747e9000)
        libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x747bc000)
        libvcsm.so => /opt/vc/lib/libvcsm.so (0x747a7000)
Then I moved to the ffmpeg-4.2.2.tar.xz, currently provided by Slackware ARM -current, checking if it contains some MMAL acceleration for the Broadcom vc4 by itself and learned the following:
- NEON SIMD acceleration should be enabled by default, because there is only a ./configure parameter to disable it: --disable-neon (disable NEON optimizations)
- there is a --enable-mmal (enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]) parameter that makes ffmpeg to link automatically (finally! don't need to specify this with LDFLAGS anymore) to the MMAL libs in /opt/vc, and when these are not available, the FFMpeg compilation bails out with: ERROR: mmal not found
If /opt/vc is available, the compilation will link to it automatically -> I could observe these in the compilation output:
Code:
-isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads
- but then I discovered that you can enable MMAL with --enable-decoder=h264_mmal and --enable-decoder=mpeg2_mmal (MPEG2 HW acceleration is only enabled if you buy a license from Raspberry). These two parameters don't require the MMAL libs in /opt/vc, apparently, and the FFMpeg doc doesn't describe them - is it actually HW acceleration? Who knows...

I moved on, used the FFMpeg build script from the Slackware ARM - current repo, modified it to add the following MMAL & Kodi related ./configure parameters and built FFMpeg:
- MMAL related acceleration
Code:
--enable-decoder=h264_mmal \
--enable-decoder=mpeg2_mmal \
- generic Linux stuff needed by Kodi
Code:
--enable-postproc \
--enable-protocol=http \
--enable-runtime-cpudetect \
--enable-pthreads \
--enable-pic \
--enable-encoder=png \
--enable-encoder=mjpeg \
- some generic muxers needed by Kodi
Code:
--enable-muxer=spdif \
--enable-muxer=adts \
--enable-muxer=asf \
--enable-muxer=ipod \
--enable-muxer=ogg \
Got the special FFMpeg package built and installed only to find out that my Kodi 18.1 - RC1 compilation form Feb 2019 isn't working anymore due to the Slack ARM -current changes. (Happy that I'm using the stable Slackware 14.2 for Kodi, -current would be a PITA, recompiling Kodi due to the frequent updates.)
Code:
# ldd /usr/local/lib/kodi/kodi-rbpi | grep found
        libidn2.so.4 => not found
        libhogweed.so.4 => not found
        libnettle.so.6 => not found
        libcdio.so.18 => not found
While still having my Kodi compilation installed, I was curious to see what it uses from the /opt/vc and got the following ldd output:
Code:
# ldd /usr/local/lib/kodi/kodi-rbpi | grep opt
        libbrcmGLESv2.so => /opt/vc/lib/libbrcmGLESv2.so (0x742ad000)
        libbrcmEGL.so => /opt/vc/lib/libbrcmEGL.so (0x74275000)
        libmmal.so => /opt/vc/lib/libmmal.so (0x74261000)
        libmmal_core.so => /opt/vc/lib/libmmal_core.so (0x74242000)
        libmmal_util.so => /opt/vc/lib/libmmal_util.so (0x74221000)
        libmmal_vc_client.so => /opt/vc/lib/libmmal_vc_client.so (0x74206000)
        libmmal_components.so => /opt/vc/lib/libmmal_components.so (0x741ea000)
        libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x741c3000)
        libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x741ad000)
        libvcos.so => /opt/vc/lib/libvcos.so (0x74193000)
        libvcsm.so => /opt/vc/lib/libvcsm.so (0x7417e000)
        libcontainers.so => /opt/vc/lib/libcontainers.so (0x7415c000)
Removed Kodi 18.1 RC1 (no way I recompile that huge pile of **** again) and tried to use the freshly built FFMpeg for Mplayer under X, testing if the --enable-decoder=h264_mmal helps.
Started Mplayer, went into settings and chose to use FFMpeg as decoder, restarted Mplayer and played a movie 1080p-h264, only to find out that all 4 CPU cores were maxed out and the playback was kind of a slide show - unwatchable.

Conclusion, so far, both FFMpeg & Kodi need the MMAL libs in /opt/vc for proper MMAL HW acceleration. I don't know if there is any other (free/non specific) MMAL lib available that could be integrated by default in Slackware ARM -current and provide HW accelerated playback for the vc4 core.

Last edited by abga; 04-29-2020 at 10:03 PM. Reason: Slackbuild = build script
 
Old 04-29-2020, 05:43 PM   #26
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Original Poster
Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
While we're at it (Kodi 18.x), I learned that the latest pvr.hts add-on (useful for watching tvheadend content(DVB streams))doesn't build anymore and found out that the last version that does is 4.4.21, use the following code to build it:
Code:
cd /kit/kodi-slack-build/addons-18/
wget https://github.com/kodi-pvr/pvr.hts/archive/4.4.21-Leia.tar.gz
tar -xzpf 4.4.21-Leia.tar.gz
cd /kit/kodi-slack-build/addons-18/pvr.hts-4.4.21-Leia/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make && make install
ldconfig
- same goes for the inputstream.adaptive (useful for some online video streams / IPTV), use something "Leia" before v 2.4.2:
https://github.com/peak3d/inputstrea...ter=2.4.2-Leia
 
  


Reply



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
Trying to build KODI 18 Leia Barcoboy Slackware 8 11-19-2018 07:53 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: Kodi v18 Leia Alpha, BleachBit Version 2.0, Use an RPi 3 to Build Your Own Cheap Car Head Unit and More LXer Syndicated Linux News 0 03-06-2018 01:30 AM
LXer: Kodi 18 Media Center to Be Dubbed "Leia," In Honor of the Late Carrie Fisher LXer Syndicated Linux News 0 01-10-2017 05:35 AM

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

All times are GMT -5. The time now is 08:13 AM.

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
Open Source Consulting | Domain Registration