[Solved] Qt 5.4 on Beaglebone black with OpenGL EGLES2: Linux is dead after execute example application. No response from keyboard and mouse.



  • 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)
    @sudo cp -r <some dir>/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/* <some dir>/rootfs@

    edit /qtbase/mkspecs/devices/linux-beaglebone-g++/qmake.conf
    @Ln 29: COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard
    Ln 39: QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/usr/include/OGLES2@

    configure
    @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
    @ Configure summary

    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: devices/linux-beaglebone-g++ (arm, CPU features: neon)
    Platform notes:

            - Also available for Linux: linux-kcc linux-icc linux-cxx
    

    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 .........

    Build options:
    Build parts ............ libs examples
    Mode ................... release
    Using C++11 ............ yes
    Using gold linker....... yes
    Using PCH .............. yes
    Target compiler supports:
    Neon ................. yes

    Qt modules and options:
    Qt D-Bus ............... runtime
    Qt Concurrent .......... yes
    Qt GUI ................. yes
    Qt Widgets ............. yes
    Large File ............. yes
    QML debugging .......... yes
    Use system proxies ..... no

    Support enabled for:
    Accessibility .......... yes
    ALSA ................... no
    CUPS ................... no
    Evdev .................. yes
    FontConfig ............. no
    FreeType ............... yes (bundled copy)
    Glib ................... no
    GTK theme .............. 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)
    journald ............... no
    mtdev .................. no
    Networking:
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    OpenSSL .............. no
    NIS .................... yes
    OpenGL / OpenVG:
    EGL .................. yes
    OpenGL ............... yes (OpenGL ES 2.0+)
    OpenVG ............... no
    PCRE ................... yes (bundled copy)
    pkg-config ............. no
    PulseAudio ............. no
    QPA backends:
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. yes
    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
    udev ................... no
    xkbcommon .............. no
    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.
      @sudo cp -r <some dir>/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib <some dir>/rootfs/home/ubuntu@

    On BBB, I neet to export LD_LIBRARY_PATH
    @export LD_LIBRARY_PATH=/rootfs/home/ubuntu/lib@

    Now, I can run Qt examples
    @cd /Qt/examples/quick/demos/stocqt
    ./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!


  • Lifetime Qt Champion

    Hi,

    IIRC, you need to also tell which input plugin you want to use e.g. -plugin evdevkeyboard



  • Thanks for the response. I tried
    @./stocqt -plugin evdevkeyboard@
    It doesn't work either.


  • Lifetime Qt Champion

    You should start your application with QT_DEBUG_PLUGINS=1 to see what happens with them



  • Thank you for respond, again.

    I solved this problem, now. It is because the Qt program doesn't have the read permission to the /dev/input/eventX. I tried to run program with sudo and the mouse and keyboard work.

    Also, I tried other solution.
    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.

    Thanks!


  • Lifetime Qt Champion

    You can also add you user to the input group which should be more secure.

    Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)



  • Hello there, sorry for diging this up. But i have the exact same problem.@hammerlei 's solution havent worked for me, could you please tell me what is the way of adding root to input group?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.