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 Artist 12 (not pro) ? #554

Open
zenny opened this issue Aug 17, 2021 · 10 comments
Open

Support for XP-Pen Artist 12 (not pro) ? #554

zenny opened this issue Aug 17, 2021 · 10 comments

Comments

@zenny
Copy link

zenny commented Aug 17, 2021

Hi,

I could not figure out any way that I can use this driver instead of the proprietary driver from xp-pen (which too is crashing without any debug possibilities).

I tried to do the following:

  1. Appended hid-ids.h with:
    #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_A12 0x080a

Ref: Bus 003 Device 002: ID 28bd:080a UGTABLET 11.6 inch PenDisplay

  1. Appended hid-uclogic-params.c with:
case VID_PID(USB_VENDOR_ID_UGEE,
			USB_DEVICE_ID_UGEE_XPPEN_TABLET_A12):
  1. Appended hid-uclogic-core.c with:
{ HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
				USB_DEVICE_ID_UGEE_XPPEN_TABLET_A12) },
  1. Appended the USBID to xorg.conf:
Section "InputClass"
        Identifier "Ugee/XP-Pen tablets with Wacom driver"
        MatchUSBID "28bd:007[1458]|28bd:0094|28bd:0042|28bd:080a|5543:004[57]|5543:0081|5543:0004|5543:3031"
        MatchDevicePath "/dev/input/event*"
        Driver "wacom"
EndSection
  1. Ran sudo make dkms_install:
$ sudo make dkms_install
dkms add .

Creating symlink /var/lib/dkms/digimend/11/source ->
                 /usr/src/digimend-11

DKMS: add completed.
dkms build digimend/11

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.4.138_1 KVERSION=5.4.138_1...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.4.138_1 (x86_64)
Consult /var/lib/dkms/digimend/11/build/make.log for more information.
make: *** [Makefile:101: dkms_modules_install] Error 10
  1. The /var/lib/dkms/digimend/11/build/make.log shows:
$ cat /var/lib/dkms/digimend/11/build/make.log
DKMS make.log for digimend-11 for kernel 5.4.138_1 (x86_64)
Tue Aug 17 11:12:24 AM CEST 2021
make[1]: Entering directory '/var/lib/dkms/digimend/11/build'
make -C /lib/modules/5.4.138_1/build M=/var/lib/dkms/digimend/11/build modules
make[2]: Entering directory '/usr/src/kernel-headers-5.4.138_1'
  CC [M]  /var/lib/dkms/digimend/11/build/hid-kye.o
  CC [M]  /var/lib/dkms/digimend/11/build/hid-uclogic-core.o
  CC [M]  /var/lib/dkms/digimend/11/build/hid-uclogic-rdesc.o
  CC [M]  /var/lib/dkms/digimend/11/build/hid-uclogic-params.o
In file included from /var/lib/dkms/digimend/11/build/hid-kye.c:21:
/var/lib/dkms/digimend/11/build/hid-ids.h:62:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   62 | xsetwacom --set "$tabletstylus" Area 100 120 32794 32797
      |           ^~
In file included from /var/lib/dkms/digimend/11/build/hid-uclogic-params.c:19:
/var/lib/dkms/digimend/11/build/hid-ids.h:62:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   62 | xsetwacom --set "$tabletstylus" Area 100 120 32794 32797
      |           ^~
In file included from /var/lib/dkms/digimend/11/build/hid-uclogic-params.c:20:
./include/linux/ctype.h: In function '__tolower':
./include/linux/ctype.h:21:22: error: '_ctype' undeclared (first use in this function)
   21 | #define __ismask(x) (_ctype[(int)(unsigned char)(x)])
      |                      ^~~~~~
./include/linux/ctype.h:36:22: note: in expansion of macro '__ismask'
   36 | #define isupper(c) ((__ismask(c)&(_U)) != 0)
      |                      ^~~~~~~~
./include/linux/ctype.h:44:6: note: in expansion of macro 'isupper'
   44 |  if (isupper(c))
      |      ^~~~~~~
