Jump to content

RK3288 Media Script (TinkerBoard)


JMCC

Recommended Posts

7 hours ago, TonyMac32 said:

Did you apply the patch Myy mentioned?  I'll push it later if it worked.

 

Yes exactly, just applied the patch and the kernel driver is back in the game

Link to comment
Share on other sites

@JMCC I'm playing a bit with GL4ES, it works like a charm (trying quake1 and quake3), you should include it in your script. 

I had to export LIBGL_ES=2 and LIBGL_COPY=1 variables but then it works very well!

Link to comment
Share on other sites

I have 2 RK3288 devices, is it possible to test this off an SD-card before overwriting the eMMC?

 

Edit: Never mind. README.txt gave me some more info and this script can only be installed once you have a running system.

 

Now i need to find an image for my RK3288 TV-box!

Link to comment
Share on other sites

33 minutes ago, fossxplorer said:

I have 2 RK3288 devices, is it possible to test this off an SD-card before overwriting the eMMC?

 

Edit: Never mind. README.txt gave me some more info and this script can only be installed once you have a running system.

 

Now i need to find an image for my RK3288 TV-box!

Maybe this?

 

Also I'm wondering if the mainline mali driver has some code for reclocking/dvfs. Maybe @Myy can answer to the question.

Looking at the voltage of the regulator exposed by the kernel in /sys/class/regulator/regulator.7/microvolts sys/class/regulator/regulator.7 (probably different on other machines, look into directories for ffa30000.gpu-mali symbolic link) it is always fixed to 1.0 volts, so I guess that the GPU is not being pushed at maximum speed even during load.  Regulator #6 instead is dedicated to the CPU and it changes accordingly to the frequency changes.

I mean, testing quake3 in full-hd at maximum detail and it is totally playable, but it would be nice to push the thing to its limits to see what it can do ^_^

Link to comment
Share on other sites

The Mali driver can use devfreq, and has various ways to be told how to vary the frequency of the GPU.

Now, I've been informed recently that a patch is necessary on mainline kernels to avoid some Mali Devfreq related warnings and panics.

A modified version of the patch is available here : https://github.com/Miouyouyou/RockMyy/blob/master/patches/Midgard/r19p0-01rel0/0010-GPU-Mali-Midgard-remove-rcu_read_lock-references.patch

The original is here : https://github.com/mihailescu2m/linux/commit/bbe73c3c1143e5991bdcaee3afaecf5c31af0647

 

That said, if you want to push the Mali GPU to higher limits, you can do something like this :

cd /sys/class/misc/mali0/device/devfreq/devfreq0/
echo `cat max_freq` > min_freq
echo 10 > polling_interval

This will force the GPU to be at its highest clock rate constantly (supposedly, I have no way to actually verify that).

 

Now, let's be clear, if you launch a GPU intensive task with these settings, while not having a beefy stable power supply, the board might just shut down or not provide any performance gain. Now that's mostly the case for USB power supplied board.

 

Still, these settings provide good performances gain on some benchmarks, very little on others. Frequency alone won't help you overcome bad optimizations. Also sometimes performances issues become CPU bound as the GPU gets faster.

 

Link to comment
Share on other sites

Thanks Myy, got devfreq to work thanks to your patch and enabling it in kernel configuration.

Now effectively I see that the regulator supplies 0.950v when it is in its lower power state (100 Mhz), which is nice for power consumption and thermal headroom. I should have practically no issues with power supply, my board is a tv box with its own 2A PSU and barrel connector. I know the SoC is quite power hungry by the way, so I'm keeping the CPU part at lower frequencies (~ 1Ghz)

 

The current governor is simple_ondemand, but I notice that it has difficulties in properly interpreting the gpu load: during glmark-es2 the frequency rises only when there are scenes which are shader-intensive (like the refracting bunny), but during "real" workloads (like quake3) it stays at lowest power state.

Link to comment
Share on other sites

Someone mentioned that the label "media" in the download image[link] is new. Is this script still required for GPU support?

 

What is the equivalent of lspci for these things [arm sbcs - specifically rock64].

 

Is there anything like, in pi3, you can adjust the memory dedicated to gpu?

 

 

Link to comment
Share on other sites

Oldies but goodies: a made a quick demo with my smartphone (sorry for the bad quality) of Quake2 running on rk3288 using GL4ES. The game works really well, it is totally playable and there are no issues of any sort ^_^

 

 

Link to comment
Share on other sites

On 6/30/2018 at 11:26 PM, Myy said:

Ah, EOVERFLOW... You might need that kind of patch applied to the Mali drivers : https://github.com/Miouyouyou/RockMyy/blob/master/patches/Midgard/r19p0-01rel0/0009-GPU-ARM-Midgard-Adapt-to-the-new-mmap-call-checks.patch

 

They might have imported Linus Torvalds patch to mmap into the 4.14 series.

 

I have got the same error but in my case it is not EOVERFLOW...attaching the file "error_strace_glmark2-es2.txt" for your reference.

@Myy Please can you help me in identifying the issue.  I have come to this thread from another thread started by me: https://forum.armbian.com/topic/8199-hw-acceleration-through-x-server-not-working/

error_strace_glmark2-es2.txt

Link to comment
Share on other sites

@naseeb Hmm, it's weird that the driver doesn't try to access /dev/mali0 at all. It doesn't even try to find DRM devices too.

Could you try the DRM version of glmark2 in a terminal (CTRL+ALT+F1 or chvt 1 from an SSH session) and see if it works better ?

 

Also try the --debug flag.

Link to comment
Share on other sites

Also, be sure to use a recent version of glmark2. Compile the GIT version if you can.

sudo apt install libjpeg-dev libpng-dev pkg-config libudev-dev libdrm-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev
git clone --depth 1 https://github.com/glmark2/glmark2
cd glmark2
./waf configure --with-flavors=drm-glesv2
./waf 

Then you should have a binary ready (find -name "glmark2-es2-drm")

 

You could install it too, but it might clashes with your current installation.

./waf install

Link to comment
Share on other sites

@JMCC, @jock

When i run script "media-rk3288.sh",  it says "Ctrl C to abort and Enter to continue". I attached "install.log" file for your reference

i checked the install.log, it tries to upgrade system to 4.15.0 but failed.

 

I have got an image from Manufacturer which doesn't have any userland Mali. I am trying to install the same. For that, I am advised to upgrade the kernel as well.

Using RKDevTool(AndroidTool.exe), i checked Device Partition of my board and got below table:

No         LBA                      Size                           Name

01        0x00002000        0x00010000               boot

02        0x00012000        0x00002000               backup

03        0x00014000        0xffffffff                      linuxroot

 

I built Latest kernel as per link: http://rockchip.wikidot.com/linux-user-guide

Out of the three approached, i followed the Debian. 

Fetched code on ubuntu VM and install all the dependency mentioned in above link. then compile the kernel as per command below(taken from above mentioned link)

Quote

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- rockchip_linux_defconfig

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4

 

All went good and i got compressed zImage.

I uploaded this new kernel with the help of RKDevTool. see attahced png file "only_kernel_update.png". It shows OK but board doesn't bootup.

 

I upload manufacturer image using 'Upgrade Firmware' tab. I think manufacture image contains "uboot + kernel.img + rootfs.img" in order.

How to bring the board up from scratch?

Meantime i am learning to use mk-image.sh tool from repository: https://github.com/rockchip-linux/build to create single image which is compatible to LBA on my board.

I have one doubt here, if i get successful in creating a single image, Is there any chance that image may corrupt my board device partition. If yes, in that in that case i am afraid i will not able to upload even manufacturer image??

 

@Myy

Thanks for sharing the steps. i compiled glmark2 as you mentioned in the above steps.

1. If i run ./glmark2-es2-drm from shell, by default it uses llvmpipe as GL_RENDERER

2. if i run  ./glmark2-es2-drm with LD_LIBRARY_PATH=/opt/libmali-gbm/

     a. it shows compatiblity errors. See attached error.txt

     b. i also ran the application with strace. See attached glmark2-es2-drm-strace.txt

 

Please share some steps to upgarde the board to latest releases{uboot(if required) + Kernel + rootfs} where i can use GPU using userland Mali rather than direct DRM.

 

only_kernel_update.png

install.log

error.txt

