Touchscreen Slow motion in DirectFB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Touchscreen Slow motion in DirectFB

2,747 Views
zhanxiaozhang
Contributor III

I use the freescale LTIB DirectFB example with touch screen(USE TSLIB DRIVER),without report BTN_TOUCH event ,I can not achieve the button click on the screen ,but it can achieve button click in x-windows(openbox).

Within DirectFB example ,when i touch and move ,the cursor move slowly(it can move ,but some delay),does anyone have experience on the DirectFB and touch screen?(I use Vernoix touch screen with GSL2680)

0 Kudos
8 Replies

1,032 Views
juangutierrez
NXP Employee
NXP Employee

Hi

I got some information about how to build DirectFB with Touchscreen support.

I have not tried yet, so I'm not sure it will be the same, or some modifications needs to be done, but I think it will be a useful to post the information here, so maybe you get some clues about what is missing.

Also consider that this is for  sabrelite BSP 12.01

How to build DirectFB with touch support from scratch in BSP 12.01

Select the following packages in ./ltib -c:

  1. Gpu-viv-bin-mx6q
  2. Do not select any DirectFB packages J

Apply the DirectFB patch (attached)

Install automake 1.7.6 in your host machine (attached)

For tslib

Do $./ltib –m prep –p tslib

To fix “couldnt load module pthres” error when running dfbinfo, modify ltib/rpm/BUILD/tslib-1.0/plugins/Makefile.am by adding the following lines:

line 108:

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

Then do scbuild and MAKE SURE the command automake-1.7 is successfully called. This will regenerate the makefile so DirectFB can see tslib (hence use it)

Do scdeploy

For DirectFB

We need to make sure the /usr/lib/directfb-1.4-0/inputdrivers/libdirectfb_tslib.so is being created. First edit DirectFB.spec located in ltib/dist/lfs-5.1/DirectFB:

This could be done more elegantly, but for lines 28 and on, add this:

if [ -n "$PKG_DIRECTFB_WANT_TS" ]

then

    TSOPTS="--with-inputdrivers=tslib"

else

    TSOPTS="--with-inputdrivers=tslib"

Then do ./ltib –p DirectFB –m prep and in ltib/rpm/BUILD/DirectFB-1.0.4/configure change every “tslib-0.0” to “tslib-1.0”.

Do scbuild and scdeploy, then make sure libdirectfb_tslib.so is there.

Now you can boot ltib and do the following (on your target):

$ export TSLIB_TSDEVICE=/dev/input/ts0

$ modprobe galcore

$ /usr/bin/dfbinfo

You should see something like this (important bits highlighted in yellow):

root@freescale ~$ dfbinfo

~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.4.0 |~~~~~~~~~~~~~~~~~~~~~~~~~~

(c) 2001-2009  The world wide DirectFB Open Source Community

(c) 2000-2004  Convergence (integrated media) GmbH

----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2012-04-09 19:05)

(*) Direct/Memcpy: Using libc memcpy()

(*) Direct/Thread: Started 'VT Switcher' (2529) [CRITICAL OTHER/OTHER 0/0] <8388608>...

(*) Direct/Thread: Started 'VT Flusher' (-1) [DEFAULT OTHER/OTHER 0/0] <8388608>...

(*) DirectFB/FBDev: Found 'DISP4 BG' (ID 0) with frame buffer at 0x18800000, 3072k (MMIO 0x00000000, 0k)

(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...

(*) DirectFB/Input: gpio-keys (1) 0.1 (directfb.org)

(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...

(*) DirectFB/Input: eGalax Touch Screen (2) 0.1 (directfb.org)

(*) Direct/Thread: Started 'Keyboard Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...

(*) DirectFB/Input: Keyboard 0.9 (directfb.org)

(*) Direct/Thread: Started 'tslib Input' (2534) [INPUT OTHER/OTHER 0/0] <8388608>...

(*) DirectFB/Input: tslib touchscreen 0 0.1 (tslib)

(*) Using the default feature settings.

(*) DirectFB/Graphics: Vivante unknown chip model 1.0 (Vivante)

(*) DirectFB/Core/WM: Default 0.3 (directfb.org)

(*) FBDev/Mode: Setting 1024x768 RGB16

(*) FBDev/Mode: Switched to 1024x768 (virtual 1024x1536) at 16 bit (RGB16), pitch 2048

(*) FBDev/Surface: Allocated 1024x768 16 bit RGB16 buffer (index 0) at offset 0 and pitch 2048.

(*) FBDev/Surface: Allocated 1024x768 16 bit RGB16 buffer (index 1) at offset 1572864 and pitch 2048.

Screen (00) FBDev Primary Screen (primary screen)

   Caps: VSYNC POWER_MANAGEMENT

     Layer (00) FBDev Primary Layer (primary layer)

Type:    GRAPHICS

Caps:    SURFACE BRIGHTNESS CONTRAST SATURATION

Input (10) gpio-keys

   Type:

   Caps:

Input (01) eGalax Touch Screen (primary mouse)

   Type: MOUSE

   Caps: AXES

   Max. Axis: 1

Input (00) Keyboard (primary keyboard)

   Type: KEYBOARD

   Caps: KEYS

   Min. Keycode: 0

   Max. Keycode: 127

Input (11) tslib touchscreen 0

   Type: MOUSE

   Caps: AXES BUTTONS

   Max. Axis: 1

   Max. Button: 0

To correctly build the DirectFB-examples package, you need to do the following:

  1. Modify DirectFB-examples.spec file located in ltib/dist/lfs-5.1/DirectFB
    1. Add –DDIRECTFB_ENABLE_DEPRECATED to export DIRECTFB_CFLAGS="-D_REENTRANT -D_GNU_SOURCE -DDIRECTFB_ENABLE_DEPRECATED -I$DEV_IMAGE/%{_prefix}/include/directfb"
  2. Enter the following command: $./ltib –m prep –p DirectFB-examples
  3. Edit the file “ve.c” under …/ltib/rpm/BUILD/DirectFB-examples-0.9.23/src,
    1. Comment line 652: //D_HEAVYDEBUG( "VB/Adding: %7.3f, %7.3f, %7.3f  [%.3f, %.3f]\n", x, y, z, s, t );
    2. Comment lines 863 to 866:
    3. //if (count == 4)
    4. //D_HEAVYDEBUG( "VB/Build:   %d, %d, %d, %d\n", input[0], input[1], input[2], input[3] );
    5. //else
    6. //D_HEAVYDEBUG( "VB/Build:   %d, %d, %d\n", input[0], input[1], input[2] );
  4. Enter the following command: $./ltib –m scbuild –p DirectFB-examples
  5. Enter the following command: $./ltib –m scdeploy –p DirectFB-examples

Now boot your setup and run a test application:

$ export TSLIB_TSDEVICE=/dev/input/ts0

$ modprobe galcore

$ /usr/bin/df_input

0 Kudos

1,032 Views
zhanxiaozhang
Contributor III

do you have source code patch for the libdirectfb_gal.so ?

0 Kudos

1,032 Views
juangutierrez
NXP Employee
NXP Employee

No, I don hace it.

Does it work for you with the binary?

If it does I can investigate about the patch.

0 Kudos

1,032 Views
zhanxiaozhang
Contributor III

it does very well

0 Kudos

1,032 Views
zhanxiaozhang
Contributor III

when I use your tslib patch:

o fix “couldnt load module pthres” error when running dfbinfo, modify ltib/rpm/BUILD/tslib-1.0/plugins/Makefile.am by adding the following lines:

line 108:

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

I can not scdeploy the tslib :


libtool: install: error: cannot install `linear.la' to a directory not ending in /usr/lib/ts/

make[2]: *** [install-pluginexecLTLIBRARIES] Error 1

make[2]: Leaving directory `/home/zgh/workspace/imx6/4_0release/source/ltib/rpm/BUILD/tslib-1.0/plugins'

make[1]: *** [install-am] Error 2

make[1]: Leaving directory `/home/zgh/workspace/imx6/4_0release/source/ltib/rpm/BUILD/tslib-1.0/plugins'

make: *** [install-recursive] Error 1

error: Bad exit status from /home/zgh/workspace/imx6/4_0release/source/ltib/tmp/rpm-tmp.73178 (%install)

RPM build errors:

    Bad exit status from /home/zgh/workspace/imx6/4_0release/source/ltib/tmp/rpm-tmp.73178 (%install)

Build time for tslib: 0 seconds

Failed building tslib

f_scdeploy() returned an error, exiting

traceback:

main:572

Exiting on error or interrupt

Can u give me some advice?



0 Kudos

1,032 Views
juangutierrez
NXP Employee
NXP Employee

Hi

i tried to set the environment but I'm not able to make the touchscreen working at all with DirectFB.

Which FS are you using, fsl_gnome or minimal configuration?

Did you set some env variables?

0 Kudos

1,032 Views
zhanxiaozhang
Contributor III

It's none of business of FS ,you should add TSLIB_CONFFILE (ts.conf) TSLIB_PLUGINDIR (tslib lib location) TSLIB_TSDEVICE (/dev/input/event*---your touchscreen device)

0 Kudos

1,032 Views
karina_valencia
NXP Apps Support
NXP Apps Support

No more  information from customer.

0 Kudos