Thread: Re: [DIGImend-devel] [DIGImend-users] Patching the hid-uclogic driver for UC-Logic tablet TWHA60 v3
Brought to you by:
spb_nick
From: Martin S. <mcs...@gm...> - 2015-06-01 07:05:17
Attachments:
uclogic_traceback
|
Hi Nick, [Note that I've moved the thread from digimend-users to digimend-devel] Thank you for the pointer to the development version. Unfortunately the development driver crashed when I loaded it on my system. I've attached the corresponding traceback from dmesg. What I did to try the driver was as follows: I removed everything from /lib/modules/`uname -r`/extra/, to ensure that I didn't end up running my version of the hid_uclogic driver by mistake. I then used rmmod to unload both usbhid and hid_uclogic. I then downloaded https://github.com/DIGImend/digimend-kernel-drivers/archive/master.zip and unzipped it. I ran make on this, and then sudo make install, then verified that the new drivers appeared under /lib/modules/`uname -r`/extra/. Finally I ran modprobe on usbhid to load it and the new hid_uclogic driver. When the tablet didn't appear to be recognized, I checked dmesg and found the traceback that's attached to this message. After that I had to reboot, because rmmod hung when I tried to unload the crashed driver. I'll be happy to run any diagnostics that you suggest. Thanks, Martin On Sun, May 31, 2015 at 4:12 AM, Nikolai Kondrashov <sp...@gm...> wrote: > Hi Martin, > > > On 05/29/2015 04:32 AM, Martin Shepherd wrote: >> >> On the digimend tablets web page UC-Logic Tablet TWHA60 v3 is listed as >> unsupported. I have this tablet, and I've just managed to get its stylus >> working by making a very small change to hid-uclogic.c. With this change, >> basic positioning, clicking the tip, and pressure sensitivity all appear >> to >> work correctly (at least in inkscape). >> >> The report descriptor for interface 0 has a different size in this tablet >> than previous versions, so the code that substitutes a fixed descriptor, >> based on this size, does nothing. To resolve this, I added an extra if() >> to >> check for the new descriptor size, and substituted a slightly different >> fixed descriptor. The only changes needed in the fixed descriptor, were to >> the logical maximums for X and Y, which should both be 2047, instead of >> the >> previous values of 39999 and 24999. >> >> I have placed the diff between the 3.13.0-53-generic (Ubuntu) version of >> the >> hid-uclogic.c file, and the fixed version, in the attached text file. I >> hope >> that this is the correct place to post this. > > > Contributions are welcome anywhere, although > DIG...@li... would be a bit more appropriate. > > We actually have this tablet supported in the development version of our > out-of-tree driver: > > https://github.com/DIGImend/digimend-kernel-drivers/archive/master.zip > > Here's the GitHub page for it: > https://github.com/DIGImend/digimend-kernel-drivers > > I need to update the website though. > > Nick |
From: Nikolai K. <sp...@gm...> - 2015-06-07 13:31:30
|
Hi Martin, On 06/01/2015 10:05 AM, Martin Shepherd wrote: > [Note that I've moved the thread from digimend-users to digimend-devel] > > Thank you for the pointer to the development version. Unfortunately > the development driver crashed when I loaded it on my system. I've > attached the corresponding traceback from dmesg. > > What I did to try the driver was as follows: I removed everything from > /lib/modules/`uname -r`/extra/, to ensure that I didn't end up running > my version of the hid_uclogic driver by mistake. I then used rmmod to > unload both usbhid and hid_uclogic. I then downloaded > https://github.com/DIGImend/digimend-kernel-drivers/archive/master.zip > and unzipped it. I ran make on this, and then sudo make install, then > verified that the new drivers appeared under /lib/modules/`uname > -r`/extra/. Finally I ran modprobe on usbhid to load it and the new > hid_uclogic driver. When the tablet didn't appear to be recognized, I > checked dmesg and found the traceback that's attached to this message. > > After that I had to reboot, because rmmod hung when I tried to unload > the crashed driver. That's a bummer. > I'll be happy to run any diagnostics that you suggest. Can you send hid-uclogic.* files from your build? Especially hid-uclogic.o. I'll try this on Ubuntu myself with the version of the kernel you're using. Which version of Ubuntu is that? Thank you. Nick |
From: Nikolai K. <sp...@gm...> - 2015-06-08 19:09:34
|
On 06/08/2015 08:32 AM, Martin Shepherd wrote: > Hi Nick, > > On Sun, Jun 7, 2015 at 6:31 AM, Nikolai Kondrashov <sp...@gm...> wrote: >> Can you send hid-uclogic.* files from your build? Especially hid-uclogic.o. > > I've attached a tar file containing them to this email. > >> I'll try this on Ubuntu myself with the version of the kernel you're using. >> Which version of Ubuntu is that? > > 3.13.0-53-generic > > Thanks for the help. Thanks, Martin! Argh, these don't have the debugging information and I'm not sure how to enable debug info for an out-of-tree module. I'll try to guess which version of Ubuntu you're using and will try it myself. Nick P.S. Please don't forget to keep the maillist in CC. |
From: Nikolai K. <sp...@gm...> - 2015-06-08 19:56:51
|
On 06/08/2015 10:09 PM, Nikolai Kondrashov wrote: > On 06/08/2015 08:32 AM, Martin Shepherd wrote: >> Hi Nick, >> >> On Sun, Jun 7, 2015 at 6:31 AM, Nikolai Kondrashov <sp...@gm...> wrote: >>> Can you send hid-uclogic.* files from your build? Especially hid-uclogic.o. >> >> I've attached a tar file containing them to this email. >> >>> I'll try this on Ubuntu myself with the version of the kernel you're using. >>> Which version of Ubuntu is that? >> >> 3.13.0-53-generic >> >> Thanks for the help. > > Thanks, Martin! > > Argh, these don't have the debugging information and I'm not sure how to > enable debug info for an out-of-tree module. > > I'll try to guess which version of Ubuntu you're using and will try it myself. Alright, I poked around a little and the issue doesn't reproduce with the Huion tablet I have. I found how to enable debug info for the modules you build so the traceback can be more useful. Could you please put this at the beginning of the makefile: ccflags-y := -g3 recompile, reinstall the modules, plug the tablet in and send me the new traceback from dmesg, plus hid-uclogic.* files again? To recompile and reinstall you can use these commands: make clean make sudo make install Thank you. Nick |
From: Martin S. <mcs...@gm...> - 2015-06-11 02:02:39
Attachments:
dmesg_traceback
hid-uclogic-files.tar.gz
|
On Mon, Jun 8, 2015 at 12:56 PM, Nikolai Kondrashov <sp...@gm...> wrote: > On 06/08/2015 10:09 PM, Nikolai Kondrashov wrote: >> >> On 06/08/2015 08:32 AM, Martin Shepherd wrote: >>> >>> Hi Nick, >>> >>> On Sun, Jun 7, 2015 at 6:31 AM, Nikolai Kondrashov <sp...@gm...> >>> wrote: >>>> >>>> Can you send hid-uclogic.* files from your build? Especially >>>> hid-uclogic.o. >>> >>> >>> I've attached a tar file containing them to this email. >>> >>>> I'll try this on Ubuntu myself with the version of the kernel you're >>>> using. >>>> Which version of Ubuntu is that? >>> >>> >>> 3.13.0-53-generic >>> >>> Thanks for the help. >> >> >> Thanks, Martin! >> >> Argh, these don't have the debugging information and I'm not sure how to >> enable debug info for an out-of-tree module. >> >> I'll try to guess which version of Ubuntu you're using and will try it >> myself. > > > Alright, I poked around a little and the issue doesn't reproduce with the > Huion tablet I have. I found how to enable debug info for the modules you > build so the traceback can be more useful. > > Could you please put this at the beginning of the makefile: > > ccflags-y := -g3 > > recompile, reinstall the modules, plug the tablet in and send me the new > traceback from dmesg, plus hid-uclogic.* files again? > > To recompile and reinstall you can use these commands: > > make clean > make > sudo make install Done. I rebooted after doing this, then plugged in the tablet. I've attached the output of dmesg from just after plugging in the tablet, so that you can see the traceback at the end. I've also attached a tar file of the hid-uclogic.* files. Note that I did this with the latest Ubuntu kernel (3.13.0-54-generic), which is one version higher than the kernel that I tested with before. Thank you, Martin |
From: Nikolai K. <sp...@gm...> - 2015-06-14 10:00:20
|
On 06/11/2015 05:02 AM, Martin Shepherd wrote: > Done. I rebooted after doing this, then plugged in the tablet. I've > attached the output of dmesg from > just after plugging in the tablet, so that you can see the traceback > at the end. I've also attached a tar file > of the hid-uclogic.* files. Note that I did this with the latest > Ubuntu kernel (3.13.0-54-generic), > which is one version higher than the kernel that I tested with before. Thanks a lot, Martin! I tracked this down to my mistake of retrieving the USB device pointer incorrectly. I pushed a fix for this and also for report descriptor generation for your device. Please try latest master: https://github.com/DIGImend/digimend-kernel-drivers/archive/master.zip Nick |
[DIGImend-devel] Fwd: [DIGImend-users] Patching the hid-uclogic
driver for UC-Logic tablet TWHA60 v3
From: Martin S. <mcs...@gm...> - 2015-06-16 02:47:35
|
I forgot to include digimend-devel in the list of recipients, so here's the email again. Hi Nick, On Sun, Jun 14, 2015 at 2:59 AM, Nikolai Kondrashov <sp...@gm...> wrote: > On 06/11/2015 05:02 AM, Martin Shepherd wrote: >> >> Done. I rebooted after doing this, then plugged in the tablet. I've >> attached the output of dmesg from >> just after plugging in the tablet, so that you can see the traceback >> at the end. I've also attached a tar file >> of the hid-uclogic.* files. Note that I did this with the latest >> Ubuntu kernel (3.13.0-54-generic), >> which is one version higher than the kernel that I tested with before. > > > Thanks a lot, Martin! I tracked this down to my mistake of retrieving the > USB > device pointer incorrectly. I pushed a fix for this and also for report > descriptor generation for your device. Please try latest master: > > https://github.com/DIGImend/digimend-kernel-drivers/archive/master.zip > > Nick Thanks. This fixed the crash, but unfortunately it didn't fix the original problem. The fixed driver now behaves like the hid-uclogic.c driver that came with the ubuntu kernel. The tip of the pen acts like a switch, but there's no X,Y motion. Thanks, Martin |
From: Nikolai K. <sp...@gm...> - 2015-06-16 09:01:36
|
On 06/16/2015 05:47 AM, Martin Shepherd wrote: > I forgot to include digimend-devel in the list of recipients, so > here's the email again. > > Hi Nick, > > On Sun, Jun 14, 2015 at 2:59 AM, Nikolai Kondrashov <sp...@gm...> wrote: >> On 06/11/2015 05:02 AM, Martin Shepherd wrote: >>> >>> Done. I rebooted after doing this, then plugged in the tablet. I've >>> attached the output of dmesg from >>> just after plugging in the tablet, so that you can see the traceback >>> at the end. I've also attached a tar file >>> of the hid-uclogic.* files. Note that I did this with the latest >>> Ubuntu kernel (3.13.0-54-generic), >>> which is one version higher than the kernel that I tested with before. >> >> >> Thanks a lot, Martin! I tracked this down to my mistake of retrieving the >> USB >> device pointer incorrectly. I pushed a fix for this and also for report >> descriptor generation for your device. Please try latest master: >> >> https://github.com/DIGImend/digimend-kernel-drivers/archive/master.zip >> >> Nick > > Thanks. This fixed the crash, but unfortunately it didn't fix the > original problem. The fixed driver now behaves like the hid-uclogic.c > driver that came with the ubuntu kernel. The tip of the pen acts like > a switch, but there's no X,Y motion. Thanks for trying it! Could you please send the "dmesg" output after plugging the tablet in, and output of "evtest" for the pen device, where you do a stroke with the pen? Thank you. Nick |
From: Nikolai K. <sp...@gm...> - 2015-06-19 12:47:25
|
Hi Martin, On 06/18/2015 08:18 AM, Martin Shepherd wrote: > I have attached 5 files. The first contains the output of dmesg when I > plugged in the tablet. Note that the driver seems to find two pens. > One of these is linked to /dev/input/event13, which appears to be the > one that works, while the other is linked to /dev/input/event15, which > doesn't produce any events. The second of the attached files shows the > output of evtest on /dev/input/event13 while I was moving the pen > horizontally from left to right. The third attachment shows the output > from the same device when moving the pen vertically from top to > bottom. The 4th and 5th attachments do the same for > /dev/input/event15, which identifies itself as being a pen, but > doesn't report any events when the pen is being moved. I hope that > this helps. Thanks, yes this helps! I've added in-range bit reversal to TWHA60 and added ignoring fake pen usages, so you should have your cursor move and extra pen interface disappear now. Please try the latest master. Thank you. Nick P.S. I wonder how did we manage to make that driver work when we added TWHA60 v3 support originally? Perhaps it has simply regressed. P.P.S. You can use "Reply to all" instead of "Reply" when replying to automatically keep the maillist in CC. |
From: Martin S. <mcs...@gm...> - 2015-06-20 01:50:45
|
Hi Nick, Your latest version of the driver appears to work perfectly. In inkscape both motion and pressure sensitivity work well. There was one problem when I first tested it. When I first loaded the driver my synaptics touchpad stopped responding to taps, and I had to reload the psmouse driver to resolve that. However since then, I've tried unloading and reloading the usbhid and hid_uclogic drivers a few times, and I haven't been able to reproduce the problem with the synaptics touch-pad. I also checked that after a reboot, that both the tablet and the synaptics touch-pad worked properly. Thank you for porting the driver to this tablet. Martin On Fri, Jun 19, 2015 at 5:47 AM, Nikolai Kondrashov <sp...@gm...> wrote: > Hi Martin, > > On 06/18/2015 08:18 AM, Martin Shepherd wrote: >> >> I have attached 5 files. The first contains the output of dmesg when I >> plugged in the tablet. Note that the driver seems to find two pens. >> One of these is linked to /dev/input/event13, which appears to be the >> one that works, while the other is linked to /dev/input/event15, which >> doesn't produce any events. The second of the attached files shows the >> output of evtest on /dev/input/event13 while I was moving the pen >> horizontally from left to right. The third attachment shows the output >> from the same device when moving the pen vertically from top to >> bottom. The 4th and 5th attachments do the same for >> /dev/input/event15, which identifies itself as being a pen, but >> doesn't report any events when the pen is being moved. I hope that >> this helps. > > > Thanks, yes this helps! I've added in-range bit reversal to TWHA60 and added > ignoring fake pen usages, so you should have your cursor move and extra pen > interface disappear now. Please try the latest master. > > Thank you. > > Nick > > P.S. I wonder how did we manage to make that driver work when we added > TWHA60 > v3 support originally? Perhaps it has simply regressed. > > P.P.S. You can use "Reply to all" instead of "Reply" when replying to > automatically keep the maillist in CC. |
From: Nikolai K. <sp...@gm...> - 2015-06-20 09:59:51
|
Hi Martin, On 06/20/2015 04:50 AM, Martin Shepherd wrote: > Your latest version of the driver appears to work perfectly. In > inkscape both motion and pressure sensitivity work well. > > There was one problem when I first tested it. When I first loaded the > driver my synaptics touchpad stopped responding to taps, and I had to > reload the psmouse driver to resolve that. However since then, I've > tried unloading and reloading the usbhid and hid_uclogic drivers a few > times, and I haven't been able to reproduce the problem with the > synaptics touch-pad. I also checked that after a reboot, that both the > tablet and the synaptics touch-pad worked properly. > > Thank you for porting the driver to this tablet. You're welcome! Glad to hear it worked finally. Not sure what to make of the synaptics issue. Now, we can try to make the buttons on the frame compatible with xf86-input-wacom driver. If you'd like to do that, please run uclogic-probe [1] on your tablet and send the output. Thank you. Nick [1] https://github.com/DIGImend/uclogic-tools |
From: Martin S. <mcs...@gm...> - 2015-06-21 23:27:27
Attachments:
uclogic-probe.txt
|
I have attached the results of running uclogic-probe on the tablet. When I pass this to uclogic-decode, I see the following: Manufacturer: UC-LOGIC Product: TWHA60 Max X: 40000 Max Y: 25000 Max pressure: 2047 Resolution: 4000 Internal model: HA60-F401 Buttons status: HK On On Sat, Jun 20, 2015 at 2:59 AM, Nikolai Kondrashov <sp...@gm...> wrote: > Hi Martin, > > On 06/20/2015 04:50 AM, Martin Shepherd wrote: >> >> Your latest version of the driver appears to work perfectly. In >> inkscape both motion and pressure sensitivity work well. >> >> There was one problem when I first tested it. When I first loaded the >> driver my synaptics touchpad stopped responding to taps, and I had to >> reload the psmouse driver to resolve that. However since then, I've >> tried unloading and reloading the usbhid and hid_uclogic drivers a few >> times, and I haven't been able to reproduce the problem with the >> synaptics touch-pad. I also checked that after a reboot, that both the >> tablet and the synaptics touch-pad worked properly. >> >> Thank you for porting the driver to this tablet. > > > You're welcome! Glad to hear it worked finally. Not sure what to make of the > synaptics issue. > > Now, we can try to make the buttons on the frame compatible with > xf86-input-wacom driver. If you'd like to do that, please run > uclogic-probe [1] on your tablet and send the output. Thank you. > > Nick > > [1] https://github.com/DIGImend/uclogic-tools |
From: Nikolai K. <sp...@gm...> - 2015-06-22 10:32:31
|
On 06/22/2015 02:27 AM, Martin Shepherd wrote: > I have attached the results of running uclogic-probe on the tablet. > When I pass this to uclogic-decode, I see the following: > > Manufacturer: UC-LOGIC > Product: TWHA60 > Max X: 40000 > Max Y: 25000 > Max pressure: 2047 > Resolution: 4000 > Internal model: HA60-F401 > Buttons status: HK On Ah, wonderful! So the buttons work. I pushed a small change to the driver, it is now in latest master. Now to use the frame buttons you will have to use xf86-input-wacom driver with your tablet, which will let you configure the shortcuts, pressure curve, rotation, etc. with xsetwacom, if not the gnome tablet app. There is no good HOWTO at the moment (contributions welcome!), but basically you have to set up an Xorg.conf snippet assigning xf86-input-wacom to all of your tablet event devices, or perhaps the "Pad" and "Pen" ones at least. This rather old HOWTO can help a bit: http://digimend.github.io/support/howto/drivers/wacom/ Nick |