Jump to content

Recommended Posts

Posted

THE MEDIA SCRIPT IS DEPRECATED, IN FAVOR OF THE OFFICIAL LEGACY MULTIMEDIA FRAMEWORK. PLEASE REFER TO THIS TOPIC:

 

 

 

The UN-official, UN-supported, UN-necessary, UN-popular, UN-precedented...

RK3288 MEDIA TESTING SCRIPT [2.0: Bionic update]

 

So here is the final release of the RK3288 media testing script. Basically, the script provides the following functionality:

  • Installing all the libraries and system configurations necessary for GPU accelerated X desktop, Chromium WebGL, full VPU video play acceleration up to 4k@30 HEVC (the maximum supported by the SoC), and GLES 3.1 / OpenCL 1.2 support.
  • Three video players supporting full VPU acceleration (RKMPP) and KMS display (GBM or a X11 DRM "hack", as described by the authors), namely: MPV, Gstreamer and Kodi 18.0 alpha preview.
  • 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).
  • A library that will act as an OpenGL to OpenGL-ES wrapper, allowing you to run programs that use OpenGL 1.5-2.0.
  • 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.

 

Here is a more thorough documentation:

 

Version 2.0 (Bionic):

  Reveal hidden contents

 

Version 1.0 (Xenial):

  Reveal hidden contents


>>> DOWNLOAD LINK (2.0, FOR BIONIC DESKTOP) <<<

 

> Older Download link (1.0, for Xenial) <

 

Instructions:

  1. Download the file above
  2. Untar it: tar xvf media-rk3288_*.tar.xz
  3. cd media-script
  4. ./media-rk3288.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!

 

 

 

Posted

Some technical notes:

 

@Igor @zador.blood.stained : I packaged the main debs in a way that they don't interfere with the mainstream Ubuntu ones, but at the same time can replace them. E.g.: the X server is called now "xserver-xorg-core-rockchip", but it provides the same version of the upstream "xserver-xorg-core", and therefore does not break anything when replaces it. I didn't care to do that with other packages that are clearly not going to become part of the Armbian build (e.g. Kodi).

 

If anyone wants to run some tests, I suggest the following:

sudo apt install glmark2-es2 clinfo
es2gears
glmark2-es2
clinfo

Also, opening Chromium and typing the address:

chrome://gpu

For last, the Rockchip mpp demos suite:

  Reveal hidden contents

But I find all this stuff boring, I'd rather test just by using real-life programs.

Posted

 

  Reveal hidden contents

 

 

Couldn't get kodi to play any video without crashing... it crashed as soon as attempt to enter video folder.  I've test v18 Leia under LibreELEC and Android without such a problem. 

Posted
  On 5/19/2018 at 6:24 AM, Samson said:

 

  Reveal hidden contents

 

 

Couldn't get kodi to play any video without crashing... it crashed as soon as attempt to enter video folder.  I've test v18 Leia under LibreELEC and Android without such a problem. 

Expand  

Are you trying to open a video from a USB drive? If you read the docs, it says that the program crashes when trying to open a video from a USB, you must copy them to the SD card. I know it is a hassle, but that is why I say that it is only a preview, not suitable for regular use.

  On 5/19/2018 at 6:24 AM, Samson said:

I've test v18 Leia under LibreELEC and Android without such a problem. 

Expand  

Was it a RKMPP accelerated version? I am not aware that there is a relesed version of Kodi18 in LibreElec or Android with RKMPP. In other words: if it is a Rockchip device, and you can play smoothly 4k videos, then it uses RKMPP, otherwise it doesn't.

I know Kodi 18 can be more or less stable in some devices. But the RKMPP+GBM implementation is one of the latest incorporations and, according to the docs, it is not stable yet. So it is perfectly normal that you had a better experience with other implementations not using this new and experimental feature.

 

In case i am wrong, and your Kodi 18 build indeed uses RKMPP+GBM, please tell me the exact version number and I will build it (you can find it in ~/.kodi/temp/kodi.log).

Posted

Yes, I read the docs and aware of the USB issue, my video folder is in a samba shared in the LAN, it scan the TV shows database without problems just crashed as soon as I attempt to enter the folder.

 

Both Kodi Leia are RKMPP accelerated, they can even play HEVC 10Bits in full speed.

 

LibreELEC can be downloaded:
http://test.libreelec.tv/LibreELEC-TinkerBoard.arm-9.0-nightly-20180517-2417476-rk3288.tar

 

and for Android version I just downloaded the 09 Apr night build from the official site.  LibreELEC version is less stable but the Android version I am actually using it in a daily basis with TinkerOS_Android V13.13.0.74, not a single crash.  I attempted to switch away from Android because my Air Mouse does not behave well under Android but works well under Linux/Windows.

 

I will dig the exact version number after back home. Thank you.

 

Posted

 

  On 5/18/2018 at 10:33 PM, JMCC said:

The UN-official, UN-supported, UN-necessary, UN-popular, UN-precedented...

RK3288 MEDIA TESTING SCRIPT

Expand  

 

This might just be the best opener I've ever seen! Made me smile, thanks :)

Posted
  On 5/19/2018 at 9:01 AM, Samson said:

my video folder is in a samba shared in the LAN

Expand  

Then we'll need to add that source to the list of ones causing a crash :) . For now, since it is a testing version, let us stick with videos in the SD card. It is possible that Libreelec has some workaround to prevent that crash. In any case, I don't think it is worth caring much about it, until there is some release (even if it is a beta, but not just a nightly) that supports a stable RKMPP. If it doesn't work then, we'll worry about it.

 

Also, we must remember that our goal here, for the time being, is not to create a working Kodi desktop, but just to test the RKMPP imprementation under Armbian.  We'll let the Kodi developers do their job, and when they finish, we'll try to port it here. 

 

[EDIT: I updated the documentation, to reflect that Samba shares also cause a crash]

Posted

I got a series of errors with the miner program using the readme.txt command:

 

WARNING:  GPU_MAX_ALLOC_PERCENT is not specified!

WARNING: GPU_USE_SYNC_OBJECTS is not specified!

Error -6: Creating kernel from program

failed to init GPU thread 0

 

Posted
  On 5/19/2018 at 3:47 PM, TonyMac32 said:

Error -6: Creating kernel from program

failed to init GPU thread 0

Expand  

I hit that error once, and a reboot fixed it. I suspect the cause may be a previous use of the GPU in the same session.

Posted
  On 5/19/2018 at 4:07 PM, JMCC said:

I suspect the cause may be a previous use of the GPU in the same session.

Expand  

ahhh ok.  I wonder if there is a bug somewhere with freeing the resource...

Posted

About the warnings, these env variables shoud fix them. Not sure whether they also prevent the other error too:

export GPU_FORCE_64BIT_PTR=0
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
export GPU_MAX_HEAP_SIZE=100

 

Posted
  On 5/19/2018 at 4:13 PM, TonyMac32 said:

1 Mh/s ?!?!

Expand  

He he, make up your mind you're on a scooter, not in a Ferrari. :D

However, these consumption measurements may give you some relief: idle 3.0W, GPU mining 4.3W (+1.3), CPU mining 11.6W (+8.6), CPU+GPU mining 12.8W (+9.8)

 

Also, it is interesting to see that RK3288 has Mali T760 4-core@600 Mhz, while Exynos 5422 has Mali T628 6-core@600 Mhz. Well, the TB performs at 1 Mh/s, and XU4 at 1.5 Mh/s. Performance/Mhz/core seems to be about the same in Mali T6xx and Mali T7xx.

Posted

Well, the integrated Intel HD4600 of my desktop PC gives me about 6 Mh/s with the Skein algo, so the performance/consumption ratio of the little Mali is not near bad. Of course, in the pools most guys show above 50 Mh/s, some of them around the 1Gh, but they must have rigs with several Nvidia cards consuming at least hundreds of watts...

Posted

is it a bug or just a temporary Problem of this solution, for the time being until RK comes up with "the solution".

That said, I wouldn't spend time in minor things, as long as it overall works.

Posted
  On 5/22/2018 at 6:05 AM, Tido said:

is it a bug or just a temporary Problem of this solution, for the time being until RK comes up with "the solution".

That said, I wouldn't spend time in minor things, as long as it overall works.

Expand  

You're right. After all, I think sooner or later the best choice will be to start trying Wayland, once we get a stable Bionic desktop. It is very common to say that Wayland is the future for Linux desktops, but it is even more true in the case of SBC's since, from what I have read, EGL works much better in Wayland than in X11 .

Posted

I wonder if someone tried the script on mainline kernel. I tried on Armbian Xubuntu 5.46 with mainline kernel 4.14.50.

I choose the "new" X.org way, and at the moment I get 1.19.3. The desktop is plenty fast and I'm using a special Firefox 59 build (download it here, referred from here). I have to say that this setup is surprisingly fast and very usable.

But looking into Xorg.0.log I see that glamor is failing to initialize EGL, also es2_info fails too, so everything seems to be done without any gpu acceleration.

glmark-es2 also fails to start and at least gives the EGL error:

paolo@xt:~/Downloads/media-script/packages/libs$ glmark2-es2 
Error: eglInitialize() failed with error: 0x3001
Error: eglInitialize() failed with error: 0x3001
Error: main: Could not initialize canvas

Trying to start it using GBM:

paolo@xt:~/Downloads/media-script/packages/libs$ LD_LIBRARY_PATH=/opt/libmali-gbm/ glmark2-es2 
Error: eglGetDisplay() failed with error: 0x3000
Error: eglGetDisplay() failed with error: 0x3000
Error: main: Could not initialize canvas

