Saturday, March 2, 2013

Running the QT5 Cinematic Experience Example on Raspberry Pi

I first saw the QT5 Cinematic Experience video here: 

  • http://www.youtube.com/watch?v=wulbR2R1GpM

The video show cased Raspberry Pi running a very fancy QT5 example. I decided I wanted to give this a try on my Pi as well. Unfortunately it was not very straightforward. If you tried to google for instruction on run QT5 on the Raspberry Pi, it'll take you in circles. 

  • http://qt-project.org/wiki/RaspberryPi_Beginners_guide
    • This instruction assumes you have a main Linux machine that can be used for cross compiling.
  • http://qt-project.org/forums/viewthread/21080
    • This instruction asks you to download the snapshot. However the location no longer exists. 
  • I also tried to use cross-ng to compile my own cross compiler. 
  • Before the cross compiler finishes compiling, I found an existing cross compiler for the Pi. 
  • I then checked out the Qt5 source and tried to compile that using  the cross compiler I downloaded without success.

Took me a couple nights before I figured out exactly what I need to do (turned out to be very simple). Someone backed up a copy of the Qt5 snapshot, and we can simply install from there instead of attempting to build your own cross compiler, cross compiling in Cygwin or Linux, and such. The information came from mainly the following two sources. 

  • http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=15861&p=299166&hilit=qt5#p299166
  • http://quitcoding.com/?page=work#cinex

The following outlines the steps I took to get the QT5 Cinematic Experience demo running:

  1. On the Pi: sudo vi /etc/apt/sources.list
  2. Append: deb http://twolife.be/raspbian/ wheezy main
  3. Exit vi
  4. Issue: sudo apt-get update
  5. Issue: sudo apt-get upgrade // this will take a while. More than an hour for me. 
  6. Issue: sudo apt-get install libqt5-* // this installs all libqt5 libraries
  7. Download the Cinematic Experience source here: http://quitcoding.com/?page=work#cinex
  8. Unzip the source into a folder of your liking. 
  9. Navigate into your unzipped directory. 
  10. Issue: qmake // this will generate the make file 
  11. Issue: make // compile
  12. Issue: ./Qt5_CinematicExperience // run!

23 comments:

  1. not able to fetch from twolife.be

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. everything went well, however, when calling qmake I receives ERROR:

    ERROR: Unknown module (s) in QT: quick qml

    ReplyDelete
    Replies
    1. same here, did you solve that problem?

      Delete
    2. Any luck wuth this I'm having the same issue

      Delete
    3. Same here. It's interesting how nothing ever works out of the box in the open-source community. Interesting and immensively frustrating. Will report back if I find anything.

      Delete
    4. Had the issue too but I installed the Qt declarative packages too and it helped. Can't recall the exact names of the packages at the moment. But look for "sudo apt-cache search declarative", hope it helps.

      Delete
  4. Hmm..

    E: Couldn't find any package by regex 'libqt5-*'

    Did the guy behind twolife.be delete his qt5 stuff? :-/

    ReplyDelete
    Replies
    1. deb http://twolife.be/raspbian/ wheezy main qt gstreamer
      deb-src http://twolife.be/raspbian/ wheezy main qt gstreamer

      Delete
  5. No , but check here for the right line to add in sources instead http://twolife.be/raspbian/

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. qmake: could not find a Qt installation of ''

    ReplyDelete
    Replies
    1. sudo apt-get install libqt5-* -> command worked, no errors, installed a bunch of libraries, but I can't find them anywhere also qmake has a problems.

      Help/

      Delete
    2. this helped
      sudo apt-get install qt5-default

      But to another one. How to install multimedia widgets multimedia

      Project ERROR: Unknown module(s) in QT: multimediawidgets multimedia

      Delete
    3. Those are installed as well

      sudo apt-get install libqt5multimediawidgets5 libqt5multimedia5
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      libqt5multimedia5 is already the newest version.
      libqt5multimediawidgets5 is already the newest version.
      0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded

      Any ideas ?

      Delete
    4. I am getting very close. This helped ->

      sudo apt-get install qtmultimedia5-dev

      Now it started to compile my project but it ended with

      /usr/bin/ld: cannot find -lpulse
      collect2: ld returned 1 exit status
      make: *** [CamTest] Error 1

      If I am not mistaken this some the pulse audio thing. Any ideas on this one ?

      Delete
    5. This helped.

      sudo apt-get install libpulse0 libpulse-dev

      Delete
    6. Thanks, misiek, for coming back and posting what worked for you. That's super-helpful.

      Delete
  8. Hi, I followed steps above to install neccessary libraries and successfully compiled the aplication. But I do have now problems regarding running Cinex demo. It writes me, that it cannot find any platform support - I have tried to run the application with -platform eglfs, but also xcb, or wayland. In downloaded folder from twolife.be repository under "usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms" I can see,that there are libraries with eglfs,minimalegl, wayland and also xcb support... So I dont know, why it does not work. I have tried to export LD_LIBRARY_PATH, QTDIR path and playing a little bit with paths altogether,but without success.

    ReplyDelete
  9. Hi Lukáš,

    Did you manage to make it work at your side? I'm asking cause i'm getting similar troubles right now :

    $ ./Qt5_CinematicExperience
    QXcbConnection: Could not connect to display

    ./Qt5_CinematicExperience -platform offscreen
    QFontDatabase: Cannot find font directory /usr/lib/arm-linux-gnueabihf/fonts - is Qt installed correctly?

    Btw big thanks to misiek and Ricky for the steps that bring us to an almost working Qt5

    ReplyDelete
  10. Hi, I have this error:

    CinematicExperience: error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory

    And already installed Qt declarative packages

    ReplyDelete
    Replies
    1. Ok, now used this sudo ln -fs /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2

      Then this error

      This application failed to start because it could not find or load the Qt platform plugin "xcb".

      Delete