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

Support for XP-Pen Deco Pro M Tablet #366

Open
rastislav-janci opened this issue Mar 30, 2020 · 17 comments
Open

Support for XP-Pen Deco Pro M Tablet #366

rastislav-janci opened this issue Mar 30, 2020 · 17 comments

Comments

@rastislav-janci
Copy link

I wold like to properly use XP-Pen Deco Pro tablet. Is there work being done on the XP-Pen Deco Pro Medium? The tablet, touchpad and stylus are recognized, and I can draw with pressure in gimp and krita, but I cannot assign any buttons, the wheel or the touchpad. Here are the debug outputs:

XP-PEN_DecoPro-descriptors.txt
XP-PEN_DecoPro-hid_report_descriptors.txt
XP-PEN_DecoPro-keys_top_left_to_bottom_right_bottop_rows.txt
XP-PEN_DecoPro-keys_top_left_to_bottom_right_top_rows.txt
XP-PEN_DecoPro-pen_coords.txt
XP-PEN_DecoPro-pen_input_keys.txt
XP-PEN_DecoPro-pen_input_no_touch.txt
XP-PEN_DecoPro-pen_input_touch.txt
XP-PEN_DecoPro-pen_presure.txt
XP-PEN_DecoPro-pen_tilt.txt
XP-PEN_DecoPro-phy_wheel_scrolling.txt
XP-PEN_DecoPro-probe.txt
XP-PEN_DecoPro-touch_pad_circular_scrolling.txt
XP-PEN_DecoPro-touch_pad_left_right.txt
XP-PEN_DecoPro-touch_pad_up_down.txt

@OdinVex
Copy link

OdinVex commented Aug 9, 2021

I have the Small. They now also have a Bluetooth version of S and M, SW and MW. The XP-Pen Tablet app is...what it is. Using a uclogic probe turned the ring LED red. I was hoping to add this to the libwacom project.

@JoseExposito
Copy link
Collaborator

JoseExposito commented Jul 10, 2022

Hi!

I just added support for the XP-PEN Deco Pro Small tablet to the mainline kernel:
https://lore.kernel.org/linux-input/20220710175043.192901-1-jose.exposito89@gmail.com/T/

I don't own the tablet. Instead, I built a modified version of DIGImend and the user who reported the issue tested it for me:
https://gitlab.freedesktop.org/libinput/libinput/-/issues/738#note_1453926

Your tablet (XP-Pen Deco Pro M) should be very similar. If you could test the code, I'll add support for it in the kernel as well.

Could you test these drivers?

First, download the source code: digimend-kernel-drivers.tar.gz
The source code contains the code from DIGImend plus the changes required to add support for your tablet.

In order to install it, you'll need to install the kernel headers:

$ sudo apt-get install -y "linux-headers-$(uname -r)"

After extracting the code, cd into the source code and:

$ make
$ sudo make install

You can uninstall it running:

$ sudo make uninstall

More detailed instructions are available in the DIGImend README file.

@JoseExposito
Copy link
Collaborator

Ooops, I forgot to ping the people who reacted to the first message and won't get notified: @rastislav-janci @OdinVex @yohanboniface @nek0 @fabienengels @BloodyMess @skandalfo @okitoxo @kanashimia

Please check my previous message

@OdinVex
Copy link

OdinVex commented Jul 11, 2022

@JoseExposito, I've tested it, and it shows my device under xsetwacom list, works in Krita, pressure, et cetera, all buttons too, but the ring and pad do not. I was hoping for a mouse-mode, but that too doesn't work (or is that off out-of-box?). I did need to add my lsusb to my 70-wacom.conf (Linux Mint) so that it would be handled. The name it reports is whacked, wish I could override it: " 9 inch PenTablet" with an extra space at the beginning. I hate closed-source firmware. Edit: Ring and pad works with xppentablet app.

@JoseExposito
Copy link
Collaborator

Hi @OdinVex , thanks a lot for the quick test.

the ring and pad do not [work]

Both the dial (ring) and touchpad should work. If not, something unexpected happened.

Could you run sudo libinput record and copy/attach the output after selecting the interface that ends in "Pad", please?

While running the command, if you press the tablet buttons or use the dial you should see the events on the terminal.

The XP-PEN firmware expose a string indicating the tablet capabilities, including the kind of frame. It could possible that the firmware is not setting a byte as expected.

Edit: Ring and pad works with xppentablet app.

Is the device working then? Or did you need to tweak some settings or similar?

@OdinVex
Copy link

OdinVex commented Jul 11, 2022

Hi @OdinVex , thanks a lot for the quick test.

the ring and pad do not [work]

Both the dial (ring) and touchpad should work. If not, something unexpected happened.

Could you run sudo libinput record and copy/attach the output after selecting the interface that ends in "Pad", please?

