i.MX6 and QtWayland bad performance and other issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX6 and QtWayland bad performance and other issue

Jump to solution
13,770 Views
yenchinlee
Contributor III

Has anyone try playing i.MX6 with QtWayland ? I find out the

QtWayland application performance is really bad, worse than running the same

application under X11 or EGLFS.

These test is use image build from Yocto project with meta-freescale's patches.

I use `Cinematic Experience' as my testing app, here is the

cinematicexperience running under weston with qtwayland.

   https://www.dropbox.com/s/3au5mmlvkroerh5/i.mx6%20with%20qtwayland.mp4?dl=0

However, compare the application speed wth EGLFS platform, you will find

the QtWayland on i.MX6 is really slow.

   https://www.dropbox.com/s/nmjbzue7k5rxwz6/i.mx6%20with%20eglfs.mp4?dl=0

Expect for the bad performance, I also can't run QtWayland's examples,

ex: qml-compositor

When I try to run the qml-compositor, there's an EGL error.

    root@machine:/usr/share/qt5/

examples/wayland/qml-compositor# ./qml-compositor -platform eglfs
    QEglFSImx6Hooks will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.
    If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1
    QtCompositor: Failed to initialize EGL display. Could not find glEGLImageTargetTexture2DOES.

Sine the compositor can't initialize EGL display, I can't running either
opengl app nor QtQuick2 application via wayland protocol.

But weston compositor can run well under the fb-backend.so, just the
slow qtwayland performance problem (weston-simple-egl works fine).

Since my goal is use Qt as the core of my system, it will be nice to run
QtWayland and build a compositor in purely Qt, like Jolla's Salifish does.

Is there anyway to make QtWayland and it's example run well under i.MX6 ?

Here is my libraries version and what I do.

Here is my machine info:

    CPU: i.MX6 DuleLite
    DRAM: 1GB (176MB for GPU)
    Kernel: 3.10.17-1.0.1_ga
    Type: Based on wandboard

    meta-freescale branch: master
    meta-qt5 branch: master

I use Qt 5.3.2 and QtWayland-git branch 5.4 (commit: c3d2a7b), which
need to add a backport patch to build with Qt 5.3.2, you can find the
patch at following link

    http://pastebin.com/gZFxSgRa

To use qtwayland, you need to setup `QT_WAYLAND_IGNORE_BIND_DISPLAY=1` variable since
i.MX6 Vivante do not use eglBindWaylandDisplayWL() to bind the
wl_display to the EGL display. For more information, please see

    https://qt.gitorious.org/qt/lkundrak-qtwayland/commit/4d4fe579225ac089b24912bf8fad5585e615ce6b

Note:

[1] You can find Qt 5.3.2 in meta-qt5 master branch
     https://github.com/meta-qt5/meta-qt5.git

[2] I also testing the libhybris on i.MX6 with Android 4.4.2_r1, but the
qml-compositor example also can't run and the qt5-qpa-hwcompositor QPA
plugin performance is not so good like qtwayland.

If you interesting to testing i.mx6 with libhybris, you can find some
info in

     https://github.com/aosp-hybris

The libhybris please to use following repo

     https://github.com/aosp-hybris/libhybris   (branch: test_viv)

Currently aosp-hybris project just put on hold (temporarily halted)
until my company's work finish. But if you interested in how to run
i.MX6DL under wandboard with libhybrs, you can contacts me for the image.

1 Solution
5,388 Views
ortogonal
Contributor III

QtWaylandCompositor works with IMX6 if some patches are added to QtBase and to QtWayland. Patches can be downloaded from: https://gist.github.com/ortogonal/c54e458e2fa856ec0923

This is just the first version, it still contains some debug information that is not needed and the biggest problem is that it adds a dependency in QtBase to wayland-server which is not really a great solution. One way to solve this is maybe to move a patched version of the eglfs platform plugin to qtwayland instead. I will continue with this work and try to make the patches more simple to use.

I've tested this on an iMX6 with custom kernel and rootfs using the 3.10.31 beta GPU-drivers. QtBase is e3bfd9bea65cc7a9e1742b0cb7ca9af22c42f730 and QtWayland is 806ada3e8b8d1ea8f29c839f22963417f7c34a90. Both are in the 5.4 branch. It will probably work on the latest stuff in the 5.4 branches as well.

I will post a more detailed blog post of what these patches does and what the "magic" is in a couple of days.

I you have questions, problems or feedback on the don't hesitate to speak up!

/Erik Larsson, Senior Software Engineer Combitech AB

View solution in original post

0 Kudos
19 Replies
5,388 Views
sanjeevsharma
Contributor IV

Hello YenChin,

Are these patches https://gist.github.com/ortogonal/c54e458e2fa856ec0923  are also applicable for omap arm.We are using wayland-egl platform plugin and we are trying to run qml app on QTwebengine 5.4 but getting an error at GLContextHelper::getEGLDisplay(); Do you have any idea ?

Any help would be appreciated .

0 Kudos
5,388 Views
yenchinlee
Contributor III

For those interesting in running QtWaylandCompositor under Freescale i.MX6 platform, you can try above patch.

I can use it to run the qml-compositor, but it seems like there are some problem we need to overcome, ex: After running qml-compositor about 5 minute or execute more application, I can't make the new application show on the compositor. (I know I can't really describe the problem here, just run the compositor with more application then you may know what I talk about.)

If you want to use Yocto to test this patch, I have build a simple layer here  coldnew/meta-fsl-imx6-qtwayland · GitHub which contains Erik's patch(with a little fix). Note that you need to use the dizzy branch of meta-qt5, since these patch is for Qt5.4-beta1. (Note: You need to set DISTRO_FEATURES = "wayland")

After building your qt source, you also need to install libgles-mx6 manualy, else when you execute the qml-compositor, you will get following error:

      QtCompositor: Failed to initialize EGL display. Could not find glEGLImageTargetTexture2DOES.

0 Kudos
5,388 Views
stavrosmarkou
Contributor II

Hi,

I have applied Eric's patches on qt 5.4.0 and i got it working like you do. I have experienced the same behavior you did but i think i can overcome this.

Try this on line 56 :

onVisibleChanged: {

        if(child && child.focus) {

                child.surface.clientRenderingEnabled = visible

        }

}

and let me know if that worked for you.

Regards,

Stavros.

0 Kudos
5,388 Views
dmitrypozhidaev
Contributor III

Hello!

I try build and use Wayland/Weston-1.70 and cross compile this at buildroot 2014.08. Qt is 5.4.

Build is success but use is imposible.

I run weston by: #weston --backend=fbdev-backend,so --tty=1

I run qt applications and got an error:

# ./qopenglwindow

Using Wayland-EGL

virtual void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay*) m_eglDisplay 0x6bbc98e0

failed to initialize EGL display

Cant find EGLConfig, returning null config

Cant find EGLConfig, returning null config

QWaylandGLContext: failed to create EGLContext, error=3008

QOpenGLWindow::beginPaint: Failed to create context

QOpenGLWindow::beginPaint: Failed to make context current

QOpenGLFunctions created with non-current context

Segmentation fault

or

# ./test_qt_ap

Using Wayland-EGL

virtual void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay*) m_eglDisplay 0x6affa8e0

failed to initialize EGL display

Cant find EGLConfig, returning null config

QWaylandGLContext: failed to create EGLContext, error=3008

Failed to create EGL context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 1, profile  0)

what can I do now?

0 Kudos
5,388 Views
sanjeevsharma
Contributor IV

Hello Dmitry,

Are you able to resolve the error by following Eric patch.

0 Kudos
5,388 Views
sanjeevsharma
Contributor IV

Hello Dmitry,

Are you able to resolve the error because I am also seeing the same problem on imx6 ?

Regards

Sanjeev Sharma

0 Kudos
5,388 Views
yenchinlee
Contributor III

Add current status what I have tested:

- kernel 3.10.17-1.0.1_ga

  1.FAILED QtWayland Compositor with X11

     QT_WAYLAND_CLIENT_BUFFER_INTEGRATION=xcomposite-egl ./qml-compositor

     When execute QtWayland client, it show something bind error like following

          root@wandboard:/# Qt5_CinematicExperience -platform wayland-xcomposite-egl

          Using XComposite-EGL

          ROOT INFORMATION 0x1e950a8 8388615 0

          Failed to bind

          Failed to bind

  2. FAILED QtWayland Compositor with eglfs

      ./qml-compositor -platform eglfs

      As this post describe

  3. FAILED QtWayland with libhybris

      As this post describe.

  4. QtWayland with Weston

      You can use weston as your compositor if not interested with QtWaylandCompositor.

- kernel 3.10.17-1.0.2_ga

1. FAILED QtWayland Compositor with eglfs

      ./qml-compositor -platform eglfs

      As this post describe

Current conclusion:

   For those want to use QtWaylandCompositer like Jolla's Salifish or WebOS does, i.MX6 may not suit your need.

0 Kudos
5,389 Views
ortogonal
Contributor III

QtWaylandCompositor works with IMX6 if some patches are added to QtBase and to QtWayland. Patches can be downloaded from: https://gist.github.com/ortogonal/c54e458e2fa856ec0923

This is just the first version, it still contains some debug information that is not needed and the biggest problem is that it adds a dependency in QtBase to wayland-server which is not really a great solution. One way to solve this is maybe to move a patched version of the eglfs platform plugin to qtwayland instead. I will continue with this work and try to make the patches more simple to use.

I've tested this on an iMX6 with custom kernel and rootfs using the 3.10.31 beta GPU-drivers. QtBase is e3bfd9bea65cc7a9e1742b0cb7ca9af22c42f730 and QtWayland is 806ada3e8b8d1ea8f29c839f22963417f7c34a90. Both are in the 5.4 branch. It will probably work on the latest stuff in the 5.4 branches as well.

I will post a more detailed blog post of what these patches does and what the "magic" is in a couple of days.

I you have questions, problems or feedback on the don't hesitate to speak up!

/Erik Larsson, Senior Software Engineer Combitech AB

0 Kudos
5,388 Views
adelantesey
Contributor IV

Hello,

does this problem still exist?

i use imx6solox with krogoth. qml-compositor and qwindow-compositor don't work.

qtwayland and opengl are installed. i can run qml application on weston. but the compositors get to errors:

when weston is up and i run qwindow-compositor, it says : another compositor is running.(cant lock lock file ...)

when i stop weston and run qwindow-compositor, it says: QXcbconnection: failed to connect to display {:0}

i tried the patches, but the files seem to change and as it is in the text above are not for krogoth distribution.

could anyone put me in correct direction please?

thanks

0 Kudos
5,388 Views
yenchinlee
Contributor III

Though I still testing this patch, but I can confirm it can work with the qml-compositor.

I'll add the information about how to use Yocto project with this patch later.

0 Kudos
5,388 Views
ortogonal
Contributor III

I've been looking at it for some time now and cannot figure out how to solve the "fbCreateWindow(compositor->display, -1, -1, 0, 0)" problem. fbCreateWindow is called from the eglfs QPA-plugin long before the compositor->display is ready.

In weston this patch is added to solve this issue. http://git.freescale.com/git/cgit.cgi/imx/meta-fsl-bsp-release.git/tree/imx/meta-fsl-arm/recipes-gra...

But I c'nt solve it in qt.

0 Kudos
5,388 Views
yenchinlee
Contributor III

At first I think it's QtWayland's problem, but after see your comment and the IRC log, I think it may the eglfs plugins problem.

When building qtbase with eglfs plugin, it will use the qeglfshooks_imx6.cpp, maybe we should add patch here.

Hope the Freescale will help this problem :smileysad:

Some others discuss this issue on IRC #imx6-dev on 2014-03-09 — irc logs at whitequark.org

0 Kudos
5,388 Views
ortogonal
Contributor III

I think that making changes in the hook-file is needed, but I think we might need to get into QtWayland as well.

Have you managed to get Weston up and running without using X?

0 Kudos
5,388 Views
yenchinlee
Contributor III

Running QtWayland under Weston compositor without X11 is ok, though the performance is not well as my original post. (with Qt5.3.2 + QtWayland 5.4 branch)

I have tested Qt5.4-beta1 + QtWayland-5.4-beta1 as wayland client runing under Weston, the slow performance issue seems like gone.

But what I really want is to use QtWayland as compositor just like Jolla's does,  it's great peaty that i.MX6 can't doing this.

0 Kudos
5,388 Views
ortogonal
Contributor III

Solved it!

I will write more information tomorrow or the day after that! But it works and the performance is really great!

5,388 Views
viktortovpyga
Contributor I

Hello Erik,

I have the similar issue with very bad performance with my browser. I have board with i.mx6, qt5.3, qtwayland plugin, weston.

I am trying different ways:

1. QWebView + wayland plugin - works very bad - 4 fps on some screen with animation;

2. QGraphicsWebView + QGLWidget + wayland plugin - I have not tested it yet;

3. QGraphicsWebView + QGLWidget + eglfs plugin  - works better than way 1, but still bad - 8 fps;

I need run browser with weston + wayland plugin. I hope step 2 will have better performance.

So, what did you do to get good performance. I have not found any information about your "magic" changes.

Could you help me with this, I have been working on this issue for a couple of months, and didn't get any good result.

Thanks in advance, Viktor.

0 Kudos
5,388 Views
sanjeevsharma
Contributor IV

Hello Viktor,

Are you able to test below configuration ?

QGraphicsWebView + QGLWidget + wayland plugin - I have not tested it yet;

Regards

Sanjeev Sharma

0 Kudos
5,388 Views
viktortovpyga
Contributor I

QGraphicsWebView + QGLWidget + wayland plugin - no, I see black screen. But it is not needed now.

I have found other way. QOpenGLWidget newer than QGLWidget.

1. QGraphicsWebView + QOpenGLWidget+ platform wayland + weston - works very slow - 8 FPS

2. QGraphicsWebView + QOpenGLWidget + platform eglfs  - works better than way 1, but still bad - 16 FPS

It would be great to get some fixes to make it works better.

Is it possible to use acceleration for  QWebView + platform wayland + weston - it is extremely slow - 3 FPS - but it is most desirable scheme for me.

0 Kudos
5,388 Views
yenchinlee
Contributor III

It sounds great ! What the magic did you do ?  Could you share the patch to let me help with testing this problem ?

0 Kudos