Tuesday, January 2, 2018

POT 5.7.0 with Qt 5.10.0 built for armv8 with GCC 6.3.0 on Raspbian Stretch

This was a good test for my cross toolchain with gcc 6.3.0 I uploaded some days ago: the new Qt 5.10.0 built with -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard, including POT for video acceleration on Raspbian Stretch. The build includes most Qt modules plus Qt WebKit (the modernized QtWebKit from
Konstantin Tokarev, version 5.212, https://github.com/annulen/webkit) plus QtWebEngine 5.9.1, a bit patched to build here. I didn't test browsers much, you'll have to work on those yourself if you need them.

By using the Qt build and the cross toolchain you can build your own applications.

Download here the build for Qt 5.10.0 with POT 5.7.
Download here the cross toolchain.

41 comments:

  1. Thank you very much for the binaries. Best wishes!

    ReplyDelete
  2. Hi Luca, thank you for your work! When I build qt on my own, I obtain two dir, qtX and qtX-host. If I would to use your build which is the best way to have a sync with a new raspberry stretch image? Better, what I have to insert in QtCreator-> Tools -> Option -> Build & Run -> Kits -> Qt-rasp3-5.10.0 -> Sysroot?

    Thank you!

    ReplyDelete
    Replies
    1. This is explained here: http://doc.qt.io/qtcreator/creator-targets.html.

      Delete
  3. hi
    after test all qml works and qt works very nice
    but your web_test is gice this error
    ./PiOmxTextures_5.7.0_pi3_5.10.0/piomxtextures_browser_we

    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
    QML QtWebEngine...
    InitializeGLOneOffImplementation
    Loading libs...
    [7780:7803:0114/115849.909577:ERROR:service_manager.cc(539)] Instance: content_packaged_services attempting to register an instance for a process it created for target: content_browser without the service_manager{client_process} capability class.
    GLSurfaceQtEGL::InitializeOneOff okSuccessfully initialized!
    Ok! Initialized!
    Received signal 11 SEGV_MAPERR 000000000011
    #0 0x000073e107d6 base::debug::StackTrace::StackTrace()
    #1 0x000073e10652 base::debug::StackTrace::StackTrace()
    #2 0x0000731a6d98 base::debug::(anonymous namespace)::StackDumpSignalHandler()
    #3 0x000073e10a72 base::debug::(anonymous namespace)::StackDumpSignalHandler()
    #4 0x00007193b6c0

    ReplyDelete
    Replies
    1. I ready built a robust app by qt/qml/c++ on your previous version ( qt 5.8 + raspbian jessie lite)
      now I need to use you r version with Qt5.10 (because it support "stl" files in 3d mesh)
      """"very thanks for your work""""

      now I set Url it start and give red screen and no webpage appear then close after about 10 sec

      messages from start to end:

      root@raspberrypi:/home/pi# ./PiOmxTextures_5.7.0_pi3_5.10.0/piomxtextures_browser_we www.google.com
      QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
      QML QtWebEngine...
      InitializeGLOneOffImplementation
      Loading libs...
      [1018:1041:0114/213636.169168:ERROR:service_manager.cc(539)] Instance: content_packaged_services attempting to register an instance for a process it created for target: content_browser without the service_manager{client_process} capability class.
      GLSurfaceQtEGL::InitializeOneOff okSuccessfully initialized!
      Ok! Initialized!
      root@raspberrypi:/home/pi#

      Delete
    2. You can try with a debugger. Unfortunately webengine in 5.10 needs a few patches to build for the pi. Does not seem to be mantained.

      Delete
  4. could you upload the full image of raspbian stretch with qt5.10

    ReplyDelete
    Replies
    1. I'm sorry but at the moment I don't have an image ready to be released.

      Delete
    2. many thanks ,
      and we will wait for your new works

      Delete
  5. Can you please explain how to install the Qt built and the toolchain? I unpacked the Qt build in /opt and updated the PATH variable. However, when running the examples the executable fails to find the libraries? I assume the toolchain requires the same method?

    ReplyDelete
  6. The libs have an rpath set. You should see the proper paths using qmake -query. The root must be in /usr/local. If instead you want to use another location then you should setup your env appropriately with any of the regular techniques.

    ReplyDelete
  7. Hi Lucas and thanks for your work. I have downloaded your build and extract Qt-rasp3-5.10.0 in /usr/local on my rapsberry pi 3. try to launch pi@raspberrypi:~/PiOmxTextures_5.7.0_pi3_5.10.0 $ ./piomxtextures_pocplayer ../M4H04419.MP4 but i have this error :
    This application failed to start because it could not find or load the Qt platform plugin "eglfs"
    in "".

    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl.

    Reinstalling the application may fix this problem.
    Abandon

    Probably an error with PATH or LD_LIBRARY_PATH (for me LD_LIBRARY_PATH=/usr/local/Qt-rasp3-5.10.0/lib
    )

    Can you help how to resolve this please ?

    ReplyDelete
    Replies
    1. Export QT_DEBUG_PLUGINS=1 and paste the logs again please.

      Delete
    2. pi@raspberrypi:~/PiOmxTextures_5.7.0_pi3_5.10.0 $ ./piomxtextures_pocplayer -platform eglfs ../M4H04419.MP4
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-rasp3-5.10.0/plugins/platforms" ...
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqeglfs.so"
      Found metadata in lib /usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqeglfs.so, metadata=
      {
      "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
      "MetaData": {
      "Keys": [
      "eglfs"
      ]
      },
      "className": "QEglFSIntegrationPlugin",
      "debug": false,
      "version": 330240
      }


      Got keys from plugin meta data ("eglfs")
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqlinuxfb.so"
      Found metadata in lib /usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqlinuxfb.so, metadata=
      {
      "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
      "MetaData": {
      "Keys": [
      "linuxfb"
      ]
      },
      "className": "QLinuxFbIntegrationPlugin",
      "debug": false,
      "version": 330240
      }


      Got keys from plugin meta data ("linuxfb")
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqminimal.so"
      Found metadata in lib /usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqminimal.so, metadata=
      {
      "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
      "MetaData": {
      "Keys": [
      "minimal"
      ]
      },
      "className": "QMinimalIntegrationPlugin",
      "debug": false,
      "version": 330240
      }


      Got keys from plugin meta data ("minimal")
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqminimalegl.so"
      Found metadata in lib /usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqminimalegl.so, metadata=
      {
      "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
      "MetaData": {
      "Keys": [
      "minimalegl"
      ]
      },
      "className": "QMinimalEglIntegrationPlugin",
      "debug": false,
      "version": 330240
      }

      ......


      Got keys from plugin meta data ("vnc")
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqwebgl.so"
      Found metadata in lib /usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqwebgl.so, metadata=
      {
      "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
      "MetaData": {
      "Keys": [
      "webgl"
      ]
      },
      "className": "QWebGLIntegrationPlugin",
      "debug": false,
      "version": 330240
      }


      Got keys from plugin meta data ("webgl")
      QFactoryLoader::QFactoryLoader() checking directory path "/home/pi/PiOmxTextures_5.7.0_pi3_5.10.0/platforms" ...
      Cannot load library /usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqeglfs.so: (libfontconfig.so.1: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
      QLibraryPrivate::loadPlugin failed on "/usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqeglfs.so" : "Cannot load library /usr/local/Qt-rasp3-5.10.0/plugins/platforms/libqeglfs.so: (libfontconfig.so.1: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)"
      This application failed to start because it could not find or load the Qt platform plugin "eglfs"
      in "".

      Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl.

      Reinstalling the application may fix this problem.

      Delete
    3. So you're missing fontconfig on your pi.

      Delete
    4. Thanks, done now ! For information i use raspbian stretch light. An idea about the main problem ?

      Delete
    5. What problem? Doesn't it work with fontconfig installed?

      Delete
    6. Installing fontconfig didn't resolve the problem.

      Delete
  8. Dear Luca,

    We succeeded in using the build with cross toolchain and the accompanying pocplayer plays our .mk4 video files perfectly. However when we are trying to build our own implementation of QtMultimedia the player shows a black screen. The difference between the example you provided and our own implementation seems to have something to do with Qt5Quick and Qt5Widgets respectively. Therefore, I was wondering if you could provide the source code of the pocplayer example in order for us to compare.

    ReplyDelete
    Replies
    1. I'm sorry, not sure I understand what you need.

      Delete
  9. Our video player with QtMultimedia based on Qt Widgets doesn't work. The executable "piomxtextures_pocplayer" works like a charm and seems to be based on QtQuick based on objdump. So I would like to diff both implementations. I also tried to cross compile the "media player example" provided by Qt Creator with the same results.

    ReplyDelete
    Replies
    1. My implementation won't work in widgets. You need to use a QML scene and render the video using QML multimedia elements like VideoOutput, MediaPlayer or Video. If your app is using widgets you may experiment with a mix of the two technologies. I never tested that but it may theretically work.

      Delete
  10. Hi Luca! Thanks for your work!

    I have problem:

    QFactoryLoader::QFactoryLoader() checking directory path "/home/pi/mediaservice" ...
    Cannot load library /usr/local/qt5.8/plugins/mediaservice/libopenmaxilmediaplayer.so: (libavformat.so.57: cannot open shared object file: No such file or directory)
    QLibraryPrivate::loadPlugin failed on "/usr/local/qt5.8/plugins/mediaservice/libopenmaxilmediaplayer.so" : "Cannot load library /usr/local/qt5.8/plugins/mediaservice/libopenmaxilmediaplayer.so: (libavformat.so.57: cannot open shared object file: No such file or directory)"
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"

    Video does not start, only black screen.
    How can I fix this error?

    Thank you in advance.

    ReplyDelete
    Replies
    1. I solved this problem.
      I did not have libraries ffmpeg. After installation it worked for me.

      Delete
  11. @modjo I had same issue with you, can u tell me how to solve this if it is like Luca said "So you're missing fontconfig on your pi."

    1. A clean Raspberry Pi then
    2. I download Qt 5.10.0 with POT 5.7 and Extract Qt-rasp3-5.10.0 to /usr/local
    3. Execute the piomxtextures_pocplayer

    ReplyDelete
    Replies
    1. The number of steps are my raspberry environment and test operations.

      Delete
    2. Install all the deps using apt.

      Delete
    3. @Luca
      Did I misunderstand? It still CANNOT execute after Install all deps from "Native Build of Qt5 on a Raspberry Pi - http://wiki.qt.io/Native_Build_of_Qt5_on_a_Raspberry_Pi"

      sudo apt-get update
      sudo apt-get upgrade
      sudo apt-get install libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev
      libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev
      libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad
      libraspberrypi-dev libpulse-dev libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev
      libiodbc2-dev libmysqlclient-dev firebird-dev libpng12-dev libjpeg9-dev libgst-dev libxext-dev libxcb1 libxcb1-dev
      libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0
      libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync1 libxcb-sync-dev libxcb-render-util0
      libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev
      libxi-dev libdrm-dev libssl-dev libxcb-xinerama0 libxcb-xinerama0-dev

      Delete
    4. Qt has its own dependencies. POT needs other dependencies. I don't have a full list, you should see what the library depends on. You probably need libv4l, libpcre, libfreetype, libfontconfig, libssl, libcrypto, libssh, libsmbclient, icu, libpng, libjpeg, libasound and others.

      Delete
    5. I followed RaspberryPi2EGLFS - https://wiki.qt.io/RaspberryPi2EGLFS,
      It can execute piomxtextures_pocplayer,
      Thanks, Luca.

      sudo apt-get update
      sudo apt-get build-dep qt4-x11
      sudo apt-get build-dep libqt5gui5
      sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0

      Delete
  12. This comment has been removed by the author.

    ReplyDelete
  13. Hello Luca,
    "AUDIO_OUT (I'll soon add POT_AUDIO_OUT; AUDIO out will probably remain for backward compatibility): you can use this to set the audio output to use:
    hdmi means output to HDMI;
    local means output to headphones;
    both means... well both the above;
    default is HDMI."

    it it works on POT version 5.7.0 ? (built by myself)
    Thanks.

    ReplyDelete
  14. Hi Luca,
    I managed to run the piomxtextures_pocplayer on my rpi3. But when I try to cross compile a simple qml program using QtCreator I get the error 'cannot find -lGLESv2'. This is the linking command:
    /opt/rpi/rpi-gcc-6.3.0/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/opt/rpi/sysroot -Wl,-O1 -Wl,-rpath,/usr/local/Qt-rasp3-5.10.0/lib -Wl,-rpath-link,/opt/rpi/sysroot/opt/vc/lib -Wl,-rpath-link,/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/opt/rpi/sysroot/lib/arm-linux-gnueabihf -o videoegltest main.o qrc_qml.o -L=/opt/vc/lib -L/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/ -L/usr/lib/arm-linux-gnueabihf/ -L/opt/rpi/sysroot/usr/local/Qt-rasp3-5.10.0/lib -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lpthread
    /opt/rpi/rpi-gcc-6.3.0/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lGLESv2

    When I do 'ls /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/ | grep GLESv2' I get
    libGLESv2.so.2
    libGLESv2.so.2.0.0

    So it seems the library is there. Why do I get this error then?
    When I remove the GLESv2 library from the makefile, linking works. But when running the executable (on rpi3) I get error "Failed to get shared context. Enable it.". How could I enable it?
    Thanks!
    Kristof

    ReplyDelete
    Replies
    1. I think GLES lib is supposed to be somewhere in /opt/vc in the pi. Not sure what is that one.
      As for the runtime error, just do what it says, enable shared context. Look into pocplayer or look into the Qt docs to know why. There is a flag somewhere.

      Delete
    2. Hi Luca, thank you for the quick reply. I found how to enable the shared gl context in your examples. I also found the linking issue (at least a workaround). If in the linking command from above I move the '-lGLESv2' just after '-L=/opt/vc/lib' and I add a symbolic link on the rpi (sysroot) 'ln -s libGLESv2_static.a libGLESv2.a' in /opt/vc/lib, then it links and runs on the device. I'm looking for a way to pass this now to the linker via the '.pro' file.
      Kristof

      Delete
    3. I don't see why linking against the static version of GL. Using the regular GL shared library that the Qt build is using should be sufficient.

      Delete
    4. You are right. I shouldn't be linking against the static library. I noted that if I remove the '-lGLESv2' from the link command, the linking works and the executable is exactly the same (same md5 hash). Thus I suppose I'm using the wrong mkspec in QtCreator. I therefor created my own mkspec based on linux-rasp-rpi3-g++ but without this flag for linking. Then it works great. Is there a way to know if the application is using hardware acceleration? Using the '-platform eglfs' flags doesn't seem to have any effect...
      Thanks,
      Kristof

      Delete
  15. This comment has been removed by the author.

    ReplyDelete
  16. thanks Luca Carlon
    these full images + some qt work on it

    system image based on raspbian jessie(pi 3b):
    https://drive.google.com/file/d/1KMiUvBvn_qL0A5Wkj_AzXsWzrg4Q7sBQ
    login :
    ssh pi@qpi.local
    pass: minder


    system image based on raspbian stretch(pi 3b+):
    https://drive.google.com/file/d/1T-6feq975OmQvOBtd19kmg3BYmVbPAt_
    login :
    ssh pi@qpi3.local
    pass: minder


    based on Luca Carlon QT libs
    many thanks again

    ReplyDelete