The kernel driver seems in place, no errors in my dmesg (except for the omnipresent master bind failed: -517)

Here is the dmesg output

Posted

It used to work on mainline, but I'm afraid recently kernel driver has been updated, and the r14p0 library we are shipping in this package does not work with mainline anymore. Can you post  the output of

cat /sys/devices/platform/ffa30000.gpu/misc/mali0/device/gpuinfo

 

Posted
  On 6/28/2018 at 10:40 PM, JMCC said:

It used to work on mainline, but I'm afraid recently kernel driver has been updated, and the r14p0 library we are shipping in this package does not work with mainline anymore. Can you post  the output of

cat /sys/devices/platform/ffa30000.gpu/misc/mali0/device/gpuinfo

 

Expand  

 

Got this:

root@xt:/home/paolo# cat /sys/devices/platform/ffa30000.gpu/misc/mali0/device/gpuinfo
Mali-T76x 4 cores r0p0 0x0750

 

Posted
  On 6/28/2018 at 9:23 PM, jock said:

Armbian Xubuntu 5.46

Expand  

Armbian Xubuntu? What do you mean by that? Can you specify distro (Xenial, Stretch, Bionic)?

 

  On 6/29/2018 at 6:37 PM, jock said:

Mali-T76x 4 cores r0p0 0x0750

Expand  

Seems correct. Can you post the error in Xorg.0.log?

Posted

It is Armbian 5.46 Ubuntu Xenial with mainline kernel 4.14.52

Here is the Xorg.0.log, you can see that modesetting driver is complaining about being unable to initialize EGL.

 

I tried also to start from a brand new image, installed manually the libmali libaries, tried all flavours of them (fbdev, gdm, X11) except wayland, but none of them was able to get past the eglInitialize(), so I guess there's some incompatibility against the kernel driver

Posted

OK. Please run "es2gears", and post the output. Also, "armbianmonitor -u".

Posted

I don't know which glmark2 you're using, but if you can, try to compile the latest version from their GIT https://github.com/glmark2/glmark2

 

If that doesn't work, could you try to paste the following :

 

The result of

echo $LD_LIBRARY_PATH

The 50 last lines of

strace glmark2-es2-drm

Executed as root from a simple terminal (CTRL+ALT+F1 or chvt 1 from SSH)

 

Posted
  On 6/30/2018 at 10:53 AM, JMCC said:

OK. Please run "es2gears", and post the output. Also, "armbianmonitor -u".

Expand  

 

armbianmonitor -u executes but just does not report the link to post here nor any errors. Don't know if it's a bug, the service is down or what else :unsure:

es2gears fails with x11 libmail and does a segmentation fault with gbm:

 

$ es2gears
EGLUT: failed to initialize EGL display

$ LD_LIBRARY_PATH=/opt/libmali-gbm/ es2gears
Segmentation fault

 

 

  On 6/30/2018 at 11:42 AM, Myy said:

I don't know which glmark2 you're using, but if you can, try to compile the latest version from their GIT https://github.com/glmark2/glmark2

 

If that doesn't work, could you try to paste the following :

 

The result of

echo $LD_LIBRARY_PATH

The 50 last lines of

strace glmark2-es2-drm

Executed as root from a simple terminal (CTRL+ALT+F1 or chvt 1 from SSH)

 

Expand  

 

Ok freshly compiled glmark2 with drm-glesv2 and x11-glesv2 flavours. Running over GBM libmali this way: # LD_LIBRARY_PATH=/opt/libmali-gbm/ strace glmark2-es2-drm from a real virtual terminal with no X11 running, these are the last 50 lines of the strace:

  Reveal hidden contents

 

Full strace is here

 

I also report the full strace running # strace glmark2-es2-drm without enforcing the LD_LIBRARY_PATH variable (which is empty) to use the system libmali for X11 installed by JMCC script

 

As a side note, I also swapped the kernel with a legacy 4.4.126 on the same installation. X11 starts with EGL acceleration enabled (no error in Xorg.0.log) and es2gears works without complaints.

 

edit:

another test with a slightly older mainline kernel (4.14.39) produces a successful result: glmark2-es2-drm against GBM libmali works wonderfully from a virtual terminal, glmark2-es2 against X11 libmali works wonderfully inside a desktop environment.

The 4.14.39 kernel still works fine even if used against the device tree from the 4.14.50 non-working kernel, so the source of problems is not the device tree.

Doing a diff over the two kernel configurations reports only some RTC drivers which have been compiled as modules in the newer kernel, but nothing directly related to GPU stuff.

lsmod reports a difference: with the working kernel mali_kbase module has 2 dependencies, instead with non-working kernel it has 0 dependencies.

As stated by @Myy in another thread, CMA memory reservation is not needed at all for the GPU acceleration: the working kernel has 0 kbytes reserved and works fine.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines