linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Trouble with an HP stylus
@ 2014-07-24 15:52 Éric Brunet
  2014-07-29  9:50 ` Jiri Kosina
  0 siblings, 1 reply; 5+ messages in thread
From: Éric Brunet @ 2014-07-24 15:52 UTC (permalink / raw)
  To: jkosina, linux-input

Hi,

I have a HP EliteBook Revolve 810 (which is a hybrid laptop/tablet) with
the HP active pen that goes with it. I have installed fedora 20 (kernel
3.15.6-200.fc20.x86_64) on this, and the pen does not work out of the box.
Playing with evtest, it appears that the kernel reports the X coordinate in
ABS_X and in ABS_Y, while the Y coordinate goes into ABS_Z and ABS_RX; here
are a few lines of output:

Event: time 1406153996.865044, -------------- SYN_REPORT ------------
Event: time 1406153996.873047, type 3 (EV_ABS), code 0 (ABS_X), value 1087
Event: time 1406153996.873047, type 3 (EV_ABS), code 1 (ABS_Y), value 1087
Event: time 1406153996.873047, type 3 (EV_ABS), code 2 (ABS_Z), value 1599
Event: time 1406153996.873047, type 3 (EV_ABS), code 3 (ABS_RX), value 1599

Of course, XOrg's evdev driver is confused and the pointer is stuck on the
diagonal X=Y.

I guess this hardware needs a new quirk to usbhid, unless there is already
a way to correct it ?

Here is the content of /sys/class/input/event8/device/uevent:

PRODUCT=3/3eb/840b/111
NAME="Atmel Atmel maXTouch Digitizer Pen"
PHYS="usb-0000:00:1a.0-1.1/input0"
UNIQ=""
PROP=0
EV=1b
KEY=c01 1 0 0 0 0
ABS=100000f
MSC=10
MODALIAS=input:b0003v03EBp840Be0111-
e0,1,3,4,k100,140,14A,14B,ra0,1,2,3,18,m4,lsfw

I hope I gave enough information on this. I don't read the mailing list,
please CC any answer.

Thanks,

	Éric Brunet

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble with an HP stylus
  2014-07-24 15:52 Trouble with an HP stylus Éric Brunet
@ 2014-07-29  9:50 ` Jiri Kosina
  2014-07-29 14:41   ` Jiri Kosina
  2014-07-29 14:45   ` Benjamin Tissoires
  0 siblings, 2 replies; 5+ messages in thread
From: Jiri Kosina @ 2014-07-29  9:50 UTC (permalink / raw)
  To: Éric Brunet; +Cc: linux-input

On Thu, 24 Jul 2014, Éric Brunet wrote:

> I have a HP EliteBook Revolve 810 (which is a hybrid laptop/tablet) with
> the HP active pen that goes with it. I have installed fedora 20 (kernel
> 3.15.6-200.fc20.x86_64) on this, and the pen does not work out of the box.
> Playing with evtest, it appears that the kernel reports the X coordinate in
> ABS_X and in ABS_Y, while the Y coordinate goes into ABS_Z and ABS_RX; here
> are a few lines of output:
> 
> Event: time 1406153996.865044, -------------- SYN_REPORT ------------
> Event: time 1406153996.873047, type 3 (EV_ABS), code 0 (ABS_X), value 1087
> Event: time 1406153996.873047, type 3 (EV_ABS), code 1 (ABS_Y), value 1087
> Event: time 1406153996.873047, type 3 (EV_ABS), code 2 (ABS_Z), value 1599
> Event: time 1406153996.873047, type 3 (EV_ABS), code 3 (ABS_RX), value 1599
> 
> Of course, XOrg's evdev driver is confused and the pointer is stuck on the
> diagonal X=Y.
> 
> I guess this hardware needs a new quirk to usbhid, unless there is already
> a way to correct it ?
> 
> Here is the content of /sys/class/input/event8/device/uevent:
> 
> PRODUCT=3/3eb/840b/111
> NAME="Atmel Atmel maXTouch Digitizer Pen"
> PHYS="usb-0000:00:1a.0-1.1/input0"
> UNIQ=""
> PROP=0
> EV=1b
> KEY=c01 1 0 0 0 0
> ABS=100000f
> MSC=10
> MODALIAS=input:b0003v03EBp840Be0111-
> e0,1,3,4,k100,140,14A,14B,ra0,1,2,3,18,m4,lsfw
> 
> I hope I gave enough information on this. I don't read the mailing list,
> please CC any answer.

Does the patch below fix the problem for you please?






diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 31e6727..d48574d 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -97,6 +97,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET },
+	{ 0x03EB, 0x840B, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5, HID_QUIRK_MULTI_INPUT },

-- 
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Trouble with an HP stylus
  2014-07-29  9:50 ` Jiri Kosina
@ 2014-07-29 14:41   ` Jiri Kosina
  2014-07-29 14:45   ` Benjamin Tissoires
  1 sibling, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2014-07-29 14:41 UTC (permalink / raw)
  To: Éric Brunet; +Cc: linux-input

On Tue, 29 Jul 2014, Jiri Kosina wrote:

> Does the patch below fix the problem for you please?
> 
> 
> 
> 
> diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
> index 31e6727..d48574d 100644
> --- a/drivers/hid/usbhid/hid-quirks.c
> +++ b/drivers/hid/usbhid/hid-quirks.c
> @@ -97,6 +97,7 @@ static const struct hid_blacklist {
>  	{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET },
>  	{ USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN, HID_QUIRK_NOGET },
>  	{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET },
> +	{ 0x03EB, 0x840B, HID_QUIRK_MULTI_INPUT },
>  	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT },
>  	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U, HID_QUIRK_MULTI_INPUT },
>  	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5, HID_QUIRK_MULTI_INPUT },

Alternatively, if you don't want to recompile your kernel, you can achieve 
the equivalent result by modprobing the 'usbhid' module with 
'quirks=0x03EB:0x840B:0x40' module parameter.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble with an HP stylus
  2014-07-29  9:50 ` Jiri Kosina
  2014-07-29 14:41   ` Jiri Kosina
@ 2014-07-29 14:45   ` Benjamin Tissoires
  1 sibling, 0 replies; 5+ messages in thread
From: Benjamin Tissoires @ 2014-07-29 14:45 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Éric Brunet, linux-input

Hi Jiri, Eric,


On Tue, Jul 29, 2014 at 5:50 AM, Jiri Kosina <jkosina@suse.cz> wrote:
> On Thu, 24 Jul 2014, Éric Brunet wrote:
>
>> I have a HP EliteBook Revolve 810 (which is a hybrid laptop/tablet) with
>> the HP active pen that goes with it. I have installed fedora 20 (kernel
>> 3.15.6-200.fc20.x86_64) on this, and the pen does not work out of the box.
>> Playing with evtest, it appears that the kernel reports the X coordinate in
>> ABS_X and in ABS_Y, while the Y coordinate goes into ABS_Z and ABS_RX; here
>> are a few lines of output:
>>
>> Event: time 1406153996.865044, -------------- SYN_REPORT ------------
>> Event: time 1406153996.873047, type 3 (EV_ABS), code 0 (ABS_X), value 1087
>> Event: time 1406153996.873047, type 3 (EV_ABS), code 1 (ABS_Y), value 1087
>> Event: time 1406153996.873047, type 3 (EV_ABS), code 2 (ABS_Z), value 1599
>> Event: time 1406153996.873047, type 3 (EV_ABS), code 3 (ABS_RX), value 1599
>>
>> Of course, XOrg's evdev driver is confused and the pointer is stuck on the
>> diagonal X=Y.
>>
>> I guess this hardware needs a new quirk to usbhid, unless there is already
>> a way to correct it ?
>>
>> Here is the content of /sys/class/input/event8/device/uevent:
>>
>> PRODUCT=3/3eb/840b/111
>> NAME="Atmel Atmel maXTouch Digitizer Pen"
>> PHYS="usb-0000:00:1a.0-1.1/input0"
>> UNIQ=""
>> PROP=0
>> EV=1b
>> KEY=c01 1 0 0 0 0
>> ABS=100000f
>> MSC=10
>> MODALIAS=input:b0003v03EBp840Be0111-
>> e0,1,3,4,k100,140,14A,14B,ra0,1,2,3,18,m4,lsfw
>>
>> I hope I gave enough information on this. I don't read the mailing list,
>> please CC any answer.
>
> Does the patch below fix the problem for you please?
>

I have already seen this Atmel panel, and the problem was that they used twice X then twice Y to report coordinates:

0x05, 0x01,                    //     Usage Page (Generic Desktop)    590
0x55, 0x0e,                    //     Unit Exponent (-2)              592
0x65, 0x11,                    //     Unit (Centimeter,SILinear)      594
0x35, 0x00,                    //     Physical Minimum (0)            596
0x75, 0x10,                    //     Report Size (16)                598
0x95, 0x02,                    //     Report Count (2)                600
0x46, 0x00, 0x0a,              //     Physical Maximum (2560)         602
0x26, 0xff, 0x0f,              //     Logical Maximum (4095)          605
0x09, 0x30,                    //     Usage (X)                       608
0x81, 0x02,                    //     Input (Data,Var,Abs)            610
0x46, 0xa0, 0x05,              //     Physical Maximum (1440)         612
0x26, 0xff, 0x0f,              //     Logical Maximum (4095)          615
0x09, 0x31,                    //     Usage (Y)                       618
0x81, 0x02,                    //     Input (Data,Var,Abs)            620

I have no ideas why they did that, but this is a pretty bad idea. I thought at the time that it was just a prototype and that they would fix it for the release, but I was wrong.

I think, a better patch would simply consist in that:

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 2619f7f..b70d4c3 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -603,7 +603,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                        if (field->flags & HID_MAIN_ITEM_RELATIVE)
                                map_rel(usage->hid & 0xf);
                        else
-                               map_abs(usage->hid & 0xf);
+                               map_abs_clear(usage->hid & 0xf);
                        break;
 
                case HID_GD_HATSWITCH:

-----

I have the report descriptors and some traces of it, so I could definitively make some more tests, but I will have to first finish the wacom bits I scheduled for today.

Eric, if you can give a shot to my patch (you can try Jiri's too, but I don't think it will work), that would simplify my process, and I will just have to reformat/submit it properly.

Cheers,
Benjamin
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Trouble with an HP stylus
@ 2014-07-30 21:50 Éric Brunet
  0 siblings, 0 replies; 5+ messages in thread
From: Éric Brunet @ 2014-07-30 21:50 UTC (permalink / raw)
  To: benjamin.tissoires; +Cc: jkosina, linux-input, eric.brunet

Hi!

Thanks for both answers.

To recall the context:

>PRODUCT=3/3eb/840b/111
>NAME="Atmel Atmel maXTouch Digitizer Pen"
>
>Playing with evtest, it appears that the kernel reports the X coordinate
>in ABS_X and in ABS_Y, while the Y coordinate goes into ABS_Z and ABS_RX;
 
> I have already seen this Atmel panel, and the problem was that they used
> twice X then twice Y to report coordinates:
> 
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 2619f7f..b70d4c3 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -603,7 +603,7 @@ static void hidinput_configure_usage(struct hid_input
> *hidinput, struct hid_fiel if (field->flags & HID_MAIN_ITEM_RELATIVE)
> map_rel(usage->hid & 0xf);
>                         else
> -                               map_abs(usage->hid & 0xf);
> +                               map_abs_clear(usage->hid & 0xf);
>                         break;
> 
>                 case HID_GD_HATSWITCH: 

Yep, this patch helps. It helps a lot. the ABS_X and ABS_Y coordinates are now 
correct, the ABS_Z and ABS_RX coordinates are gone, I can point and click with 
the pen.

However, things do not work totally as expected, and the pen remains unusable 
for many drawing applications. I am not sure if the problem lies in the 
input/hid system, or in Xorg's evdev driver or in the applications, but the 
problem I am about to describe occurs only with the pen: everything works as 
expected with the touchpad (recognized as a simple mouse) or with the finger on 
the touchscreen:
  * when I try to make annotations with okular with the "draw a freehand line" 
tool, the line I draw with the pen jumps (drawing a straight line) to some 
apparently random point outside okular's window and jumps back (drawing 
another straight line) to where the pen is, several times per second. I don't 
want to send a jpg to the whole mailing list, but I can send a snapshot on a 
private email on request.
  * when I try to use a drawing tool with gimp or mypaint, each time I raise
the pen and put it at some other place to make another drawing, a straight line 
is drawn between the last and the new position of the pen.

Here is what happens on evtest if I touch the screen with the pen, move a
bit and stops touching; I didn't see anything suspicious, except maybe that 
sometimes there is a single ABS_X or a single ABS_Y without the other 
coordinate between two SYN_REPORT.

Event: time 1406710046.690615, type 1 (EV_KEY), code 320 (BTN_TOOL_PEN), value 1
Event: time 1406710046.690615, type 3 (EV_ABS), code 0 (ABS_X), value 3279
Event: time 1406710046.690615, type 3 (EV_ABS), code 1 (ABS_Y), value 2555
Event: time 1406710046.690615, -------------- SYN_REPORT ------------
Event: time 1406710046.697616, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1406710046.697616, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1406710046.697616, -------------- SYN_REPORT ------------
Event: time 1406710046.713550, type 3 (EV_ABS), code 0 (ABS_X), value 3287
Event: time 1406710046.713550, type 3 (EV_ABS), code 1 (ABS_Y), value 2539
[ Many other EV_ABS events]
Event: time 1406710047.317556, type 3 (EV_ABS), code 0 (ABS_X), value 3755
Event: time 1406710047.317556, type 3 (EV_ABS), code 1 (ABS_Y), value 1699
Event: time 1406710047.317556, -------------- SYN_REPORT ------------
Event: time 1406710047.340556, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1406710047.340556, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1406710047.340556, -------------- SYN_REPORT ------------
Event: time 1406710047.342504, type 1 (EV_KEY), code 320 (BTN_TOOL_PEN), value 0
Event: time 1406710047.342504, -------------- SYN_REPORT ------------

Thanks again for the patch,

        Éric Brunet
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-30 22:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 15:52 Trouble with an HP stylus Éric Brunet
2014-07-29  9:50 ` Jiri Kosina
2014-07-29 14:41   ` Jiri Kosina
2014-07-29 14:45   ` Benjamin Tissoires
  -- strict thread matches above, loose matches on Subject: below --
2014-07-30 21:50 Éric Brunet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).