-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Huion RTP-700 wrong device match and aspect ratio after firmware update #784
Comments
Hooray. The update probably changed the firmware version that we need to identify the tablet since Huion thinks it's fun to have multiple devices use the same USB product ids. Can you run https://github.com/whot/huion-switcher please and let us know what the output of that is? Thanks. |
Thank you for your work. It outputs:
|
In an unmodified system
With the aforementioned workaround
Im not sure if it is related but I also noticed the top pen button started acting as flipping the pen instead of a button, this pen has no eraser and libwacom correctly reports as such. Before the firmware update both buttons worked as buttons.
Everything looks correct, except the size is 11x6.9 inches. I sent the sysinfo in linuxwacom/wacom-hid-descriptors#420 |
Thanks! -> #802
to confirm: this used to work? right not it looks like the hid-uclogic kernel driver doesn't support it and we don't have a udev-hid-bpf entry for it yet - and that one would require huion-switcher (see #718, same story). |
Yes it used to work, including the keep aspect option correctly changing the aspect ratio. I didn't have to use huion-switcher or perform any additional setup. |
alright, so an outline of how things work, maybe that helps narrow down what changed. The Huion devices (that I have seen) provide multiple HID devices, some of which are emulation nodes (e.g. the pad button send key events) so that the tablet works OOTB without any driver support. One HID device is the one that reports all data through a vendor collection but the device needs to be switched to that mode (see huion-switcher) before that device sends events. Once that's done the other nodes stop sending events until the device is unplugged. hid-recorder should show you those different devices. For many older devices the kernel For unhandled (and newer) devices the kernel does nothing, instead you need to use huion-switcher to switch to raw mode and then a BPF file through udev-hid-bpf to change the HID report descriptors so the data isn't in some proprietary vendor protocol but is recognised by the kernel. That's the kernel level. In user-space libwacom tries to detect the device and libinput/gnome rely on this to some degree to allow for configuration. However... Huion re-uses PIDs so the only way libwacom can differentiate between devices is to use the firmare ID prefix ( In other words: libwacom will not detect your device correctly, we have at current count 121 devices that may have the So I don't have a good answer what's going on here but maybe the above may help narrow down what could've changed. Attaching the |
Sorry if i forget something im not sure if i understood all that but before using huion-switcher i get these 3 nodes, the second one has pen events and pen button events but not tablet button events
after huion-switcher , the first one has the pen and all button events raw-dev-hidraw1.txt
|
Right, so it's mostly the same behaviour as all the others. Note that since you don't have a BPF loaded right now the report descriptors do not change. The goal of the BPFs is two-fold:
So part of any confusion is probably because we're mangling two things together here but only one behavior happens at any time - depending which mode the tablet is in. When you run huion-switcher it reads a USB string descriptor in the US English language ID, that's a normal read-only operation and usually does things like fetch the manufacturer ID. In Huion's case if you read the 200 string descriptor index it will switch into tablet mode and send everything through /dev/hidraw1 instead of the default firmware mode. You don't get tablet button events because in default firmware mode the pad buttons emulate key events, again this is all expected. So let's look at the first goal, change the rdesc: See the comment starting in line 26 in this bpf and the corresponding rdesc fixup in For the second goal we have Then we have Then you look at
For simplicity: if you start by copying all the bits for edit: the RTP700 uses a shared PID so I don't think we can implement the generic handling anyway, we have to switch to vendor mode because that also gives us the firmware ID that we need to reliably detect this device. IOW any BPF for your device will only do the vendor version anyway. |
Ok so I made these changes to the source code
Compiled it and installed as per instructions in udev-hid-bpf's readme file and then installed with
It works in vendor mode now. It fixed the barrel button being misidentified as eraser problem, buttons works but libwacom still doesnt detect it without modifying the .tablet and the aspect ratio option isn't doing anything at all now (though I can work around this by changing the value in line 307) |
nice, good work on getting it to work - can you file a PR in udev-hid-bpf please? You'll need to file a user verification issue (see the issue template) in the fdo gitlab instance first so you can fork the repo there.
If you install
(if not can you attach, not copy, the full Note that this only works if triggered via udev since huion-switcher cannot retrospectively add a udev property to a device. Arguably the RTP700 doesn't need the firmware match since it has its name in the string so we could reduce the device match to just:
in which case it should get detected either way.
ftr, that option is implemented fully in the compositor, there is nothing libwacom can do to make this work. libwacom only says "this is an external tablet" and then the rest is implemented elsewhere. In the libwacom repo there's The logical min/max should specify the values that the device sends. The physical max is the width/height in mm. The goal is that the device presents itself correctly - any aspect ratio mapping fix is ok as temporary fix locally but please don't try to upstream that, as above it needs to be fixed in the compositor. |
My bad, it does match with the udev rule
It matches w/ the existing file, the correct DeviceMatch with names would be
|
fwiw if you use your BPF program from udev-hid-bpf!156 the device should come up as |
Device name: Huion RTP-700
Device model identifier: RTP-700
libwacom version: 2.13.0-1
I understand that libwacom does affect whether the device works (see Troubleshooting)
Bug description
The graphics tablet doesn't show up in GNOME Settings after an update to its firmware.
The names that show up in evtest are
In lsusb:
I dont know how to edit the .tablet's DeviceMatch to properly support it but I just removed the name from the match and that made it show up in the settings program however when i use the "keep aspect ratio" option it is corrected to a wrong aspect ratio. The tablet is physically 23:14 and when using "keep aspect ratio" on a 16:9 monitor the active area becomes 23:8 (or 16:5.6).
The text was updated successfully, but these errors were encountered: