Bug 89802 - libinput incorrectly groups device behind same USB hub
Summary: libinput incorrectly groups device behind same USB hub
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium minor
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 89426 102235
  Show dependency treegraph
 
Reported: 2015-03-28 00:55 UTC by Jason Gerecke
Modified: 2017-08-30 06:03 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Output from `udevadm info --export-db` (133.59 KB, text/plain)
2015-04-07 16:33 UTC, Jason Gerecke
Details
0001-udev-prepend-the-libinput-group-with-the-product-str.patch (1.98 KB, patch)
2015-04-09 06:30 UTC, Peter Hutterer
Details | Splinter Review

Description Jason Gerecke 2015-03-28 00:55:34 UTC
The logic that libinput uses to determine if two devices should be part of the same group winds up grouping together anything behind the same USB hub. The Cintiq 24HDT uses such a hub internally to provide seperate tablet and touchscreen devices. It also, however, exposes one of the hub's ports externally for the user to connect things to. If another input device is connected to that port, it will be added to the same group as the Cintiq. This can also be observed with /any/ USB hub, grouping all devices plugged into it.

This doesn't seem to cause any issues at the moment, but has been filed so it isn't forgotten. I imagine that fixing it will likely first require having libwacom or udev provide more information about related devices.
Comment 1 Peter Hutterer 2015-04-07 05:11:57 UTC
Can you attach a udevadm info --export-db from such a device tree please. So we have it available when we get to it. thanks.
Comment 2 Jason Gerecke 2015-04-07 16:33:47 UTC
Created attachment 114925 [details]
Output from `udevadm info --export-db`

Here's the requested output. Both an Intuos (056a:0303) and Intuos Pro (056a:0315) are connected behind a generic USB hub (1a40:0201). The output from libinput's event-debug tool starts off with:

event2  DEVICE_ADDED     Power Button                      seat0 default group1 cap:k
event1  DEVICE_ADDED     Power Button                      seat0 default group2 cap:k
event19 DEVICE_ADDED     Wacom Intuos PT M Pen             seat0 default group3 cap:T   size 216.00/135.00mm left
event20 DEVICE_ADDED     Wacom Intuos PT M Finger          seat0 default group3 cap:p   size 215.58/136.53mm tap left scroll-nat scroll-2fg-edge
event16 DEVICE_ADDED     Wacom Intuos Pro M Pen            seat0 default group3 cap:T   size 223.52/139.70mm left
event18 DEVICE_ADDED     Wacom Intuos Pro M Finger         seat0 default group3 cap:p   size 227.56/141.24mm tap left scroll-nat scroll-2fg-edge
event0  DEVICE_ADDED     AT Translated Set 2 keyboard      seat0 default group4 cap:k
event4  DEVICE_ADDED     Dell WMI hotkeys                  seat0 default group5 cap:k
Comment 3 Peter Hutterer 2015-04-09 06:30:28 UTC
Created attachment 114975 [details] [review]
0001-udev-prepend-the-libinput-group-with-the-product-str.patch

simple fix, likely going to be enough for what we need though, right?

I'm not sure there is an easy generic fix to the "I've plugged a 24HD into a 24HD" case. Though that use case suggests you have enough money to get someone to write a custom udev rule for you ;)
Comment 4 Jason Gerecke 2015-04-10 00:56:20 UTC
I think the intent of Benjamin's 

Yeah, that should do the trick as least as far as this bug is concerned.

Even ignoring the 24HD-connected-to-a-24HD case, this patch won't work right on a 24HD (or any Wacom pen & touch display tablet IIRC) since the pen and touch devices have separate USB PIDs. Though, unless you have some other means of knowing the PID of the associated device, I think you're pretty much out of luck trying to simply detect it.
Comment 5 Peter Hutterer 2015-04-10 01:00:30 UTC
damn, something was at the back of my head when I wrote this telling me I've seen different pids for the same device before. Back to the drawing board I guess.
Comment 6 Peter Hutterer 2015-06-22 02:19:40 UTC
http://lists.freedesktop.org/archives/wayland-devel/2015-June/022797.html
patch from above with a different commit message. doesn't solve the issue here, but solves the issue with misc devices plugged into the same usb hub
Comment 7 Peter Hutterer 2015-06-23 04:23:41 UTC
commit b1fc392268807653956867867dba3fdfabfc4d05
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Apr 9 16:08:14 2015 +1000

    udev: prepend the libinput group with the product string
Comment 8 Peter Hutterer 2016-01-15 04:23:20 UTC
I'm going to close this one as fixed. It fixes part of the problem, albeit not the originally reported one for the 24HD. Can't come up with a better solution, the best option here is to have local configuration that assigns the libinput device group manually.


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.