Skip to contentSkip to conversation

qt4-embedded & tslib

PATCH In review Eric Bénard 3 participants 12 messages Sep 6, 2009 – Sep 25, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

in order to get gt4-embedded working with tslib, I had to do the following change.
Without this, tslib loads properly the module_raw (input in my case) but none of the module (pthres, linear & co) defined in ts.conf (despite the fact ts_test & co are running fine).

Eric

recipes/qt4/qt4-embedded.inc +2 -4
index 95b770a..91b2a6b 100644
@@ -4,7 +4,7 @@ LICENSE = "GPL QPL"
 PRIORITY = "optional"
 HOMEPAGE = "http://www.trolltech.com"
 DEPENDS += "directfb tslib"
-INC_PR = "r14"
+INC_PR = "r15"
 
 QT_BASE_NAME ?= "qt4-embedded"
 QT_BASE_LIB  ?= "libqt-embedded"
@@ -30,7 +30,7 @@ QT_CONFIG_FLAGS += " \
     -qtlibinfix ${QT_LIBINFIX} \
     -qt-decoration-styled -plugin-decoration-default 
-plugin-decoration-windows \
     -plugin-gfx-transformed -plugin-gfx-qvfb -plugin-gfx-vnc 
-plugin-gfx-directfb \
-    -plugin-mouse-tslib -qt-mouse-pc -qt-mouse-qvfb \
+    -qt-mouse-tslib -qt-mouse-pc -qt-mouse-qvfb \
     -qt-kbd-tty -qt-kbd-usb -qt-kbd-qvfb \
     -DQT_KEYPAD_NAVIGATION \
     "
#1 lore raw
Quoted 7 lines · On Sunday 06 September 2009 14:31:36 Eric Bénard wrote:

Hi,

in order to get gt4-embedded working with tslib, I had to do the following change.
Without this, tslib loads properly the module_raw (input in my case) but none of the module (pthres, linear & co) defined in ts.conf (despite the fact ts_test & co are running fine).

Please google for the QWS_MOUSE_PROTO environement variable... tslib support is built as a plugin and Qt needs to be instructed to load it.

regards

	z.

PS: http://qt.nokia.com/doc/4.5/qt-embedded-envvars.html

#2 lore raw
Quoted 7 lines · Holger Hans Peter Freyther
Quoted 3 lines · On Sunday 06 September 2009 14:31:36 Eric Bénard wrote:

Without this, tslib loads properly the module_raw (input in my case) but none of the module (pthres, linear & co) defined in ts.conf (despite the fact ts_test & co are running fine).

Please google for the QWS_MOUSE_PROTO environement variable... tslib support is built as a plugin and Qt needs to be instructed to load it.

of course, without this variable it's not loaded at all.
But even with this variable, it doesn't work for me with -plugin-mouse-tslib but works with -qt-mouse-tslib. I tried :
tslib:/dev/input/event0 & tslib:/dev/input/touchscreen0

In fact, the module_raw (input) is properly loaded (which means QT was instructed by QWS_MOUSE_PROTO to use tslib and TSLIB_PLUGINDIR is properly set) but the other modules (pthres, linear & co) are not properly loaded (from what I saw with strace they are found, opened, and closed). If I comment out all the modules (not module_raw) from ts.conf everything is properly loaded but of course tslib gives raw values to QT so touchscreen is unusable.

Eric

#3 lore raw
Quoted 14 lines · Eric Bénard
Quoted 7 lines · Holger Hans Peter Freyther
Quoted 3 lines · On Sunday 06 September 2009 14:31:36 Eric Bénard wrote:

Without this, tslib loads properly the module_raw (input in my case) but none of the module (pthres, linear & co) defined in ts.conf (despite the fact ts_test & co are running fine).

Please google for the QWS_MOUSE_PROTO environement variable... tslib support is built as a plugin and Qt needs to be instructed to load it.

of course, without this variable it's not loaded at all. But even with this variable, it doesn't work for me with -plugin-mouse-tslib but works with -qt-mouse-tslib. I tried :
tslib:/dev/input/event0 & tslib:/dev/input/touchscreen0

Quoted 3 lines

In fact, the module_raw (input) is properly loaded (which means QT was instructed by QWS_MOUSE_PROTO to use tslib and TSLIB_PLUGINDIR is properly set) but the other modules (pthres, linear & co) are not properly loaded (from what I saw with strace they are found, opened, and closed). If I comment out all the modules (not module_raw) from ts.conf everything is properly loaded but of course tslib gives raw values to QT so touchscreen is unusable.

Eric

Actually, the problem is that tslib is linked incorrectly.
The pthres, linear, etc. modules are not linked to libts so theyre missing symbols when an attempt is made to load them. To confirm, do

LD_PRELOAD=/usr/lib/libts-1.0.so.0 <args>

tslib modules will resolve symbols properly so tslib will work.

A quick patch to tslib to link those modules against libts is below. A little dirty linking against the static libs, but it works!

Add to tslib_1.0.bb SRC_URI.

~Matt

plugins/Makefile.am +4 -0
@@ -107,15 +107,19 @@ pluginexec_LTLIBRARIES = \
 
 variance_la_SOURCES    = variance.c
 variance_la_LDFLAGS    = -module $(LTVSN)
+variance_la_LIBADD     = $(top_builddir)/src/libts.la
 
 dejitter_la_SOURCES    = dejitter.c
 dejitter_la_LDFLAGS    = -module $(LTVSN)
+dejitter_la_LIBADD     = $(top_builddir)/src/libts.la
 
 linear_la_SOURCES      = linear.c
 linear_la_LDFLAGS      = -module $(LTVSN)
+linear_la_LIBADD       = $(top_builddir)/src/libts.la
 
 pthres_la_SOURCES      = pthres.c
 pthres_la_LDFLAGS      = -module $(LTVSN)
+pthres_la_LIBADD       = $(top_builddir)/src/libts.la
 
 # hw access
 corgi_la_SOURCES       = corgi-raw.c
#4 lore raw

Hi Matthew,

Quoted 2 lines · Matthew Dombroski

Actually, the problem is that tslib is linked incorrectly.
The pthres, linear, etc. modules are not linked to libts so theyre missing symbols when an attempt is made to load them.

ts_calibrate & ts_test are working fine : doesn't is mean the modules are properly linked ?

Quoted 6 lines

To confirm, do

LD_PRELOAD=/usr/lib/libts-1.0.so.0 <args>

tslib modules will resolve symbols properly so tslib will work.

I'll try this and tell you the result.

Thanks
Eric

#5 lore raw
Quoted 7 lines · Eric Bénard

Hi Matthew,

Quoted 2 lines · Matthew Dombroski

Actually, the problem is that tslib is linked incorrectly.
The pthres, linear, etc. modules are not linked to libts so theyre missing symbols when an attempt is made to load them.

ts_calibrate & ts_test are working fine : doesn't is mean the modules are properly linked ?

ldd says not:

$ ldd dejitter.so
libc.so.6 => /lib/libc.so.6 (0x4000a000)
/lib/ld-linux.so.3 (0x2a000000)

With my patch:

$ ldd dejitter.so
libts-1.0.so.0 => /usr/lib/libts-1.0.so.0 (0x4000a000)
libdl.so.2 => /lib/libdl.so.2 (0x40014000)
libc.so.6 => /lib/libc.so.6 (0x4001f000)
/lib/ld-linux.so.3

I'm not sure why Qt is the only place it fails (unlinked). My opinion is that linking properly is technically better.

~Matt

#6 lore raw
Quoted 19 lines · On Thursday 10 September 2009 00:02:07 Matthew Dombroski wrote:
Quoted 9 lines · Eric Bénard

Hi Matthew,

Quoted 3 lines · Matthew Dombroski

Actually, the problem is that tslib is linked incorrectly. The pthres, linear, etc. modules are not linked to libts so theyre missing symbols when an attempt is made to load them.

ts_calibrate & ts_test are working fine : doesn't is mean the modules are properly linked ?

ldd says not:

$ ldd dejitter.so
libc.so.6 => /lib/libc.so.6 (0x4000a000)
/lib/ld-linux.so.3 (0x2a000000)

With my patch:

Quoted 8 lines
$ ldd dejitter.so
libts-1.0.so.0 => /usr/lib/libts-1.0.so.0 (0x4000a000)
libdl.so.2 => /lib/libdl.so.2 (0x40014000)
libc.so.6 => /lib/libc.so.6 (0x4001f000)
/lib/ld-linux.so.3

I'm not sure why Qt is the only place it fails (unlinked). My opinion is that linking properly is technically better.

Can you provide us with the output of the failure?

#7 lore raw
Quoted 29 lines · Holger Hans Peter Freyther
Quoted 27 lines · On Thursday 10 September 2009 00:02:07 Matthew Dombroski wrote:
Quoted 11 lines · Eric Bénard

Hi Matthew,

Quoted 4 lines · Matthew Dombroski

Actually, the problem is that tslib is linked incorrectly. The pthres, linear, etc. modules are not linked to libts so theyre missing symbols when an attempt is made to load them.

ts_calibrate& ts_test are working fine : doesn't is mean the modules are properly linked ?

ldd says not:

$ ldd dejitter.so
libc.so.6 =>  /lib/libc.so.6 (0x4000a000)
/lib/ld-linux.so.3 (0x2a000000)

With my patch:

$ ldd dejitter.so
libts-1.0.so.0 =>  /usr/lib/libts-1.0.so.0 (0x4000a000)
libdl.so.2 =>  /lib/libdl.so.2 (0x40014000)
libc.so.6 =>  /lib/libc.so.6 (0x4001f000)
/lib/ld-linux.so.3
Quoted 3 lines
Quoted 3 lines

I'm not sure why Qt is the only place it fails (unlinked). My opinion is that linking properly is technically better.

Hmm... tslib svn has fixed it anyway.
See http://svn.berlios.de/viewcvs/tslib/trunk/tslib/plugins/Makefile.am?revision=56&view=markup

Quoted 2 lines

Can you provide us with the output of the failure?

runtime failure:

# app  -qws
Couldnt load module pthres
QWSTslibMouseHandlerPrivate: ts_config() failed with error: 'No such file or directory'
Please check your tslib installation!

My tslib installation is fine.

~Matt

#8 lore raw
Quoted 11 lines · Matthew Dombroski
Quoted 2 lines · Holger Hans Peter Freyther

Can you provide us with the output of the failure?

runtime failure:

# app  -qws
Couldnt load module pthres
QWSTslibMouseHandlerPrivate: ts_config() failed with error: 'No such file or directory'
Please check your tslib installation!

same thing here. I'll send you the strace later.

Eric

#9 lore raw

PATCH 1/1 qt4-embedded & tslib

In reply to Matthew Dombroski

Hi,

Quoted 11 lines · Matthew Dombroski

Actually, the problem is that tslib is linked incorrectly.
The pthres, linear, etc. modules are not linked to libts so theyre missing symbols when an attempt is made to load them. To confirm, do

LD_PRELOAD=/usr/lib/libts-1.0.so.0 <args>

tslib modules will resolve symbols properly so tslib will work.

A quick patch to tslib to link those modules against libts is below. A little dirty linking against the static libs, but it works!

in fact, the patch you sent on the list was integrated into tslib in november 2008 :
http://svn.berlios.de/viewcvs/tslib/trunk/tslib/plugins/Makefile.am?r1=51&r2=56

Please find attached a patch to add this patch to the tslib's recipe.

Best regards
Eric

recipes/tslib/tslib/tslib-pluginsld.patch new file +36 -0
new file mode 100644
index 0000000..37ef808
@@ -0,0 +1,36 @@
+ plugins/Makefile.am |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/plugins/Makefile.am b/plugins/Makefile.am
+index 3b902c2..4c4ef8b 100644
+--- a/plugins/Makefile.am
++++ b/plugins/Makefile.am
+@@ -114,15 +114,19 @@ pluginexec_LTLIBRARIES = \
+   
+ variance_la_SOURCES	= variance.c
+ variance_la_LDFLAGS	= -module $(LTVSN)
++variance_la_LIBADD	= $(top_builddir)/src/libts.la
+   
+ dejitter_la_SOURCES	= dejitter.c
+ dejitter_la_LDFLAGS	= -module $(LTVSN)
++dejitter_la_LIBADD	= $(top_builddir)/src/libts.la
+   
+ linear_la_SOURCES	= linear.c
+ linear_la_LDFLAGS	= -module $(LTVSN)
++linear_la_LIBADD	= $(top_builddir)/src/libts.la
+ 
+ pthres_la_SOURCES	= pthres.c
+ pthres_la_LDFLAGS	= -module $(LTVSN)
++pthres_la_LIBADD	= $(top_builddir)/src/libts.la
+ 
+ # hw access
+ corgi_la_SOURCES	= corgi-raw.c
+@@ -148,6 +152,7 @@ tatung_la_LDFLAGS	= -module $(LTVSN)
+ 
+ input_la_SOURCES	= input-raw.c
+ input_la_LDFLAGS	= -module $(LTVSN)
++input_la_LIBADD	  = $(top_builddir)/src/libts.la
+ 
+ linear_h2200_la_SOURCES	= linear-h2200.c
+ linear_h2200_la_LDFLAGS	= -module $(LTVSN)
+
recipes/tslib/tslib_1.0.bb +3 -2
index 1929ee0..bbd4793 100644
@@ -1,6 +1,7 @@
 SRC_URI = "http://download.berlios.de/tslib/${BP}.tar.bz2 \
            file://fix_version.patch;patch=1 \
-           file://tslib-nopressure.patch;patch=1"
-PR = "${INC_PR}.2"
+           file://tslib-nopressure.patch;patch=1 \
+	   file://tslib-pluginsld.patch;patch=1"
+PR = "${INC_PR}.3"
 
 include tslib.inc
#10 lore raw
Quoted 20 lines · On Thursday 24 September 2009 21:02:10 Eric Bénard wrote:

Hi,

Quoted 11 lines · Matthew Dombroski

Actually, the problem is that tslib is linked incorrectly. The pthres, linear, etc. modules are not linked to libts so theyre missing symbols when an attempt is made to load them. To confirm, do

LD_PRELOAD=/usr/lib/libts-1.0.so.0 <args>

tslib modules will resolve symbols properly so tslib will work.

A quick patch to tslib to link those modules against libts is below. A little dirty linking against the static libs, but it works!

in fact, the patch you sent on the list was integrated into tslib in november 2008 :
http://svn.berlios.de/viewcvs/tslib/trunk/tslib/plugins/Makefile.am?r1=51&r
2=56

Quoted 5 lines

Please find attached a patch to add this patch to the tslib's recipe.

Best regards
Eric

PS: This will be unlikely tracked by patchwork. Could you try in the future to send a patch from git format-patch and add a signed-off-by line so landing the patch will be more easy.

#11 lore raw
Quoted 2 lines · Holger Hans Peter Freyther

PS: This will be unlikely tracked by patchwork. Could you try in the future to send a patch from git format-patch and add a signed-off-by line so landing the patch will be more easy.

OK I'll do for the next patch

Thanks,
Eric