Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to tweak/build qvfb (Qt/X11 and Virtual FB) featureset
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
egberts
Guru
Guru


Joined: 04 Nov 2003
Posts: 357
Location: Dimmed Cathode Ray Tube

PostPosted: Sun Jul 24, 2005 10:14 pm    Post subject: How to tweak/build qvfb (Qt/X11 and Virtual FB) featureset Reply with quote

This has been updated many times...

Brief Overview: Qt-Embedded is a windows platform for embedded system. QtE differs than Qt as it has lower memory usages. To jump start your QtEmbedded application development, TrollTech provided Qt Virtual Frame Buffer (qvfb) to enable rapid prototyping on the host platform while your other embedded team is busy getting their hardware and kernel ready.

To the many folks that tried to build "qvfb" particularly version 3.3.x, its been problematic. So I've included these steps to cut to the chase. So here goes...

When attempting to establish a Qt virtual framebuffer (qvfb), I've struggled with the following, in absense of any documentations (and for your relative ease of use):
Code:
# emerge x11-libs/qt
# emerge x11-libs/qt-embedded

Then due to lack of qvfb executable, I went back into the code doing (BUT FIRSTLY, unset QTDIR and QTMAKESPEC)
Code:
# cd /usr/portage/x11-libs/qt-embedded/
# ebuild qt-embedded-3.3.4.ebuild compile


Since we want to prepare and build the Qt application on the host platform, I've added two more options to the qt-embedded configure: VNC and QVFB. This way I can prototype my Qt Embedded application using VNC directly or using QVFB. Either one will work just fine. QVFB may be easier to use. Tweaked qt-embedded ebuild file and changed out the compile options so that it reflects:
Code:

# vi /usr/portage/x11-libs/qt-embedded/qt-embedded-3.3.4.ebuild
...
    ./configure ${myconf} -shared -depths 1,16,32 -stl \
        -qt-gfx-vnc -qt-gfx-qvfb -freetype -qvfb \
        -prefix ${QTBASE} -platform ${PLATFORM} -xplatform ${XPLATFORM} \
        -embedded || die

Save and exit the edit session, and do the 'gentoo'...
Code:

# ebuild qt-embedded-3.3.4.ebuild digest compile preinst install postinst

Because we're not embedding our Qt virtual framebuffer, we going to build against Qt (as opposed to Qt-Embedded) as we want the qvfb to run on the host platform. In fact, during Qt-Embedded development using virtual frame buffer, we will never use the Qt-Embedded stuff. We do this by updating shell bash environment with
Code:
export QTDIR=/usr/qt/3
export QMAKESPEC=/usr/qt/3/mkspecs/qws/linux-x86-g++

Still have to tweak the qvfb Makefile some more:
Code:
# vi /var/tmp/portage/qt-embedded-3.3.4-r1/work/qt-embedded-free-3.3.4/tools/qvfb/Makefile

Then update the CFLAGS, CXXFLAGS and LIBS so that it looks like:
Code:
CFLAGS   = -pipe -I${QTDIR}/include/private -I/usr/include/mysql -fno-exceptions -Wall -W -O2  -DQT_NO_DEBUG -DQT_SHARED
CXXFLAGS = -pipe -I${QTDIR}/include/private -fno-exceptions -fno-rtti -I/usr/include/mysql -fno-exceptions -Wall -W -O2  -DQT_NO_DEBUG -DQT_SHARED
LIBS     = $(SUBLIBS) -L/usr/lib/mysql -L/usr/qt/3/lib -lqt -ldl


Since qt-embedded requires the missing uic utility, Did a symbolic link from QT bin
Code:
# ln -s /usr/qt/3/bin/uic /var/tmp/portage/qt-embedded-3.3.4/work/qt-embedded-free-3.3.4/bin/uic


Now to build the qvfb ... (cymbal crashes)...Went into the qvfb source directory and did the following
Code:
# cd /var/tmp/portage/qt-embedded-3.3.4/work/qt-embedded-free-3.3.4/tools/qvfb
# make



I copied the qvfb into $QTEDIR/tools directory AND $QTDIR/bin (for ease of use),
Code:
# cp qvfb $QTDIR/bin/qvfb
#cp qvfb $QTEDIR/tools/qvfb


As an insurance... I also deleted the following files (i knew this by using strace from prior debugging session)
Code:
# rm /tmp/.qtvfb_mouse-0
# rm /tmp/.qtvfb_keyboard-0

then logged out of root and retried this...
Code:
$ /usr/qt/3/bin/qvfb



Then it's time to run the qvfb. I did this
Code:
# ${QTDIR}/bin/qvfb -width 480 -height 320 -depth 1

Quote:
Note: You may have to log out of root, especially if your X-window is owned by a non-root. I've tried to do 'xhost +' but it won't work.
Here's what happened if you tried to...
Code:
# qvfb
Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
Using display 0
Qt/Embedded data directory is not owned by user 0

Ohhhhkay... So don't try to run qvfb under an account that doesn't own its own X11 session.


A VIRTUAL WINDOW APPEARS! Yeah! Yes! YESSSSS-SIRRREEE! Me bad... For most of you folks, you can stop there and start window development.

Since I want VNC or qvfb and don't need the mouse, I went back to the whole beginning and tweaked the ebuild file to include the following options:
Code:
        -no-mouse-pc -no-mouse-bus -no-mouse-linuxtp \
        -no-mouse-yopy -no-mouse-vr41xx \


Does anyone else have better luck than me in deciphering TrollishTech documentation?
_________________
Clusters of Fry's Special, AMD 2200, 2 GB DDR, 220 GB (2008.1/desktop, stage 1, -O3) x8
HP Compaq Fry's SPecial, AMD 2100, 2 GB DDR, 260 GB (2008.0/server, stage 1, -O3)
Ultra Sparc 5, 256MB, 3GB (2006.1/server, stage 1, -O3)


Last edited by egberts on Sat Dec 03, 2005 8:05 am; edited 12 times in total
Back to top
View user's profile Send private message
krapansky
n00b
n00b


Joined: 15 Mar 2005
Posts: 31
Location: Budapest, Hungary

PostPosted: Fri Nov 11, 2005 7:26 pm    Post subject: Reply with quote

Thx for howto, I could build qvfb, but it exits with seg fault :(
(version 3.3.4-r1)
I wonder if someone has luck with it.
Back to top
View user's profile Send private message
egberts
Guru
Guru


Joined: 04 Nov 2003
Posts: 357
Location: Dimmed Cathode Ray Tube

PostPosted: Fri Nov 11, 2005 9:42 pm    Post subject: Reply with quote

You can try using 'emerge strace' and perform the following:

Code:
strace qvfb

_________________
Clusters of Fry's Special, AMD 2200, 2 GB DDR, 220 GB (2008.1/desktop, stage 1, -O3) x8
HP Compaq Fry's SPecial, AMD 2100, 2 GB DDR, 260 GB (2008.0/server, stage 1, -O3)
Ultra Sparc 5, 256MB, 3GB (2006.1/server, stage 1, -O3)
Back to top
View user's profile Send private message
krapansky
n00b
n00b


Joined: 15 Mar 2005
Posts: 31
Location: Budapest, Hungary

PostPosted: Fri Nov 11, 2005 10:56 pm    Post subject: Reply with quote

egberts wrote:
You can try using 'emerge strace' and perform the following:

Code:
strace qvfb


yes, I did it, and the result is:
Code:

....
gettimeofday({1131748461, 661918}, NULL) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Back to top
View user's profile Send private message
egberts
Guru
Guru


Joined: 04 Nov 2003
Posts: 357
Location: Dimmed Cathode Ray Tube

PostPosted: Sat Nov 12, 2005 7:55 am    Post subject: Part 2: How to run application under Qt Virtual Framebuffer Reply with quote

Reread the original posting as it has been updated intensively.

Once qvfb is up and running... one can try out all the QtEmbedded example application files. Under gentoo, these files are owned by 'root' so the easiest method is to change the owner/protection bits of these example files:
Code:

# cd /var/tmp/portage/qt-embedded-3.3.4
# chown -R john:users * .


Log out of root (and into the X11 owner session)
Code:
# exit
$

Now we can fire up the virtual frame buffer in your embedded screen-size and depth specification
Quote:
${QTDIR}/qvfb -width 480 -height 320 -depth 32 &


Then go over to the example directory
# cd /var/tmp/portage/qt-embedded-3.3.4/work/qt-embedded-3.3.4/examples/

Quote:
Note: Many of the example codes require a depth of 32 (of which I did not include in my build procedure as my setup example only covers 1 or 16.)

_________________
Clusters of Fry's Special, AMD 2200, 2 GB DDR, 220 GB (2008.1/desktop, stage 1, -O3) x8
HP Compaq Fry's SPecial, AMD 2100, 2 GB DDR, 260 GB (2008.0/server, stage 1, -O3)
Ultra Sparc 5, 256MB, 3GB (2006.1/server, stage 1, -O3)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum