3 3

Exynos 5422 (Odroid XU4, HC1, HC2) Media Testing Script

Recommended Posts

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



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:


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
         . 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
                $ 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:
- 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


- 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!





Download the file above

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

cd exynos5422




  • 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.



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

bump, since kernels got another update and 4.14 appears to be the kernel of the week.  I can't remember but is this Xenial-specific?  Never mind, <ctrl>-f doesn't find things in the teasers, I found it.

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

So after all we want to have good old XU4 added to the Bionic multimedia team? Let's see what we can do about it… ;)

Share this post

Link to post
Share on other sites
32 minutes ago, TonyMac32 said:

I think people don't know the SoC used on the XU4,



Is it now abusive behavior to change a title? :ph34r::lol:

Share this post

Link to post
Share on other sites


I am the happy owner of the Odroid HC-1 running Armbian currently. Is there support on the Debian side of things regarding this devices ability to encode video using ffmpeg? Ive been trying to find instructions on how to compile the code myself

Share this post

Link to post
Share on other sites
3 hours ago, monery said:

Is there support on the Debian side of things regarding this devices ability to encode video using ffmpeg?

Yes, there is, and you can find the instructions in this same forum:

You can skip the Emby part, if you don't want it. As a matter of fact, I now recommend the recent FOSS project Jellyfin over Emby (I myself made the contribution to Jellyfin that enabled XU4/HC1 hardware encoding, so I can confirm it works).

Share this post

Link to post
Share on other sites
On 11/10/2019 at 3:09 PM, JMCC said:

You can skip the Emby part, if you don't want it.

before posting on the forum, I did try using just the ffmpeg out of the project. I figured I was maybe doing something wrong since every attempt to render a video ended in errors, followed by some random location causing a seg fault. I hope its me and troubles with new software. Another idea I just had... it would be great if I could do sudo apt install ffmpeg-exynos-5422. Is there anything legal that would prevent a compiled package like this to be added to armbian?

Share this post

Link to post
Share on other sites
1 hour ago, monery said:

it would be great if I could do sudo apt install ffmpeg-exynos-5422

Yes, it would be. That is something in my TO-DO list, but my personal life hasn't given me the chance to do it in the last months. Let's see if it can be done at some point.

Share this post

Link to post
Share on other sites
1 hour ago, monery said:

every attempt to render a video ended in errors, followed by some random location causing a seg fault

Please try with the ffmpeg from the post linked above. Keep in mind it is compiled for a Debian Stretch image. Anyway, the latest official ffmpeg is also supposed to have support for MFC encoder, though I'm not sure whether it supports bitrate enforcing, like the one I compiled. I used this repo: https://github.com/mihailescu2m/FFmpeg

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

3 3