Qt 5.4 on BBB OpenGL: Linux is dead after execute examples. Keyboard and mouse have no response.

Hello everyone

I’m new on Qt on arm linux. I’m trying to cross compile the newest version Qt 5.4 for Beaglebone Black(BBB). I think I almost successed because I finished configure and make of Qt 5.4 based on root file system on BBB. When I try to run an example, the GUI shows up but the linux is dead and there is no response from keyboard and mouse. The only thing I can do is to reset BBB. Could someone help me with this problem? I will describe my steps as follow:

  1. Build Ubuntu SD card

For this step, I followed the following website:
https://eewiki.net/display/linuxonarm/BeagleBone+Black

Kernel version:
Linux arm 3.18.0-bone1 #1 Mon Dec 8 23:08:59 EST 2014 armv71 armv71 armv71 GNU/Linux

Root file system:
Ubuntu 14.04.1 LTS

Cross compiler:
arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 – Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease)

The SD card just works fine.

  1. Build and install SGX driver
    Also, I followed the SGX part of the following website
    https://eewiki.net/display/linuxonarm/BeagleBone+Black

The demo program OGLES2ChameleonMan works fine.

  1. Build Qt 5.4
    (1) Download Qt 5.4 source qt-everywhere-opensource-src-5.4.0.tar.gz
    http://download.qt-project.org/archive/qt/5.4/5.4.0/single/

(2) Configure Qt 5.4
copy the newest cross compiler library to root file system (otherwise the configure has errors)

  1. sudo cp -r /gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/* /rootfs

edit /qtbase/mkspecs/devices/linux-beaglebone-g++/qmake.conf

  1. Ln 29: COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard

  2. Ln 39: QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/usr/include/OGLES2

configure

  1. sudo ./configure -prefix /home/ubuntu/Qt -device linux-beaglebone-g++ -device-option CROSS_COMPILE=/home/albert/arm-dev/kernel_dev/bb-kernel/dl/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- -sysroot /media/albert/rootfs -release -opensource -confirm-license -opengl es2 -v

configure result

  1. Configure summary

  2. Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)

  3. Building for: devices/linux-beaglebone-g++ (arm, CPU features: neon)

  4. Platform notes:

    • Also available for Linux: linux-kcc linux-icc linux-cxx
  5. qmake vars … styles += mac fusion windows DEFINES += QT_NO_MTDEV DEFINES += QT_NO_LIBUDEV QMAKE_X11_PREFIX = /usr sql-drivers = sql-plugins = sqlite qmake switches …

  6. Build options:

  7. Build parts … libs examples

  8. Mode … release

  9. Using C++11 … yes

  10. Using gold linker… yes

  11. Using PCH … yes

  12. Target compiler supports:

  13. Neon … yes

  14. Qt modules and options:

  15. Qt D-Bus … runtime

  16. Qt Concurrent … yes

  17. Qt GUI … yes

  18. Qt Widgets … yes

  19. Large File … yes

  20. QML debugging … yes

  21. Use system proxies … no

  22. Support enabled for:

  23. Accessibility … yes

  24. ALSA … no

  25. CUPS … no

  26. Evdev … yes

  27. FontConfig … no

  28. FreeType … yes (bundled copy)

  29. Glib … no

  30. GTK theme … no

  31. HarfBuzz … yes (bundled copy)

  32. Iconv … yes

  33. ICU … no

  34. Image formats:

  35. GIF … yes (plugin, using bundled copy)

  36. JPEG … yes (plugin, using bundled copy)

  37. PNG … yes (in QtGui, using bundled copy)

  38. journald … no

  39. mtdev … no

  40. Networking:

  41. getaddrinfo … yes

  42. getifaddrs … yes

  43. IPv6 ifname … yes

  44. OpenSSL … no

  45. NIS … yes

  46. OpenGL / OpenVG:

  47. EGL … yes

  48. OpenGL … yes (OpenGL ES 2.0+)

  49. OpenVG … no

  50. PCRE … yes (bundled copy)

  51. pkg-config … no

  52. PulseAudio … no

  53. QPA backends:

  54. DirectFB … no

  55. EGLFS … yes

  56. KMS … no

  57. LinuxFB … yes

  58. XCB … no

  59. Session management … yes

  60. SQL drivers:

  61. DB2 … no

  62. InterBase … no

  63. MySQL … no

  64. OCI … no

  65. ODBC … no

  66. PostgreSQL … no

  67. SQLite 2 … no

  68. SQLite … yes (plugin, using bundled copy)

  69. TDS … no

  70. udev … no

  71. xkbcommon … no

  72. zlib … yes (bundled copy)

make and make install just work fine.

  1. Run Qt examples
    Before run Qt examples, again, I need to copy some cross compiler’s lib file into SD card, otherwise it has errors when execute program.

  2. sudo cp -r /gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib /rootfs/home/ubuntu

On BBB, I neet to export LD_LIBRARY_PATH

  1. export LD_LIBRARY_PATH=/rootfs/home/ubuntu

Now, I can run Qt examples

  1. cd /Qt/examples/quick/demos/stocqt

  2. ./stocqt

At this moment, the GUI shows on the screen. However, there is no mouse cursor and the keyboard doesn’t response. I can still see the terminal’s text cursor flashing. The only thing I can do now is to reset BBB. I also tried several other examples and all yield the same result. No mouse cursor and keyboard response.

Does any one know what should I do to fix this problem? Thanks!

Hello everyone

I’m new on Qt on arm linux. I’m trying to cross compile the newest version Qt 5.4 for Beaglebone Black(BBB). I think I almost successed because I finished configure and make of Qt 5.4 based on root file system on BBB. When I try to run an example, the GUI shows up but the linux is dead and there is no response from keyboard and mouse. The only thing I can do is to reset BBB. Could someone help me with this problem? I will describe my steps as follow:

  1. Build Ubuntu SD card

For this step, I followed the following website:
https://eewiki.net/display/linuxonarm/BeagleBone+Black

Kernel version:
Linux arm 3.18.0-bone1 #1 Mon Dec 8 23:08:59 EST 2014 armv71 armv71 armv71 GNU/Linux

Root file system:
Ubuntu 14.04.1 LTS

Cross compiler:
arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 – Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease)

The SD card just works fine.

  1. Build and install SGX driver
    Also, I followed the SGX part of the following website
    https://eewiki.net/display/linuxonarm/BeagleBone+Black

The demo program OGLES2ChameleonMan works fine.

  1. Build Qt 5.4
    (1) Download Qt 5.4 source qt-everywhere-opensource-src-5.4.0.tar.gz
    http://download.qt-project.org/archive/qt/5.4/5.4.0/single/

(2) Configure Qt 5.4
copy the newest cross compiler library to root file system (otherwise the configure has errors)

  1. sudo cp -r /gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/* /rootfs

edit /qtbase/mkspecs/devices/linux-beaglebone-g++/qmake.conf

  1. Ln 29: COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard

  2. Ln 39: QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/usr/include/OGLES2

configure

  1. sudo ./configure -prefix /home/ubuntu/Qt -device linux-beaglebone-g++ -device-option CROSS_COMPILE=/home/albert/arm-dev/kernel_dev/bb-kernel/dl/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- -sysroot /media/albert/rootfs -release -opensource -confirm-license -opengl es2 -v

configure result

  1. Configure summary

  2. Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)

  3. Building for: devices/linux-beaglebone-g++ (arm, CPU features: neon)

  4. Platform notes:

    • Also available for Linux: linux-kcc linux-icc linux-cxx
  5. qmake vars … styles += mac fusion windows DEFINES += QT_NO_MTDEV DEFINES += QT_NO_LIBUDEV QMAKE_X11_PREFIX = /usr sql-drivers = sql-plugins = sqlite qmake switches …

  6. Build options:

  7. Build parts … libs examples

  8. Mode … release

  9. Using C++11 … yes

  10. Using gold linker… yes

  11. Using PCH … yes

  12. Target compiler supports:

  13. Neon … yes

  14. Qt modules and options:

  15. Qt D-Bus … runtime

  16. Qt Concurrent … yes

  17. Qt GUI … yes

  18. Qt Widgets … yes

  19. Large File … yes

  20. QML debugging … yes

  21. Use system proxies … no

  22. Support enabled for:

  23. Accessibility … yes

  24. ALSA … no

  25. CUPS … no

  26. Evdev … yes

  27. FontConfig … no

  28. FreeType … yes (bundled copy)

  29. Glib … no

  30. GTK theme … no

  31. HarfBuzz … yes (bundled copy)

  32. Iconv … yes

  33. ICU … no

  34. Image formats:

  35. GIF … yes (plugin, using bundled copy)

  36. JPEG … yes (plugin, using bundled copy)

  37. PNG … yes (in QtGui, using bundled copy)

  38. journald … no

  39. mtdev … no

  40. Networking:

  41. getaddrinfo … yes

  42. getifaddrs … yes

  43. IPv6 ifname … yes

  44. OpenSSL … no

  45. NIS … yes

  46. OpenGL / OpenVG:

  47. EGL … yes

  48. OpenGL … yes (OpenGL ES 2.0+)

  49. OpenVG … no

  50. PCRE … yes (bundled copy)

  51. pkg-config … no

  52. PulseAudio … no

  53. QPA backends:

  54. DirectFB … no

  55. EGLFS … yes

  56. KMS … no

  57. LinuxFB … yes

  58. XCB … no

  59. Session management … yes

  60. SQL drivers:

  61. DB2 … no

  62. InterBase … no

  63. MySQL … no

  64. OCI … no

  65. ODBC … no

  66. PostgreSQL … no

  67. SQLite 2 … no

  68. SQLite … yes (plugin, using bundled copy)

  69. TDS … no

  70. udev … no

  71. xkbcommon … no

  72. zlib … yes (bundled copy)

make and make install just work fine.

  1. Run Qt examples
    Before run Qt examples, again, I need to copy some cross compiler’s lib file into SD card, otherwise it has errors when execute program.

  2. sudo cp -r /gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib /rootfs/home/ubuntu

On BBB, I neet to export LD_LIBRARY_PATH

  1. export LD_LIBRARY_PATH=/rootfs/home/ubuntu

Now, I can run Qt examples

  1. cd /Qt/examples/quick/demos/stocqt

  2. ./stocqt

Try

./stocqt -platform eglfs

Regards,
John

Thanks!

I tried adding -platform eglfs but the result is still the same. Either mouse and keyboard doesn’t response.

I believe the default platform is eglfs. So, even I don’t use -platform option, the it should run with eglfs platform. Am I right? My reference is here http://doc.qt.io/qt-5/embedded-linux.html.

Any more suggestion?

As I know , Ti’s Graphic driver will not support 3.18 kernel for current now

You should use 3.12 to match the ti graphic driver

Thank you for the respond. However, I’ve successfully run the Graphic’s demo program on 3.18 kernel. Does that mean the Graphic driver has no problem? Thanks!

Why not just install Arch Linux ARM and pacman -S qt5 and be done with it?

Why not just install Arch Linux ARM and pacman -S qt5 and be done with it?

You should "re-read" the thread. You'll find even Arch Linux ARM
can't solve this, as you'd still have to "manually" rebuild qt5 with
the un-distributable sgx lib bits.

Sorry Arch isn't always the answer..

Regards,

Sounds like you don't have permission to the input devices.
Try running with sudo or add the keyboard / mouse to a group and add permissions to your user.
LinuxFB and eglfs require direct access to /dev/input/event?

Hello Peter,

Thank you for your response. After I tried running with sudo, the keyboard and mouse work, now!
Also, I created /etc/udev/rules.d/99-input.rules with following content:

KERNEL==“event*”, NAME=“input/%k”, MODE=“664”, GROUP=“input”

Then, I rebooted BBB and all the events have read permissions. The qt example programs works.

By the way, I noticed another problem. When the Qt programs are running, the terminal’s cursor is still flashing. Sometimes the whole terminal screen will pop-up for a very short time. So the whole screen is flashing. I think this is because the terminal is trying to refresh the screen. How can I stop terminal from refreshing the screen? Thanks!

(Should I start this problem in another thread?)

You can turn off the cursor using environment variable QT_QPA_EGLFS_HIDECURSOR=1

I haven't found the proper way to have the console and a EGLFS Qt application on the LCD work at the same time.
I've found that debugging messages go to the main console while the Qt application runs on the LCD
So, the LCD display flashes with debugging messages on the console.
I had to re-compile Qt 5.3 with -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT to get it to stop spamming the main console.
If you figure out how to make it work right, that would be great.

A great resource for Qt embedded options is here:
https://qt-project.org/doc/qt-5-snapshot/embedded-linux.html

You can turn off the cursor using environment variable
QT_QPA_EGLFS_HIDECURSOR=1

I haven't found the proper way to have the console and a EGLFS Qt
application on the LCD work at the same time.
I've found that debugging messages go to the main console while the Qt
application runs on the LCD
So, the LCD display flashes with debugging messages on the console.
I had to re-compile Qt 5.3 with -DQT_NO_DEBUG_OUTPUT
-DQT_NO_WARNING_OUTPUT to get it to stop spamming the main console.
If you figure out how to make it work right, that would be great.

I think you just remove the console=tty0 from your mmcargs line in
uEnv.txt file. That should remove the console output from your display,
but will continue to display the console on the UART.

Regards,
John