glmark2-es2-drm-strace.txt

Link to comment
Share on other sites

5 hours ago, naseeb said:

When i run script "media-rk3288.sh",  it says "Ctrl C to abort and Enter to continue". I attached "install.log" file for your reference

i checked the install.log, it tries to upgrade system to 4.15.0 but failed.

If you notice, your install.log shows that the mali package has a conflict with libgles2-mesa-dev. Try uninstalling that package. I only guarantee the script to work in a fresh Armbian Xenial with default 4.4 kernel. If you are using Next, or you install additional packages before the script, it may or may not work.

 

The Bionic version is under development, and I will try to take care of that package conflict. Thanks for the info.

Link to comment
Share on other sites

Hello everyone, got a question regarding the rock64 and the HDMI output. I installed armbian recently with the media test script provided in this board, but everytime I run xrandr, I get this:

 

rock64@rock64:~$ sudo xrandr --listproviders
Can't open display
rock64@rock64:~$ xrandr --props
Can't open display

Xorg logs correctly identify that no display is enabled, also noted that glamor failed to start:

 

[    12.505] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    12.908] (II) Module glx: vendor="X.Org Foundation"
[    12.908]    compiled for 1.19.2, module version = 1.0.0
[    12.908]    ABI class: X.Org Server Extension, version 10.0
[    12.926] (II) LoadModule: "modesetting"
[    12.938] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[    12.968] (II) Module modesetting: vendor="X.Org Foundation"
[    12.968]    compiled for 1.19.2, module version = 1.19.2
[    12.968]    Module class: X.Org Video Driver
[    12.968]    ABI class: X.Org Video Driver, version 23.0
[    12.968] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    12.979] (II) modeset(0): using drv /dev/dri/card0
[    12.979] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    12.979] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[    12.979] (**) modeset(0): Option "AccelMethod" "glamor"
[    12.979] (==) modeset(0): RGB weight 888
[    12.979] (==) modeset(0): Default visual is TrueColor
[    12.979] (II) Loading sub module "glamoregl"
[    12.979] (II) LoadModule: "glamoregl"
[    12.994] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[    13.270] (II) Module glamoregl: vendor="X.Org Foundation"
[    13.270]    compiled for 1.19.2, module version = 1.0.0
[    13.270]    ABI class: X.Org ANSI C Emulation, version 0.4
[    13.270] (II) glamor: OpenGL accelerated X.org driver based.
[    16.509] (II) glamor: EGL version 1.4 (DRI2):
[    16.509] EGL_MESA_drm_image required.
[    16.518] (EE) modeset(0): glamor initialization failed
[    16.518] (II) modeset(0): ShadowFB: preferred NO, enabled NO
[    16.518] (II) modeset(0): Output HDMI-1 has no monitor section
[    16.518] (II) modeset(0): EDID for output HDMI-1
[    16.518] (II) modeset(0): Output HDMI-1 disconnected
[    16.518] (WW) modeset(0): No outputs definitely connected, trying again...
[    16.518] (II) modeset(0): Output HDMI-1 disconnected
[    16.518] (WW) modeset(0): Unable to find connected outputs - setting 1024x768 initial framebuffer
[    16.518] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[    16.518] (==) modeset(0): DPI set to (96, 96)
[    16.518] (II) Loading sub module "fb"

 

I am a bit at loss since I wanted to use my rock64 as a headless server with nomachine and would love to use 1920x1080 as with ayufan builds.

 

As expected, display info is empty on XFCE:

AiS64eq.png

 

I would really love to stay with armbian since ayufan releases are usually very experimental and armbian looks pretty stable. Is there anyone facing the same issue?

Link to comment
Share on other sites

 @naseeb As JMCC already said, the script will work on Armbian Ubuntu Xenial. I'm using it with latest dev kernel (4.18) and it works too, but don't expect it works on other distributions, expecially Bionic which has a different  way to handle mesa packages.

Also if you compile the kernel from the rockchip repository, probably you miss the mali kernel driver and you have to compile it yourself later as a module. Armbian includes some useful patches for that too.

Does /dev/mali0 exist on your filesystem? I first would stick to a kernel built for Armbian, which has some useful patches that helps. You can build just the kernel following the instructions and then drop it into your filesystem to see if it boots/works.

You may also try one of the Xenial images of my armbian fork for RK3288 TV boxes (see the TV Box forum section) which, with a bit of luck, may boot on your board... many devices won't work, but the basics of the SoC (GPU, USB, HDMI, ethernet, ...) should be fine

 

 

Link to comment
Share on other sites

1 hour ago, korso said:

Hello everyone, got a question regarding the rock64 and the HDMI output. I installed armbian recently with the media test script provided in this board, but everytime I run xrandr, I get this:

 

I would really love to stay with armbian since ayufan releases are usually very experimental and armbian looks pretty stable. Is there anyone facing the same issue?

I guess this script will never work on rock64: it has a RK3328 SoC and Mali-450 GPU. This script instead installs drivers for RK3288 which has a totally different and not compatible Mali-760 GPU

Link to comment
Share on other sites

@naseeb From the logs, it is clear that your user-space drivers are more recent that the kernel drivers.

 

The Mali Midgard proprietary drivers are split into two parts :

- The kernel driver, under GPL license, which must be added to the kernel or modified to be compiled as an OOT module.

- The user-space binary driver, which is a proprietary set of libraries that provide the OpenGL/OpenCL functions. These might be replaced by https://gitlab.freedesktop.org/panfrost in some distant future.

 

Now, getting a new kernel (4.4 -> 4.14) does not ensure you that you'll get newer drivers. You'll get newer drivers, only if the archive containing newer drivers were included in the kernel.

Still, IIRC, the linux kernel 4.14 and 4.18-dev provided by Armbian should include more recent Mali Midgard kernel drivers that should allow you to use the provided libraries.

 

However, if you switch from a 4.4 to a 4.14, you'll lose the VPU support at the moment.

 

Concerning the NV12 support, I would suggest you try this, to test the support for this format : https://github.com/robclark/kmscube

I guess that Mali drivers supports this format since Mali-400 GPU supported it : https://community.arm.com/graphics/f/discussions/6178/mali-400-dumb-questions

Link to comment
Share on other sites

12 hours ago, jock said:

I guess this script will never work on rock64: it has a RK3328 SoC and Mali-450 GPU. This script instead installs drivers for RK3288 which has a totally different and not compatible Mali-760 GPU

opsss. Makes sense. Now i noticed that Ayufan's xorg.conf and the one that the scripts generates and the drivers are completely different :( I'll go back to ayufan's builds then and see if I can give it another spin.

 

A shame since I really like armbian. Any chance of building a similar script for the RK3328?

Link to comment
Share on other sites

56 minutes ago, korso said:

Any chance of building a similar script for the RK3328?

Yes, it's on the TO-DO list. Updated RK3288 first, then RK3399, and then RK3328. I'm a little busy ATM with other affairs, but hopefully will be able to get into this in a couple weeks.

 

EDIT: @jock In the meantime, if you write a step-by-step for the gl4es library, or post a link to some guide that is already written, I can also include it in the script. Right now, the only thing I know about that lib is that it exists, no idea how it works.

Link to comment
Share on other sites

On 9/28/2018 at 12:48 PM, JMCC said:

Yes, it's on the TO-DO list. Updated RK3288 first, then RK3399, and then RK3328. I'm a little busy ATM with other affairs, but hopefully will be able to get into this in a couple weeks.

 

EDIT: @jock In the meantime, if you write a step-by-step for the gl4es library, or post a link to some guide that is already written, I can also include it in the script. Right now, the only thing I know about that lib is that it exists, no idea how it works.

@JMCC yes of course, I will do a small tutorial as soon as I have some spare time!

The compilation process is quite easy to accomplish, although documenting important environment variables is essential ;)

Link to comment
Share on other sites

On 9/27/2018 at 8:57 PM, JMCC said:

If you notice, your install.log shows that the mali package has a conflict with libgles2-mesa-dev. Try uninstalling that package.

@JMCC I tried your script on fresh manufacturer's provided image. Please find attached the install.log 

It shows error:

Quote

dpkg: error processing package flash-kernel

 

Board is not upgraded to new kernel.

I also tried manually to upgrade the new kernel as per the link: http://opensource.rock-chips.com/wiki_Linux_user_guide. Please let me know if i should create another thread for upgrading image using the linux SDK??

install.log

Link to comment
Share on other sites

3 hours ago, naseeb said:

@JMCC I tried your script on fresh manufacturer's provided image. Please find attached the install.log 

It shows error:

 

Board is not upgraded to new kernel.

I also tried manually to upgrade the new kernel as per the link: http://opensource.rock-chips.com/wiki_Linux_user_guide. Please let me know if i should create another thread for upgrading image using the linux SDK??

install.log

It seems like some upstream change to the "hwe" packages, that now are installing Ubuntu's 4.15 kernel. It should not be a problem in the Bionic version of the script, when it is released.

 

In the meantime, for Xenial, just select the 1.18 ("Old") version of the X server, when the script asks you. That should take care of the problem, since the script won't try to install the hwe backport.

Link to comment
Share on other sites

13 hours ago, JMCC said:

In the meantime, for Xenial, just select the 1.18 ("Old") version of the X server, when the script asks you. That should take care of the problem, since the script won't try to install the hwe backport.

@JMCC I tried 1.18 version but still get the below error when run command LD_LIBRARY_PATH=/opt/libmali-gbm/ ./glmark2-es2-drm 

 

Quote

ubuntu@localhost:~/glmark2/build/src$ LD_LIBRARY_PATH=/opt/libmali-gbm/ ./glmark2-es2-drm 
file /dev/mali0 is not of a compatible version (user 10.6, kernel 10.4)
ERROR: The DDK is not compatible with any of the Mali GPUs on the system.
The DDK was built for 0x750 r0p0 status range [1..1], but none of the GPUs matched:
file /dev/mali0 is not of a compatible version (user 10.6, kernel 10.4)
Error: eglInitialize() failed with error: 0x3001
file /dev/mali0 is not of a compatible version (user 10.6, kernel 10.4)
ERROR: The DDK is not compatible with any of the Mali GPUs on the system.
The DDK was built for 0x750 r0p0 status range [1..1], but none of the GPUs matched:
file /dev/mali0 is not of a compatible version (user 10.6, kernel 10.4)
Error: eglInitialize() failed with error: 0x3001
Error: main: Could not initialize canvas
ubuntu@localhost:~/glmark2/build/src$

Attaching install.log file as well for your reference.

install.log

Link to comment
Share on other sites

1 hour ago, naseeb said:

@JMCC I tried 1.18 version but still get the below error when run command LD_LIBRARY_PATH=/opt/libmali-gbm/ ./glmark2-es2-drm 

 

Attaching install.log file as well for your reference.

install.log

Please post the output of "armbianmonitor -m"

Link to comment
Share on other sites

1 hour ago, JMCC said:

Please post the output of "armbianmonitor -m"

Quote

ubuntu@localhost:~/build-master/packages/bsp/common/usr/bin$ sudo ./armbianmonitor -m
[sudo] password for ubuntu: 
Stop monitoring using [ctrl]-[c]
Time        CPU    load %cpu %sys %usr %nice %io %irq  C.St.

17:33:58:  816MHz  0.15  16%   2%   8%   1%   2%   0%  0/10
17:34:03:  216MHz  0.14   2%   1%   1%   0%   0%   0%  0/10
17:34:08:  408MHz  0.13   1%   0%   0%   0%   0%   0%  0/10
17:34:14:  408MHz  0.12   1%   0%   0%   0%   0%   0%  0/10
17:34:19:  216MHz  0.11   1%   0%   0%   0%   0%   0%  0/10
17:34:24:  216MHz  0.10   1%   0%   0%   0%   0%   0%  0/10
17:34:29:  216MHz  0.09   1%   0%   0%   0%   0%   0%  0/10
17:34:34: 1608MHz  0.08   2%   0%   1%   0%   0%   0%  0/10
17:34:39:  408MHz  0.16   2%   0%   1%   0%   0%   0%  0/10
17:34:44:  216MHz  0.14   5%   1%   3%   0%   0%   0%  0/10
17:34:49:  216MHz  0.13   2%   1%   1%   0%   0%   0%  0/10

@JMCC Here you go

Link to comment
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.

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

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines