iberianpig / xSwipe

Multitouch gestures with synaptics driver on X11, Linux
451 stars 56 forks source link

Depends on deprecated option "-m" #4

Open ghost opened 11 years ago

ghost commented 11 years ago

https://bbs.archlinux.org/viewtopic.php?pid=1267066#p1267066

Your script is not compatible with current versions of the driver. (And as far as I can tell, the "ubuntu world" will get this driver with 13.10).

Maybe there is an other way to get the data? I would love to see this working for me (arch linux with version 1.7.1 of synclient).

iberianpig commented 10 years ago

Thanks for letting me know. Sorry, I don't know other one. Now, I'm looking for a new way.

sjas commented 10 years ago

So far creating an own driver and using it is the only alternative? Fedora 19 already has the 'new' driver.

If you are about to start a new project, tell me, maybe I can help. I did a little C and Perl in the past, but I never dug into device or X programming, which seems the only way.

EDIT: Also it would be great, if you could provide a sample output of the 'synclient -m 10' option, when the trackpad is used, to have an idea how the data to be provided by a new X part has to look like.

ghost commented 10 years ago

I guess one could fork the synaptics driver (http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/) and implement the old function back in. That would be easier then starting from scratch. Or you could take the driver and implement things like pinch, three-finger back and forth etc directly, but I'd prefer to have it easy customizable which would be possible with the -m flag.

Here's an example of the -m output: http://www.ibm.com/developerworks/library/os-touchpad/index.html (Listing 1. Example synclient -m 100 output)

I've found nothing about the drop of -m in the logs right now, might be usefull to know which version of synclient is still able to do it.

Edit: Looks like evtest could be useful to get the data. I'll look into it and see, if we can gain a similiar output out of it. Edit 2: Link to evtest: http://cgit.freedesktop.org/evtest/ Edit 3: Output of evtest, seems promising, it's hard to read though: http://paste42.de/6019/Output_of_evtest_for_a_synaptics_touchpad Edit 4: For the output I made following movements in that order: 1 Finger: Up, Down, Right, Left 2 Fingers: Up, Down, Right, Left, Pinch In (2 fingers moving away), Pinch Out 3 Fingers: Up, Down, Left, Right

Edit 5: The downside of evtest for now: It wont work in my kde session and I have to switch to a tty:


This device is grabbed by another process. No events are available to evtest while the other grab is active. In most cases, this is caused by an X driver, try VT-switching and re-run evtest again.


sjas commented 10 years ago

evtest won't work in LXDE either.

So it is better to look into creating a new driver anyway.

What is the easiest way to find out, what specs the touchpad has? (I.e. supporting how many fingers in parallel,...) I did not really understand the evtest output yet, too.

jfallon1997 commented 10 years ago

The terminal outputs (on x-server)

***********************************************
  This device is grabbed by another process.
  No events are available to evtest while the
  other grab is active.
  In most cases, this is caused by an X driver,
  try VT-switching and re-run evtest again.
***********************************************

This seems like the sought of thing a patch to the xf86-input-driver could fix though.

I have found Evtest will work whilst X-org server runs but the user must be switched to a VT not running x-server (ctrl-alt-F1/2/3/etc) on Arch Linux

ghost commented 10 years ago

Good news everyone!

We can disable the grab of the device and start up evtest in an active X session: http://www.x.org/archive/X11R7.6/doc/man/man4/synaptics.4.xhtml (search for "grab")

Now the only thing left is a way to interpret the evtest output. We can test for a single value at a time with the --query option. I've not had the chance to look into that, but it would make our lives a lot easier, the output of even a single touch generates a lot of lines.

I caught a good example for an input report for 2 fingers:

Event: time 1380915594.260341, -------------- SYN_REPORT ------------
Event: time 1380915594.285240, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 0
Event: time 1380915594.285240, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1901
Event: time 1380915594.285240, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 4199
Event: time 1380915594.285240, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 1
Event: time 1380915594.285240, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 5662
Event: time 1380915594.285240, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1624
Event: time 1380915594.285240, type 3 (EV_ABS), code 0 (ABS_X), value 1901
Event: time 1380915594.285240, type 3 (EV_ABS), code 1 (ABS_Y), value 4199
Event: time 1380915594.285240, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 64

As far as I can see, every ABS_MT_SLOT is a finger.

One concern about the usabilty of the script however is the need of root access to run evtest. (One could add a nopasswd-option for evtest in the sudoers file of course)

EDIT: Looks like we can't use query to look after EV_ABS which is basically everything we need. Also, after each restart, the /dev/input/event* are in a different order, but that is easy to find out (cat /proc/bus/input/devices).

EDIT 2: Ok, so the next problem is: I don't get evtest to "see" more than 2 fingers, ABS_MT_SLOT seems to be just a trigger for MultiTouch, not for the number of fingers. So even with 3 fingers there is only ABS_MT_SLOT value 1 and there are only coordinates shown for 2 fingers, as in the example above.

iberianpig commented 10 years ago

What should I type in terminal to get the input report? Please tell me the command.

ghost commented 10 years ago

You need to be root and grab has to be disabled, if you want to run it in X, otherwise switch to a tty.

Next you type in: evtest /dev/input/eventXX Where XX is mapped to your synaptics touchpad.

amitanilkulkarni commented 10 years ago

@x421 - How do I fork the old synaptic driver? Upgrading from Kubuntu 13.04 to 13.10 removed the '-m' option. (Sorry, I'm a noob.)

ghost commented 10 years ago

@amitk-iitm Sorry, I never worked with drivers in linux (well, forking, contributing, you know), but forking is just making a copy of the code and give it an other name. You then would have to implement the -m option back in and use the driver for your touchpad.

Next thing is, that wayland is on its way, we will get new drivers anyways, maybe we'll get a better gesture support then (the current driver is written for x).

sjas commented 10 years ago

From https://en.wikipedia.org/wiki/Wayland_(display_server) :
The Wayland protocol is essentially only about input handling and buffer management. The handling of the input hardware relies on evdev in Linux, and similar components in other operating systems.

Not sure what this means in our context, just wanted to mention it here.

cif2cif commented 10 years ago

Hi,

Here they provide a not very cool solution, downgrading to version 1.6.2:

http://askubuntu.com/questions/363077/problem-with-synclient-m-flag-missing

Any other idea about how to fix this?

felipejfc commented 10 years ago

I tried to downgrade but no luck, lack of dependencies: Pacote xorg-input-abi-18 não está instalado.

felipejfc commented 10 years ago

I found a solution, i uninstalled xserver-xorg-input-synaptics and grabbed its sources for 1.6.4 here : http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/ and compilled/installed manually from the source... After that I got -m working again... My only issue is that my touch pad is only recognizing up to 3 fingers in linux mint, it should recognize 4 as it does in windows...

amitanilkulkarni commented 10 years ago

@x421 - I've switched to archlinux too. Found an interesting package in AUR: https://aur.archlinux.org/packages/xf86-input-synaptics-xswipe-git/ It's a forked branch with -m flag forward ported and 4/5 finger detectable. Trying it out now.

mpiannucci commented 10 years ago

I have gotten this to work fine on both Ubuntu and Arch with the forked xserver-xorg-input-synaptics found here. I have also written up a little post so I remember the steps I took to get it to work http://blog.mpiannucci.com/view/multitouchgesture

jmcbee commented 9 years ago

@mpiannucci Thank you :love_letter: