PDA

View Full Version : Platform plugins and XCB question



ben80
3rd September 2014, 12:45
Hi everyone,

unfortunately i couldn't get any help on the qt-project forum, so i'd like to try it here as well.
i could need some help to better understand the platform concept (eglfs, xcb).


My system
I crosscompiled Qt5.3 on my linux debian desktop and i use QtCreator to write QML code and deploy it to my raspberry pi.


My goal:
A program that runs on the rpi, but the gui is shown on my Win7 desktop computer.
-> I want to use QML quick 2.0 and quick.controls
-> I was thinking about a putty ssh / X11 connection and XMing on Win7


My available platform plugins after compiling qt5 for the raspberry:

eglfs
minimalegl
offscreen
linuxfb
minimal



Questions:

The eglfs plugin doesn’t support X11, right?
Does XCB support X11?
If (2) is true, then where do i get the xcb plugin for my raspberry?


Are there binaries for raspbian/wheezy? Where?
Can i compile it myself? How? I followed the following guide to crosscompile qt5: http://qt-project.org/wiki/RaspberryPi_Beginners_guide

Is there another plugin that is better suited for my goal than the xcb plugin?



Thanks so much for your help,
Ben

wysota
3rd September 2014, 13:00
The eglfs plugin doesn’t support X11, right?
Right.

Does XCB support X11?
Yes.

If (2) is true, then where do i get the xcb plugin for my raspberry?
Not sure what you mean. However X11 on raspberry pi really sucks so try avoiding it if you are after good performance.

Are there binaries for raspbian/wheezy? Where?
No idea. If you can't find them in the repositories then probably no.

Can i compile it myself?
Sure.

How?
Well... you would probably have to build Qt yourself and make sure all dependencies for building xcb were met.


Is there another plugin that is better suited for my goal than the xcb plugin?
In general if you want to show the output of rpi app on Windows then going through X11/SSH will give you terrible performance. Unless you have some solution to transfer the framebuffer data to the Windows host efficiently, I'd probably suggest implementing a custom platform plugin that would somehow provide means to do it, e.g. by writing to some virtual framebuffer (shared memory segment?) which would be accessed by some service you could connect to from the Windows host.

ben80
3rd September 2014, 20:49
In general if you want to show the output of rpi app on Windows then going through X11/SSH will give you terrible performance
Ok good to know.
All i need is, to show a small window where the user can change some program settings, that's it.
I already tried X11 on the RPI with the "NetSurf GTK web browser". The performance is enough for my needs.



where do i get the xcb plugin for my raspberry?
Can i compile it myself?

>Not sure what you mean.
>Well... you would probably have to build Qt yourself and make sure all dependencies for building xcb were met.


I already compiled qt5 for the rpi. Thus I got the following platform plugins. eglfs, minimalegl, offscreen, linuxfb, minimal.
But no XCB.

So, is the XCB source code part of the qt5 source? I cannot find it.
Do i have to compile it the same way like other qt5 modules, e.g. "qtdeclarative": -> qmake, make, make install

Ben

faldzip
3rd September 2014, 23:07
When you run ./configure script of your Qt sources then it prints the setup at the end and there you can check what is going to be compiled and what is not, because some dependencies are not met. So yes, the xcb platform plugin is there in Qt sources and you probably have to have some libxcb1-dev package installed on the Pi (if you are using Raspbian) and I prefere using -qt-xcb switch with Qt's ./configure script (so it uses xcb sources bundled with Qt). You can add -v option to configure to see what tests fail and why.

ben80
4th September 2014, 01:01
ok, i am close to giving up. I guess i am not enough familiar with compiling for linux devices.
I understand that i have to rebuild my qt5, what i already did but it doesn't work for me.

I tried to do the following steps:


1) configure:
Using the option -qt-xcb:

niki@debian:~/opt/qt5/qtbase$ sudo ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-relocations -reduce-exports -release -make libs -prefix /usr/local/qt5pi -qt-xcb -v > outputConfigure.txt

2) make & make install

sudo make
sudo make install
Then i would expect to find the platform plugin XCB in the folder: /usr/local/qt5pi/plugins/platforms/ -> but it's not!!
There are a bunch of errors and warnings, but these were also there when i compiled qt5 the first time.


3) Copy to sd-card
After the steps above i would copy the rasp-pi-rootfs folder to my sd-card of the raspbery.

4) install xcb dependencies
On my raspberry i would: sudo apt-get install libxcb1-dev

5) compile and deploy my code to the raspberry using QTcreator

6) run
./myApp -platform xcb


I really appreciate your help!
I know it's not easy to work through my problem description.

Ben

faldzip
4th September 2014, 07:15
How the libxcb1-dev package can be available in step 1 when you installed it in step 3? Did you check what is in file outputConfigure.txt? First of all it said that configuring failed so builind Qt then was pointless. Then it said:


The test for linking against libxcb failed!
You might need to install dependency packages for libxcb.
See src/plugins/platforms/xcb/README.

Did you checked this file?

And remember to install packages first on the RPi and then copy the sdcard to your sysroot dir, because they are needed in the compile time.

wysota
4th September 2014, 08:38
Ok good to know.
All i need is, to show a small window where the user can change some program settings, that's it.

Then maybe it is better to expose some network service on Pi and connect to it using a separate Windows-only program that will show the UI and pass user settings to the service over network.

ben80
5th September 2014, 10:12
How the libxcb1-dev package can be available in step 1 when you installed it in step 3?
And remember to install packages first on the RPi and then copy the sdcard to your sysroot dir, because they are needed in the compile time.
Good hint, it's kind of logical but i didn't think of it.

I think i will compile a clean version from scratch, since i wanted to use the newest qt5 version anyway.

Do you think i can use chroot to install all needed packages into the raspbian image on my host pc?
That way, i don't have to copy the image back and forth to the sd-card. My raspberry is built into another mechanical frame where it's not easily accessible.

faldzip
5th September 2014, 11:02
Never tried chroot - you may check it. But surely you can mount the running Pi sysroot trough the ethernet (with nfs) so you will have the "live" image of it.

But for your task I would really consider the solution mentioned by wysota as the remote X connection on windows looks like the most complicated solution.

ben80
7th September 2014, 10:23
ok, i understand.
I think i will look again at both solutions as soon as my son gives me a bit spare time ;-)
But i will rebuild qt5 anyway, since i would like to work with the newest version.

Thanks guys