Qml components not loaded properly on xcb platform - qt

I'm trying to run an application on xcb platform over iMx6 (qt 5.12.8), unfortunately some qml objects are not rendered correctly for example components which requires qtgraphicaleffects. I suspect that the reason for this strange behavior is a wrong cross-compilation of qt libraries, in fact no matter I change configure parameters, I'm not able to enable EGL on X11 which should solve my issue.
If I enable qt libs verbose configure I read:
egl-x11.cpp:49:9: error: invalid conversion from ‘EGLNativeDisplayType {aka void*}’ to ‘Display* {aka _XDisplay*}’ [-fpermissive]
dpy = egldpy;
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ yes
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... no
LinuxFB ................................ no
VNC .................................... yes
Mir client ............................. no
Someone faced the same issue? How could be solved? any help would be appreciated.

I'm answering to my own question for whom may face the same problem. I was compiling qt using a sysroot configured to run with Vivante plugin for video acceleration. That was not compatible with eglfs on x11. Without egl , qt libraries are not able to render correctly complex objects such as those mentioned in the question. Compiling with the right dependencies and running with eglfs solved the issue.

Related

Cross-compilation QT 5.15 on Raspberry pi3 with qtwebengine

I am trying to cross compile QT 5.15.2 for a Raspberry Pi 3. I am following this guide:
https://ebsolution31.wordpress.com/2020/10/08/cross-compile-qt/
I can cross compile qtbase, but I failed many times to cross compile qt-webengine.
After the make command of the qtwebengine every times I get this error:
ninja: build stopped: subcommand failed.
make[3]: *** [Makefile.gn_run:344: run_ninja] Error 1
make[3]: Leaving directory '/home/administrator/raspi/qt_source/qt_5.15.2/qtwebengine/src/core'
make[2]: *** [Makefile:82: sub-gn_run-pro-make_first] Error 2
make[2]: Leaving directory '/home/administrator/raspi/qt_source/qt_5.15.2/qtwebengine/src/core'
make[1]: *** [Makefile:79: sub-core-make_first] Error 2
make[1]: Leaving directory '/home/administrator/raspi/qt_source/qt_5.15.2/qtwebengine/src'
make: *** [Makefile:49: sub-src-make_first] Error 2
I saw in many forum that could be related to a RAM problems or a lack of resources. I have tried to give the command on a 16 GB RAM machine and also tried to create a big swapfile without any result.
Could you please help me to find a solution?
I will post my .config summary configuration of the qtbase and of the qtwebengine:
Configure summary QTBASE:
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: devices/linux-rasp-pi3-vc4-g++ (arm, CPU features: neon)
Target compiler: gcc 7.4.1
Configuration: cross_compile compile_examples enable_new_dtags largefile neon shared shared rpath release c++11 c++14 c++17 c++1z concurrent dbus reduce_exports stl
Build options:
Mode ................................... release
Optimize release build for size ........ no
Building shared libraries .............. yes
Using C standard ....................... C11
Using C++ standard ..................... C++17
Using ccache ........................... no
Using new DTAGS ........................ yes
Relocatable ............................ yes
Using precompiled headers .............. no
Using LTCG ............................. no
Target compiler supports:
NEON ................................. yes
Build parts ............................ libs
Qt modules and options:
Qt Concurrent .......................... yes
Qt D-Bus ............................... yes
Qt D-Bus directly linked to libdbus .... yes
Qt Gui ................................. yes
Qt Network ............................. yes
Qt Sql ................................. yes
Qt Testlib ............................. yes
Qt Widgets ............................. yes
Qt Xml ................................. yes
Support enabled for:
Using pkg-config ....................... yes
udev ................................... yes
Using system zlib ...................... yes
Zstandard support ...................... no
Qt Core:
DoubleConversion ....................... yes
Using system DoubleConversion ........ yes
GLib ................................... yes
iconv .................................. no
ICU .................................... yes
Built-in copy of the MIME database ..... yes
Tracing backend ........................ <none>
Logging backends:
journald ............................. no
syslog ............................... no
slog2 ................................ no
PCRE2 .................................. yes
Using system PCRE2 ................... no
Qt Network:
getifaddrs() ........................... yes
IPv6 ifname ............................ yes
libproxy ............................... no
Linux AF_NETLINK ....................... yes
OpenSSL ................................ no
Qt directly linked to OpenSSL ........ no
OpenSSL 1.1 ............................ no
DTLS ................................... no
OCSP-stapling .......................... no
SCTP ................................... no
Use system proxies ..................... yes
GSSAPI ................................. no
Qt Gui:
Accessibility .......................... yes
FreeType ............................... yes
Using system FreeType ................ yes
HarfBuzz ............................... yes
Using system HarfBuzz ................ no
Fontconfig ............................. yes
Image formats:
GIF .................................. yes
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... yes
PNG .................................. yes
Using system libpng ................ yes
Text formats:
HtmlParser ........................... yes
CssParser ............................ yes
OdfWriter ............................ yes
MarkdownReader ....................... yes
Using system libmd4c ............... no
MarkdownWriter ....................... yes
EGL .................................... yes
OpenVG ................................. no
OpenGL:
Desktop OpenGL ....................... no
OpenGL ES 2.0 ........................ yes
OpenGL ES 3.0 ........................ yes
OpenGL ES 3.1 ........................ yes
OpenGL ES 3.2 ........................ yes
Vulkan ................................. no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. yes
libinput ............................... yes
INTEGRITY HID .......................... no
mtdev .................................. yes
tslib .................................. no
xkbcommon .............................. yes
X11 specific:
XLib ................................. yes
XCB Xlib ............................. yes
EGL on X11 ........................... yes
xkbcommon-x11 ........................ yes
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ no
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGLFS X11 ............................ yes
LinuxFB ................................ yes
VNC .................................... yes
Qt Sql:
SQL item models ........................ yes
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows
Qt PrintSupport:
CUPS ................................... yes
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... yes
PostgreSQL ............................. yes
SQLite2 ................................ yes
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... yes
Qt Testlib:
Tester for item models ................. yes
Note: Also available for Linux: linux-clang linux-icc
Note: PKG_CONFIG_LIBDIR automatically set to /home/administrator/raspi/sysroot/usr/lib/pkgconfig:/home/administrator/raspi/sysroot/usr/share/pkgconfig:/home/administrator/raspi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig
Note: PKG_CONFIG_SYSROOT_DIR automatically set to /home/administrator/raspi/sysroot
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/home/administrator/raspi/qt5pi'.
Configure summary QTWEBENGINE:
Qt WebEngine Build Tools:
Use System Ninja ....................... yes
Use System Gn .......................... no
Jumbo Build Merge Limit ................ 8
Developer build ........................ no
Sanitizer .............................. no
QtWebEngine required system libraries:
fontconfig ........................... yes
dbus ................................. yes
nss .................................. yes
khr .................................. yes
glibc ................................ yes
Optional system libraries used:
re2 .................................. no
icu .................................. no
libwebp, libwebpmux and libwebpdemux . no
opus ................................. no
ffmpeg ............................... no
libvpx ............................... no
snappy ............................... no
glib ................................. yes
zlib ................................. yes
minizip .............................. no
libevent ............................. no
jsoncpp .............................. no
protobuf ............................. no
libxml2 and libxslt .................. yes
lcms2 ................................ yes
png .................................. yes
JPEG ................................. yes
harfbuzz ............................. no
freetype ............................. yes
Qt WebEngineCore:
Embedded build ......................... yes
Full debug information ................. no
Pepper Plugins ......................... no
Printing and PDF ....................... no
Proprietary Codecs ..................... yes
Spellchecker ........................... yes
Native Spellchecker .................... no
WebRTC ................................. no
PipeWire over GIO ...................... no
Geolocation ............................ no
WebChannel support ..................... no
Kerberos Authentication ................ no
Extensions ............................. no
Node.js ................................ yes
Support qpa-xcb ........................ no
Building v8 snapshot supported ......... yes
Use ALSA ............................... yes
Use PulseAudio ......................... yes
Qt WebEngineQml:
Support Qt WebEngine Qml ............... yes
UI Delegates ........................... yes
Test Support ........................... no
Qt WebEngineWidgets:
Support Qt WebEngine Widgets ........... yes
Qt PDF:
Support V8 ............................. no
Support XFA ............................ no
Support XFA-BMP ........................ no
Support XFA-GIF ........................ no
Support XFA-PNG ........................ no
Support XFA-TIFF ....................... no
Qt PDF Widgets:
Support Qt PDF Widgets ................. yes
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/home/administrator/raspi/qt5pi'.
Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
This is the a part of the build visible after make where there is a FAILED inside :
[4/13058] /home/administrator/raspi/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -MMD -MF obj/third_party/zlib/bundled_zlib/deflate.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -DCR_SYSROOT_HASH=3fcc1d4e44127006318371002a0f421a4fde2ab4 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DZLIB_IMPLEMENTATION -DADLER32_SIMD_NEON -DINFLATE_CHUNK_SIMD_NEON -DCRC32_ARMV8_CRC32 -DARMV8_OS_LINUX -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/third_party/zlib -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -march=armv8-a -mfloat-abi=hard -mtune=cortex-a53 -mfpu=neon -mthumb -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -std=gnu11 --sysroot=../../../../../../sysroot -c ../../3rdparty/chromium/third_party/zlib/deflate.c -o obj/third_party/zlib/bundled_zlib/deflate.o
FAILED: obj/third_party/zlib/bundled_zlib/deflate.o
/home/administrator/raspi/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -MMD -MF obj/third_party/zlib/bundled_zlib/deflate.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -DCR_SYSROOT_HASH=3fcc1d4e44127006318371002a0f421a4fde2ab4 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DZLIB_IMPLEMENTATION -DADLER32_SIMD_NEON -DINFLATE_CHUNK_SIMD_NEON -DCRC32_ARMV8_CRC32 -DARMV8_OS_LINUX -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/third_party/zlib -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -march=armv8-a -mfloat-abi=hard -mtune=cortex-a53 -mfpu=neon -mthumb -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -std=gnu11 --sysroot=../../../../../../sysroot -c ../../3rdparty/chromium/third_party/zlib/deflate.c -o obj/third_party/zlib/bundled_zlib/deflate.o
In file included from ../../3rdparty/chromium/third_party/zlib/deflate.c:54:0:
../../3rdparty/chromium/third_party/zlib/contrib/optimizations/insert_string.h:58:42: error: attribute(target("arch=armv8-a+crc")) is unknown
const Pos str) {
^~~~~
cc1: warning: unrecognized command line option ‘-Wno-packed-not-aligned’

QT EGLFS backend with Mesa driver without X11/Xorg

I am trying to run one of the example apps from QT 5.12 without having XServer installed. I am using Ubuntu Linux. When I start it using linuxfb backend, it works fine, but then mapboxgl plugin does not work (probably because of lack of native opengl)
but when I start it with EGLFS backend
./qml_location_mapviewer -platform eglfs
it fails with "Could not initialize egl display"
I tried weston/wayland compositor and -platform wayland everything works as well. Why QT EGLFS does not see my Intel Haswell Open GL device, but everyone else can?
as #derhass suggested it was required to recompile QT with all necessary OpenGL libraries installed first.
# essentials
sudo apt-get install build-essential libssl-dev python
# bluez stack (optional)
sudo apt-get install libbluetooth-dev bluetooth blueman bluez libusb-dev libdbus-1-dev bluez-hcidump bluez-tools
# OpenGL EGL support
sudo apt-get install mesa-utils libegl1-mesa libegl1-mesa-dev libgbm-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
# assuming QT is downloaded and extracted before
cd ~/qt-everywhere-src-5.12.6
./configure -confirm-license -opensource -nomake tests -nomake examples -openssl-linked
Ensure you get EGLFS section similar to this:
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ yes
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGLFS X11 ............................ yes
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
Then compile and install the whole thing
make
sudo make install
Compile your project and run it.
cd mapviewer
/usr/local/Qt-5.12.6/qmake
make
./qml_location_mapviewer -platform eglfs
Please have a look here:
https://doc.qt.io/qt-5/embedded-linux.html
In particular, try to set the following environment variable before running your application:
export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
If that doesn't work, do an strace and check for failed open calls to check if any libraries are missing:
strace ./qml_location_mapviewer -platform eglfs 2>&1 | tee log.txt
Of particular importance are the following libraries/plugins in /usr/lib:
libQt5EglFSDeviceIntegration.so.5
libQt5EglFsKmsSupport.so.5
qt5/plugins/platforms/libqeglfs.so
qt5/plugins/egldeviceintegrations/libqeglfs-kms-integration.so

Compile QtWebEngine natively on Raspberry Pi

I am trying to compile QtWebEngine on Raspberry Pi 3. Whole Qt library compiled ok, but when I'm trying to run make in the directory with QtWebEngine I get this:
pi#raspberrypi:~/qt5/qtwebengine$ /usr/local/qt5/bin/qmake
Running configuration tests...
Done running configuration tests.
Configure summary:
Qt WebEngine:
Embedded build ......................... yes
Pepper Plugins ......................... no
Printing and PDF ....................... no
Proprietary Codecs ..................... no
Spellchecker ........................... yes
Native Spellchecker .................... no
WebRTC ................................. no
Use System Ninja ....................... no
Geolocation ............................ no
WebChannel support ..................... yes
Use v8 snapshot ........................ yes
Kerberos Authentication ................ no
Building v8 snapshot supported ......... yes
Use ALSA ............................... yes
Use PulseAudio ......................... no
Optional system libraries used:
re2 .................................. no
icu .................................. no
libwebp, libwebpmux and libwebpdemux . no
opus ................................. no
ffmpeg ............................... no
libvpx ............................... no
snappy ............................... no
glib ................................. no
zlib ................................. no
minizip .............................. no
libevent ............................. no
jsoncpp .............................. no
protobuf ............................. no
libxml2 and libxslt .................. no
lcms2 ................................ no
png .................................. no
JPEG ................................. yes
harfbuzz ............................. no
freetype ............................. no
x11 .................................. no
Required system libraries:
fontconfig ........................... no
dbus ................................. no
nss .................................. no
khr .................................. yes
glibc ................................ yes
Required system libraries for qpa-xcb:
libdrm ............................... no
xcomposite ........................... no
xcursor .............................. no
xi ................................... no
xtst ................................. no
WARNING: Thumb instruction set is required to build ffmpeg for QtWebEngine.
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/usr/local/qt5'.
Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
pkg-config is required
QtWebEngine will not be built.
Questions:
Why it cannot be compiled? Because of fontconfig, dbus and nss libraries?
I've tried to install libfontconfig1-dev but it is already installed. The same with dbus and nss.
What I am doing wrong?
You are missing pkg-config and libs are not detected. Note "pkg-config is required". Most likely you compiled qt without pkg-config support.

How to enable EGLFS i.Mx6 QPA for Qt on IMX6Q?

I am cross compiling Qt with Buildroot and GCC Linaro for an IMX6Q target.
I would like to use eglfs platform plugin but i am confused about the list of associated backends available.
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ yes
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... no
LinuxFB ................................ no
VNC .................................... yes
Mir client ............................. no
I guess that the EGLFS i.Mx6 is best suited for IMX6Q but how is it possible to activate this option instead of the EGLDevice or GBM ?
I have configured Qt with -device linux-imx6-g++ ( using buildroot Custom configuration options) but it does not change anything and i don't see any other options so far.
Thanks for any help.
Enable BR2_PACKAGE_IMX_GPU_VIV, which will provide the OpenGL implementation for i.MX6.

Cross Compiling Qt 5.10.1 for Raspberry Pi 3 not compiling webEngine

I'm trying to cross compile the Qt libraries for my raspberry pi. I actually got it working, but the module I needed the most for the project I was planing was not compiled. I need the webengine module.
Here is the output form the configure script:
Qt WebEngine:
Embedded build ......................... yes
Pepper Plugins ......................... no
Printing and PDF ....................... no
Proprietary Codecs ..................... no
Spellchecker ........................... yes
Native Spellchecker .................... no
WebRTC ................................. no
Use System Ninja ....................... no
Geolocation ............................ yes
Use v8 snapshot ........................ yes
Use ALSA ............................... yes
Use PulseAudio ......................... yes
Optional system libraries used:
re2 .................................. no
icu .................................. no
libwebp, libwebpmux and libwebpdemux . yes
opus ................................. yes
ffmpeg ............................... no
libvpx ............................... no
snappy ............................... no
libsrtp .............................. no
glib ................................. yes
zlib ................................. yes
minizip .............................. yes
libevent ............................. yes
jsoncpp .............................. yes
protobuf ............................. no
libxml2 and libxslt .................. yes
lcms2 ................................ no
png .................................. yes
harfbuzz ............................. yes
Required system libraries:
fontconfig ........................... yes
dbus ................................. yes
nss .................................. yes
khr .................................. yes
glibc ................................ yes
Required system libraries for qpa-xcb:
libdrm ............................... yes
xcomposite ........................... no
xcursor .............................. no
xi ................................... no
xrandr ............................... no
xtst ................................. no
As you can see, I have the required system libraries. But do I need everything that is listed under the Qt WebEngine headline?
EDIT: I found out why it was skiping the qtWebEngine:
V8 snapshot cannot be built. Most likely, the 32-bit host compiler does not work. Please make sure you have 32-bit devel environment installed, or configure webengine with '-no-webengine-v8-snapshot'
QtWebEngine will not be built.
I am not sure what the V8 snapshot is used for and why the installer couldn't use the 32-Bit compiler.
This is probably your problem: https://bugreports.qt.io/browse/QTBUG-67983
As you can see, this was fixed in Qt 5.11.1. Unfortunately there is another bug which will prevent you from compiling QtWebengine (workaround included): https://bugreports.qt.io/browse/QTBUG-65256

Resources