2 2
JMCC

Exynos 5422 Media Testing Script

Recommended Posts

The UN-official, UN-supported, UN-timely, UN-derrated...

Exynos 5422 MEDIA TESTING SCRIPT

 

Yes, the script is somewhat untimely, because it comes when including kernel 4.14 in Armbian next images is getting troublesome. And underrated, because this old SoC seems to be losing the focus of attention in favor of some more modern powerful ones. But it is still a great SoC, and it is worth trying to get the best out of it.

 

The script will provide the installation of all the libraries and system configurations necessary for GPU accelerated X desktop, Chromium WebGL,VPU decoding/encoding acceleration through MFC, and GLES 3.1 / OpenCL 1.1 support.

It will also install two media players (MPV and Kodi stable) and FFmpeg, all of them using VPU acceleration.

Two example programs using the OpenCL functionality: Examples form the Arm Compute Library, and a GPU crypto miner (an old version, but small and simple).

Two additional small packages, that have no big interest from the developer prospective, but I find them interesting to play with: Support libraries for commercial web video streaming (tested with Netflix), and a simple Pulseaudio GTK equalizer using LADSPA.

 

Since all the features require the 4.14 kernel to work, the script will also give the option to install an archived 4.14.43 Armbian kernel, in case some other version is detected in the system. Of course, the best option is to use armbian-config to perform a kernel upgrade, but we are providing the archived version just in case the 4.14 packages disappear temporarily from Armbian repos.

 

Also, this script can be tailored for desktop or headless installation, by selecting the appropriate options in the main menu.

 

Here is a more thorough documentation:

Spoiler

ARMBIAN UNOFFICIAL Exynos 5422 MEDIA TESTING SCRIPT
---------------------------------------------------
v1.0 Xenial - 2018/05/27


This script will install several multimedia-related software pieces in a
XU4/HC1/etc. Ubuntu Xenial Armbian desktop dev image (kernel 4.14.y).
Currently it only supports the installation of the features, while
uninstall must be performed manually.

The script must be run in a command line from the same directory it was
unpacked (./media-5422.sh), and will ask for superuser privileges if not
launched with "sudo". Each subfolder contains, in addition to the
packages needed for installation, a text file with information about the
sources for those packages.

 

Since it requires kernel 4.14.y to work, the first thing the script will
do is checking the kernel version, and in case it does not match the
required version, it will give the user the option to install a bundled
4.14.43-dev Armbian kernel. Though, it is recommended to exit the script
and perform the kernel upgrade through armbian-config, in order to get
the latest version.

 

Later, it will present the user with a menu where they can select the
features to be installed. Here is a brief description of each option:

- System: This option will install the base libraries and system files 
          configuration. It must be run at least once before installing
          any of the other features, and re-run in case some system
          upgrade modifies any of the pertinent configs.

 

- Xserver: If this option is enabled, it will install and configure the
           accelerated X server. It will also make other options use the
           X version of the apps and libs when it is enabled, or the 
           fbdev version when disabled. Currently, it affects the base 
           system libs and Kodi.
 
- Devel: When this option is enabled, the script will install the 
         development libraries for every other option that is enabled.
         So, for example, if in your first run of the script you keep 
         this option disabled and enable the rest, it will install all 
         the features but without any devel lib. If eventually you need,
         e.g., to compile some app requiring Gstreamer development libs,
         then you can run again the script, and select only "Devel" and
         "Gstreamer", so in that run it will only install Gstreamer with
         the development libraries, without touching the rest.
         
- MPV: This is an updated version of MPV, which will use EGL 
       acceleration for display and, optionally, MFC hardware decoding.
       The MFC implementation does not support dmabuf, so it won't
       improve much the smoothness of software decoding, but it will
       keep CPU usage much lower.
         · To use the non-MFC version, just type "mpv <file>" in the
           console, or use the launcher labeled simply "mpv Media
           Player".
         . To use the MFC acceleration, type "mpv -hwdec <file>", or use
           the "mpv (MFC)" launcher.

 

- FFmpeg: This will install FFmpeg 3.4 with improved MFC hardware
          encoding support. The standard FFmpeg already supports v4l2,
          but this version patched by memeka allows you to set bitrate.
            · To use the hardware encoder, invoke it like the following
              example:
                $ ffmpeg -i <infile> -an -vcodec h264_v4l2m2m -b:v 2M \
                 -pix_fmt nv21 <outfile>.mp4
            · It seems like Emby supports HW transcoding through the 
              Exynos 5422 MFC with this FFmpeg installed, but I have not
              tested it. More info:
              https://github.com/MediaBrowser/Emby/issues/2762
            
