[Solved] -platform and linuxfb documentation



  • Hello,

    I'm writing a QT app that uses the linux frame buffer. I would like to learn more about the built in command line options (such as -platform). Other than the very short blurb in the Application class documentation, there isn't much I've found. Is there any other documentation?

    Also, QT uses /dev/fb0 as the primary frame buffer. I'd like to use a different frame buffer. How can I configure this?


  • Lifetime Qt Champion

    Hi,

    Did you look at "this":http://qt-project.org/doc/qt-4.8/qt-embedded-displaymanagement.html ?

    Hope it helps



  • Ah, kind of helps. I don't see any examples about how to select a different frame buffer?

    I tried
    ./app -platform linuxfb -display "LinuxFb:/dev/fb1"

    But it still displays on /dev/fb0...



  • I should also note this is for QTv5.1


  • Lifetime Qt Champion

    I think you are missing tty= before /dev/fb1



  • Thanks for the help, but I don't think that's quite right. tty=<device> specifies the device file for a certain console "/dev/tty0", not the frame buffer.

    Reading the code (qlinuxfbscreen.cpp) it's looking for the parameter fb=

    I was able to correctly use a different frame buffer by calling it like so

    ./app -platform linuxfb:fb="/dev/fbX"


  • Lifetime Qt Champion

    Oups, sorry ! I've mixed the two while writing the message. Glad you found out !

    If this solves your problem don't forget to update the thread's title to solved so other forum users may know a solution has been found :)



  • hi img_man,

    I used ./app -platform linuxfb:fb=”/dev/fbX” but I got segmentation fault error. My qt version is 5.0.1.

    By the way, in qt4.8 there is a way to combine 2 fb devices into a single screen using qws. In qt5+ qws is replaced by qpa. Do you know how to do the same thing on qt5?



  • fbX is just an example, you need to insert the correct number for X. List (ls -la) your /dev directory and find the correct frame buffer.

    If there are two frame buffers in /dev, they may already be blended by your hardware.

    Perhaps you've already done that, in which case, I would suggest trying something easy, like 'cat /dev/urandom > /dev/fb0'. Which should populate your screen with (psuedo) random pixel data. Does it work?



  • hi img_man,

    bq. fbX is just an example, you need to insert the correct number for X. List (ls -la) your /dev directory and find the correct frame buffer.
    --> I know but it does not work even with fb0. I also tried in Qt5.1, it does work but display position is incorrect and touch input dies.

    bq. If there are two frame buffers in /dev, they may already be blended by your hardware.
    --> I think they are not blended since I used QDesktop instance to check number of screen and available geometry. Only one screen is recognized.

    bq. Perhaps you’ve already done that, in which case, I would suggest trying something easy, like ‘cat /dev/urandom > /dev/fb0’. Which should populate your screen with (psuedo) random pixel data. Does it work?
    --> yes, it does.



  • Hi img_man,

    Even if it works then I can only switch the display output for the entire app. What I would like is to create an app that can manipulate its output itself. Lets take an example: a video playback app which has a list of video files displayed on the first screen. When one file is selected, its content is played on the second screen.

    Hope you can help me with this and thank you very much for your reply!



  • Interesting. So, you have at least one frame buffer that is full screen, you can write to it, but your app stops when you try to launch it?

    I've struggled with seg faults in QT also. One thing that's helped me is to make sure that all the QT libraries (or at least links to the libraries) are in /usr/lib. If QT tries to start and can't find the libraries it needs, it will fail.

    You also need to have the platform directory in your app directory, with the correct platform libraries in it that you wish to use.

    Not sure about touch input, I haven't tried that yet.

    Does your /dev directory show two frame buffers? Are you using two displays?



  • Hello All,

    I tried the same thing [QT Version: 5.2.1]. Here is my actual command:

    ./gui_qt -platform linuxfb:fb="/dev/fb0"

    but i got following error:

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

    Reinstalling the application may fix this problem.
    Aborted (core dumped)

    Kindly help me out. Thanks
    Sid



  • Hi Sidii,

    I haven't used qt in a little while now, but I seem to recall that there's an undocumented requirement that the platform plugins you intend to use must be located in a folder named "platform", located in the same folder as your app. These can be links, instead of a direct copy of the plugin from your install directory.

    I may have the folder name wrong, but it should be easy to find it in your install directory and copy it to your app directory (or make a soft link).

    The directory structure, for instance, should look like

    app_name
    platforms
    platforms/linuxfbplugin_name

    Sorry if I forget some of the details on the naming conventions qt uses, but I think you should be able to extrapolate my meaning.



  • Thanks a lot img_man :)
    I will try and will update you.



  • Dear img_man,

    I created a folder called platforms. This has 3 files: libqlinuxfb.so, libqminimal.so and libqoffscreen.so.

    Now when i start my application with following command:

    @ ./gui_qt -platform linuxfb:fb=/dev/fb0@

    I get following error:

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

    Available platform plugins are: linuxfb, minimal, offscreen.

    Reinstalling the application may fix this problem.
    Aborted (core dumped)

    Any idea whats going wrong??



  • Also please note that i am developing the QT application in another machine and then transferring it to another machine to test it. What all extra things i need in the test machine apart from platforms folder??

    Thanks in advance.



  • Thanks a lot img_man !!
    My code is now working.



  • I have a similar issue except I don't get the line saying what IS available.

    export LD_LIBRARY_PATH=/home/isaw/Qt/lib:/home/isaw/Qt/plugins/platforms:/$LD_LIBRARY_PATH

    /home/isaw/iBaseQtWidget
    /home/isaw/fonts/... (not configured)
    /home/isaw/lib/... libQt5xxxxx.so.5.3.2
    /home/isaw/plugins/...
    .../platform/... libqlinuxfb.so, libqminimal.so, and libqoffscreen.so

    Linux 2.6.21 on Arm920t processor.




Log in to reply
 

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