This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Improving Qt Performance

Part Number: AM5728

Tool/software: Linux

Customer working to try to optimize their html page load times, driving two displays LCD and HDMI (with different content). Using current Linux PSDK v5.02 on AM572x EVM. They use multiple QWebEngineViews to "preload" several different control view, then the idea is they can rapidly switch between them. This works well once the pages are initial rendered, but they been trying to improve what happens the first time the page is loaded. As it is, when the page is shown for the first time, there is a fairly ugly white flash that is shown for maybe a couple hundred ms, and then their page is shown fully rendered. Our pages do take some time to draw so the delay is understandable, but they need a solution to avoid the white flash foir their product.

One odd thing is that is noticed when they first load a web page, Qt emits a debug message:

Non-blocking swap buffers not supported. Subsurface rendering can be affected.

What does this mean?

Might have something to do with the fact that the version of Qt which comes with the board kit has openGL enabled. I pass --disable-gpu when I start the QT application, and I also use ensure my WebEngineView sets the settings to QWebEngineSettings::WebGLEnabled, false and QWebEngineSettings::Accelerated2dCanvasEnabled, false, but they still get the following debug messages from Qt:

Using Wayland-EGL

wlpvr: PVR Services Initialised

Non-blocking swap buffers not supported. Subsurface rendering can be affected.

Is there's an easy way to completely remove open GL support? They do not use it, and they believe it could be limiting thier performance. Would this mean they will need to rebuild Qt without openGL support? They tried not starting pvr in /etc/init.d/rc.pvr, but then the application does not work at all (nor does matrix browser).

Any suggestion/ideas on how to force QtWebEngineView to render the web page before it is shown somehow. They have tried everything what thye can think of

  • We have instructions for disabling the GPU as part of the yocto build here:

    software-dl.ti.com/.../Overview_Building_the_SDK.html

    However, if you're trying to get the best possible performance, why are you disabling the GPU? In that case, you get software-rendered OpenGL instead of hardware-accelerated OpenGL. When the code is written to use OpenGL, you can't get rid of OpenGL. You can only control how it is rendered.
  • What the customer has seen on the prior AM devices is that the time to load the texture memory greatly impacted the performance.

    In regards to the white screen flashes they are observing, is there some sort of watermarking process that is filling in the memory? They are navigating through about 100 webkit pages that I presume are dynamically allocated. Thoughts on how to address this white screen flashes?
  • Software rendering of QT application can be done using linuxfb QPA.
    #<qtapp> -platform linuxfb

    Regarding the warning message on "Non-blocking swap buffers not supported. Subsurface rendering can be affected.", it can be ignored. It just means that buffers are swapped when vsync signal is received. This is to avoid tearing.
  • Manisha,

    Thanks for info.  Will share with the customer.  Any thoughts on the white screen flash they are observing?  It sounds like the either buffer was prefilled with a fixed value or a fixed value is being outputted for a frame before the correct buffer content is rendered.

    Regards,

    Lawrence

  • Manisha,

    They gave that a try but they get a series of errors when they ran their app and then it crashes (and they are definitely calling QtWebEngine::initialize very early).

     

    WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.

    QQuickWidget is not supported on this platform.

     

    This plugin does not support createPlatformOpenGLContext!

    Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile))

    Aborted (core dumped)

     

    Even very basic Qt example programs like tabdialog crash with the -platform linuxfb option even if they are explicit and use ./tabdialog -platform linuxfb:fb=/dev/fb0:

     

    root@tm48-evm:/usr/share/qt5/examples/widgets/dialogs/tabdialog# ./tabdialog -platform linuxfb

    Segmentation fault (core dumped)

    root@tm48-evm:/usr/share/qt5/examples/widgets/dialogs/tabdialog# ./tabdialog -platform linuxfb:fb=/dev/fb0

    Segmentation fault (core dumped)

     

    They will try rebuilding Qt without SGX as per Brad instructions to see if that helps.

     

  • Hi Lawrence,

    My bad. QtWebEngine uses OpenGL calls inside many files.
    qtwebengine\src\core\web_engine_context.cpp, qtwebengine\src\webengine\api\qtwebengineglobal.cpp, qtwebengine\src\3rdparty\chromium\

    It can't be used with linuxfb QPA.

    Regards,
    Manisha
  • Hi Lawrence,

    I don't expect Qt build without SGX will work either as the QT-based software rendering does not invoke openGL calls at all.

    The QtWebengine is heavy weighted with the chromium as the base. If the customer does not need heavy html5 support, they should try QtWebkit-based browser. Unfortunately we do not support that at the release build any more, but it is pretty easy to update the yocto recipes to replace qtwebengine with qtwebkit.

    Hope this helps.

    Regards,
    Manisha
  • Hi Manisha,

    The plan for this product is to support html5 (for future upgrades) so they will stick with QtWebengine. Any suggestion on the white screen flash?

    Regards,

    Lawrence
  • Have you/they tried Chromium?
  • You mean to use Chromium directly instead of QtWebengine? I can ask
  • Exactly. It's probably worth at least doing some evaluation on the EVM to see if there are any benefits compared to the others (e.g. maybe it doesn't have the white screen issue, etc.).
  • Brad/Anyone

    Customer is looking for any pointers/examples of using Chromium directly. Any pointers?

    Regards,

    Lawrence
  • Last I checked it is included in the prebuilt file system. Just launch and then browse to a web page. I hooked up a usb keyboard and mouse for easier navigation.

  • I thought QtWebEngine is an API layer on top of portion of Chromium. What they would need is a way to make calls directly to Chromium to bypass QtWebEngine, not a web browser
  • Check the Chroimum Browser application in Matrix GUI.

    Matrix-Gui -> Browser -> Chromium Browser

    /usr/bin/google-chrome

    #!/bin/sh

    export CHROME_DEVEL_SANDBOX=/usr/sbin/chrome-devel-sandbox
    export LD_LIBRARY_PATH=/usr/lib/chromium

    CHROME_EXTRA_ARGS=" --use-gl=egl "
    if [ "`whoami`" = "root" ] ; then
    CHROME_EXTRA_ARGS="${CHROME_EXTRA_ARGS} --user-data-dir=/home/root/.chromium/"
    fi

    /usr/bin/chromium/chrome ${CHROME_EXTRA_ARGS} $@

    Regarding the white flash, it might be just the buffers are getting swapped for display in middle of the buffer updates.
  • The Chromium build is completely independent of Qt.  You are correct that QtWebEngine is leveraging much of the chromium infrastructure.