Jump to content

JMCC

Members
  • Posts

    941
  • Joined

  • Last visited

Reputation Activity

  1. Like
    JMCC got a reaction from chwe in Odroid xu4 Webgl   
    Okay, this script is confirmed to work in a XU4  image with desktop and kernel NEXT 4.14.29 nightly:
     
    #!/bin/bash if [ $EUID != 0 ]; then sudo "$0" "$@" exit $? fi # User setup grep -q odroid /etc/passwd || adduser --no-create-home --disabled-login --disabled-password --gecos "" odroid usermod -aG video $(getent passwd 1000 | cut -f1 -d:) # Package installation wget http://deb.odroid.in/5422-s/pool/main/m/mali-x11/mali-x11_20170718-r17p0-20503ff-3_armhf.deb dpkg -i mali-x11_20170718-r17p0-20503ff-3_armhf.deb rm mali-x11_20170718-r17p0-20503ff-3_armhf.deb wget http://deb.odroid.in/5422-s/pool/main/x/xf86-video-armsoc/xserver-xorg-video-armsoc-exynos_1.4.1-0ubuntu4_armhf.deb dpkg -i xserver-xorg-video-armsoc-exynos_1.4.1-0ubuntu4_armhf.deb rm xserver-xorg-video-armsoc-exynos_1.4.1-0ubuntu4_armhf.deb wget http://deb.odroid.in/5422-s/pool/main/x/xf86-video-armsoc/xserver-xorg-video-armsoc_1.4.1-0ubuntu6_armhf.deb dpkg -i xserver-xorg-video-armsoc_1.4.1-0ubuntu6_armhf.deb rm xserver-xorg-video-armsoc_1.4.1-0ubuntu6_armhf.deb wget http://deb.odroid.in/5422-s/pool/main/libs/libsdl2/libsdl2-2.0-0_2.0.4%2bdfsg1-2ubuntu3_armhf.deb dpkg -i libsdl2-2.0-0_2.0.4+dfsg1-2ubuntu3_armhf.deb rm libsdl2-2.0-0_2.0.4+dfsg1-2ubuntu3_armhf.deb wget http://deb.odroid.in/5422-s/pool/main/p/pixman/libpixman-1-0_0.34.0-1hk3_armhf.deb dpkg -i libpixman-1-0_0.34.0-1hk3_armhf.deb rm libpixman-1-0_0.34.0-1hk3_armhf.deb apt -y install libdrm-exynos1 # Udev rules echo 'KERNEL=="mali0",SUBSYSTEM=="misc",MODE="0777" KERNEL=="CEC", MODE="0777" KERNEL=="cec*", MODE="0777"' > /etc/udev/rules.d/10-odroid.rules # Xorg config sudo rm /etc/X11/xorg.conf.d/* echo 'Section "Device" Identifier "Mali-Fbdev" Driver "armsoc" Option "fbdev" "/dev/fb0" Option "Debug" "false" Option "DPMS" "false" Option "NoFlip" "true" Option "NoHardwareMouse" "true" EndSection Section "ServerLayout" Identifier "Default Layout" Option "BlankTime" "0" Option "StandbyTime" "0" Option "SuspendTime" "0" Option "OffTime" "0" EndSection Section "DRI" Mode 0666 EndSection Section "Extensions" Option "Composite" "Disable" Option "RENDER" "Disable" EndSection ' > /etc/X11/xorg.conf.d/01-armbian-defaults.conf # Chromium config echo '# Default settings for chromium-browser. This file is sourced by /bin/sh from # /usr/bin/chromium-browser # Options to pass to chromium-browser CHROMIUM_FLAGS=" --disable-namespace-sandbox --use-gl=egl --ignore-gpu-blacklist --disable-accelerated-2d-canvas --num-raster-threads=2" ' > /etc/chromium-browser/default [ -e /usr/lib/chromium-browser/libEGL.so ] && mv /usr/lib/chromium-browser/libEGL.so /usr/lib/chromium-browser/libEGL.so.org [ -e /usr/lib/chromium-browser/libGLESv2.so ] && mv /usr/lib/chromium-browser/libGLESv2.so /usr/lib/chromium-browser/libGLESv2.so.org ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/chromium-browser/libEGL.so ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/chromium-browser/libGLESv2.so echo ' *********************************** * Configuration complete. * * PLEASE REBOOT * *********************************** ' exit 0 Notes:
    You must disable window compositing, or performance will be awful The problem is that, without compositing, some elements of the Xfce UI became invisible, the most annoying being the tray notification icons. I have checked, and it also happens in the Hardkernel image, but it is not a problem for them since they use Mate as default DE. We'll need to find a way to work around this.
  2. Like
    JMCC got a reaction from jkljkl1197 in Tinkerboard with ISP1 driver doesn't boot (camera support)   
    Just ordered an ov5647 camera to join the party. Will take a few days to ship from China, though
  3. Like
    JMCC got a reaction from chwe in Tinkerboard with ISP1 driver doesn't boot (camera support)   
    Just ordered an ov5647 camera to join the party. Will take a few days to ship from China, though
  4. Like
    JMCC reacted to chwe in Tinkerboard with ISP1 driver doesn't boot (camera support)   
    I'm building an image with their buildscript right now.  In case this doesn't work I'll open an issue on their github repo (and as a side note that they should rename their rootfs name on gdrive: rootfs-debian-20171225(fix a stupid mistake, affect performance since 20170901).tar.gz  it's nasty to work with such names from console... ).
     
    Another side note: 
    RK suggests to use gcc <6:
     
    Whereas we use gcc7, I tested it with:
    case $BRANCH in default) KERNELSOURCE='https://github.com/rockchip-linux/kernel.git' KERNELBRANCH='branch:release-4.4' KERNELDIR='linux-rockchip' KERNEL_USE_GCC='< 6.0' it built without issues but the kernel failed also to boot... Can this have an effect? I'm not that motivated to test all possible configurations with gcc<6...  
     
    Update:
    At least it boots...   but dmesg shows:
    linaro@linaro-alip:/usr/local/bin$ dmesg | grep ov56 [ 3.664487] OF: graph: no port node found in /i2c@ff660000/ov5647@36 [ 3.677146] ov5647 2-0036: DT parsing error: -22 [ 3.687968] ov5647: probe of 2-0036 failed with error -22 and therefore as expected their camera test fails too:
    linaro@linaro-alip:/usr/local/bin$ sudo ./test_camera.sh Start MIPI CSI Camera Preview! ./test_camera.sh: 9: ./test_camera.sh: cannot create /sys/module/video_rkisp1/parameters/rkisp1_debug: Permission denied Setting pipeline to PAUSED ... ERROR: Pipeline doesn't want to pause. ERROR: from element /GstPipeline:pipeline0/GstRkXImageSink:rkximagesink0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure. Additional debug info: gstbasesink.c(5184): gst_base_sink_change_state (): /GstPipeline:pipeline0/GstRkXImageSink:rkximagesink0: Failed to start Setting pipeline to NULL ... Freeing pipeline ... I'll open an issue...  Seems that the camera is powered during boot (red LED on camera board shines up for a short time before it turns off). 
     
    Update II:
    issue is open and I hope we get some respond:
    https://github.com/rockchip-linux/kernel/issues/72
     
  5. Like
    JMCC got a reaction from jkljkl1197 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    Yesterday the development branch of  the kernel received some changes that seem to fix many errors, including the one you point out. If you are not using your system for a production environment, you can switch to nightly builds, test it and tell us if it works for you. 
     
    In order to switch to nightly builds, launch "armbian-config" and then "System > Nightly"
  6. Like
    JMCC got a reaction from TonyMac32 in Configuration doesn't stick   
    Then that can be the reason why the kernel kept reverting to disable those other configs after I enabled them. 
     
    That's right, as a matter of fact now I remember some other changes I tried at the beginning and they made it correctly into the compiled kernel. I guess frustration blurred my mind when I wrote that post. But I learnt a lot about device tree sources and kernel config files.
     
    Confirmed to work in current development branch kernel
  7. Like
    JMCC got a reaction from Igor in Configuration doesn't stick   
    Then that can be the reason why the kernel kept reverting to disable those other configs after I enabled them. 
     
    That's right, as a matter of fact now I remember some other changes I tried at the beginning and they made it correctly into the compiled kernel. I guess frustration blurred my mind when I wrote that post. But I learnt a lot about device tree sources and kernel config files.
     
    Confirmed to work in current development branch kernel
  8. Like
    JMCC got a reaction from TonyMac32 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    The new archive I uploaded is identical to the one from March 1, except for the corrected mpv package.
     
    Yes, you need to do "sudo apt -f install" for the unmet dependencies, after installing the packages. I added it to the original post. Thank you for pointing this out.
  9. Like
    JMCC got a reaction from Stuart Naylor in Rock64 Rockchip_dri driver missing   
    If I'm not wrong, that error is due to Mali not supporting OpenGL, but only OpenGL ES. In other words: there is no rockchip_dri.so, it just doesn't exist anywhere, and I don't think it will exist.
     
    Rockchip provides a tweaked X server that gives you glamor acceleration through OpenGL ES, but it only works for mali midgard  (RK3288 and 3399). However, you can get 3D acceleration for your RK 3288 3328 (sorry, typo) through the armsoc driver. If you are interested, I can give you more info on it.
  10. Like
    JMCC got a reaction from chwe in Rock64 Rockchip_dri driver missing   
    If I'm not wrong, that error is due to Mali not supporting OpenGL, but only OpenGL ES. In other words: there is no rockchip_dri.so, it just doesn't exist anywhere, and I don't think it will exist.
     
    Rockchip provides a tweaked X server that gives you glamor acceleration through OpenGL ES, but it only works for mali midgard  (RK3288 and 3399). However, you can get 3D acceleration for your RK 3288 3328 (sorry, typo) through the armsoc driver. If you are interested, I can give you more info on it.
  11. Like
    JMCC reacted to nitroshift in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    Confirmed as working on kernel 4.16.0-rc4 too.
     
    nitroshift
  12. Like
    JMCC got a reaction from chwe in Odroid xu4 Webgl   
    I have a HC1 (a kind of a headless XU4), so I can't test WebGL. It should work if you install these two packages:
    http://deb.odroid.in/5422-s/pool/main/m/mali-x11/mali-x11_20170718-r17p0-20503ff-3_armhf.deb
    http://deb.odroid.in/5422-s/pool/main/x/xf86-video-armsoc/xserver-xorg-video-armsoc-exynos_1.4.1-0ubuntu4_armhf.deb
     
    And then replace /etc/X11/xorg.conf.d/(whatever-is-the-name-of-the-conf-file) with the following:
    Section "Device" Identifier "Mali FBDEV" Driver "armsoc" Option "fbdev" "/dev/fb0" Option "Fimg2DExa" "false" Option "DRI2" "true" Option "DRI2_PAGE_FLIP" "false" Option "DRI2_WAIT_VSYNC" "true" # Option "Fimg2DExaSolid" "false" # Option "Fimg2DExaCopy" "false" # Option "Fimg2DExaComposite" "false" Option "SWcursorLCD" "false" EndSection Section "Screen" Identifier "DefaultScreen" Device "Mali FBDEV" DefaultDepth 24 EndSection Maybe you can play with the commented-out lines, and see how it affects performance. Let us know whether it works.
  13. Like
    JMCC got a reaction from jkljkl1197 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    It is a Youtube-specific plugin. It will do nothing outside of Youtube.
     
    AFAIK, the RK3288's VPU cannot decode VP9, so it will be decoded through software. VP8 seems to be supported, though I have not tested it. More info: http://rockchip.wikidot.com/rk3288
  14. Like
    JMCC got a reaction from Tido in Tinker Board Sound   
    You must install the "default" image, not "mainline". Sound is not working in mainline. This is the right one: https://dl.armbian.com/tinkerboard/Ubuntu_xenial_default_desktop.7z.torrent
  15. Like
    JMCC got a reaction from TonyMac32 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    Updated to include also Open CL testing with a GPU miner. No, guys, you're not going to get rich with your little Tinker, but it is funny to see her join all those mining rigs and ASICs at the mining pools.
  16. Like
    JMCC got a reaction from jkljkl1197 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    As of now, Debian Stretch image is still under development (though very functional already). So I would recommend you to build Ubuntu. Maybe when Stretch image is released officially, it will be better to use it for the Tinkerboard, since all the Rockchip-linux packages are built against Stretch. But for now, I recommend Ubuntu.
  17. Like
    JMCC got a reaction from TonyMac32 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    @pipozovato You downloaded the wrong image. It should be https://dl.armbian.com/tinkerboard/Ubuntu_xenial_default_desktop.7z, with 4.4 kernel. And, until the new image is released, you must also install the testing packages with the updated 4.4 kernel, from the post referenced at the beginning.
     
    @pro777 When the new image is released, permissions will be set properly by default. Until then, you can put in /etc/rc.local these three lines:
    sudo chmod 666 /dev/hevc-service sudo chmod 666 /dev/mali0 sudo chmod 666 /dev/media* You guys must remember that all these features are still under testing. The stable image won't need all the fixes.
  18. Like
    JMCC got a reaction from chwe in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    @pipozovato You downloaded the wrong image. It should be https://dl.armbian.com/tinkerboard/Ubuntu_xenial_default_desktop.7z, with 4.4 kernel. And, until the new image is released, you must also install the testing packages with the updated 4.4 kernel, from the post referenced at the beginning.
     
    @pro777 When the new image is released, permissions will be set properly by default. Until then, you can put in /etc/rc.local these three lines:
    sudo chmod 666 /dev/hevc-service sudo chmod 666 /dev/mali0 sudo chmod 666 /dev/media* You guys must remember that all these features are still under testing. The stable image won't need all the fixes.
  19. Like
    JMCC got a reaction from pro777 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    [UPDATE 2018/05/21: I have created a script to configure everything described in this tutorial, plus some more things. There will be no updates to the tutorial from now on. Please refer all the questions and bug reports to the script. It can be found here:]
     
    [UPDATE 2018/03/16: Fixed mpv package]
    [UPDATE 2018/03/01: Added OpenCL testing through GPU cryptocurrency mining]
     
    With the new default kernel based on rockchip-linux, boards with RK3288 SoC have now full kernel support for interacting with the GPU and hardware video decoder. Rockchip-linux also provides userspace libraries and other software to make everything work. In this tutorial, you'll learn to set everything up in a current Armbian Xenial default image.
     
    (Note: rockchip-linux uses Debian Stretch as their base distro for all their packages. So we would be better off using the Stretch Armbian image, but it is still not stable enough for production. Therefore, we are going to install a few backports over the Xenial image, to make everything work)
     
    Start by downloading and extracting this compressed file: https://mega.nz/#!hrxy0bra!pOD0L_vIaq3wn0DWwRGYGsT2PSUIJG-HZbcyrJ4m6As
    It contains all the packages I am going to refer to in the tutorial
     
     
    1. Install backported X server from the ubuntu repos
    $ sudo apt install xserver-xorg-hwe-16.04 xserver-xorg-video-fbdev-hwe-16.04 2. Install libraries
    Install all the packages under the "libs" directory, in the file you downloaded and extracted.
     
    3. Install and configure tweaked X server
    In order to make graphic acceleration work under X, rockchip-linux developers have created a tweaked X server. To enable it:
    You need to disable compositing. In the Xfce menu, navigate to "Settings > Window Manager Tweaks", choose the rightmost tab (Compositor), and uncheck "Enable display compositing". Install the packages under the "xserver" directory of our downloaded compressed file Make a backup of the file "/etc/X11/xorg.conf.d/01-armbian-defaults.conf", and replace its content with the following: Section "Device" Identifier "Rockchip Graphics" Driver "modesetting" Option "AccelMethod" "glamor" ### "glamor" to enable 3D acceleration, "none" to disable Option "DRI" "2" # You can disable Vsync for better 3D benchmark score, at the cost of worst video playing. Not recommended. # Option "Dri2Vsync" "false" EndSection Section "Screen" Identifier "Default Screen" SubSection "Display" Depth 24 Modes "1920x1080" "1280x1024" "1024x768" "800x600" EndSubSection EndSection 3. Restart X
     
    4. Test 3D acceleration
    $ sudo apt install glmark2-es2 $ glmark2-es2 If everything is working, you shoud see a window with rotating 3D objects, and console output shoud start like this:
    ======================================================= glmark2 2014.03+git20150611.fa71af2d ======================================================= OpenGL Information GL_VENDOR: ARM GL_RENDERER: Mali-T760 GL_VERSION: OpenGL ES 3.2 v1.r14p0-01rel0-git(966ed26).eedaf0c5244add8e249cecdd3c721329 =======================================================  
    5. Test video acceleration with MPV
    Install the package under the directory "mpv".
    When you play a video with this version, it will use GPU EGL accelerated video display, but decoding will still be via software. That means you can play up to 1080p@30fps HVEC quite smoothly, with around 80-90% CPU use. Anything above that resolution/fps will be jerky.
    In order to use full acceleration with MPV, you need to be under Wayland. I intend to do some other post on that, God willing.
     
    6. Test video acceleration with Gstreamer
    The "official" way of using full HW video acceleration under X is via a special Gstreamer plugin created by the rockchip-linux developers. But we need to install a backported version of Gstreamer, in order for the plugin to work.
    Install all the packages in the "gstreamer-backport" directory Install all the packages in the "gstreamer" folder (these are for the rockchip plugin) Do "sudo apt -f install" for the unmet dependencies You can now play a video from command line with either of these commands: $ gst-launch-1.0 filesrc location=<videofile> ! decodebin ! videoconvert ! rkximagesink $ gst-play-1.0 --videosink=rkximagesink <videofile> This plugin uses GPU acceleration for display, through a KMS overlay, and also hardware decoding via the rockchip mpp interface. You can play 4k@30fps HEVC with perfect smoothness, while the CPU stays under 15% use. If you don't have any 4k video, you can try with this one: http://www.libde265.org/hevc-bitstreams/sintel-4096x1744-cfg02.mkv
    (Notice that if you try to display any subtitle, it will make the plugin crash).
     
    7. Install a Gstreamer demo player
    Instead of launching videos through the command line, you can also install a simple video player that will use the rockchip plugin.
    Install the following packages: $ sudo apt-get install libqt5opengl5 libqt5qml5 libqt5quick5 libqt5widgets5 libqt5gui5 libqt5core5a qml-module-qtquick2 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5 qtmultimedia5-examples qtmultimedia5-doc-html 2. Create the file "/usr/share/applications/demo-player.desktop" with the following content:
    #!/usr/bin/env xdg-open [Desktop Entry] Categories=Qt;KDE;AudioVideo;Player;Video; Comment=A gstreamer base player Exec=env QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink /usr/lib/arm-linux-gnueabihf/qt5/examples/multimediawidgets/player/player --geometry 960x640+0+0 GenericName=Media Player Icon=/usr/share/icons/gnome/48x48/categories/applications-multimedia.png Name=Media Player Type=Application X-KDE-StartupNotify=false Keywords=movie;player;media;kde;qt; X-Ayatana-Desktop-Shortcuts=Screen;Window Now you will see an entry "Media Player" in the Xfce menu, and you can also choose to play video files with this player by right-clicking on them and choosing "Open with..."
     
    8. Enable acceleration for Chromium
    For last, we are going to enable acceleration for Chromium Web Browser
    Backup the file "/etc/chromium-browser/default", and modify it to look like this: # Default settings for chromium-browser. This file is sourced by /bin/sh from # /usr/bin/chromium-browser # Options to pass to chromium-browser # A set of command line flags that we want to set by default. # Do not hide any extensions in the about:extensions dialog export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --show-component-extension-options" # Don't use the GPU blacklist (bug #802933) export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --ignore-gpu-blacklist" # Use EGL acceleration export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --use-gl=egl"  
    Launch Chrome, and enter in the address bar "chrome://gpu". If everything is OK, you should see something like this:

    Now, go to the Chrome Web Store and install the extension "h264ify". It will force youtube to use H264 instead of VP9, which has no acceleration with RK3288.
    Enter Youtube and play any 1080p video. It should play fairly well, dropping frames only when some kind of overlay pops up (like an ad on top of the video, or the controls overlay).
    Test WebGL, for example with this page: http://webglsamples.org/aquarium/aquarium.html
     
    9. NEW: Testing OpenCL with a GPU cryptocurrency miner
    Download either of these compiled GPU miners (each of them features diferent algorithms): https://goo.gl/gHrPGg / https://goo.gl/MTSgBG Untar them, cd into the directory and run them (in case you get an error, try doing "sudo make install"). E.g.: ./sgminer -k lyra2rev2 -o stratum+tcp://<url of pool>:<port> -u <your username> -p d=0.050 -I 14 -w 64  
    If you want to learn more, you can follow this tutorial: https://www.novaspirit.com/2017/12/21/gpu-mining-on-tinkerboard/ Mining with the skein algorithm:

     
     
    Please report your experiences and suggestions. Wayland testing stays in the to-do list. Thanks,.
     
  20. Like
    JMCC got a reaction from jkljkl1197 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    @jkljkl1197 Sorry, if you told us which board you have, I can't find the post where you said it. I assume it is a Tinker Board.  Well, in that case, I think you have two options: Armbian and the official TinkerOS Debian.
     
    About Armbian, if you are not able to build an image yourself with the new kernel, you can either download the old image and then install the packages referenced in the OP of this thread (including the kernel packages, from another thread linked also there), or you can also wait until the new image is released.
     
    About TinkerOS, it will give you some of those things already configured without you needing to do so. But Armbian is more stable, has slightly better performance, and several tweaks and scripts that you won't find in TinkerOS.
     
    I recommend you to try both, and see which one suits your needs better. This is what the world of FOSS and SBC's is about: experimenting, trying, learning, tinkering... ;-)
  21. Like
    JMCC reacted to TonyMac32 in Tinker Board Sound   
    updated OP
  22. Like
    JMCC got a reaction from jkljkl1197 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    Glad it worked.
     
    Yes, if you disable vsync you can get over 200 fps. But it is useless since your screen is still refreshing at 60hz, and you lose all that smoothness in video playing.
     
    Probably needs some specific entries in Xorg config file. Unfortunately, I don't have the touchscreen to test.
     
    Sure. Maybe adding a menu item to armbian-config in RK3288 boards.
     
     
    Also, I think I know which changes would need to be made in order to make it work in RK3328 and RK3399. But I don't have any board with thise SoC's. I am not planning to buy any RK3328; maybe a RK3399, when they release one for the average user who doesn't need to attach three LVDS at a time.
  23. Like
    JMCC got a reaction from jkljkl1197 in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    [UPDATE 2018/05/21: I have created a script to configure everything described in this tutorial, plus some more things. There will be no updates to the tutorial from now on. Please refer all the questions and bug reports to the script. It can be found here:]
     
    [UPDATE 2018/03/16: Fixed mpv package]
    [UPDATE 2018/03/01: Added OpenCL testing through GPU cryptocurrency mining]
     
    With the new default kernel based on rockchip-linux, boards with RK3288 SoC have now full kernel support for interacting with the GPU and hardware video decoder. Rockchip-linux also provides userspace libraries and other software to make everything work. In this tutorial, you'll learn to set everything up in a current Armbian Xenial default image.
     
    (Note: rockchip-linux uses Debian Stretch as their base distro for all their packages. So we would be better off using the Stretch Armbian image, but it is still not stable enough for production. Therefore, we are going to install a few backports over the Xenial image, to make everything work)
     
    Start by downloading and extracting this compressed file: https://mega.nz/#!hrxy0bra!pOD0L_vIaq3wn0DWwRGYGsT2PSUIJG-HZbcyrJ4m6As
    It contains all the packages I am going to refer to in the tutorial
     
     
    1. Install backported X server from the ubuntu repos
    $ sudo apt install xserver-xorg-hwe-16.04 xserver-xorg-video-fbdev-hwe-16.04 2. Install libraries
    Install all the packages under the "libs" directory, in the file you downloaded and extracted.
     
    3. Install and configure tweaked X server
    In order to make graphic acceleration work under X, rockchip-linux developers have created a tweaked X server. To enable it:
    You need to disable compositing. In the Xfce menu, navigate to "Settings > Window Manager Tweaks", choose the rightmost tab (Compositor), and uncheck "Enable display compositing". Install the packages under the "xserver" directory of our downloaded compressed file Make a backup of the file "/etc/X11/xorg.conf.d/01-armbian-defaults.conf", and replace its content with the following: Section "Device" Identifier "Rockchip Graphics" Driver "modesetting" Option "AccelMethod" "glamor" ### "glamor" to enable 3D acceleration, "none" to disable Option "DRI" "2" # You can disable Vsync for better 3D benchmark score, at the cost of worst video playing. Not recommended. # Option "Dri2Vsync" "false" EndSection Section "Screen" Identifier "Default Screen" SubSection "Display" Depth 24 Modes "1920x1080" "1280x1024" "1024x768" "800x600" EndSubSection EndSection 3. Restart X
     
    4. Test 3D acceleration
    $ sudo apt install glmark2-es2 $ glmark2-es2 If everything is working, you shoud see a window with rotating 3D objects, and console output shoud start like this:
    ======================================================= glmark2 2014.03+git20150611.fa71af2d ======================================================= OpenGL Information GL_VENDOR: ARM GL_RENDERER: Mali-T760 GL_VERSION: OpenGL ES 3.2 v1.r14p0-01rel0-git(966ed26).eedaf0c5244add8e249cecdd3c721329 =======================================================  
    5. Test video acceleration with MPV
    Install the package under the directory "mpv".
    When you play a video with this version, it will use GPU EGL accelerated video display, but decoding will still be via software. That means you can play up to 1080p@30fps HVEC quite smoothly, with around 80-90% CPU use. Anything above that resolution/fps will be jerky.
    In order to use full acceleration with MPV, you need to be under Wayland. I intend to do some other post on that, God willing.
     
    6. Test video acceleration with Gstreamer
    The "official" way of using full HW video acceleration under X is via a special Gstreamer plugin created by the rockchip-linux developers. But we need to install a backported version of Gstreamer, in order for the plugin to work.
    Install all the packages in the "gstreamer-backport" directory Install all the packages in the "gstreamer" folder (these are for the rockchip plugin) Do "sudo apt -f install" for the unmet dependencies You can now play a video from command line with either of these commands: $ gst-launch-1.0 filesrc location=<videofile> ! decodebin ! videoconvert ! rkximagesink $ gst-play-1.0 --videosink=rkximagesink <videofile> This plugin uses GPU acceleration for display, through a KMS overlay, and also hardware decoding via the rockchip mpp interface. You can play 4k@30fps HEVC with perfect smoothness, while the CPU stays under 15% use. If you don't have any 4k video, you can try with this one: http://www.libde265.org/hevc-bitstreams/sintel-4096x1744-cfg02.mkv
    (Notice that if you try to display any subtitle, it will make the plugin crash).
     
    7. Install a Gstreamer demo player
    Instead of launching videos through the command line, you can also install a simple video player that will use the rockchip plugin.
    Install the following packages: $ sudo apt-get install libqt5opengl5 libqt5qml5 libqt5quick5 libqt5widgets5 libqt5gui5 libqt5core5a qml-module-qtquick2 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5 qtmultimedia5-examples qtmultimedia5-doc-html 2. Create the file "/usr/share/applications/demo-player.desktop" with the following content:
    #!/usr/bin/env xdg-open [Desktop Entry] Categories=Qt;KDE;AudioVideo;Player;Video; Comment=A gstreamer base player Exec=env QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink /usr/lib/arm-linux-gnueabihf/qt5/examples/multimediawidgets/player/player --geometry 960x640+0+0 GenericName=Media Player Icon=/usr/share/icons/gnome/48x48/categories/applications-multimedia.png Name=Media Player Type=Application X-KDE-StartupNotify=false Keywords=movie;player;media;kde;qt; X-Ayatana-Desktop-Shortcuts=Screen;Window Now you will see an entry "Media Player" in the Xfce menu, and you can also choose to play video files with this player by right-clicking on them and choosing "Open with..."
     
    8. Enable acceleration for Chromium
    For last, we are going to enable acceleration for Chromium Web Browser
    Backup the file "/etc/chromium-browser/default", and modify it to look like this: # Default settings for chromium-browser. This file is sourced by /bin/sh from # /usr/bin/chromium-browser # Options to pass to chromium-browser # A set of command line flags that we want to set by default. # Do not hide any extensions in the about:extensions dialog export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --show-component-extension-options" # Don't use the GPU blacklist (bug #802933) export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --ignore-gpu-blacklist" # Use EGL acceleration export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --use-gl=egl"  
    Launch Chrome, and enter in the address bar "chrome://gpu". If everything is OK, you should see something like this:

    Now, go to the Chrome Web Store and install the extension "h264ify". It will force youtube to use H264 instead of VP9, which has no acceleration with RK3288.
    Enter Youtube and play any 1080p video. It should play fairly well, dropping frames only when some kind of overlay pops up (like an ad on top of the video, or the controls overlay).
    Test WebGL, for example with this page: http://webglsamples.org/aquarium/aquarium.html
     
    9. NEW: Testing OpenCL with a GPU cryptocurrency miner
    Download either of these compiled GPU miners (each of them features diferent algorithms): https://goo.gl/gHrPGg / https://goo.gl/MTSgBG Untar them, cd into the directory and run them (in case you get an error, try doing "sudo make install"). E.g.: ./sgminer -k lyra2rev2 -o stratum+tcp://<url of pool>:<port> -u <your username> -p d=0.050 -I 14 -w 64  
    If you want to learn more, you can follow this tutorial: https://www.novaspirit.com/2017/12/21/gpu-mining-on-tinkerboard/ Mining with the skein algorithm:

     
     
    Please report your experiences and suggestions. Wayland testing stays in the to-do list. Thanks,.
     
  24. Like
    JMCC got a reaction from chwe in Tutorial: 3D, video acceleration and OpenCL in RK3288 boards with new 4.4 (default) kernel   
    Glad it worked.
     
    Yes, if you disable vsync you can get over 200 fps. But it is useless since your screen is still refreshing at 60hz, and you lose all that smoothness in video playing.
     
    Probably needs some specific entries in Xorg config file. Unfortunately, I don't have the touchscreen to test.
     
    Sure. Maybe adding a menu item to armbian-config in RK3288 boards.
     
     
    Also, I think I know which changes would need to be made in order to make it work in RK3328 and RK3399. But I don't have any board with thise SoC's. I am not planning to buy any RK3328; maybe a RK3399, when they release one for the average user who doesn't need to attach three LVDS at a time.
  25. Like
    JMCC got a reaction from bedalus in Changing Default kernel, Testing needed   
    I just posted the tutorial:
     
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines