← Back to team overview

multi-touch-dev team mailing list archive

Re: "frequently send multitouch events" leads to X crash.

 

On 05/03/2011 05:19 AM, peng zhang wrote:
> Hi, folks,
> 
> I have a simple app which emulate multitouch events by send continous MT
> event to /dev/input/eventX (that file related with real touch device.),
> but after a while, that would lead to the X crash.
> Even I already reduce the frequency to 3 times per second, or even one
> per second, those events sent to /dev/input/eventX as below (send the
> whole sequence 3/s or 1/s and wait for several mins): 
> 
> /* emulate finger 1*/
> event.type = EV_ABS;
> event.code = ABS_MT_TRACKING_ID;
> event.value = 1;
> write(fd, &event, sizeof(struct input_event));
> 
> event.type = EV_ABS;
> event.code = ABS_MT_POSITION_X;
> event.value = 1000;
> write(fd, &event, sizeof(struct input_event));
> 
> event.type = EV_ABS;
> event.code = ABS_MT_POSITION_Y;
> event.value = 1000;
> write(fd, &event, sizeof(struct input_event));
> 
> event.type = EV_SYN;
> event.code = SYN_MT_REPORT;
> event.value = 0;
> write(fd, &event, sizeof(struct input_event));
> 
> /* emulate finger 2*/
> ...
> 
> event.type = EV_SYN;
> event.code = SYN_REPORT;
> event.value = 0;
> write(fd, &event, sizeof(struct input_event));
> 
> I can read back those events from the /dev/input/eventX by evtest.
> 
> After several mins (at most 15 mins), the X crash with many info in log
> like: 
> [  3967.109] (EE) libmtdev sent SYN_MT_REPORT(EE) libmtdev sent
> SYN_MT_REPORT(EE)
> (many many "(EE) libmtdev sent SYN_MT_REPORT").
> 
> Some backtrace like:
> Fatal server error:
> [  4054.156] Wrong event type 0.
>  and 
> [  4054.194] 0: /usr/bin/Xorg (xorg_backtrace+0x3c) [0x809c4cc]
> [  4054.194] 1: /usr/bin/Xorg (0x8047000+0x64396) [0x80ab396]
> [  4054.195] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0xb777640c]
> [  4054.195] 3: /usr/lib/libmtdev.so.1 (mtdev_empty+0xd) [0xb5cacc0d]
> [  4054.195] 4: /usr/lib/libmtdev.so.1 (mtdev_get+0x63) [0xb5cacce3]
> 
> 
> But interface with touchpanel with real fingers doesn't lead to this issue. 
> Anything wrong with above emulation steps?

I've not heard of any crashes like this in real world usage, but your
methods seem reasonable. I would suggest filing a bug on launchpad.net:

https://bugs.launchpad.net/mtdev/+filebug

Thanks!

-- Chase


Follow ups

References