Bug 14057 - xf86-input-fpit crashes/fails with Xserver 1.4
Summary: xf86-input-fpit crashes/fails with Xserver 1.4
Status: VERIFIED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/fpit (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-13 08:07 UTC by Brice Goglin
Modified: 2008-05-08 19:20 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
random patches trying to make fpit work again (3.45 KB, patch)
2008-01-29 19:20 UTC, Peter Hutterer
no flags Details | Splinter Review
the source I actually ran 2008/01/30 (19.69 KB, text/plain)
2008-01-30 11:13 UTC, TreeBoy
no flags Details
the source I ran 2008/03/05 (22.11 KB, text/x-csrc)
2008-03-05 10:38 UTC, TreeBoy
no flags Details
Patch for current git tree (3.11 KB, patch)
2008-04-07 23:34 UTC, Peter Hutterer
no flags Details | Splinter Review

Description Brice Goglin 2008-01-13 08:07:23 UTC
Bug reported by "TreeBoy" at the URL above 3 weeks ago, same diagnostic observed by another user. Config and log available at the URL above.

He says:
When running X everything is fine until I touch the touchscreen when X dies.
The system is unusable as the display does not refresh and all I see is the non-updating X server window, even though all X processes are no longer running.
If I connect from another PC, I get an error along the lines of "Undefined
function IsCorePointer"

jcristau told him to try the following patch to fix this error:
http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=fpit-xserver-1.4.diff;att=1;bug=457722

It fixed the crash but the touchscreen still does not work:
"Unfortunately, the touchscreen no longer does anything. If I cat /dev/ttyS1 I do see data, but the mouse pointer doesn't respond at all."

He also tried setting is_core_pointer to 0, but it didn't help.
Comment 1 Peter Hutterer 2008-01-13 16:35:28 UTC
I think the driver needs work with the conv_x/conv_y until the scaling is back in the server. ATM it wouldn't work too well. See #10324

Aside from that, I think the call to xf86XInputSetScreen can be removed. 

Can you give those two a try and see if it changes anything. I don't see anything wrong in the driver other than the scaling thing.
Comment 2 Peter Hutterer 2008-01-28 16:52:25 UTC
ping?
Comment 3 Brice Goglin 2008-01-28 23:20:33 UTC
The submitter replied yesterday on the Debian BTS, here's what he says:

I have now tried commenting out the "xf86XInputSetScreen" call which I found 
on line 259.

I tried it with the unadulterated Debian source which caused X to hang: I 
could only restart the machine by holding down the power button.

I then tried it both with the "is_core_pointer=0" and 
with "is_core_pointer=1". They both produced the same result which is the 
last result I described: no pointer movement but output appearing 
from "cat /dev/ttyS1".

I'm afraid that I do not understand what "try those two" mean. I presume that 
the second item is related to freedesktop bug 10324, but I could not identify 
the test.

Many thanks for all your help.

(Sorry about the delay in responding, I have been forced to live outside of my 
home for the last two weeks due to leaking from an upstairs neighbour. This 
shall mean that I shall also be away from my home between 2nd Feb and 23 Feb 
while the serious work is done on repairs.)
Comment 4 Peter Hutterer 2008-01-29 19:20:30 UTC
Created attachment 14026 [details] [review]
random patches trying to make fpit work again

Please give the above patches a try. I don't know if they work, but they may just do.

If the pointer still doesn't move, put an ErrorF("....") in before posting events (look for xf86PostMotionEvent) and print the conv_x/conv_y coordinates.
Comment 5 TreeBoy 2008-01-30 11:11:05 UTC
Hi.

I'm the original reporter on Debian.

I have tried the patch you have supplied and I get the same problem as last described: no mouse pointer movement, but I can see output going through /dev/ttyS1

I noticed while compiling that there were a couple of problems:

dpkg-shlibdeps: warning: symbol xf86PostButtonEvent used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol xf86Msg used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol RemoveEnabledDevice used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol xf86RemoveEnabledDevice used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol InitValuatorClassDeviceStruct used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol xf86SetIntOption used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol Xfree used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol xf86XInputSetScreen used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol InitFocusClassDeviceStruct used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: symbol xf86CollectInputOptions used by debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in none of the libraries.
dpkg-shlibdeps: warning: 25 other similar warnings have been skipped (use -v to see them all).
dh_gencontrol
dpkg-gencontrol: warning: unknown substitution variable ${misc:Depends}
dh_md5sums
dh_builddeb
dpkg-deb: building package `xserver-xorg-input-fpit' in `../xserver-xorg-input-fpit_1.1.0-3+3_i386.deb'.
 dpkg-genchanges  >../xserver-xorg-input-fpit_1.1.0-3+3_i386.changes
dpkg-genchanges: not including original source code in upload
dpkg-buildpackage: binary and diff upload (original source NOT included)

**END

I don't know if this is relevant, but I thought I would add it.

Many thanks for your assistance.
TreeBoy

Comment 6 TreeBoy 2008-01-30 11:13:39 UTC
Created attachment 14040 [details]
the source I actually ran 2008/01/30

This is the file that I ran.

The diff that you provided did not match my source: I do not know why they are so different, but I hope that this helps.
Comment 7 Peter Hutterer 2008-01-30 18:21:43 UTC
(In reply to comment #5)
> Hi.
> 
> I'm the original reporter on Debian.
> 
> I have tried the patch you have supplied and I get the same problem as last
> described: no mouse pointer movement, but I can see output going through
> /dev/ttyS1
> 
> I noticed while compiling that there were a couple of problems:
> 
> dpkg-shlibdeps: warning: symbol xf86PostButtonEvent used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
[...]

this is a setup issue. all these functions are defined in the xserver. maybe you're lacking xserver-dev or something like that?
but they're not really a problem.


(In reply to comment #6)
> Created an attachment (id=14040) [details]
> the source I actually ran 2008/01/30
> 
> This is the file that I ran.
> 
> The diff that you provided did not match my source: I do not know why they are
> so different, but I hope that this helps.

the one I posted is the one for git master. Please get the driver from git://anongit.freedesktop.org/git/xorg/driver/xf86-input-fpit, otherwise it'll make debugging even harder.

Comment 8 Julien Cristau 2008-01-31 11:00:53 UTC
(In reply to comment #5)
> I noticed while compiling that there were a couple of problems:
> 
> dpkg-shlibdeps: warning: symbol xf86PostButtonEvent used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol xf86Msg used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol RemoveEnabledDevice used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol xf86RemoveEnabledDevice used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol InitValuatorClassDeviceStruct used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol xf86SetIntOption used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol Xfree used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol xf86XInputSetScreen used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol InitFocusClassDeviceStruct used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.
> dpkg-shlibdeps: warning: symbol xf86CollectInputOptions used by
> debian/xserver-xorg-input-fpit/usr/lib/xorg/modules/input/fpit_drv.so found in
> none of the libraries.

ignore this, it's a bug in dpkg-shlibdeps imo.
Comment 9 Peter Hutterer 2008-02-27 15:29:00 UTC
ping?
Comment 10 TreeBoy 2008-03-05 10:35:52 UTC
Hello.

Sorry about the delay, but I've only just got back home (after having to 
evacuate for building repairs) and got the machine out of storage. I am now 
available every evening after work and so you should find me much more 
responsive.

Anyway: I got the package from the git URI that you provided, but I found that 
the patch that you had provided did not exactly fit with the code that I got 
(version 1.53 for your patch, but 1.6 i git).

I attach the source that I have been using.

I got the same results as before: X runs and the driver is loaded, but no 
movement happens although stuff appears through /dev/ttyS1.

When I added the debug messages, I find that both conv_x and conv_y are always 
zero.

Hope this helps.

Regards
Comment 11 TreeBoy 2008-03-05 10:38:11 UTC
Created attachment 14864 [details]
the source I ran 2008/03/05
Comment 12 Peter Hutterer 2008-04-07 23:34:49 UTC
Created attachment 15749 [details] [review]
Patch for current git tree

The same patches, should apply to the current git tree.

The coordinate conversion has been merged into the server, so this isn't needed anymore. However, if you don't have a recent server from git, your movements may be wrong.
Comment 13 Jon 2008-04-29 13:50:04 UTC
Hi, I am really trying to fix this problem and really appreciate your work so please keep it up and I will test as I can.

If I use the current GIT version of the module, my X doesn't crash but the pointer also doesn't move. As the other poster mentioned catting gives info. If I apply your most recent patch, it crashes my X.

I heard there was a way to compile with a debug switch but I am pretty unexperienced in the area and can basically only apply patches and compile, but want to help solve this issue.

Let me know what else I can do! Thanks!
Comment 14 Jon 2008-04-29 13:53:51 UTC
Do I need to compile the whole X server from GIT? This is what my log says about my current version. I'm on Ubuntu Hardy on a Gateway CX2619.

X.Org X Server 1.4.0.90
Release Date: 5 September 2007
X Protocol Version 11, Revision 0
Build Operating System: Linux Ubuntu (xorg-server 2:1.4.1~git20080131-1ubuntu9)
Current Operating System: Linux MobileStudio 2.6.24-16-rt #1 SMP PREEMPT RT Thu Apr 10 15:15:40 UTC 2008 i686
Build Date: 15 April 2008  05:26:17PM
Comment 15 Jon 2008-04-30 09:04:35 UTC
I can now confirm that the current GIT version works. In xorg.conf, the AlwaysCore entry should not exist, and SendCoreEvents should be set to "true". Also no BaudRate should be set (at least for me).

The only thing that is not working for me is right-clicking. I added
"xsetpointer TOUCHSCREEN
xmodmap -e "pointer = 1 3 2""
to .xinitrc in my home directory. When I do "xsetpointer TOUCHSCREEN" in the console, it says "Extended device TOUCHSCREEN not found"

Otherwise, everything is working. Any guidance on the right-click issue?
Comment 16 Peter Hutterer 2008-04-30 19:11:35 UTC
(In reply to comment #15)
> I can now confirm that the current GIT version works. In xorg.conf, the
> AlwaysCore entry should not exist, and SendCoreEvents should be set to "true".

this has been fixed in the server, was cherry-picked yesterday by jcristau.

> The only thing that is not working for me is right-clicking. I added
> "xsetpointer TOUCHSCREEN
> xmodmap -e "pointer = 1 3 2""
> to .xinitrc in my home directory. When I do "xsetpointer TOUCHSCREEN" in the
> console, it says "Extended device TOUCHSCREEN not found"

try xsetpointer -l and make sure if TOUCHSCREEN is listed in your devices.
Comment 17 Jon 2008-04-30 19:17:30 UTC
(In reply to comment #16)
> (In reply to comment #15)
> > I can now confirm that the current GIT version works. In xorg.conf, the
> > AlwaysCore entry should not exist, and SendCoreEvents should be set to "true".
> 
> this has been fixed in the server, was cherry-picked yesterday by jcristau.
> 
Meaning that once we get the new version of the server, this config will still work, yes? It will just be less picky?

> > The only thing that is not working for me is right-clicking. I added
> > "xsetpointer TOUCHSCREEN
> > xmodmap -e "pointer = 1 3 2""
> > to .xinitrc in my home directory. When I do "xsetpointer TOUCHSCREEN" in the
> > console, it says "Extended device TOUCHSCREEN not found"
> 
> try xsetpointer -l and make sure if TOUCHSCREEN is listed in your devices.
> 
jon@MobileStudio:~$ xsetpointer -l
0: "Virtual core keyboard"	[XKeyboard]
1: "Virtual core pointer"	[XPointer]
2: "Generic Keyboard"	[XExtensionKeyboard]
3: "<default pointer>"	[XExtensionPointer]
4: "TOUCHSCREEN"	[XExtensionPointer]
5: "Synaptics Touchpad"	[XExtensionPointer]
jon@MobileStudio:~$ xsetpointer TOUCHSCREEN
Extended device TOUCHSCREEN not found
jon@MobileStudio:~$ xsetpointer "TOUCHSCREEN"
Extended device TOUCHSCREEN not found

.......
Comment 18 Peter Hutterer 2008-04-30 20:23:15 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > (In reply to comment #15)
> > > I can now confirm that the current GIT version works. In xorg.conf, the
> > > AlwaysCore entry should not exist, and SendCoreEvents should be set to "true".
> > 
> > this has been fixed in the server, was cherry-picked yesterday by jcristau.
> > 
> Meaning that once we get the new version of the server, this config will still
> work, yes? It will just be less picky?

yes, the old handling was simply incorrect.

> jon@MobileStudio:~$ xsetpointer -l
> 0: "Virtual core keyboard"      [XKeyboard]
> 1: "Virtual core pointer"       [XPointer]
> 2: "Generic Keyboard"   [XExtensionKeyboard]
> 3: "<default pointer>"  [XExtensionPointer]
> 4: "TOUCHSCREEN"        [XExtensionPointer]
> 5: "Synaptics Touchpad" [XExtensionPointer]
> jon@MobileStudio:~$ xsetpointer TOUCHSCREEN
> Extended device TOUCHSCREEN not found
> jon@MobileStudio:~$ xsetpointer "TOUCHSCREEN"
> Extended device TOUCHSCREEN not found

this is a bug in xsetpointer. I'm fixing it right now, but with server 1.4 and above xsetpointer is deprecated to a point that it can't do anything but listing the devices. In your case, you don't need this call.

Comment 19 Jon 2008-04-30 20:40:21 UTC
> 
> > jon@MobileStudio:~$ xsetpointer -l
> > 0: "Virtual core keyboard"      [XKeyboard]
> > 1: "Virtual core pointer"       [XPointer]
> > 2: "Generic Keyboard"   [XExtensionKeyboard]
> > 3: "<default pointer>"  [XExtensionPointer]
> > 4: "TOUCHSCREEN"        [XExtensionPointer]
> > 5: "Synaptics Touchpad" [XExtensionPointer]
> > jon@MobileStudio:~$ xsetpointer TOUCHSCREEN
> > Extended device TOUCHSCREEN not found
> > jon@MobileStudio:~$ xsetpointer "TOUCHSCREEN"
> > Extended device TOUCHSCREEN not found
> 
> this is a bug in xsetpointer. I'm fixing it right now, but with server 1.4 and
> above xsetpointer is deprecated to a point that it can't do anything but
> listing the devices. In your case, you don't need this call.
> 
Well, if I take out that line of my .xinitrc, the button on the pen still registers as a middle click, not a right click.
Comment 20 Peter Hutterer 2008-04-30 20:54:32 UTC
(In reply to comment #19)
> Well, if I take out that line of my .xinitrc, the button on the pen still
> registers as a middle click, not a right click.

All this line did was to set the TOUCHSCREEN to be the core pointer. This isn't necessary anymore (and not possible anyway). 

actually - you may want to skip the xmodmap line. It's mapping button 3 to 2, and looking at the fpit code this may be mapping right button to middle button.
Comment 21 Jon 2008-04-30 21:04:16 UTC
(In reply to comment #20)
> (In reply to comment #19)
> > Well, if I take out that line of my .xinitrc, the button on the pen still
> > registers as a middle click, not a right click.
> 
> All this line did was to set the TOUCHSCREEN to be the core pointer. This isn't
> necessary anymore (and not possible anyway). 
> 
> actually - you may want to skip the xmodmap line. It's mapping button 3 to 2,
> and looking at the fpit code this may be mapping right button to middle button.
> 

The pen button by default is a middle click. I want to change this to make it right-click. With or without the xmodmap line the button on the pen performs a middle-click.
Comment 22 Jon 2008-04-30 21:12:56 UTC
(In reply to comment #21)
> > actually - you may want to skip the xmodmap line. It's mapping button 3 to 2,
> > and looking at the fpit code this may be mapping right button to middle button.
> > 
> 
> The pen button by default is a middle click. I want to change this to make it
> right-click. With or without the xmodmap line the button on the pen performs a
> middle-click.
> 
The button on the pen registers in xinput test TOUCHSCREEN as a button 2 press. Running the xmodmap line from a terminal produces the desired effect, except that it does it for my touchpad as well. I only want it to do this for the pen. Perhaps modifying the source is a better alternative to this. But I'm still not sure why it doesn't work from my .xinitrc file.
Comment 23 Peter Hutterer 2008-04-30 21:26:36 UTC
(In reply to comment #22)
> The button on the pen registers in xinput test TOUCHSCREEN as a button 2 press.

button 2 is middle click.

> Running the xmodmap line from a terminal produces the desired effect, except
> that it does it for my touchpad as well. I only want it to do this for the pen.

xmodmap modifies the virtual core pointer. the physical devices all feed into this device, thus it applies to all devices.

> Perhaps modifying the source is a better alternative to this. But I'm still not
> sure why it doesn't work from my .xinitrc file.

no. this shouldn't be in the driver. what we need is a modification of xmodmap to do this per device. on that note, xmodmap is fairly straightforward, so you can get cracking right away ;)


Pushing the fixes as
2823f7c3f3784a1a398b8d5a9157c2e5263b6285 
01a4da993a2ecd0f017baef49b6e57b82c05316d
95676d89c7954cc5550ed386b784b470034320cc

Bug marked as fixed.

Comment 24 Jon 2008-04-30 22:02:17 UTC
Thanks for all your help. I achieved the button switch with "xinput set-button-map TOUCHSCREEN 1 3 2"

This will do for now.
Comment 25 so3 2008-05-02 12:42:13 UTC

hi there savvy guys, thanks to the patch provided by Peter Hutterer I was finally able to get my digitizer and the right-clicking issue working on a cx2735m Gateway, nevertheless, I cannot get any clicking whenever I revert the screen to Tablet mode by doing "xrandr -o 2", but it does track the pointer. Any suggestions???...


Thanks in advance, you've been extremely helpful
Comment 26 Peter Hutterer 2008-05-08 19:20:15 UTC
(In reply to comment #25)
> hi there savvy guys, thanks to the patch provided by Peter Hutterer I was
> finally able to get my digitizer and the right-clicking issue working on a
> cx2735m Gateway, nevertheless, I cannot get any clicking whenever I revert the
> screen to Tablet mode by doing "xrandr -o 2", but it does track the pointer.
> Any suggestions???...

good question. 
please start up xev and see if any clicks show up there. If not, please open a separate bug with the xev output and a xorg log file attached. (lets try to keep bugreports to one problem at a time).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.