- CLSamples: A couple of simple programs to test OpenCL capabilities:
         · Compiled examples from the Arm Compute Library
         . An old GPU crypto miner (cgminer) with support for
           extra algorythms like Skein.
         They are installed under ~/clsamples, where you can find
         a readme.txt file with instructions.

 

- Streaming: This will install the Widevine and Pepper-Flash libraries
             for Chrome, enabling you to stream videos from sites such
             as Netflix (tested) or Hulu (untested).
             It will also install the h264ify addon, which will force
             all Youtube videos to use the H.264 codec.

 

- Equalizer: A GTK-based equalizer for PulseAudio, using LADSPA. You
             need to enable it through the menu entry, and select the
             desired preset or tweak your own settings. The "Boosted"
             preset is recommended for everyday use.
             This package is old and unmaintained, but I still find it
             useful.

 

- Kodi: A stable Kodi 17.6 Krypton with EGL display and MFC hardware 
        decoding. Depending on whether you selected "Xserver" or not in 
        the option above, it will install the X11 or the fbdev version.

 

As you see, you can tailor the script options for desktop or headless
configurations. For example, OpenCL and FFmpeg can be useful even in
the HC1/HC2/MC1, for tasks such as media transcoding, GPU mining, etc..

 

Please report bugs and suggestions in the thread dedicated to this
script at the Armbian Forum. Enjoy!

 

JMCC.
 

>>> DOWNLOAD LINK <<<

Instructions:

Download the file above

Untar it: tar xvf media-exynos5422_1.0.tar.xz

cd exynos5422

./media-exynos5422.sh

 

Notes:

  • This script is not officially supported by the Armbian project. It is just a community effort to help the development of the main build, by experimenting with a possible implementation of the media capabilities of this particular SoC.
  • Therefore, questions about the script should not be laid out as support requests, but as commentaries or community peer-to-peer assistance.
  • That being said, all commentaries/suggestions/corrections are very welcome. In the same way, I will do my best to help solve any difficulty that may arise regarding the script.

 

Enjoy!

Share this post


Link to post
Share on other sites

Some tech notes:

 

@Igor @zador.blood.stained : In this case, the X driver did not need the name to be changed, because it is a specific driver to Exynos SoC's (xserver-xorg-video-armsoc), so there was no problem with it replacing the upstream version. Unless, of course, it creates some conflict with S5P6818 (Nanopc T3/Nanopi Fire3 users, if you can shed some light it will be appreciated).

 

However, the version from Hardkernel repos requires a custom libpixman to work, but I have compiled this one against the standard libpixman, just to simplify. Though it is not too well documented, I think the reason for the custom libpixman is some troubles with VNC. I have tested x11vnc with this library, and it works perfectly.

 

That can be due to the fact that, unlike Hardkernel, we are disabling the Composite and RENDER X extensions. With them enabled, you run into different problems, that can be verified in Hardkernel images, such as some UI elements becoming invisible.

Share this post


Link to post
Share on other sites
14 hours ago, zador.blood.stained said:

AFAIK the xf86-video-armsoc driver is generic and can support multiple platforms (i.e. there was a patch to add sunxi DRM+Mali support to it).

Well, actually, according to the documentation, the module should choose dinamically the right DRM driver among the supported ones. But the fact is that Ubuntu packages divide the driver into two modules, one for exynos and the other for pl111. The generic "xserver-xorg-video-armsoc", in Ubuntu, is just a meta-package that will install "xserver-xorg-video-armsoc-exynos". I have tried this driver in other non-exynos SoC's and it didn't work.

 

At the same time, the driver has so many forks that it is difficult to make general statements. For example, the version forked by Rockchip seems to be backwards-compatible with the original "generic" version: I tested it on the XU4, and it works, though performance is noticeably worst than the driver we are using in this script. This driver has been further patched for the Rock64, and it can be interesting for RK3328 boards (I'll dig more on this when I get my Renegade).

 

The version we are using in this script is yet another fork, based on the Ubuntu version, made by CrashOverride from the Odroid community. It adds some very interesting features, such as G2D acceleration support and fullscreen Vsync.  I'm not sure if these mods can be ported to other versions of the driver, but simply using it as-is in another SoC won't work, as I pointed above.

Share this post


Link to post
Share on other sites
1 hour ago, Mr.Grape said:

Any updates or is the project dead?

If the community is interested, I can release a Bionic version. But right now I'm busy with the Rockchips, this one will go later.

 

It just seemed to me like there was not much interest in XU4, because people were not posting here (in Rockchip SoC's there is a stream of posts with each release)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2