PDA

View Full Version : Blank screen with Qt5.7 and EGLFS



danielesd
5th October 2016, 10:04
Hello!
Im working on custom Hardware, related to Beaglebone black. I compiled everything cross from source.
If I enable OpenGL and run an application, the screen turns black and nothing happens.
Here are my steps and environments:

Kernel:
3.12.15-rt25 (A testing 4.6.7 kernel behaves similar. Let me know, if you need kernel config or device tree options)


Steps to compile Qt:

wget http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.tar.gz
tar xf qt-everywhere-opensource-src-5.7.0.tar.gz
cd qt-everywhere-opensource-src-5.7.0
cat ../0001-patched-to-build-with-ELDK-5.3-and-Graphics_SDK_5_01.patch | patch -p1
cd ..
mkdir qt-everywhere-opensource-src-5.7.0-build
cd qt-everywhere-opensource-src-5.7.0-build

export ARCH=arm
export CROSS_COMPILE=armv7a-
export PATH=/opt/eldk-5.3/armv7a/sysroots/i686-eldk-linux/usr/bin:/opt/eldk-5.3/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi:$PATH

../qt-everywhere-opensource-src-5.7.0/configure -opensource -confirm-license -prefix /opt/qt-embedded-v5.7.0-armv7a -platform linux-g++-64 -xplatform devices/linux-beagleboard-g++ -device beagleboard -device-option CROSS_COMPILE=/opt/eldk-5.3/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/armv7a- -nomake examples -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-pch -qt-libpng -qt-libjpeg -tslib -linuxfb -no-xcb -I$PWD/../../../packages/tslib-1.0/src -I/opt/Graphics_SDK_5_01_01_02/include/OGLES2/ -L$PWD/../../../packages/tslib-1.0/src/.libs -L/tftpboot/hh300/linux/rootfs/usr/lib -opengl -pkg-config -v


0001-patched-to-build-with-ELDK-5.3-and-Graphics_SDK_5_01.patch:

diff --git a/qtbase/mkspecs/common/g++-base.conf b/qtbase/mkspecs/common/g++-base.conf
index c42c46b..ae22071 100644
--- a/qtbase/mkspecs/common/g++-base.conf
+++ b/qtbase/mkspecs/common/g++-base.conf
@@ -27,7 +27,7 @@ QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE}
QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE

-QMAKE_CXXFLAGS_CXX11 = -std=c++11
+QMAKE_CXXFLAGS_CXX11 = -std=c++0x
QMAKE_CXXFLAGS_CXX14 = -std=c++1y
QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++11
diff --git a/qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf b/qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf
index 604da50..9d8db69 100644
--- a/qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf
+++ b/qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf
@@ -36,8 +36,8 @@ QMAKE_CXXFLAGS_RELEASE += -O3
QMAKE_LIBS += -lrt -lpthread -ldl

# Extra stuff (OpenGL, DirectFB, ...)
-QMAKE_INCDIR_EGL =
-QMAKE_LIBDIR_EGL =
+QMAKE_INCDIR_EGL = /opt/Graphics_SDK_5_01_01_02/include
+QMAKE_LIBDIR_EGL = /opt/gfxlibraries/gfx_rel_es8.x
QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
QMAKE_LIBDIR_OPENGL_ES2 = $${QMAKE_LIBDIR_EGL}
QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL}
@@ -47,7 +47,7 @@ QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 $${QMAKE_LIBS_EGL}
QMAKE_LIBS_OPENVG = -lOpenVG $${QMAKE_LIBS_EGL}

-DISTRO_OPTS += hard-float
+#DISTRO_OPTS += hard-float

# No need for any special EGL device integration.
# Prioritize the default, compiled-in integration over any plugins.


Configurte output:

Build options:
Configuration .......... audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus doubleconversion egl eglfs enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz iconv inotify ipv6ifname large-config libudev linuxfb medium-config minimal-config mremap neon nis opengl opengles2 openssl pcre png poll_poll posix_fallocate qpa qpa reduce_exports release rpath shared small-config system-zlib threadsafe-cloexec tslib xinput2 xlib xrender
Build parts ............ libs
Mode ................... release
Using sanitizer(s)...... none
Using C++ standard ..... c++11
Using gold linker....... no
Using new DTAGS ........ yes
Using PCH .............. no
Using LTCG ............. no
Target compiler supports:
Neon ................. yes

Qt modules and options:
Qt D-Bus ............... yes (loading dbus-1 at runtime)
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
Large File ............. no
QML debugging .......... yes
Use system proxies ..... no

Support enabled for:
Accessibility .......... no
ALSA ................... no
CUPS ................... no
DoubleConversion........ yes (bundled copy)
Evdev .................. yes
FontConfig ............. no
FreeType ............... yes (bundled copy)
Glib ................... no
GStreamer .............. no
GTK platformtheme ...... no
HarfBuzz ............... yes (bundled copy)
Iconv .................. yes
ICU .................... no
Image formats:
GIF .................. yes (plugin, using bundled copy)
JPEG ................. yes (plugin, using bundled copy)
PNG .................. yes (in QtGui, using bundled copy)
libinput................ no
Logging backends:
journald ............... no
syslog ............... no
mtdev .................. no
Networking:
getaddrinfo .......... yes
getifaddrs ........... yes
IPv6 ifname .......... yes
libproxy.............. no
OpenSSL .............. yes (loading libraries at run-time)
NIS .................... yes
OpenGL / OpenVG:
EGL .................. yes
OpenGL ............... yes (OpenGL ES 2.0+)
OpenVG ............... no
PCRE ................... yes (bundled copy)
pkg-config ............. yes
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ yes
EGLFS i.MX6 ........ no
EGLFS i.MX6 Wayland. no
EGLFS EGLDevice .... no
EGLFS GBM .......... no
EGLFS Mali ......... no
EGLFS Raspberry Pi . no
EGLFS X11 .......... no
LinuxFB .............. yes
Mir client............ no
XCB .................. no
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... yes (plugin, using bundled copy)
TDS .................. no
tslib .................. yes
udev ................... yes
xkbcommon-x11........... no
xkbcommon-evdev......... no
zlib ................... yes (system library)


Target environment (shorted):

TSLIB_CONFFILE=/etc/ts.conf
POINTERCAL_FILE=/app/pointercal
TSLIB_CALIBFILE=/app/pointercal
LD_LIBRARY_PATH=/opt/qt-embedded-v5.7.0-armv7a/lib:/opt/qt-embedded-v5.7.0-armv7a/plugins/platforms/
QWS_MOUSE_PROTO=Tslib:/dev/input/by-path/platform-44e0b000.i2c-event-mouse
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
QTARGS=--platform eglfs -plugin tslib
TSLIB_TSDEVICE=/dev/input/by-path/platform-44e0b000.i2c-event-mouse
QWS_DISPLAY=Multi: LinuxFb: VNC::size=1024x768


ldd on hellogl2 example:

root@ppc3xx:/app# ldd hellogl2
libQt5Widgets.so.5 => /opt/qt-embedded-v5.7.0-armv7a/lib/libQt5Widgets.so.5 (0xb6b99000)
libQt5Gui.so.5 => /opt/qt-embedded-v5.7.0-armv7a/lib/libQt5Gui.so.5 (0xb683d000)
libQt5Core.so.5 => /opt/qt-embedded-v5.7.0-armv7a/lib/libQt5Core.so.5 (0xb6429000)
librt.so.1 => /lib/librt.so.1 (0x4b9d8000)
libdl.so.2 => /lib/libdl.so.2 (0x4b840000)
libGLESv2.so => /usr/lib/libGLESv2.so (0xb63b4000)
libEGL.so => /usr/lib/libEGL.so (0xb63a9000)
libIMGegl.so => /usr/lib/libIMGegl.so (0xb638f000)
libsrv_um.so => /usr/lib/libsrv_um.so (0xb635c000)
libpthread.so.0 => /lib/libpthread.so.0 (0x4b9b0000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x4ba88000)
libm.so.6 => /lib/libm.so.6 (0x4ba10000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4b988000)
libc.so.6 => /lib/libc.so.6 (0x4b850000)
libz.so.1 => /usr/lib/libz.so.1 (0x4b9f0000)
/lib/ld-linux.so.3 (0x4b810000)
ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0xb6333000)
(Why doesn't it depend on libQt5OpenGL.so.5?)


starting hellogl2 example:

root@ppc3xx:/app# ./hellogl2
QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).


At this point, nothing else happens and Display tungs black.
Let me know, if you need any more infos to solve the problem.

Kind Regards, Daniel

oldFox64
15th November 2016, 12:41
You have 2 platform plugins there: LinuxFB and EGLFS. Maybe they are in conflict or ur application is trying to launch with LinuxFB instead of eglfs. But do not pay me much attention, I'm also having troubles to run eglfs getting "Could not open egl display" error :(