Problems with Wacom Intuos PT M (CTH680) on FreeBSD
Hello,
I'm using FreeBSD 10.1 and FreeBSD use webcamd witch contain linux wacom driver to provide wacom tablets support. More info here: http://www.selasky.org/hans_petter/video4bsd/ or http://www.freshports.org/multimedia/webcamd/
I've got latest version of webcamd and Wacom device CTH680, but device isn't working correct.
dmesg:
ugen2.3: <Wacom Co.,Ltd.> at usbus2
ums0: <Wacom Co.,Ltd. Intuos PTM, class 0/0, rev 2.00/1.00, addr 3> on usbus2
uhid2: <Wacom Co.,Ltd. Intuos PTM, class 0/0, rev 2.00/1.00, addr 3> on usbus2
uhid3: <Wacom Co.,Ltd. Intuos PTM, class 0/0, rev 2.00/1.00, addr 3> on usbus2
here are two outputs from webcamd:
first (/usr/local/sbin/webcamd -i 0 -d ugen2.3 -U webcamd -G webcamd -H):
: USB HID core driver
Linux video capture interface: v2.00lirc_dev: IR Remote Control driver registered, major 14
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR LIRC bridge handler initialized
IR XMP protocol handler initialized
uvcvideo: Unable to create debugfs directory
USB Video Class driver (1.1.1)
cpia2: V4L-Driver for Vision CPiA2 based cameras v3.0.1 au0828 driver loaded
pvrusb2: V4L in-tree version:Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tuner
pvrusb2: Debug mask is 31 (0x1f)
USBVision USB Video Device Driver for Linux : 0.9.11
em28xx: Registered (Em28xx v4l2 Extension) extension
em28xx: Registered (Em28xx dvb Extension) extension
Attached to ugen2.3[0]
DBG: 0003:056A:0303.0001: Kicking head 1 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 2 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 3 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 4 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 5 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 6 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 7 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 8 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 9 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 10 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 11 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 12 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 13 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 14 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 15 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 16 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 17 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 18 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 19 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 20 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 21 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
INFO: 0003:056A:0303.0001: П│F: USB HID v1.10 Device [Wacom Co.,Ltd. Intuos PTM] on usb-/dev/usb-/dev/usb/input0
Waiting for HAL USB device.
Creating /dev/input/event0
#------------------------------------------
second (/usr/local/sbin/webcamd -i 1 -d ugen2.3 -U webcamd -G webcamd -H):
#------------------------------------------
: USB HID core driver
Linux video capture interface: v2.00lirc_dev: IR Remote Control driver registered, major 14
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR LIRC bridge handler initialized
IR XMP protocol handler initialized
uvcvideo: Unable to create debugfs directory
USB Video Class driver (1.1.1)
cpia2: V4L-Driver for Vision CPiA2 based cameras v3.0.1 au0828 driver loaded
pvrusb2: V4L in-tree version:Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tuner
pvrusb2: Debug mask is 31 (0x1f)
USBVision USB Video Device Driver for Linux : 0.9.11
em28xx: Registered (Em28xx v4l2 Extension) extension
em28xx: Registered (Em28xx dvb Extension) extension
Attached to ugen2.3[1]
DBG: 0003:056A:0303.0001: Kicking head 1 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
DBG: 0003:056A:0303.0001: Kicking head 2 tail 0
ERR: 0003:056A:0303.0001: usb_submit_urb(ctrl) failed: -32
INFO: 0003:056A:0303.0001: П│F: USB HID v1.10 Device [Wacom Co.,Ltd. Intuos PTM] on usb-/dev/usb-/dev/usb/input1
Waiting for HAL USB device.
Creating /dev/input/event1
Creating /dev/input/event2
Creating /dev/input/js0
At the end, sometimes after few manipulations the touch by fingers starts working. Pen never works.
Can anyone help to resolve this problem? If you need other logs, please ask. --
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Denis,
Quoted 9 lines · Denis Akiyakov
Hello,
I'm using FreeBSD 10.1 and FreeBSD use webcamd witch contain linux wacom driver to provide wacom tablets support. More info here:
http://www.selasky.org/hans_petter/video4bsd/ or
http://www.freshports.org/multimedia/webcamd/I've got latest version of webcamd and Wacom device CTH680, but device isn't working correct.
Have you tried the device with Linux instead of FreeBSD? If it works in Linux that means that the port of linux drivers to BSD is to blame and you need to contact its authors, otherwise we need to adjust wacom driver in kernel for this device.
Thanks.
Signature · 1 line
Dmitry
Quoted 10 lines · Dmitry Torokhov
Hi Denis,
Quoted 7 lines · Denis Akiyakov
Hello,
I'm using FreeBSD 10.1 and FreeBSD use webcamd witch contain linux wacom driver to provide wacom tablets support. More info here:
http://www.selasky.org/hans_petter/video4bsd/ or
http://www.freshports.org/multimedia/webcamd/
Quoted 9 lines
Quoted 2 lines
I've got latest version of webcamd and Wacom device CTH680, but device isn't working correct.
Have you tried the device with Linux instead of FreeBSD? If it works in Linux that means that the port of linux drivers to BSD is to blame and you need to contact its authors, otherwise we need to adjust wacom driver in kernel for this device.
Thanks.
Hello, Dmitry.
I've tried tablet in Ubuntu 14.04.1. All functions that work in Windows 7 (in Krita) work under Ubuntu's Krita.
Thank you for your attention.
Quoted 18 lines · Denis Akiyakov
Quoted 17 lines · Dmitry Torokhov
Hi Denis,
Quoted 9 lines · Denis Akiyakov
Hello,
I'm using FreeBSD 10.1 and FreeBSD use webcamd witch contain linux wacom driver to provide wacom tablets support. More info here:
http://www.selasky.org/hans_petter/video4bsd/ or
http://www.freshports.org/multimedia/webcamd/I've got latest version of webcamd and Wacom device CTH680, but device isn't working correct.
Have you tried the device with Linux instead of FreeBSD? If it works in Linux that means that the port of linux drivers to BSD is to blame and you need to contact its authors, otherwise we need to adjust wacom driver in kernel for this device.
Quoted 9 lines
Quoted 2 lines
Thanks.
Hello, Dmitry.
I've tried tablet in Ubuntu 14.04.1. All functions that work in Windows 7 (in Krita) work under Ubuntu's Krita.
Thank you for your attention.
Hi,
The problem appears to be that webcamd launches two instances for each interface, so the shared data is not the same like with Linux. Actually the shared data is NULL.
I think however it would be clever that the Linux Wacom code would check "wacom->shared->touch_input" for NULL before using it, because it is not always set. This can be an easy way to crash the kernel when plugging a USB devices.
drivers/hid/wacom_wac.c:1395
and some more places.
--HPS
Hi Hans,
Quoted 31 lines · Hans Petter Selasky
Quoted 29 lines · Denis Akiyakov
Quoted 15 lines · Dmitry Torokhov
Hi Denis,
Quoted 10 lines · Denis Akiyakov
Hello,
I'm using FreeBSD 10.1 and FreeBSD use webcamd witch contain linux wacom driver to provide wacom tablets support. More info here:
http://www.selasky.org/hans_petter/video4bsd/ or
http://www.freshports.org/multimedia/webcamd/I've got latest version of webcamd and Wacom device CTH680, but device isn't working correct.
Quoted 7 lines
Have you tried the device with Linux instead of FreeBSD? If it works in Linux that means that the port of linux drivers to BSD is to blame and you need to contact its authors, otherwise we need to adjust wacom driver in kernel for this device.
Thanks.
Hello, Dmitry.
I've tried tablet in Ubuntu 14.04.1. All functions that work in Windows 7 (in Krita) work under Ubuntu's Krita.
Quoted 6 lines
Quoted 2 lines
Thank you for your attention.
Hi,
The problem appears to be that webcamd launches two instances for each interface, so the shared data is not the same like with Linux. Actually the shared data is NULL.
If shared is NULL on FreeBSD, you need to make sure that part of code is portable on FreeBSD. On Linux, the driver would fail to load if shared is NULL since at least the current data can be assigned to wacom_shared (please refer to wacom_add_shared_data() in wacom_sys.c for detail).
Quoted 3 lines
I think however it would be clever that the Linux Wacom code would check "
wacom->shared->touch_input" for NULL before using it, because it is not always set. This can be an easy way to crash the kernel when plugging a USB devices.
drivers/hid/wacom_wac.c:1395
touch_input is used in 6 places (4 times in wacom_wac.c and 2 times in wacom_sys.c). They are called only when touch_max is not zero, that is, only when touch input is defined.
If touch_input is NULL on FreeBSD, you need to figure out the root cause. Checking on touch_input itself would not fix the root cause...
We are here to help if there is anything unclear to you in the code.
Cheers,
Ping
Quoted 2 lines · Ping Cheng
If
touch_inputis NULL on FreeBSD, you need to figure out the root cause. Checking ontouch_inputitself would not fix the root cause...
Right.
The root cause is that FreeBSD launches two instances of the driver, running in two different userland processes, for the two different Wacom interfaces on a common USB device. In Linux the wacom interface drivers are running from the same kernel, and can share the data in question, but in FreeBSD's webcamd emulation, this doesn't work. Then the first wacom probe call would have to grab the second interface.
Technically speaking this is a FreeBSD only problem and I plan to deliver a patch with the webcamd software to fix this, like already suggested to you guys. This situation can also happen on Linux in case of a "BadUSB" device. That's why I think that the NULL check should be upstreamed.
--HPS
Quoted 14 lines · Hans Petter Selasky
Quoted 2 lines · Ping Cheng
If
touch_inputis NULL on FreeBSD, you need to figure out the root cause. Checking ontouch_inputitself would not fix the root cause...Right.
The root cause is that FreeBSD launches two instances of the driver, running in two different userland processes, for the two different Wacom interfaces on a common USB device. In Linux the wacom interface drivers are running from the same kernel, and can share the data in question, but in FreeBSD's webcamd emulation, this doesn't work. Then the first wacom probe call would have to grab the second interface.
Quoted 5 lines
Technically speaking this is a FreeBSD only problem and I plan to deliver a patch with the webcamd software to fix this, like already suggested to you guys. This situation can also happen on Linux in case of a "BadUSB" device. That's why I think that the NULL check should be upstreamed.
Hmm, looking at this again it seems that we just cross our fingers and hope that both interfaces are enumerated by the time we get event data from the device. I do not think this is quite safe. We probably should be checking the overall state of probing (i.e. whether we are done probing both interfaces) before processing data for the device.
Or maybe we should just forcibly try claiming secondary interface while probing primary instead of messing with shared data item.
That won't help Hans though: the devices do use 2 interfaces in tandem, treating them separately will result in incorrect behavior.
Thanks.
Signature · 1 line
Dmitry
Hi Dmitry,
Quoted 21 lines · Dmitry Torokhov
Quoted 14 lines · Hans Petter Selasky
Quoted 2 lines · Ping Cheng
If
touch_inputis NULL on FreeBSD, you need to figure out the root cause. Checking ontouch_inputitself would not fix the root cause...Right.
The root cause is that FreeBSD launches two instances of the driver, running in two different userland processes, for the two different Wacom interfaces on a common USB device. In Linux the wacom interface drivers are running from the same kernel, and can share the data in question, but in FreeBSD's webcamd emulation, this doesn't work. Then the first wacom probe call would have to grab the second interface.
Quoted 5 lines
Technically speaking this is a FreeBSD only problem and I plan to deliver a patch with the webcamd software to fix this, like already suggested to you guys. This situation can also happen on Linux in case of a "BadUSB" device. That's why I think that the NULL check should be upstreamed.
Quoted 5 lines
Hmm, looking at this again it seems that we just cross our fingers and hope that both interfaces are enumerated by the time we get event data from the device. I do not think this is quite safe. We probably should be checking the overall state of probing (i.e. whether we are done probing both interfaces) before processing data for the device.
Are you going to make a patch to address the issue?
Quoted 2 lines
Or maybe we should just forcibly try claiming secondary interface while probing primary instead of messing with shared data item.
If we incorporate the above idea into a patch, we need to keep in mind that not all tablets support touch data. So, not all tablets have two interfaces.
Cheers,
Ping
Quoted 7 lines
That won't help Hans though: the devices do use 2 interfaces in tandem, treating them separately will result in incorrect behavior.
Thanks.
--
Dmitry
Quoted 25 lines · Ping Cheng
Hi Dmitry,
Quoted 21 lines · Dmitry Torokhov
Quoted 19 lines · Hans Petter Selasky
Quoted 2 lines · Ping Cheng
If
touch_inputis NULL on FreeBSD, you need to figure out the root cause. Checking ontouch_inputitself would not fix the root cause...Right.
The root cause is that FreeBSD launches two instances of the driver, running in two different userland processes, for the two different Wacom interfaces on a common USB device. In Linux the wacom interface drivers are running from the same kernel, and can share the data in question, but in FreeBSD's webcamd emulation, this doesn't work. Then the first wacom probe call would have to grab the second interface.
Technically speaking this is a FreeBSD only problem and I plan to deliver a patch with the webcamd software to fix this, like already suggested to you guys. This situation can also happen on Linux in case of a "BadUSB" device. That's why I think that the NULL check should be upstreamed.
Quoted 7 lines
Quoted 5 lines
Hmm, looking at this again it seems that we just cross our fingers and hope that both interfaces are enumerated by the time we get event data from the device. I do not think this is quite safe. We probably should be checking the overall state of probing (i.e. whether we are done probing both interfaces) before processing data for the device.
Are you going to make a patch to address the issue?
Not in the nearest future, sorry.
Quoted 7 lines
Quoted 3 lines
Or maybe we should just forcibly try claiming secondary interface while probing primary instead of messing with shared data item.
If we incorporate the above idea into a patch, we need to keep in mind that not all tablets support touch data. So, not all tablets have two interfaces.
Right, but we do know the models that use multiple interfaces, right?
Signature · 1 line
Dmitry
Quoted 32 lines · Dmitry Torokhov
Quoted 31 lines · Ping Cheng
Hi Dmitry,
Quoted 26 lines · Dmitry Torokhov
Quoted 14 lines · Hans Petter Selasky
Quoted 2 lines · Ping Cheng
If
touch_inputis NULL on FreeBSD, you need to figure out the root cause. Checking ontouch_inputitself would not fix the root cause...Right.
The root cause is that FreeBSD launches two instances of the driver, running in two different userland processes, for the two different Wacom interfaces on a common USB device. In Linux the wacom interface drivers are running from the same kernel, and can share the data in question, but in FreeBSD's webcamd emulation, this doesn't work. Then the first wacom probe call would have to grab the second interface.
Quoted 5 lines
Technically speaking this is a FreeBSD only problem and I plan to deliver a patch with the webcamd software to fix this, like already suggested to you guys. This situation can also happen on Linux in case of a "BadUSB" device. That's why I think that the NULL check should be upstreamed.
Hmm, looking at this again it seems that we just cross our fingers and hope that both interfaces are enumerated by the time we get event data from the device. I do not think this is quite safe. We probably should be checking the overall state of probing (i.e. whether we are done probing both interfaces) before processing data for the device.
Quoted 3 lines
Quoted 1 line
Are you going to make a patch to address the issue?
Not in the nearest future, sorry.
No problem. I just want to make sure we don't duplicate the work...
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Or maybe we should just forcibly try claiming secondary interface while probing primary instead of messing with shared data item.
I looked into the code. It is not a simple task to claim secondary interface while probing the primary one. For some devices, there is no easy way to tell if they have multi-interfaces or not before accessing the data,
Quoted 5 lines
Quoted 3 lines
If we incorporate the above idea into a patch, we need to keep in mind that not all tablets support touch data. So, not all tablets have two interfaces.
Right, but we do know the models that use multiple interfaces, right?
Some models may have same product ID but can have pen or pen and touch interfaces. We'll have to request the device to be sure...
Since touch_input is the only shared data/pointer that should not be called before all interlaces are probed, checking on touch_input when it is called, as suggested by Hans, is a feasible solution. As a by-product, it also fixes the FreeBSD issue.
I'll post my patch here soon.
Ping