./include/linux/ctype.h:21:22: note: each undeclared identifier is reported only once for each function it appears in
   21 | #define __ismask(x) (_ctype[(int)(unsigned char)(x)])
      |                      ^~~~~~
./include/linux/ctype.h:36:22: note: in expansion of macro '__ismask'
   36 | #define isupper(c) ((__ismask(c)&(_U)) != 0)
      |                      ^~~~~~~~
./include/linux/ctype.h:44:6: note: in expansion of macro 'isupper'
   44 |  if (isupper(c))
      |      ^~~~~~~
./include/linux/ctype.h: In function '__toupper':
./include/linux/ctype.h:21:22: error: '_ctype' undeclared (first use in this function)
   21 | #define __ismask(x) (_ctype[(int)(unsigned char)(x)])
      |                      ^~~~~~
./include/linux/ctype.h:31:22: note: in expansion of macro '__ismask'
   31 | #define islower(c) ((__ismask(c)&(_L)) != 0)
      |                      ^~~~~~~~
./include/linux/ctype.h:51:6: note: in expansion of macro 'islower'
   51 |  if (islower(c))
      |      ^~~~~~~
In file included from /var/lib/dkms/digimend/11/build/hid-uclogic-core.c:23:
/var/lib/dkms/digimend/11/build/hid-ids.h:62:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   62 | xsetwacom --set "$tabletstylus" Area 100 120 32794 32797
      |           ^~
In file included from ./include/linux/ioport.h:13,
                 from ./include/linux/device.h:15,
                 from /var/lib/dkms/digimend/11/build/hid-uclogic-core.c:16:
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_inrange_timeout':
./include/linux/kernel.h:994:51: error: invalid use of undefined type 'struct uclogic_drvdata'
  994 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
      |                                                   ^~
./include/linux/compiler.h:397:9: note: in definition of macro '__compiletime_assert'
  397 |   if (!(condition))     \
      |         ^~~~~~~~~
./include/linux/compiler.h:417:2: note: in expansion of macro '_compiletime_assert'
  417 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |  ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
./include/linux/kernel.h:994:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  994 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
      |  ^~~~~~~~~~~~~~~~
./include/linux/kernel.h:994:20: note: in expansion of macro '__same_type'
  994 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
      |                    ^~~~~~~~~~~
./include/linux/timer.h:153:2: note: in expansion of macro 'container_of'
  153 |  container_of(callback_timer, typeof(*var), timer_fieldname)
      |  ^~~~~~~~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:57:36: note: in expansion of macro 'from_timer'
   57 |  struct uclogic_drvdata *drvdata = from_timer(drvdata, t,
      |                                    ^~~~~~~~~~
In file included from <command-line>:
././include/linux/compiler_types.h:133:35: error: invalid use of undefined type 'struct uclogic_drvdata'
  133 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
      |                                   ^~~~~~~~~~~~~~~~~~
./include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
   17 | #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
      |                                ^~~~~~~~~~~~~~~~~~~
./include/linux/kernel.h:997:21: note: in expansion of macro 'offsetof'
  997 |  ((type *)(__mptr - offsetof(type, member))); })
      |                     ^~~~~~~~
./include/linux/timer.h:153:2: note: in expansion of macro 'container_of'
  153 |  container_of(callback_timer, typeof(*var), timer_fieldname)
      |  ^~~~~~~~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:57:36: note: in expansion of macro 'from_timer'
   57 |  struct uclogic_drvdata *drvdata = from_timer(drvdata, t,
      |                                    ^~~~~~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:59:35: error: invalid use of undefined type 'struct uclogic_drvdata'
   59 |  struct input_dev *input = drvdata->pen_input;
      |                                   ^~
/var/lib/dkms/digimend/11/build/hid-kye.c: In function 'kye_report_fixup':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_report_fixup':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:80:13: error: invalid use of undefined type 'struct uclogic_drvdata'
   80 |  if (drvdata->desc_ptr != NULL) {
      |             ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:81:18: error: invalid use of undefined type 'struct uclogic_drvdata'
   81 |   rdesc = drvdata->desc_ptr;
      |                  ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:82:19: error: invalid use of undefined type 'struct uclogic_drvdata'
   82 |   *rsize = drvdata->desc_size;
      |                   ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_input_mapping':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:95:42: error: invalid use of undefined type 'struct uclogic_drvdata'
   95 |  struct uclogic_params *params = &drvdata->params;
      |                                          ^~
/var/lib/dkms/digimend/11/build/hid-kye.c:611:12: error: 'easypen_i405x_rdesc_fixed' undeclared (first use in this function); did you mean 'easypen_m406xe_rdesc_fixed'?
  611 |    rdesc = easypen_i405x_rdesc_fixed;
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
      |            easypen_m406xe_rdesc_fixed
/var/lib/dkms/digimend/11/build/hid-kye.c:611:12: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_input_configured':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:116:42: error: invalid use of undefined type 'struct uclogic_drvdata'
  116 |  struct uclogic_params *params = &drvdata->params;
      |                                          ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:134:10: error: invalid use of undefined type 'struct uclogic_drvdata'
  134 |   drvdata->pen_input = hi->input;
      |          ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_probe':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:208:43: error: invalid application of 'sizeof' to incomplete type 'struct uclogic_drvdata'
  208 |  drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
      |                                           ^
In file included from ./include/linux/workqueue.h:9,
                 from ./include/linux/srcu.h:21,
                 from ./include/linux/notifier.h:16,
                 from ./arch/x86/include/asm/uprobes.h:13,
                 from ./include/linux/uprobes.h:49,
                 from ./include/linux/mm_types.h:14,
                 from ./include/linux/mmzone.h:21,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/xarray.h:14,
                 from ./include/linux/radix-tree.h:18,
                 from ./include/linux/idr.h:15,
                 from ./include/linux/kernfs.h:13,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/device.h:16,
                 from /var/lib/dkms/digimend/11/build/hid-uclogic-core.c:16:
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:213:22: error: invalid use of undefined type 'struct uclogic_drvdata'
  213 |  timer_setup(&drvdata->inrange_timer, uclogic_inrange_timeout, 0);
      |                      ^~
./include/linux/timer.h:125:18: note: in definition of macro '__init_timer'
  125 |  init_timer_key((_timer), (_fn), (_flags), NULL, NULL)
      |                  ^~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:213:2: note: in expansion of macro 'timer_setup'
  213 |  timer_setup(&drvdata->inrange_timer, uclogic_inrange_timeout, 0);
      |  ^~~~~~~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:214:9: error: invalid use of undefined type 'struct uclogic_drvdata'
  214 |  drvdata->re_state = U8_MAX;
      |         ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:218:35: error: invalid use of undefined type 'struct uclogic_drvdata'
  218 |  rc = uclogic_params_init(&drvdata->params, hdev);
      |                                   ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:225:39: error: invalid use of undefined type 'struct uclogic_drvdata'
  225 |  uclogic_params_hid_dbg(hdev, &drvdata->params);
      |                                       ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:226:13: error: invalid use of undefined type 'struct uclogic_drvdata'
  226 |  if (drvdata->params.invalid) {
      |             ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:233:39: error: invalid use of undefined type 'struct uclogic_drvdata'
  233 |  rc = uclogic_params_get_desc(&drvdata->params,
      |                                       ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:234:18: error: invalid use of undefined type 'struct uclogic_drvdata'
  234 |          &drvdata->desc_ptr,
      |                  ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:235:18: error: invalid use of undefined type 'struct uclogic_drvdata'
  235 |          &drvdata->desc_size);
      |                  ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:259:34: error: invalid use of undefined type 'struct uclogic_drvdata'
  259 |   uclogic_params_cleanup(&drvdata->params);
      |                                  ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: At top level:
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:290:41: warning: 'struct uclogic_drvdata' declared inside parameter list will not be visible outside of this definition or declaration
  290 | static int uclogic_raw_event_pen(struct uclogic_drvdata *drvdata,
      |                                         ^~~~~~~~~~~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_raw_event_pen':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:293:43: error: invalid use of undefined type 'struct uclogic_drvdata'
  293 |  struct uclogic_params_pen *pen = &drvdata->params.pen;
      |                                           ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:334:21: error: invalid use of undefined type 'struct uclogic_drvdata'
  334 |   mod_timer(&drvdata->inrange_timer,
      |                     ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: At top level:
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:357:10: warning: 'struct uclogic_drvdata' declared inside parameter list will not be visible outside of this definition or declaration
  357 |   struct uclogic_drvdata *drvdata,
      |          ^~~~~~~~~~~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_raw_event_frame':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:381:26: error: invalid use of undefined type 'struct uclogic_drvdata'
  381 |   u8 prev_state = drvdata->re_state;
      |                          ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:398:10: error: invalid use of undefined type 'struct uclogic_drvdata'
  398 |   drvdata->re_state = state;
      |          ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_raw_event':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:431:42: error: invalid use of undefined type 'struct uclogic_drvdata'
  431 |  struct uclogic_params *params = &drvdata->params;
      |                                          ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:461:34: error: passing argument 1 of 'uclogic_raw_event_pen' from incompatible pointer type [-Werror=incompatible-pointer-types]
  461 |     return uclogic_raw_event_pen(drvdata, data, size);
      |                                  ^~~~~~~
      |                                  |
      |                                  struct uclogic_drvdata *
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:290:58: note: expected 'struct uclogic_drvdata *' but argument is of type 'struct uclogic_drvdata *'
  290 | static int uclogic_raw_event_pen(struct uclogic_drvdata *drvdata,
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:469:6: error: passing argument 1 of 'uclogic_raw_event_frame' from incompatible pointer type [-Werror=incompatible-pointer-types]
  469 |      drvdata, &params->frame_list[i],
      |      ^~~~~~~
      |      |
      |      struct uclogic_drvdata *
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:357:27: note: expected 'struct uclogic_drvdata *' but argument is of type 'struct uclogic_drvdata *'
  357 |   struct uclogic_drvdata *drvdata,
      |   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c: In function 'uclogic_remove':
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:484:25: error: invalid use of undefined type 'struct uclogic_drvdata'
  484 |  del_timer_sync(&drvdata->inrange_timer);
      |                         ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:486:15: error: invalid use of undefined type 'struct uclogic_drvdata'
  486 |  kfree(drvdata->desc_ptr);
      |               ^~
/var/lib/dkms/digimend/11/build/hid-uclogic-core.c:487:33: error: invalid use of undefined type 'struct uclogic_drvdata'
  487 |  uclogic_params_cleanup(&drvdata->params);
      |                                 ^~
make[3]: *** [scripts/Makefile.build:262: /var/lib/dkms/digimend/11/build/hid-kye.o] Error 1
make[3]: *** Waiting for unfinished jobs....
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:262: /var/lib/dkms/digimend/11/build/hid-uclogic-core.o] Error 1
make[3]: *** [scripts/Makefile.build:262: /var/lib/dkms/digimend/11/build/hid-uclogic-params.o] Error 1
make[2]: *** [Makefile:1734: /var/lib/dkms/digimend/11/build] Error 2
make[2]: Leaving directory '/usr/src/kernel-headers-5.4.138_1'
make[1]: *** [Makefile:25: modules] Error 2
make[1]: Leaving directory '/var/lib/dkms/digimend/11/build'
  1. Any input to resolve this issue? Some outpus about the xp-pen artist 12 tablet are follows:
$ xinput list | grep UG
⎜   ↳ UGTABLET 11.6 inch PenDisplay Mouse       id=8    [slave  pointer  (2)]
⎜   ↳ UGTABLET 11.6 inch PenDisplay             id=9    [slave  pointer  (2)]
    ↳ UGTABLET 11.6 inch PenDisplay Keyboard    id=10   [slave  keyboard (3)]
$ lsusb | grep UG
Bus 003 Device 002: ID 28bd:080a UGTABLET 11.6 inch PenDisplay

The tablet pointer gets detected with default kernel drivers that comes with v5.4.138 in tty console, but does not respond inside X! Hopefully this driver may work. Thanks in advance.

/z

@nic3-14159
Copy link

Hello! Does the driver compile at all before you make any changes? Also, could you also post the actual code you wrote somewhere? I can't quite tell what changes you made.

I did notice the line
62 | xsetwacom --set "$tabletstylus" Area 100 120 32794 32797
in the make log, which is unexpected. It seems like somehow there is an xsetwacom command in hid-ids.h? That shouldn't be there if there is.

@zenny

This comment has been minimized.

@zenny
Copy link
Author

zenny commented Aug 17, 2021

Hello! Does the driver compile at all before you make any changes?

Yes as of below:

$ make
make -C /lib/modules/5.4.138_1/build M=/xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers modules
make[1]: Entering directory '/usr/src/kernel-headers-5.4.138_1'
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-kye.o
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-uclogic-core.o
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-uclogic-rdesc.o
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-uclogic-params.o
  LD [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-uclogic.o
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-polostar.o
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-viewsonic.o
  Building modules, stage 2.
  MODPOST 4 modules
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-kye.mod.o
  LD [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-kye.ko
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-polostar.mod.o
  LD [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-polostar.ko
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-uclogic.mod.o
  LD [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-uclogic.ko
  CC [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-viewsonic.mod.o
  LD [M]  /xtbmr/HOMEPOOL/HOME/VOIDHOME.BAK/zenny/Downloads/gitrepos/digimend-kernel-drivers/hid-viewsonic.ko
make[1]: Leaving directory '/usr/src/kernel-headers-5.4.138_1'

Also, could you also post the actual code you wrote somewhere? I can't quite tell what changes you made.

I appended (added lines):

  1. Appended line 60 in hid-ids.h with:
    #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_A12 0x080a

Ref: Bus 003 Device 002: ID 28bd:080a UGTABLET 11.6 inch PenDisplay

  1. Appended line 1195-1196 in hid-uclogic-params.c with:
case VID_PID(USB_VENDOR_ID_UGEE,
			USB_DEVICE_ID_UGEE_XPPEN_TABLET_A12):
  1. Appended 537-538 in hid-uclogic-core.c with:
{ HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
				USB_DEVICE_ID_UGEE_XPPEN_TABLET_A12) },
  1. Appended the USBID 28bd:080a of the tablet to line 26 of xorg.conf to look like:
MatchUSBID "28bd:007[1458]|28bd:0094|28bd:0042|28bd:080a|5543:004[57]|5543:0081|5543:0004|5543:3031"

I did notice the line
62 | xsetwacom --set "$tabletstylus" Area 100 120 32794 32797
in the make log, which is unexpected. It seems like somehow there is an xsetwacom command in hid-ids.h? That shouldn't be there if there is.

I could find no trace of the 62 | xsetwacom --set "$tabletstylus" Area 100 120 32794 32797 in hid-ids.h

@nic3-14159 Thanks for the pointer.

However, compiling again went through, but yet to see whether the stylus works inside X or not.

After a reboot, xinput list fails to detect the tablet completely (getting bad to worse?):

$ lsusb | grep UG
Bus 001 Device 003: ID 28bd:080a UGTABLET 11.6 inch PenDisplay
$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SEMICO USB Keyboard Consumer Control      id=10   [slave  pointer  (2)]
⎜   ↳ PixArt Dell MS116 USB Optical Mouse       id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ SEMICO USB Keyboard                       id=8    [slave  keyboard (3)]
    ↳ SEMICO USB Keyboard                       id=9    [slave  keyboard (3)]
    ↳ SEMICO USB Keyboard System Control        id=11   [slave  keyboard (3)]
$ xsetwacom --list devices
$ lsmod | grep hid
mac_hid                16384  0
uhid                   20480  0
hid_uclogic            32768  0
hid_generic            16384  0
usbhid                 53248  1 hid_uclogic
hid                   131072  4 usbhid,hid_uclogic,hid_generic,uhid
usbcore               266240  10 xhci_hcd,ohci_hcd,ehci_pci,usbhid,hid_uclogic,usbkbd,ehci_hcd,usbmouse,xhci_pci,ohci_pci

Do I need to append something in xorg.conf, too? I have a multihead setup with the xp-pen tablet attached head runs with 60-screen1.conf that reads:

$ cat /etc/X11/60-screen1.conf
# Location: /etc/X11/60-screen1.conf

Section "ServerFlags"
        Option "AllowMouseOpenFail" "on"
        Option "AllowEmptyInput" "on"
        Option "ZapWarning"         "on"
        Option "HandleSpecialKeys"  "off" # Zapping on
        Option "DRI2" "on"
        Option "Xinerama" "off"
EndSection

Section "InputClass"
    Identifier "ignore_other_seats"
    Option "Ignore" "yes"
    MatchLayout "Seat0"
EndSection

Section "InputClass"
    Identifier "keyboard_default"
    MatchTag "seat0"
    MatchLayout "Seat0"
    MatchIsKeyboard "on"
    Driver "evdev"
    Option "xkb_rules" "evdev"
    Option "xkb_model" "evdev"
    Option "xkb_layout" "us"
    Option "GrabDevice" "on"
    Option "Ignore" "no"
EndSection

Section "InputClass"
    Identifier "mouse_default"
    MatchTag "seat0"
    MatchLayout "Seat0"
    MatchIsPointer "on"
    Driver "evdev"
    Option "GrabDevice" "on"
    Option "Ignore" "no"
EndSection

Section "Device"
        Identifier      "Default Card 0"
        Driver          "radeon"
        Option          "NoLogo"                "1"
        BusId           "PCI:1:0:0"
        Option          "ProbeAllGpus"          "false"
        MatchSeat       "seat0"
EndSection

Section "Screen"
        Identifier              "Screen0"
        Device                  "Default Card 0"
        Monitor                 "Asus0"
        DefaultDepth    24
        Option                  "DPI"   "100x100"
        Subsection "Display"
                Depth   24
                Modes   "1920x1080"
        EndSubsection
EndSection

Section "Monitor"
    Identifier     "Asus0"
    VendorName     "Unknown"
    ModelName      "Asus"
    HorizSync       30.0 - 81.0
    VertRefresh     50.0 - 75.0
    Option         "DPMS"
EndSection

Section "ServerLayout"
        Identifier      "Seat0"
        Screen          "Screen0"       0                   0
        Option "Clone" "off"
        Option "SingleCard" "on"
EndSection

xrandr outputs to:

$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  50.00    59.94    59.99
   1920x1080i    60.00    59.94
   1600x1200     60.00
   1680x1050     59.88
   1280x1024     75.02    60.02
   1440x900      59.90
   1280x960      60.00
   1366x768      59.79
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1024x768      75.03    70.07    60.00
   832x624       74.55
   800x600       72.19    75.00    60.32    56.25
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08
DVI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 256mm x 144mm
   1920x1080     60.00*+  62.81    59.94
   1920x1080i   125.62
   1680x1050     61.00
   1280x1024     60.02
   1440x900      59.90
   1360x768      59.95
   1280x720      60.00    59.94
   1024x768      60.00
   1152x648      60.01
   800x600       60.32
   720x480       60.00    59.94
   640x480       60.00    59.94
VGA-0 disconnected (normal left inverted right x axis y axis)

The main screen is connected to HDMI-0 and the tablet to the DVI-0 port of the same card, mirrored display mode (tried with top of each other by running xrandr --output HDMI-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-0 --mode 1920x1080 --pos 0x1080 --rotate normal --output VGA-0 --off, but no go).

Any inputs appreciated! Cheers,

@nic3-14159
Copy link

nic3-14159 commented Aug 17, 2021

Based on where you added the case statement in hid-uclogic-params.c, xinput likely does not recognize your tablet due to issue #550. (Not that the place you added the case statement is necessarily wrong, there just happens to be an issue that only seems to affect tablets there) I have done some debugging with the person who filed that issue, and there is now a potential fix for that (outlined in #553).

Essentially, you just need to add
hdev->quirks |= HID_QUIRK_HIDINPUT_FORCE;
at line 206 in hid-uclogic-core.c

See if that makes xinput recognize your tablet.

Also, I wouldn't be surprised if the tablet buttons don't work properly. It seems like a lot of newer XP-Pen tablets require a new initialization procedure to enable the buttons properly (otherwise they send keyboard events and not tablet button events) There is a pull request (#291) for that procedure, but it hasn't been merged yet and may need to be adapted to work with different models.

@zenny
Copy link
Author

zenny commented Aug 17, 2021

Based on where you added the case statement in hid-uclogic-params.c, xinput likely does not recognize your tablet due to issue #550. (Not that the place you added the case statement is necessarily wrong, there just happens to be an issue that only seems to affect tablets there) I have done some debugging with the person who filed that issue, and there is now a potential fix for that (outlined in #553).

Essentially, you just need to add
hdev->quirks |= HID_QUIRK_HIDINPUT_FORCE;
at line 206 in hid-uclogic-core.c

Thanks I appended the line 206 to hdi-uclogic-core.c, and recompiled and installed.

See if that makes xinput recognize your tablet.

Still not detected by xinput, fyi.

Also, I wouldn't be surprised if the tablet buttons don't work properly. It seems like a lot of newer XP-Pen tablets require a new initialization procedure to enable the buttons properly (otherwise they send keyboard events and not tablet button events) There is a pull request (#291) for that procedure, but it hasn't been merged yet and may need to be adapted to work with different models.

I guess XP-Pen Artist 12 could be their earlier releases?!

@nic3-14159
Copy link

nic3-14159 commented Aug 17, 2021

Still not detected by xinput, fyi.

Just checking, did you either reboot or run sudo modprobe -r hid-uclogic after installing the driver with the fix I suggested? If not, the kernel could still be running the old driver without the fix.

Also, I took a look at the logs you posted in that other issue, and it does appear that the frame buttons emit keyboard events. That, along with some details in the USB device descriptor, tells me that the Artist 12 is indeed one of these newer tablets that need the new init procedure for the frame buttons to work properly.

@zenny
Copy link
Author

zenny commented Aug 17, 2021

Still not detected by xinput, fyi.

Just checking, did you either reboot or run sudo modprobe -r hid-uclogic after installing the driver with the fix I suggested? If not, the kernel could still be running the old driver without the fix.

Rebooted and no go either.

Also, I took a look at the logs you posted in that other issue, and it does appear that the frame buttons emit keyboard events. That, along with some details in the USB device descriptor, tells me that the Artist 12 is indeed one of these newer tablets that need the new init procedure for the frame buttons to work properly.

Is there any way to overcome this?

I see. Then I have a wrong guess.

In my case even the pen stylus pointers/cursor gets detected in tty console (ctrl+alt+fn), but NOT detected inside X even after appending (forcing) as of below inside the xorg.conf:

$ cat /usr/share/X11/xorg.conf.d/60-xppen.conf
Section "InputClass"
        Identifier "XP-Pen Artist 12 Keyboard"
        MatchUSBID "28bd:080a"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "XP-Pen Artist 12"
        MatchIsTablet "on"
        Driver "wacom"
        MatchUSBID "28bd:080a"
        MatchDevicePath "/dev/input/event*"
EndSection

Section "InputClass"
        Identifier "XP-Pen Artist 12 Mouse"
        MatchUSBID "28bd:080a"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Anyway, so nice of you for prompt inputs.

@zenny
Copy link
Author

zenny commented Aug 17, 2021

Meanwhile I just saw the udev.rules file with some strange values. Does this need to be changed, too? If so, to what?

However, in my case, xsetwacom --list devices and xinput list fails to give any output related to the tablet, however libinput list-devices detects the tablet!!!

#291 (comment) points to hwdb.d Is that something to do with that makes the stylus not work inside X?

@kurikaesu
Copy link

Could you do a sudo libinput record and then look for something like this?:

  udev:
    properties:
    - ID_INPUT=1
    - ID_INPUT_HEIGHT_MM=129
    - ID_INPUT_KEY=0
    - ID_INPUT_TABLET=1
    - ID_INPUT_TABLET_PAD=1
    - ID_INPUT_WIDTH_MM=230
    - LIBINPUT_DEVICE_GROUP=3/28bd/909:usb-0000:0a:00.3-2

What I'm interested in is if udev is listing the device as a mouse.

Secondly, if you plug in the tablet and do a dmesg you should be able to see if the driver actually detects the device. The uclogic lines below are digimend driver outputs.:

[89715.950719] usb 3-2.3: new full-speed USB device number 18 using xhci_hcd
[89716.063518] usb 3-2.3: New USB device found, idVendor=28bd, idProduct=0909, bcdDevice= 0.00
[89716.063524] usb 3-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[89716.063526] usb 3-2.3: Product: 9 inch PenTablet
[89716.063529] usb 3-2.3: SerialNumber: 0000000000
[89716.219139] uclogic 0003:28BD:0909.0026: interface is invalid, ignoring
[89716.219730] uclogic 0003:28BD:0909.0027: interface is invalid, ignoring
[89716.227163] input: 9 inch PenTablet Pen as /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.2/0003:28BD:0909.0028/input/input58
[89716.286719] input: 9 inch PenTablet Pad as /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.2/0003:28BD:0909.0028/input/input59
[89716.286839] uclogic 0003:28BD:0909.0028: input,hidraw0: USB HID v1.00 Keypad [9 inch PenTablet] on usb-0000:0a:00.3-2.3/input2
[89716.312365] uclogic 0003:28BD:0909.0026: interface is invalid, ignoring
[89716.314353] uclogic 0003:28BD:0909.0027: interface is invalid, ignoring

@zenny
Copy link
Author

zenny commented Aug 28, 2021

Could you do a sudo libinput record and then look for something like this?:

  udev:
    properties:
    - ID_INPUT=1
    - ID_INPUT_HEIGHT_MM=129
    - ID_INPUT_KEY=0
    - ID_INPUT_TABLET=1
    - ID_INPUT_TABLET_PAD=1
    - ID_INPUT_WIDTH_MM=230
    - LIBINPUT_DEVICE_GROUP=3/28bd/909:usb-0000:0a:00.3-2

What I'm interested in is if udev is listing the device as a mouse.

I have posted the outcomes of libinput record in http://ix.io/3xbL. The further outputs are pressing of the buttons on the tablet.

Secondly, if you plug in the tablet and do a dmesg you should be able to see if the driver actually detects the device. The uclogic lines below are digimend driver outputs.:

[89715.950719] usb 3-2.3: new full-speed USB device number 18 using xhci_hcd
[89716.063518] usb 3-2.3: New USB device found, idVendor=28bd, idProduct=0909, bcdDevice= 0.00
[89716.063524] usb 3-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[89716.063526] usb 3-2.3: Product: 9 inch PenTablet
[89716.063529] usb 3-2.3: SerialNumber: 0000000000
[89716.219139] uclogic 0003:28BD:0909.0026: interface is invalid, ignoring
[89716.219730] uclogic 0003:28BD:0909.0027: interface is invalid, ignoring
[89716.227163] input: 9 inch PenTablet Pen as /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.2/0003:28BD:0909.0028/input/input58
[89716.286719] input: 9 inch PenTablet Pad as /devices/pci0000:00/0000:00:07.1/0000:0a:00.3/usb3/3-2/3-2.3/3-2.3:1.2/0003:28BD:0909.0028/input/input59
[89716.286839] uclogic 0003:28BD:0909.0028: input,hidraw0: USB HID v1.00 Keypad [9 inch PenTablet] on usb-0000:0a:00.3-2.3/input2
[89716.312365] uclogic 0003:28BD:0909.0026: interface is invalid, ignoring
[89716.314353] uclogic 0003:28BD:0909.0027: interface is invalid, ignoring

Meanwhile, I upgraded the linux kernel to v.5.4.142, the libwacom driver detects (without digimend compilation) the tablet and the stylus without digimend, but the the seven buttons on the tablet itself does not respond to, though libinput record detects the events when buttons pressed as seen in http://ix.io/3xbL.

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

3 participants