Bug 101470 - syndaemon attaches to wrong touchpad
Summary: syndaemon attaches to wrong touchpad
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/synaptics (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Peter Hutterer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-16 16:05 UTC by Mario Limonciello
Modified: 2018-08-10 20:59 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
# xinput list --long (8.53 KB, text/plain)
2017-06-16 16:05 UTC, Mario Limonciello
no flags Details

Description Mario Limonciello 2017-06-16 16:05:21 UTC
Created attachment 132004 [details]
# xinput list --long

On many Dell systems the Synaptics touchpad has the capability to run in both PS/2 and I2C modes.  When running on a modern kernel, the touchpad will run in I2C mode.

When in I2C mode, the 'psmouse' driver is still loaded however, meaning that there are two input devices on the system.  No input flows through the 'psmouse' driver, it's all handled via i2c-hid instead.

Unfortunately, when starting up syndaemon doesn't check which touchpad it's actually attached to.  The login in syndaemon just looks for a touchpad that supports the Synaptics touchpad properties and both of them support these.  This leads to syndaemon not working properly.

Device 'SynPS/2 Synaptics TouchPad':
	Device Enabled (142):	1
	Coordinate Transformation Matrix (144):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (273):	1
	Device Accel Constant Deceleration (274):	2.500000
	Device Accel Adaptive Deceleration (275):	1.000000
	Device Accel Velocity Scaling (276):	12.500000
	Synaptics Edges (297):	1583, 5359, 1371, 4481
	Synaptics Finger (298):	25, 30, 0
	Synaptics Tap Time (299):	180
	Synaptics Tap Move (300):	250
	Synaptics Tap Durations (301):	180, 100, 100
	Synaptics ClickPad (302):	1
	Synaptics Middle Button Timeout (303):	0
	Synaptics Two-Finger Pressure (304):	282
	Synaptics Two-Finger Width (305):	7
	Synaptics Scrolling Distance (306):	-113, -113
	Synaptics Edge Scrolling (307):	0, 0, 0
	Synaptics Two-Finger Scrolling (308):	1, 1
	Synaptics Move Speed (309):	1.000000, 1.750000, 0.035168, 0.000000
	Synaptics Off (310):	2
	Synaptics Locked Drags (311):	0
	Synaptics Locked Drags Timeout (312):	5000
	Synaptics Tap Action (313):	2, 3, 0, 0, 1, 3, 0
	Synaptics Click Action (314):	1, 3, 0
	Synaptics Circular Scrolling (315):	0
	Synaptics Circular Scrolling Distance (316):	0.100000
	Synaptics Circular Scrolling Trigger (317):	0
	Synaptics Circular Pad (318):	0
	Synaptics Palm Detection (319):	0
	Synaptics Palm Dimensions (320):	10, 200
	Synaptics Coasting Speed (321):	20.000000, 50.000000
	Synaptics Pressure Motion (322):	30, 160
	Synaptics Pressure Motion Factor (323):	1.000000, 1.000000
	Synaptics Resolution Detect (324):	1
	Synaptics Grab Event Device (325):	0
	Synaptics Gestures (326):	1
	Synaptics Capabilities (327):	1, 0, 0, 1, 1, 1, 1
	Synaptics Pad Resolution (328):	1, 1
	Synaptics Area (329):	0, 0, 0, 0
	Synaptics Soft Button Areas (330):	3471, 0, 4083, 0, 0, 0, 0, 0
	Synaptics Noise Cancellation (331):	28, 28
	Device Product ID (260):	2, 7
	Device Node (261):	"/dev/input/event6"



Device 'DLL0704:01 06CB:76AE Touchpad':
	Device Enabled (142):	1
	Coordinate Transformation Matrix (144):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (273):	1
	Device Accel Constant Deceleration (274):	2.500000
	Device Accel Adaptive Deceleration (275):	1.000000
	Device Accel Velocity Scaling (276):	12.500000
	Synaptics Edges (297):	48, 1168, 36, 644
	Synaptics Finger (298):	25, 30, 0
	Synaptics Tap Time (299):	180
	Synaptics Tap Move (300):	61
	Synaptics Tap Durations (301):	180, 100, 100
	Synaptics ClickPad (302):	1
	Synaptics Middle Button Timeout (303):	0
	Synaptics Two-Finger Pressure (304):	282
	Synaptics Two-Finger Width (305):	7
	Synaptics Scrolling Distance (306):	-27, -27
	Synaptics Edge Scrolling (307):	0, 0, 0
	Synaptics Two-Finger Scrolling (308):	1, 1
	Synaptics Move Speed (309):	1.000000, 1.750000, 0.143575, 0.000000
	Synaptics Off (310):	0
	Synaptics Locked Drags (311):	0
	Synaptics Locked Drags Timeout (312):	5000
	Synaptics Tap Action (313):	2, 3, 0, 0, 1, 3, 0
	Synaptics Click Action (314):	1, 3, 0
	Synaptics Circular Scrolling (315):	0
	Synaptics Circular Scrolling Distance (316):	0.100000
	Synaptics Circular Scrolling Trigger (317):	0
	Synaptics Circular Pad (318):	0
	Synaptics Palm Detection (319):	0
	Synaptics Palm Dimensions (320):	10, 200
	Synaptics Coasting Speed (321):	20.000000, 50.000000
	Synaptics Pressure Motion (322):	30, 160
	Synaptics Pressure Motion Factor (323):	1.000000, 1.000000
	Synaptics Resolution Detect (324):	1
	Synaptics Grab Event Device (325):	0
	Synaptics Gestures (326):	1
	Synaptics Capabilities (327):	1, 0, 0, 1, 1, 0, 0
	Synaptics Pad Resolution (328):	12, 12
	Synaptics Area (329):	0, 0, 0, 0
	Synaptics Soft Button Areas (330):	608, 0, 557, 0, 0, 0, 0, 0
	Synaptics Noise Cancellation (331):	6, 6
	Device Product ID (260):	1739, 30382
	Device Node (261):	"/dev/input/event15"
Comment 1 Peter Hutterer 2017-06-18 22:30:29 UTC
Quick workaround here would be to add an xorg.conf snippet to ignore the mute serial device. Unless you're rebuilding kernels a lot and expect the i2c driver to fail frequently, this won't be a problem otherwise.

For the RMI4 patches, the latest revisions won't make the serial kernel device show up. I'm not 100% sure if that will apply for the i2c patches too. Benjamin? If so, then I think the xorg.conf.d snippet is a good enough workaround until the kernel is in place.
Comment 2 Benjamin Tissoires 2017-06-19 07:36:24 UTC
I think most Dell laptops are using hid-rmi, not SMBus.
And there is currently no way from i2c-hid to remove the PS/2 node. I don't see any simple way to achieve that, so I think we will have to deal with it in user space.
Comment 3 Mario Limonciello 2017-06-19 13:10:06 UTC
@Peter:
Yeah an xorg.conf.d snippet can workaround and ignore the PS/2 device, but it's not a very general solution.

@Benjamin:
The machine here is an XPS 13.  The touchpad is a precision touchpad.  It uses i2c-hid and hid-multitouch not hid-rmi.


One idea that came to mind to me for syndaemon detecting this situation is if multiple devices match the synaptics characteristics pick the one with the 		higher "Max number of touches".  The i2c mode has higher bandwidth and should generally support more touches I think.
Comment 4 Peter Hutterer 2017-06-20 00:07:55 UTC
Mario: the synaptics driver doesn't export the number of touches, so that's a no-go. It'll have to be heuristics or a user-supplied argument.
Comment 5 Mario Limonciello 2017-06-20 16:19:45 UTC
Oh where did that max touches information come from in the --long output (see attachment)?

I'm not sure what other heuristics could reliably be used for detecting this, maybe pad resolution?
Comment 6 Peter Hutterer 2017-06-20 22:49:25 UTC
synaptics 1.8 I suspect, it was dropped with 1.9 which has been out since november
Comment 7 Mario Limonciello 2017-06-22 21:58:23 UTC
Yeah, I see on 1.9 that the max touches doesn't show up for this TP.

As another idea, what about if the order of devices checked is just reversed?  Touchpads that support multiple modes will come in up PS2 mode first and get a lower event number as a result.  When switching to I2C they should always have higher event numbers right?

So if you reverse the order of devices to check you should start with the higher events and more likely get a better default.
Comment 8 Peter Hutterer 2017-06-22 23:24:42 UTC
No, sorry. That's simply not good enough, if we have to change the code anyway we might as well try to make it work properly instead of hoping that it maybe works. There's no guarantee about the device node ordering and just because that's current kernel behaviour doesn't mean we should rely on it.

A better fix here would be to make syndaemon simply apply to all touchpads rather than just the first one it finds. Except for the case of an external touchpad, this should always work but for external touchpads you don't need syndaemon anyway.
Comment 9 Anthony Wong 2017-06-27 18:09:06 UTC
Peter, what is the best way to distinguish (in the code) whether a touchpad is external or not?
Comment 10 Peter Hutterer 2017-06-27 22:01:54 UTC
dp_get_device() already does that, it checks for the XI_TOUCHPAD type and the "Synaptics Off" property. Look for the "Yay, device is suitable" comment, clearly there was some enthusiasm to spare when I wrote that code :)
That 'break' there is the first hurdle - because of it we don't look at anything but the first touchpad. Start there, and off into the rabbithole it goes...
Comment 11 GitLab Migration User 2018-08-10 20:59:49 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics/issues/5.


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.