While running the command, if you press the tablet buttons or use the dial you should see the events on the terminal.

The XP-PEN firmware expose a string indicating the tablet capabilities, including the kind of frame. It could possible that the firmware is not setting a byte as expected.

Edit: Ring and pad works with xppentablet app.

Is the device working then? Or did you need to tweak some settings or similar?

I have a ton of devices that interact with libinput all the time, too difficult to sort (hardware developer). As for the ring and pad, it only worked with the xppentablet app *.deb from XP-Pen. If I remove the digimend driver compile from above, I can use the ring and pad. This could be something on my end, I do a ton of libinput and event overrides for so many things.

@JoseExposito
Copy link
Collaborator

Hi!

I have a ton of devices that interact with libinput all the time, too difficult to sort

It is difficult to tell without knowing which kind of frame the driver is setting for your device.

Since I imagine you feel confortable coding, you can try to add the following line to hid-uclogic-params.c in the driver I sent to you:

static int uclogic_params_ugee_v2_init(struct uclogic_params *params,
				       struct hid_device *hdev)
[...]
	/* Initialize the frame interface */
+	frame_type = UCLOGIC_PARAMS_FRAME_MOUSE;
	switch (frame_type) {
	case UCLOGIC_PARAMS_FRAME_DIAL:
	case UCLOGIC_PARAMS_FRAME_MOUSE:
		rc = uclogic_params_ugee_v2_init_frame_dial(&p, desc_params,
							    ARRAY_SIZE(desc_params));
		break;
	case UCLOGIC_PARAMS_FRAME_BUTTONS:
	default:
		rc = uclogic_params_ugee_v2_init_frame_buttons(&p, desc_params,
							       ARRAY_SIZE(desc_params));
		break;
	}

	if (rc) {
		uclogic_params_init_invalid(&p);
		goto output;
	}

I have seen another tablet reporting an invalid frame_type and it might also be the case for your device.

Otherwise lets see if somebody else with less devices connected to their computer can test the driver and run sudo libinput record.

Thanks!

@OdinVex
Copy link

OdinVex commented Jul 11, 2022

@JoseExposito, Tested, no change as far as mousing goes.

XP-Pen Tablet App:
Mouse Mode Enabled: Pen will function like a trackpad, you can lift your pen and reposition your cursor as if pushing it around (like a real mouse), but it disables Pressure and maybe Angle?
Mouse Mode Disabled: Pen position is absolute, X:Y ends up being X:Y on screen area. In short, at 0:0 on the tablet, the cursor goes to 0:0 on the screen area. At max:max, it goes to the bottom right of the screen area, and in a multiple monitor situation...it goes to the other viewport. Eg, on a two-monitor setup, only half the tablet is usable for me.

I'm hoping the driver can be extended to operate in Mouse-Mode with pressure+/angle.
To further clarify which version of the hardware I'm using: Non-BT, Small, via USB-C.

@andigandi
Copy link

Is this worth testing with the Deco Pro MW version? At least when connected via USB?

https://www.xp-pen.com/product/915.html

@JoseExposito
Copy link
Collaborator

@OdinVex :

Mouse Mode Disabled: Pen position is absolute, X:Y ends up being X:Y on screen area. In short, at 0:0 on the tablet, the cursor goes to 0:0 on the screen area. At max:max, it goes to the bottom right of the screen area, and in a multiple monitor situation...it goes to the other viewport. Eg, on a two-monitor setup, only half the tablet is usable for me.

Ah ok, I misunderstood your first comment. I thought you said that the touchpad (that acts like a mouse) didn't work. However this is a different issue.

I seems like from the XP-PEN app it is possible to change the way the pen works (absolute coordinates vs relative coordinates), and the mouse/relative mode doesn't work. I'd need to investigate how that works. I image it sends a packet to the tablet firmware to change the working mode.

To further clarify which version of the hardware I'm using: Non-BT, Small, via USB-C

That's interesting. I assumed you were using the Medium version of the device, not the Small version.
It is surprising that the dial and the touchpad are not working.

Your device is the same one used by this user:
https://gitlab.freedesktop.org/libinput/libinput/-/issues/738#note_1455009

And he got his device fully working.


@andigandi it'd be nice. I'm own a Deco Pro SW and hopefully the small and the medium versions should work in a similar way.

In order to avoid commenting here, could you create a different bug report, please? Make sure to ping me (@JoseExposito) so I get notified.

I'd only need your device model and ID when connected over USB and/or using the USB dongle.
In my case both IDs are the same.

The easiest way to find out the device model/ID is to run sudo lininput record, select your device (any interface) and copy and paste a line that looks like:

    # ID: bus 0x3 vendor 0x28bd product 0x933 version 0x111

@OdinVex
Copy link

OdinVex commented Jul 11, 2022

@JoseExposito, I did, the Ring and Pad do not work as well. :/ I may or may not have once reverse-engineered the XP-Pen Windows software and found abs/rel wasn't controlled by the device, but rather the driver. As for why mine may not work, it could be the various libinput configs, maybe a stray udev, or the xppentablet app. Mind, the Deco Pro S that I have worked out of box with stock Linux Mint kernel, no xppentablet app, et cetera. I just didn't have full control over everything, such as limiting the area on screen to a specific monitor.

@Danthe-GH
Copy link

@JoseExposito
Hello. I use an XP-Pen Deco Pro M
It works well for me, but xsetwacom doesn't detect it
when I set "/etc/X11/xorg.conf.d/50-tablet.conf"
xsetwacom list 11 inch PenTablet stylus id: 13 type: STYLUS 11 inch PenTablet Pad pad id: 14 type: PAD
the pad works, but when I use the touch the whole tablet stops working, I have to disconnect it and it just works again until the touch is used.

@JoseExposito
Copy link
Collaborator

Hi @Danthe-GH ,

Support for the XP-Pen Deco Pro M has been queued to be released for Linux kernel 6.3:
https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/log/?h=for-6.3/uclogic

You can try to take those patches and compile your own kernel with them applied. Hopefully, your device should be fully supported. There are multiple guides online explaining how to do it, it changes a bit depending on the distro you are using.

@Danthe-GH
Copy link

Danthe-GH commented Jan 22, 2023

Hi @Danthe-GH ,

Support for the XP-Pen Deco Pro M has been queued to be released for Linux kernel 6.3: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/log/?h=for-6.3/uclogic

You can try to take those patches and compile your own kernel with them applied. Hopefully, your device should be fully supported. There are multiple guides online explaining how to do it, it changes a bit depending on the distro you are using.

Thanks for the reply, but I only see support for Deco Pro S (0x0909), Deco Pro Sw (0x0933) and Deco Pro MW (0x0934).
No support for Deco Pro M (0x0904)

JoseExposito added a commit to JoseExposito/linux that referenced this issue Jan 23, 2023
The XP-PEN Deco Pro M is a UGEE v2 device with a frame with 8 buttons,
a bitmap dial and a mouse. Its pen has 2 buttons, supports tilt and
pressure.

All the pieces to support it are already in place. Add its ID in order
to support the device.

Link: DIGImend/digimend-kernel-drivers#366
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
@JoseExposito
Copy link
Collaborator

Ah sorry, the names are too similar and I mixed them in my head.

Could you test this driver, please? digimend-kernel-drivers.zip.

It includes the latest changes from the mainline kernel and support for your tablet.

You can follow the instructions available in this comment.

I added your tablet ID to the xorg.conf file present in DIGImend, so hopefully you won't need to change your local config.

but when I use the touch the whole tablet stops working, I have to disconnect it and it just works again until the touch is used

Does this happen when you touch the tablet with the pen? Or when you touch the circular touchpad present on the left hand side of the tablet?

This issue reminds me to https://gitlab.freedesktop.org/libinput/libinput/-/issues/839. The difference is that this user was experimenting issues after using the stylus button.

Could you attach the output of sudo libinput record as a text file, please? You should see 3 interfaces for your tablet (Pen, Pad and Mouse) and events when interacting with them.

@Danthe-GH
Copy link

The problem happens when I touch the touchpad, the whole tablet stops responding, however, when libinput is executed, the tablet reacts and the crash does not happen.
Mouse.txt
Pad.txt
Pen.txt

@JoseExposito
Copy link
Collaborator

The kernel side seems to be working as expected. The only problem that I noticed is that the pad udev properties:

  udev:
    properties:
    - ID_INPUT=1
    - ID_INPUT_KEY=1
    - LIBINPUT_DEVICE_GROUP=3/28bd/904:usb-0000:0a:00.3-2

Should include:

    - ID_INPUT_TABLET=1
    - ID_INPUT_TABLET_PAD=1

You can solve it adding your device to libwacom:
https://github.com/linuxwacom/libwacom#adding-tablet-descriptions-to-libwacom

About the issue with the tablet not responding after using the touchpad, it'd be interesting to test it again after adding your device to libwacom. Also, if you could run sudo libinput debug-events --verbose, press a pad button, use the touchpad and then press again the same button and use the stylus and attach the output, we'll have more information about what is going on.

For reference, this is a simplified overview about how libinput's tools work:

kernel -> libinput record -> libinput -> libinput debug-events -> apps

You output of libinput record does not show any issues in the kernel output. sudo libinput debug-events --verbose will help us to understand if the problem is with libinput.

Anyway, I'd try to add your device to libwacom, as it might fix the issue.

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

No branches or pull requests

5 participants