Could not initialize egl display on Odroid board
-
Hi,
I've cross compiled Qt 5.7.0 for my Odroid board running linux 16.04 LTS but when i run my application, i can only use the xcb plugin option. The problem with xcb is that i'm seeing image flickering/tearing when displaying images on screen. I've read that for embedded boards, eglfs option is better and so i'm trying to see if using the eglfs plugin may help.
I've configured mkspecs qmake.conf file like this:
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublibinclude(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)QMAKE_INCDIR_EGL = ../usr/include/EGL
QMAKE_INCDIR_OPENGL_ES2 = ../usr/include/GLES2
QMAKE_LIBDIR_OPENGL_ES2 = ../usr/lib/arm-linux-gnueabi/QMAKE_LIBS_EGL += -lEGL
QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL
load(qt_config)Configured Qt with the following options:
../qt-5.7.0/qtbase/configure -prefix /opt/Qt5.7.0 -opensource -confirm-license -opengl es2 -eglfs -qt-xcb -no-icu -zlib -libjpeg -libpng -nomake examples -nomake tests
The config summary looks like this:
OpenGL / OpenVG:
EGL .................. yes
OpenGL ............... yes (OpenGL ES 2.0+)
OpenVG ............... no
PCRE ................... system
pkg-config ............. yes
PulseAudio ............. yes
QPA backends:
DirectFB ............. no
EGLFS ................ yes
EGLFS i.MX6 ........ no
EGLFS i.MX6 Wayland. no
EGLFS EGLDevice .... no
EGLFS GBM .......... yes
EGLFS Mali ......... no
EGLFS Raspberry Pi . no
EGLFS X11 .......... yes
LinuxFB .............. yes
Mir client............ no
XCB .................. yes (bundled copy)
EGL on X ........... yes
GLX ................ yes
MIT-SHM ............ yes
Xcb-Xlib ........... yes
Xcursor ............ yes (loaded at runtime)
Xfixes ............. yes (loaded at runtime)
Xi2 ................ yes
Xrandr ............. yes (loaded at runtime)
Xrender ............ yes
XKB ................ yes
XShape ............. yes
XSync .............. yes
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ yes (plugin)
OCI .................. no
ODBC ................. yes (plugin)
PostgreSQL ........... yes (plugin)
SQLite 2 ............. no
SQLite ............... yes (plugin, using bundled copy)
TDS .................. yes (plugin)
tslib .................. no
udev ................... yes
xkbcommon-x11........... yes (system library)
xkbcommon-evdev......... yes
zlib ................... yes (bundled copy)The issue i'm running into is that when i'm running my application, i get the following error message:
Debug: (null) ((null):0, Got keys from plugin meta data ("xcb"))
Debug: (null) ((null):0, loaded library "/home/odroid/svneglfs/bin/platforms/libqeglfs.so")
Debug: (null) ((null):0, QFactoryLoader::QFactoryLoader() checking directory path "/home/odroid/svneglfs/bin/egldeviceintegrations" ...)
Fatal: (null) ((null):0, Could not initialize egl display)I'm not sure why it's not able to initialize egl display. I already made sure that egl related dependencies are installed on my Odroid board by installing libegl1-mesa libgles2-mesa libgles2-mesa-dev. When ldd checking the libqeglfs.so, the links seem correct.
linux-vdso.so.1 => (0x0000007f96ecc000) libQt5EglDeviceIntegration.so.5 => /home/odroid/svneglfs/bin/platforms/./../../lib/libQt5EglDeviceIntegration.so.5 (0x0000007f96df6000) libQt5Gui.so.5 => /home/odroid/svneglfs/bin/platforms/./../../lib/libQt5Gui.so.5 (0x0000007f96922000) libQt5Core.so.5 => /home/odroid/svneglfs/bin/platforms/./../../lib/libQt5Core.so.5 (0x0000007f96387000) libstdc++.so.6 => /usr/lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007f961db000) libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f96093000) libfontconfig.so.1 => /usr/lib/aarch64-linux-gnu/libfontconfig.so.1 (0x0000007f96046000) libfreetype.so.6 => /usr/lib/aarch64-linux-gnu/libfreetype.so.6 (0x0000007f95fa9000) libQt5DBus.so.5 => /home/odroid/svneglfs/bin/platforms/./../../lib/libQt5DBus.so.5 (0x0000007f95f16000) libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000007f95f03000) libglib-2.0.so.0 => /lib/aarch64-linux-gnu/libglib-2.0.so.0 (0x0000007f95dfc000) libinput.so.10 => /usr/lib/aarch64-linux-gnu/libinput.so.10 (0x0000007f95dc2000) libxkbcommon.so.0 => /usr/lib/aarch64-linux-gnu/libxkbcommon.so.0 (0x0000007f95d78000) libudev.so.1 => /lib/aarch64-linux-gnu/libudev.so.1 (0x0000007f95d47000) libmtdev.so.1 => /usr/lib/aarch64-linux-gnu/libmtdev.so.1 (0x0000007f95d31000) libEGL.so.1 => /usr/lib/aarch64-linux-gnu/libEGL.so.1 (0x0000007f95bed000) libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007f95bc1000) /lib/ld-linux-aarch64.so.1 (0x00000055556c2000) libharfbuzz.so.0 => /usr/lib/aarch64-linux-gnu/libharfbuzz.so.0 (0x0000007f95b5d000) libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007f95ab0000) libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007f95a8f000) libpcre16.so.3 => /usr/lib/aarch64-linux-gnu/libpcre16.so.3 (0x0000007f95a28000) libexpat.so.1 => /lib/aarch64-linux-gnu/libexpat.so.1 (0x0000007f959f4000) libz.so.1 => /lib/aarch64-linux-gnu/libz.so.1 (0x0000007f959cc000) libpng12.so.0 => /lib/aarch64-linux-gnu/libpng12.so.0 (0x0000007f9599d000) libdbus-1.so.3 => /lib/aarch64-linux-gnu/libdbus-1.so.3 (0x0000007f9594c000) libpcre.so.3 => /lib/aarch64-linux-gnu/libpcre.so.3 (0x0000007f958db000) libevdev.so.2 => /usr/lib/aarch64-linux-gnu/libevdev.so.2 (0x0000007f958b2000) libwacom.so.2 => /usr/lib/aarch64-linux-gnu/libwacom.so.2 (0x0000007f95899000) libUMP.so => /usr/lib/aarch64-linux-gnu/libUMP.so (0x0000007f95880000) libX11.so.6 => /usr/lib/aarch64-linux-gnu/libX11.so.6 (0x0000007f95758000) libdrm.so.2 => /usr/lib/aarch64-linux-gnu/libdrm.so.2 (0x0000007f95738000) libXfixes.so.3 => /usr/lib/aarch64-linux-gnu/libXfixes.so.3 (0x0000007f95722000) libXext.so.6 => /usr/lib/aarch64-linux-gnu/libXext.so.6 (0x0000007f95702000) libXdamage.so.1 => /usr/lib/aarch64-linux-gnu/libXdamage.so.1 (0x0000007f956ef000) librt.so.1 => /lib/aarch64-linux-gnu/librt.so.1 (0x0000007f956d7000) libgraphite2.so.3 => /usr/lib/aarch64-linux-gnu/libgraphite2.so.3 (0x0000007f956ab000) libsystemd.so.0 => /lib/aarch64-linux-gnu/libsystemd.so.0 (0x0000007f95628000) libgudev-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libgudev-1.0.so.0 (0x0000007f9560f000) libgobject-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgobject-2.0.so.0 (0x0000007f955b3000) libxcb.so.1 => /usr/lib/aarch64-linux-gnu/libxcb.so.1 (0x0000007f95587000) libselinux.so.1 => /lib/aarch64-linux-gnu/libselinux.so.1 (0x0000007f9555a000) liblzma.so.5 => /lib/aarch64-linux-gnu/liblzma.so.5 (0x0000007f9552c000) libgcrypt.so.20 => /lib/aarch64-linux-gnu/libgcrypt.so.20 (0x0000007f95493000) libffi.so.6 => /usr/lib/aarch64-linux-gnu/libffi.so.6 (0x0000007f9547b000) libXau.so.6 => /usr/lib/aarch64-linux-gnu/libXau.so.6 (0x0000007f95467000) libXdmcp.so.6 => /usr/lib/aarch64-linux-gnu/libXdmcp.so.6 (0x0000007f95452000) libgpg-error.so.0 => /lib/aarch64-linux-gnu/libgpg-error.so.0 (0x0000007f95431000)
Is there something else i'm missing? Racking my brain as to why this isn't working and any help would be greatly appreciated.
-
@ccptleu said in Could not initialize egl display on Odroid board:
-eglfs -qt-xcb
Pick either one.
Are you sure that configure picks up the mkspecs you have created? I don't see -platform flag in the configure line.
-
@ccptleu said in Could not initialize egl display on Odroid board:
-eglfs -qt-xcb
Pick either one.
Are you sure that configure picks up the mkspecs you have created? I don't see -platform flag in the configure line.
@sierdzio
I will give that a try. Didn't know that I need to choose between one option or the other for eglfs or xcb during the configure stage. So if I want to try different plugins on the arm board i would need to use differently compiled Qt libraries? Can the same Qt arm build work on different boards?(eg. Odroid and Nvidia?)I've compiled Qt on a separate Linux machine using chroot to arm sysroot. I know it chose my custom mkspec as when I didn't specify the EGL paths the configure stage complained I didn't specify them.
-
@sierdzio
I will give that a try. Didn't know that I need to choose between one option or the other for eglfs or xcb during the configure stage. So if I want to try different plugins on the arm board i would need to use differently compiled Qt libraries? Can the same Qt arm build work on different boards?(eg. Odroid and Nvidia?)I've compiled Qt on a separate Linux machine using chroot to arm sysroot. I know it chose my custom mkspec as when I didn't specify the EGL paths the configure stage complained I didn't specify them.
@ccptleu said in Could not initialize egl display on Odroid board:
Didn't know that I need to choose between one option or the other for eglfs or xcb during the configure stage.
Well it depends. I'm not sure about Odroid, but for example on Raspberry Pi, EGLFS on X is not available. So you can compile for EGLFS or xcb, but I'm not sure if you can have both. I think the last time I tried it worked, but xcb performance was abysmally bad.
On desktop it is definitely possible to compile multiple plugins and choose one at runtime. So most probably my recommendation to pick one was wrong.
So if I want to try different plugins on the arm board i would need to use differently compiled Qt libraries? Can the same Qt arm build work on different boards?(eg. Odroid and Nvidia?)
I'm sorry but I don't have enough experience to answer with certainty here.
-
@ccptleu said in Could not initialize egl display on Odroid board:
Didn't know that I need to choose between one option or the other for eglfs or xcb during the configure stage.
Well it depends. I'm not sure about Odroid, but for example on Raspberry Pi, EGLFS on X is not available. So you can compile for EGLFS or xcb, but I'm not sure if you can have both. I think the last time I tried it worked, but xcb performance was abysmally bad.
On desktop it is definitely possible to compile multiple plugins and choose one at runtime. So most probably my recommendation to pick one was wrong.
So if I want to try different plugins on the arm board i would need to use differently compiled Qt libraries? Can the same Qt arm build work on different boards?(eg. Odroid and Nvidia?)
I'm sorry but I don't have enough experience to answer with certainty here.
-
Actually i may know why im not able to run with eglfs. My application runs with multiple dock widgets on top of a main window and i read that multiple windows are not supported for eglfs. I've ported my application that was originally created for a linux desktop environment to arm embedded platform. Is my only option to use xcb or wayland to be able to run my application without changing the windowing?
-
Actually i may know why im not able to run with eglfs. My application runs with multiple dock widgets on top of a main window and i read that multiple windows are not supported for eglfs. I've ported my application that was originally created for a linux desktop environment to arm embedded platform. Is my only option to use xcb or wayland to be able to run my application without changing the windowing?
@ccptleu said in Could not initialize egl display on Odroid board:
Actually i may know why im not able to run with eglfs. My application runs with multiple dock widgets on top of a main window and i read that multiple windows are not supported for eglfs.
But these dock widgets are not separate windows, right?
Anyway, that is easy to check: try creating a simple test app, just with single QWidget (or some simple QML application) and see if it runs. To me, the error message "Could not initialize egl display" sounds like it is failing even before it tries to create your UI.
-
@ccptleu said in Could not initialize egl display on Odroid board:
Actually i may know why im not able to run with eglfs. My application runs with multiple dock widgets on top of a main window and i read that multiple windows are not supported for eglfs.
But these dock widgets are not separate windows, right?
Anyway, that is easy to check: try creating a simple test app, just with single QWidget (or some simple QML application) and see if it runs. To me, the error message "Could not initialize egl display" sounds like it is failing even before it tries to create your UI.
@sierdzio You're correct. I tried running simple Qt GUI example and cannot open for eglfs. Even installing qt creator i cannot run with eglfs. I have to manually set it to xcb before i can run qtcreator but i also get this error "Plugin initialization failed: Cannot create OpenGL context" so that while it cannot load the QmlDesigner, QmlProfiler and Welcome pages, the rest of qtcreator loads.
-
Hm, are you sure you have all dependencies? Can you run some other OpenGL software, like glxgears?
You can try installing missing deps by running:
sudo apt-get build-dep qt5-default
But it is surprising that your Qt config happily accepted OpenGL and EGLFS (which means that it also run the tests with good results), yet it does not run.
-
@sierdzio said in Could not initialize egl display on Odroid board:
Hm, are you sure you have all dependencies? Can you run some other OpenGL software, like glxgears?
You can try installing missing deps by running:
sudo apt-get build-dep qt5-default
I ran sudo apt-get build-dep qt5-default before on the arm board and checked again that i should have all the Qt dependencies.
I just tried running glxgears but it errors out with
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 155 (GLX)
Minor opcode of failed request: 24 (X_GLXCreateNewContext)
Value in failed request: 0x0
Serial number of failed request: 35
Current serial number in output stream: 36But it is surprising that your Qt config happily accepted OpenGL and EGLFS (which means that it also run the tests with good results), yet it does not run.
Yes, that's why it's puzzling. I cross compiled Qt for Arm from another Linux PC but all the dependencies i have on there i also have on the ARM board.