Bug 102235 - Wacom Cintiq 27QHD touch and the Express Key Remote need to be in the same LIBINPUT_DEVICE_GROUP tag to work
Summary: Wacom Cintiq 27QHD touch and the Express Key Remote need to be in the same LI...
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Peter Hutterer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 89802
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-15 15:52 UTC by Camille Bissuel
Modified: 2017-09-07 08:18 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Udevadm info for tablet (1.25 KB, text/plain)
2017-08-15 15:52 UTC, Camille Bissuel
Details
Udevadm info for EKR (1.21 KB, text/plain)
2017-08-15 15:53 UTC, Camille Bissuel
Details
udev: hardcode the Wacom EKR into the 27QHDT device group (2.33 KB, patch)
2017-08-17 19:19 UTC, Peter Hutterer
Details | Splinter Review
libinput list devices after patch (9.85 KB, text/plain)
2017-08-28 12:34 UTC, Camille Bissuel
Details
udevadm info export-db Cintiq 27 after patch (226.95 KB, text/plain)
2017-08-28 12:36 UTC, Camille Bissuel
Details
Proposed changes to Peter's branch (2.95 KB, patch)
2017-08-30 22:01 UTC, Jason Gerecke
Details | Splinter Review

Description Camille Bissuel 2017-08-15 15:52:54 UTC
Created attachment 133528 [details]
Udevadm info for tablet

Hi dear Wayland maintainers,

after a discussion with Carlos Garnacho from Gnome (I'm an illustrator myself, not a developer), it appear that the Wacom Cintiq 27QHD touch tablet and the Express Key Remote need to be in the same LIBINPUT_DEVICE_GROUP tag to work under Wayland.

Actually the tablet is working with Wayland (as far as I can test with Mypaint-git), but the Express Key Remote (said EKR) is not.

Joined are logs asked by Carlos for udevadm...

Thanks a lot for your work,
Camille

PS: I'm all in favor of Wayland, I think it's the way to go for touch event + stylus + mouse under linux, great work !
Comment 1 Camille Bissuel 2017-08-15 15:53:18 UTC
Created attachment 133529 [details]
Udevadm info for EKR
Comment 2 Camille Bissuel 2017-08-15 15:58:11 UTC
I forgot to say I'm using Antergos Linux (Arch based), Gnome Control Center 3.24.3, Wayland 1.14.0, and libinput 1.8.1.
I obviously own a Cintiq 27 and an AKR Remote, which is pluged though an USB dongle at the back of the Cintiq...
Comment 3 Peter Hutterer 2017-08-17 19:19:01 UTC
Created attachment 133579 [details] [review]
udev: hardcode the Wacom EKR into the 27QHDT device group

Most EKR users will use it with the 27QHDT, so let's force it into that group
by default. There's a range of cases that's not covered (including 27QHD, no
touch) or any case of the EKR being used with another tablet or even the
receiver plugged into another USB port. All these cases need custom udev rules
to assign the right device group, let's just get the default right though.

https://bugs.freedesktop.org/show_bug.cgi?id=102235

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Comment 4 Carlos Garnacho Parro 2017-08-17 19:48:25 UTC
Comment on attachment 133579 [details] [review]
udev: hardcode the Wacom EKR into the 27QHDT device group

Review of attachment 133579 [details] [review]:
-----------------------------------------------------------------

Just a drive-by comment, can't test this without evemu recordings...

::: udev/libinput-device-group.c
@@ +131,5 @@
> +		     * udev rule, so do those that need to use the
> +		     * EKR with another tablet.
> +		     */
> +		    if (product_id == 0x331) /* ExpressKey Remote */
> +			    product_id = 0x32c; /* 27QHT */

You mention 27QHDT in the comment, but here you mention 27QHT, and the product ID seems different from the one at the udevadm info, is this on purpose?
Comment 5 Peter Hutterer 2017-08-17 19:58:02 UTC
urgh, no, sorry. the functionality is correct but the commit message/comments aren't sufficient. The 27QHDT has different PIDs for the tablet and touch device, we change the 27QHDT to the device group of the touch device (0x32c). For the EKR we need to do the same. See the LIBINPUT_DEVICE_GROUP property in the udevadm info output.

I'll fix the commit message/comments when we have it confirmed that it's working, thanks.
Comment 6 Carlos Garnacho Parro 2017-08-17 20:04:38 UTC
Ooh, I see. I was looking at ID_MODEL_ID, now the number is clearer :).
Comment 7 Camille Bissuel 2017-08-18 09:45:07 UTC
I'm sorry I didn't get if I need to test something ... your discussion was a little a little too technical for me... !

I'm also sorry to say I'm leaving today for some (once in a year) holidays, far from my computer, and I'll be back on Monday, August, the 28th... So I'll continue to test your work if needed when I come back.

Anyway, many thanks for your work !
Comment 8 Peter Hutterer 2017-08-21 02:06:48 UTC
Yes, I'll need you to test the patch please. download the patch, grab libinput's git repository, apply the patch with "git am <patchfile>" and then build it. You don't actually need to install the whole new libinput, you can just copy the libinput-device-group binary into /usr/lib/udev/

Then restart and everything should work.

full build instructions are here:
https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html
Comment 9 Carlos Garnacho Parro 2017-08-21 09:54:07 UTC
Btw... Jason filed https://bugzilla.gnome.org/show_bug.cgi?id=786338 with the same issue around a 24HDT. I guess we don't have that many devices to pair the EKR with, but I kind of wonder how well will these heuristics scale...
Comment 10 Peter Hutterer 2017-08-22 04:46:50 UTC
FTR, see the gnome bug carlos linked to in comment 9 for more comments
Comment 11 Peter Hutterer 2017-08-28 05:00:58 UTC
Jason or Carlos, can you get me the udevadm info --export-db from a system with the the EKR plugged into a Cintiq. Ideally once for 24 and once for 27, thanks.
Comment 12 Camille Bissuel 2017-08-28 12:34:42 UTC
Created attachment 133835 [details]
libinput list devices after patch

Hi Peter,
just compiled and installed libinput with your patch...
But I'm not sure this is working, first because I can't map buttons yet because of this bug : https://bugzilla.gnome.org/show_bug.cgi?id=786326

and second because libinput is complaining with an error :
$ sudo libinput list-devices
libinput error: event8  - libinput error: Wacom Cintiq 27QHD touch Pad: libinput error: libinput bug: device does not meet tablet criteria. Ignoring this device.

 despite we can find find it later as event11...
Comment 13 Camille Bissuel 2017-08-28 12:36:29 UTC
Created attachment 133836 [details]
udevadm info export-db Cintiq 27 after patch

I know you didn't ask this to me, but if it can help... 
I don't have a Cintiq 24  so I can't compare...
Comment 14 Peter Hutterer 2017-08-30 06:01:36 UTC
Jason: please test
 https://github.com/whot/libinput/tree/wip/tablet-EKR-device-group

Don't need to install libinput, running ./build/libinput-device-group /sys/class/input/event10 with the event node adjusted for the EKR is enough. It should print out the same device group as the cintiq gets as LIBINPUT_DEVICE_GROUP in udev, but I'm sure I have a bug or two in there. Code is simple enough, you should be able to finish it from this.

Camille: if you get to it first, you win :)
Comment 15 Carlos Garnacho Parro 2017-08-30 11:16:11 UTC
(In reply to Peter Hutterer from comment #11)
> Jason or Carlos, can you get me the udevadm info --export-db from a system
> with the the EKR plugged into a Cintiq. Ideally once for 24 and once for 27,
> thanks.

FWIW, can't help with testing... I lack such fancy Cintiq models :).
Comment 16 Camille Bissuel 2017-08-30 13:53:51 UTC
Hi Peter, I win ;)

$ ./builddir/libinput-device-group /sys/class/input/event25
3/56a/331/110:usb-0000:04:00.0-1

$ /usr/lib/udev/libinput-device-group /sys/class/input/event25
3/56a/32c/110:usb-0000:04:00.0-1

same result !
Thanks for your work
Comment 17 Jason Gerecke 2017-08-30 22:01:00 UTC
Created attachment 133893 [details] [review]
Proposed changes to Peter's branch

I gave it a test as well and found that libinput-device-group would report the EKR rather than the device it was plugged into:

    $ ./libinput-device-group /sys/class/input/event13/
    3/56a/331/110:usb-0000:00:1d.0-1.6

Looking at the patch, I think I've uncovered a few issues:

1) The line `*vendor_id = vid` is missing, preventing matches from working

2) The function is passed a udev device from the "input" subsystem. Calling `udev_device_get_parent_with_subsystem_devtype` on that will return its USB device, not the USB hub it's connected to.

3) Assuming (2) is fixed, the udev enumeration includes all children, grandchildren, etc. This has two consequences:

    3a) The EKR is part of the list and should be skipped. Really, any EKR for that matter.

    3b) The EKR could potentially bind to a grandchild of the parent (e.g. if you have both an EKR and a USB hub plugged into the Cintiq) rather than a fellow child.


I've attached a patch which addresses these issues and which can be applied on top of Peter's branch. In the process, I've also changed how the to-be-bound device is found so that the requirement of having the EKR plugged directly into the Cintiq is removed (though the code still prefers direct connections). This additional change isn't strictly necessary, but I feel would improve the usability.
Comment 18 Peter Hutterer 2017-08-31 01:28:39 UTC
thanks, squashed together and sent to the list, will merge in a few days.

https://lists.freedesktop.org/archives/wayland-devel/2017-August/034894.html
Comment 19 Peter Hutterer 2017-09-06 23:23:32 UTC
commit c44c028678e6084df28083e2c8fec9c470d7cd69 
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Aug 30 15:53:01 2017 +1000

    udev: move the EKR into the parent's device group
Comment 20 Camille Bissuel 2017-09-07 08:18:37 UTC
Great, thanks to both of you for your work !


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.