Skip to content
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

UC-Logic XP-Pen Artist 22HD support #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abisaro
Copy link

@abisaro abisaro commented Aug 5, 2017

This is an initial support for XP-Pen Artist 22HD, it needs someimprovement and rework for sure, but the basic is there, including pressure sensitivity

@spbnick
Copy link
Member

spbnick commented Aug 30, 2017

Thank you very much, this looks clean and simple! I'd like to cleanup the report descriptors a little, but otherwise I think it is good to go.

Did you try running uclogic-probe on this? Has it produced anything?

@miharenthas
Copy link

miharenthas commented Sep 10, 2017

Hi, if you need testing I might help --have one of these devices.
BTW, abisaro's driver does work for me, pressure sensitivity included. Thanks!

@miharenthas
Copy link

miharenthas commented Sep 12, 2017

So, running uclogic-probe on the tablet results in:
M 55 00 47 00 45 00 45 00
P 54 00 41 00 42 00 4C 00 45 00 54 00 20 00 4D 00 4F 00 4E 00 49 00 54 00 4F 00 52 00
S 64 0C 03 11 95 D2 53 03 00 FF 07 F0 07
S 65 04 03 20 A0
S 6E 04 03 31 00
S 79 0A 03 46 00 34 00 30 00 31 00
S 7A 08 03 01 00 00 00 00 00
S 7B 0C 03 48 00 4B 00 20 00 4F 00 6E 00
Which I'm afraid I can't really interpret.

Also, I noticed that for the pen to be mapped properly (xinput map-to-output etc...) to the monitor it needs to be initially connected with the cable, at that point becomes available ad a pointer device --without connection, it still works but it's seen as a keyboard and can't be mapped... I'll try to solve, if that's a problem (not sure it is: once it's mapped it can be disconnected), but I really can't guarantee.

@spbnick
Copy link
Member

spbnick commented Sep 13, 2017

Hi @miharenthas, thanks for stepping up to testing this. Given that the tablet responds to uclogic-probe (you can decode the output with uclogic-decode), we might be able to make the driver simpler. Could you please run sudo uclogic-probe again, and then run sudo usbhid-dump for your tablet (without reconnecting it), make a few strokes with the pen and post the output here? Also, please post the output of sudo lsusb -v for your tablet.

@abisaro
Copy link
Author

abisaro commented Sep 18, 2017

Hi @miharenthas, @spbnick, sorry for my "silence", I was on holiday and without internet connection, @miharenthas you are welcome and thank you for stepping in btw.

I think I can find a bit of time to do some testing in the following days, one of the thing I have a feeling needs some improvement is the sensitivity, it seems to me it's not that accurate, I saw in the code that it is managed in a specific way replacing some part of the descriptor, but I was not confident enough to play with it, and of course what @miharenthas describes needs a fix.

I'll be back as soon as I've collected some more information and data

@spbnick
Copy link
Member

spbnick commented Sep 18, 2017

@abisaro, that must have been a good holiday, if you didn't have a connection :) Could you try enabling your tablet same as others, but without enabling the frame buttons, as it doesn't have any? We might be able to make it work without adding a custom report descriptor. Make sure you're enabling the right interface, though.

@abisaro
Copy link
Author

abisaro commented Sep 18, 2017

@spbnick ahah, yes, it has been a good holiday, from time to time I visit my father who has no internet, and apart from enjoying my time with him I discovered that I really enjoy disconnecting myself for some days, I think we all should do it at least once or twice per year...
but anyway, can you give me some more details on how to do what you suggest? it's not clear to me.
btw I noticed that in Gimp's input device I have:

  • UC-Logic 21.5" Tablet Monitor Mouse
  • UC-Logic 21.5" Tablet Monitor Pen Pen (0) <- note the "Pen Pen"
  • UC-Logic 21.5" Tablet Monitor Pad <- greyed out
  • UC-Logic 21.5" Tablet Monitor Pen <- greyed out

the output from lsusb is this:

andrea@fafner:~$ lsusb -v -d 5543:0047

Bus 001 Device 008: ID 5543:0047 UC-Logic Technology Corp. 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x5543 UC-Logic Technology Corp.
  idProduct          0x0047 
  bcdDevice            0.00
  iManufacturer           5 
  iProduct                6 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           59
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     179
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               7
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     181
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               7

this is the dmesg output for the uclogic driver at boot:

[    2.462327] usb 1-9.3.1: New USB device found, idVendor=5543, idProduct=0047
[    2.463652] input: UC-Logic 21.5" Tablet Monitor as /devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9.3/1-9.3.1/1-9.3.1:1.0/0003:5543:0047.0003/input/input18
[    2.463838] hid-generic 0003:5543:0047.0003: input,hidraw2: USB HID v1.11 Mouse [UC-Logic 21.5" Tablet Monitor] on usb-0000:00:14.0-9.3.1/input0
[    2.464718] input: UC-Logic 21.5" Tablet Monitor as /devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9.3/1-9.3.1/1-9.3.1:1.1/0003:5543:0047.0004/input/input19
[    2.464934] hid-generic 0003:5543:0047.0004: input,hiddev0,hidraw3: USB HID v1.11 Mouse [UC-Logic 21.5" Tablet Monitor] on usb-0000:00:14.0-9.3.1/input1
[    2.781894] input: UC-Logic 21.5" Tablet Monitor Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9.3/1-9.3.1/1-9.3.1:1.1/0003:5543:0047.0004/input/input21
[    2.790359] uclogic 0003:5543:0047.0004: input,hiddev0,hidraw2: USB HID v1.11 Mouse [UC-Logic 21.5" Tablet Monitor] on usb-0000:00:14.0-9.3.1/input1
[    2.794241] inxorg.0.logput: UC-Logic 21.5" Tablet Monitor Pen as /devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9.3/1-9.3.1/1-9.3.1:1.0/0003:5543:0047.0003/input/input23
[    2.794303] input: UC-Logic 21.5" Tablet Monitor Pad as /devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9.3/1-9.3.1/1-9.3.1:1.0/0003:5543:0047.0003/input/input24
[    2.794342] uclogic 0003:5543:0047.0003: input,hidraw3: USB HID v1.11 Keypad [UC-Logic 21.5" Tablet Monitor] on usb-0000:00:14.0-9.3.1/input0
andrea@fafner:~$ 

and this is from Xorg.0.log:

[    13.100] (II) config/udev: Adding input device UC-Logic 21.5" Tablet Monitor Pen (/dev/input/event19)
[    13.100] (**) UC-Logic 21.5" Tablet Monitor Pen: Applying InputClass "evdev tablet catchall"
[    13.100] (**) UC-Logic 21.5" Tablet Monitor Pen: Applying InputClass "libinput tablet catchall"
[    13.100] (**) UC-Logic 21.5" Tablet Monitor Pen: Applying InputClass "calibration"
[    13.100] (II) Using input driver 'libinput' for 'UC-Logic 21.5" Tablet Monitor Pen'
[    13.100] (**) UC-Logic 21.5" Tablet Monitor Pen: always reports core events
[    13.100] (**) Option "Device" "/dev/input/event19"
[    13.100] (**) Option "_source" "server/udev"
[    13.152] (II) input device 'UC-Logic 21.5" Tablet Monitor Pen', /dev/input/event19 is tagged by udev as: Tablet
[    13.182] (II) UC-Logic 21.5" Tablet Monitor Pen: tablet unknown to libwacom
[    13.183] (II) input device 'UC-Logic 21.5" Tablet Monitor Pen', /dev/input/event19 is a tablet
[    13.210] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9.3/1-9.3.1/1-9.3.1:1.0/0003:5543:0047.0003/input/input23/event19"
[    13.210] (II) XINPUT: Adding extended input device "UC-Logic 21.5" Tablet Monitor Pen" (type: TABLET, id 12)
[    13.262] (II) input device 'UC-Logic 21.5" Tablet Monitor Pen', /dev/input/event19 is tagged by udev as: Tablet
[    13.274] (II) UC-Logic 21.5" Tablet Monitor Pen: tablet unknown to libwacom
[    13.274] (II) input device 'UC-Logic 21.5" Tablet Monitor Pen', /dev/input/event19 is a tablet
[    13.275] (II) config/udev: Adding input device UC-Logic 21.5" Tablet Monitor Pen (/dev/input/mouse2)
[    13.275] (**) UC-Logic 21.5" Tablet Monitor Pen: Applying InputClass "calibration"
[    13.275] (II) No input driver specified, ignoring this device.
[    13.275] (II) This device may have been added with another device file.
[    13.277] (II) config/udev: Adding input device UC-Logic 21.5" Tablet Monitor Pad (/dev/input/event21)
[    13.277] (**) UC-Logic 21.5" Tablet Monitor Pad: Applying InputClass "evdev tablet catchall"
[    13.277] (**) UC-Logic 21.5" Tablet Monitor Pad: Applying InputClass "libinput tablet catchall"
[    13.277] (**) UC-Logic 21.5" Tablet Monitor Pad: Applying InputClass "calibration"
[    13.277] (II) Using input driver 'libinput' for 'UC-Logic 21.5" Tablet Monitor Pad'
[    13.277] (**) UC-Logic 21.5" Tablet Monitor Pad: always reports core events
[    13.277] (**) Option "Device" "/dev/input/event21"
[    13.277] (**) Option "_source" "server/udev"
[    13.278] (II) input device 'UC-Logic 21.5" Tablet Monitor Pad', /dev/input/event21 is tagged by udev as: Tablet
[    13.278] (EE) libinput bug: Device 'UC-Logic 21.5" Tablet Monitor Pad' does not meet tablet criteria. Ignoring this device.
[    13.278] (II) input device 'UC-Logic 21.5" Tablet Monitor Pad', /dev/input/event21 is a tablet
[    13.292] (II) failed to create input device '/dev/input/event21'.
[    13.292] (EE) libinput: UC-Logic 21.5" Tablet Monitor Pad: Failed to create a device for /dev/input/event21
[    13.292] (EE) PreInit returned 2 for "UC-Logic 21.5" Tablet Monitor Pad"
[    13.292] (II) UnloadModule: "libinput"
[    13.293] (II) config/udev: Adding input device UC-Logic 21.5" Tablet Monitor Pad (/dev/input/js0)
[    13.293] (**) UC-Logic 21.5" Tablet Monitor Pad: Applying InputClass "calibration"
[    13.293] (II) No input driver specified, ignoring this device.
[    13.293] (II) This device may have been added with another device file.
[    13.294] (II) config/udev: Adding input device UC-Logic 21.5" Tablet Monitor Mouse (/dev/input/event18)
[    13.294] (**) UC-Logic 21.5" Tablet Monitor Mouse: Applying InputClass "evdev pointer catchall"
[    13.294] (**) UC-Logic 21.5" Tablet Monitor Mouse: Applying InputClass "libinput pointer catchall"
[    13.294] (**) UC-Logic 21.5" Tablet Monitor Mouse: Applying InputClass "calibration"
[    13.294] (II) Using input driver 'libinput' for 'UC-Logic 21.5" Tablet Monitor Mouse'
[    13.294] (**) UC-Logic 21.5" Tablet Monitor Mouse: always reports core events
[    13.294] (**) Option "Device" "/dev/input/event18"
[    13.294] (**) Option "_source" "server/udev"
[    13.347] (II) input device 'UC-Logic 21.5" Tablet Monitor Mouse', /dev/input/event18 is tagged by udev as: Mouse
[    13.347] (II) input device 'UC-Logic 21.5" Tablet Monitor Mouse', /dev/input/event18 is a pointer caps
[    13.363] (**) Option "config_iuclogic-probenfo" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9.3/1-9.3.1/1-9.3.1:1.1/0003:5543:0047.0004/input/input21/event18"
[    13.363] (II) XINPUT: Adding extended input device "UC-Logic 21.5" Tablet Monitor Mouse" (type: MOUSE, id 13)
[    13.363] (**) Option "AccelerationScheme" "none"
[    13.363] (**) UC-Logic 21.5" Tablet Monitor Mouse: (accel) selected scheme none/0
[    13.363] (**) UC-Logic 21.5" Tablet Monitor Mouse: (accel) acceleration factor: 2.000
[    13.363] (**) UC-Logic 21.5" Tablet Monitor Mouse: (accel) acceleration threshold: 4
[    13.415] (II) input device 'UC-Logic 21.5" Tablet Monitor Mouse', /dev/input/event18 is tagged by udev as: Mouse
[    13.415] (II) input device 'UC-Logic 21.5" Tablet Monitor Mouse', /dev/input/event18 is a pointer caps
[    13.416] (II) config/udev: Adding input device UC-Logic 21.5" Tablet Monitor Mouse (/dev/input/mouse1)
[    13.416] (**) UC-Logic 21.5" Tablet Monitor Mouse: Applying InputClass "calibration"
[    13.416] (II) No input driver specified, ignoring this device.
[    13.416] (II) This device may have been added with another device file.

maybe it can help you, in the meanwhile I will see to collect some data using uclogic-probe and usbhid-dump

@miharenthas
Copy link

miharenthas commented Sep 18, 2017

Hi, sorry for the long silence: I was on the way and didn't have the device with me.

So, attached you can find the lsusb -v -d 5543:0047 and what xinput says.
Interestingly, this time around the pen (UGEE TABLET MONITOR Pen Pen (0)) the pen was recognized right away and was mappable to the screen. No direct USB connection required.
I can't tell if it was a quirk the previous time or if a couple of Kernel updates can have something to do with it.
Also, the second to last section is the output of sudo uclogic-probe | uclogic-decode.
And the last one is usbhid-dump: 003:005:00{0,1} is our guy.

BTW: I can confirm that Gimp does see all the devices (four in total). The good one is the Pen Pen (0). But I don't feel like the sensitivity is off or anything: everything seems to work flawlessly here and with the expected dynamics.

uclogic-monitor-log.txt

@spbnick
Copy link
Member

spbnick commented Sep 19, 2017

@abisaro Yeah, disconnecting is good for you. Did that by going backpacking for three days with my family this summer.

The grayed-out entries in the GIMP device dialog is saved settings for previously connected devices. You can remove them by pressing the little trashcan button below the list.

Thank you for the dumps, I just edited your comment a little, so they would be formatted properly.

@spbnick
Copy link
Member

spbnick commented Sep 19, 2017

@miharenthas, thank you! Hmm, curious that you got it working just like that.

Sorry, I made a mistake in my instructions, and I actually need the output of usbhid-dump -es to get the input stream, and that done after executing uclogic-probe. I.e. the full command should be sudo uclogic-probe BUS DEV && sudo usbhid-dump -es -a BUS:DEV, where BUS is the tablet bus number and DEV its device number in the lsusb output.

@miharenthas
Copy link

miharenthas commented Sep 25, 2017

Hi @spbnick,
So the result of your command, copied verbatim and with bus and devce IDs is:

M 55 00 47 00 45 00 45 00
P 54 00 41 00 42 00 4C 00 45 00 54 00 20 00 4D 00 4F 00 4E 00 49 00 54 00 4F 00 52 00
S 64 0C 03 11 95 D2 53 03 00 FF 07 F0 07
S 65 04 03 20 A0
S 6E 04 03 31 00
S 79 0A 03 46 00 34 00 30 00 31 00
S 7A 08 03 01 00 00 00 00 00
S 7B 0C 03 48 00 4B 00 20 00 4F 00 6E 00

Starting dumping interrupt transfer stream
with 1 minute timeout.

003:005:001:Interrupt transfer timed out
003:005:000:Interrupt transfer timed out
No more interfaces to dump

I'm not really sure if this is what you hoped for.
Sorry it took a while: sadly I'm very busy and I could get around to use the monitor a bit just today.

@spbnick
Copy link
Member

spbnick commented Sep 26, 2017

Thank you @miharenthas. The usbhid-dump command you executed was what I asked. However, could you please also do a few strokes with the pen after starting it? Then it will produce input report stream which I'm interested in.

I understand. Thank you for finding time to do this.

@miharenthas
Copy link

Hi, after a veeery long silence, here I am again.

Attached you can find two files with the dumps of me moving the pen around a) just hovering and updating the position and b) (almost) just pressing it into the monitor, to generate pressure output.

This weekend I have time to do this, so feel free to ask all the questions that pop into your mind!

dump-justmoving.txt
dump-pressure.txt

@miharenthas
Copy link

Hi, is this pull request still alive?
I'm finding it very useful and I'd really like to see it merged: once I got those dumps I posted, what can I do to simplify the driver?

Thanks!

P.S.: the merge conflict should be very easy to solve: I did it on a branch of mine and it's just matter to move some code around.

@spbnick
Copy link
Member

spbnick commented May 4, 2018

Everyone involved with this PR, you're welcome to join the new #DIGImend channel on irc.freenode.net and discuss this PR, other issues and help each other! Come and say "Hi!"

@Deevad Deevad mentioned this pull request May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants