linuxwacom / xf86-input-wacom

X.Org driver for Wacom devices
356 stars 46 forks source link

Don't report fifth valuator unless it exists on tool #261

Closed skomra closed 2 years ago

skomra commented 2 years ago

Fixes #199

Prior to this commit we assumed that all non Art Pens needed their fifth valuator normalized.

Signed-off-by: Aaron Skomra aaron.skomra@wacom.com

skomra commented 2 years ago

Fix looks good, thanks. A minor style change for readability but I'd really appreciate it if you could add a test case for this too. This is in the core driver code so it should be possible to add a pytest case for it, see test_axis_updates for inspiration.

Hi Peter, thanks for the review. Just to clarify, you want a test added to the test suite that tests that we don't report a fifth (you) / sixth (Ping) valuator for a regular stylus.

Is there any documentation on how to run the test suite?

Thanks, Aaron

whot commented 2 years ago

Basically: sudo pytest except it'll tell you the two missing env vars you need to set up :) ninja -C builddir test also does the trick and it'll set up those env vars for you. But for future reference, there is now this wiki page

skomra commented 2 years ago

Hi Peter, I am getting assert errors for the x value when I try to test the rotation values. Where do the axis values (22400 and 22512 here) get generated.

test/test_wacom.py::test_axis_updates[x] Motion(is_absolute=True, axes=<wacom.EventData object at 0x7fd0d1c1c940 (WacomEventData at 0x24350d0)>), x, 22400, 22512

whot commented 2 years ago

Where do the axis values (22400 and 22512 here) get generated.

Sev() is the "Scaled Event", takes an axis code and a percent, then scales it into the right actual value for the current test device. So Sev("ABS_X", 50) translates into 22400 because the pth660 that we use as (currently our ownly) test device has an axis range of 44800. Most tests should use Sev() to accommodate for different test devices in the future, use Ev() only when it's a very specific value. See test/__init__.py, it has a bit of documentation for all this.

skomra commented 2 years ago

Hi Peter, Thanks that helps. There is this line (178) in test_wacom.py Sev("ABS_Z", 50), # FIXME: what is this axis??

ABS_Z is rotation, but If I add rotation to the map I'm unable to create parameterized rotation events like you do for the other axis. The rotation (current[name]) with rotation as the parameter is always zero despite the fact that I increment it like the other paramaters:

whot commented 2 years ago

This actually came up recently elsewhere and - it's bad naming. The "rotation" axis does not apply to the artpen rotation, only to the cursor/puck rotation axis. The artpen rotation shares the same X valuator as the airbrush wheel [1], so it's handled through the "wheel" axis instead. I fixed this in #265 now, together with a few other cleanups that were necessary.

[1] historical reasons, it's always bloody historical reasons...

skomra commented 2 years ago

Hi Peter, I'm running your test with just the "wheel" axis and a different (non-art) pen ( 0x16802)

+@pytest.mark.parametrize("axis", [ "wheel"])
+#@pytest.mark.parametrize("axis", ["x", "y", "pressure", "tilt_x", "tilt_y", "wheel"])
 def test_axis_updates(mainloop, opts, axis):
     """
     Check that the various axes come through correctly
@@ -175,7 +176,7 @@ def test_axis_updates(mainloop, opts, axis):
             return axes[map[axis]]

         ev = [
-            Ev("ABS_MISC", PenId.ARTPEN),
+            Ev("ABS_MISC", PenId.CINTIQ_13_PEN),
             Ev("MSC_SERIAL", 0x123456),
             Sev("ABS_X", 50 + axval("x")),
             Sev("ABS_Y", 50 + axval("y")),
@@ -212,9 +213,14 @@ def test_axis_updates(mainloop, opts, axis):
     first = {name: getattr(next(events).axes, name) for name in map}

     for e in events:
+        print("event " +str(e))
         current = {name: getattr(e.axes, name) for name in map}
+        print("current " + str(current))
         for name in map:
-            if name == axis:
-                assert first[name] < current[name]
-            else:
-                assert first[name] == current[name]
+            print(str(name) + ", " + str(first[name]) + ", " + str(current[name]))
+            #if name == axis:
+            #    assert first[name] < current[name]
+            #else:
+            #    assert first[name] == current[name]

I see the wheel value change in test-xi2 (below), but not in a print statment that I added to the loop at the end of your test (below below). I'm probably making a mistake somewhere or don't understand something, but I'm stuck so I thought I'd reach out for help.


----------------------------------

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -900.00 (-900.00)

EVENT type 12 (PropertyEvent)
     property: 513 'Wacom Serial IDs'
     changed: modified
EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -836.00 (-836.00)

EVENT type 12 (PropertyEvent)
     property: 512 'Wacom Pressurecurve'
     changed: modified
EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -773.00 (-773.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -709.00 (-709.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -646.00 (-646.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -583.00 (-583.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -519.00 (-519.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -456.00 (-456.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -393.00 (-393.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -329.00 (-329.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -266.00 (-266.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -203.00 (-203.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -139.00 (-139.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -76.00 (-76.00)

EVENT type 17 (RawMotion)
    device: 2 (15)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: -13.00 (-13.00)

---------------------------------

root@aas:/home/aas/git/xf86-input-wacom# cd /home/aas/git/xf86-input-wacom; export GI_TYPELIB_PATH="$PWD/builddir:$GI_TYPELIB_PATH";export LD_LIBRARY_PATH="$PWD/builddir:$LD_LIBRARY_PATH"; pytest -s -vv -k test_axis_updates
================================================================== test session starts ===================================================================
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/aas/git/xf86-input-wacom
collected 6 items / 5 deselected / 1 selected                                                                                                            

test/test_wacom.py::test_axis_updates[wheel] ________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d460 (WacomEventData at 0x15bfe00)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d4c0 (WacomEventData at 0x164ee00)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d520 (WacomEventData at 0x164ee70)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d580 (WacomEventData at 0x164eee0)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d5e0 (WacomEventData at 0x1588680)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d640 (WacomEventData at 0x15886f0)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d6a0 (WacomEventData at 0x1588760)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d700 (WacomEventData at 0x15a3700)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
________________________________________
event Motion(is_absolute=True, axes=<wacom.EventData object at 0x7f5729c9d760 (WacomEventData at 0x15a3770)>)
current {'x': 22400, 'y': 14800, 'pressure': 0, 'tilt_x': 0, 'tilt_y': 0, 'wheel': 0}
------------------------------------
x, 22400, 22400
------------------------------------
y, 14800, 14800
------------------------------------
pressure, 0, 0
------------------------------------
tilt_x, 0, 0
------------------------------------
tilt_y, 0, 0
------------------------------------
wheel, 0, 0
PASSED
whot commented 2 years ago

python side-note: use f-strings for easier string composition, e.g.:

print(f"{name}, {first[name]}, {current[name])}")

iirc this also implicitly calls str() on the variable passed in.

Applying the same printfs locally on the master branch - the wheel axis still updates, so if it doesn't on your system that means the patch you have seems to work :)

Why it still updates in X... not sure. Assuming you've installed correctly and restarted X so the new driver is picked up this must be an issue in the X driver layer. There's a DBG() in wcmSendEvents() immediately after your code - what does that show in the X log?

skomra commented 2 years ago

Hi Peter,

I realize now that I neglected to mention that the above test output was done without my patch applied. My apologies. I am trying to create the failing test first and then apply my patch and then see that the issue is resolved.

The wacom device is created by your test system during the test process, and I don't think (iirc) that I can set the log level on a device that has not been created. Is there a way to set the log level without the device id. Maybe I just need to figure out how to printf the dbg message instead.

Thanks, Aaron

jigpu commented 2 years ago

Hi Aaron,

The test suite already initializes the driver's log levels to maximum and captures its output, but the Python logger apparently isn't configured to actually write the output anywhere. I don't know if there's a better solution, but if you apply the following patch and re-run pytest you should see all the output.

diff --git a/test/__init__.py b/test/__init__.py
index e6d93fa..00558b1 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -39,6 +39,7 @@ except ValueError as e:
     raise ImportError("Unable to load GIR bindings")

+logging.basicConfig(level=logging.DEBUG)
 logger = logging.getLogger(__name__)
skomra commented 2 years ago

Why it still updates in X... not sure. Assuming you've installed correctly and restarted X so the new driver is picked up this must be an issue in the X driver layer. There's a DBG() in wcmSendEvents() immediately after your code - what does that show in the X log?

Hi Peter, Thanks for the patch! Here's the DBG output without my patch applied:


test/test_wacom.py::test_axis_updates[wheel] DEBUG:test:Found device: PTH660
DEBUG:test:PreInit for 'Wacom Intuos Pro M Pen' with options {'CommonDBG': '12', 'DebugLevel': '12', 'Device': '/dev/input/event24'}
DEBUG:test:DEBUG:  1: usbDetect                       | 
INFO:test:I: type not specified, assuming 'stylus'.
INFO:test:I: other types will be automatically added.
DEBUG:test:DEBUG:  1: usbWcmInit                      | initializing USB tablet
DEBUG:test:DEBUG:  6: usbWcmInitPadState              | Initializing PAD channel 17
INFO:test:p: using pressure threshold of 851 for button 1
INFO:test:c: panscroll is 0
INFO:test:c: panscroll modified to 2600
INFO:test:p: maxX=44800 maxY=29600 maxZ=8191 resX=200000 resY=200000  tilt=enabled
INFO:test:I: hotplugging dependent devices.
INFO:test:I: hotplugging completed.
DEBUG:test:DEBUG:  4: wcmLinkTouchAndPen              | No suitable device to link with found.
DEBUG:test:DEBUG: 10: usbDetectConfig                 | 
DEBUG:test:DEBUG: 10: wcmDevInit                      | (type 1) 8 buttons, 6 axes
DEBUG:test:DEBUG: 10: wcmDevOpen                      | 
DEBUG:test:DEBUG: 10: wcmReadPacket                   | fd=7
DEBUG:test:DEBUG:  1: wcmReadPacket                   | pos=0 remaining=256
DEBUG:test:DEBUG: 10: wcmReadPacket                   | buffer has 240 bytes
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 7 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=3 code=40 value=92162
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=3 code=0 value=22400
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[3]->type=3 code=1 value=14800
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[4]->type=3 code=24 value=4096
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[5]->type=1 code=320 value=1
DEBUG:test:DEBUG:  6: usbParseKeyEvent                | USB stylus detected 140
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[6]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=0 aw2=0 rw=0 t=0 px=1 st=0 cs=0
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: storeRawSample                  | initialize channel data.
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=0    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG:  6: wcmSendButtons                  | buttons=0
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=36
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=36 aw2=0 rw=0 t=0 px=1 st=0 cs=0
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: wcmReadPacket                   | fd=7
DEBUG:test:DEBUG:  1: wcmReadPacket                   | pos=0 remaining=256
DEBUG:test:DEBUG: 10: wcmReadPacket                   | buffer has 240 bytes
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=72
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=72 aw2=0 rw=0 t=0 px=1 st=0 cs=1
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=108
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=108 aw2=0 rw=0 t=0 px=1 st=0 cs=2
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=144
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=144 aw2=0 rw=0 t=0 px=1 st=0 cs=3
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: wcmReadPacket                   | fd=7
DEBUG:test:DEBUG:  1: wcmReadPacket                   | pos=0 remaining=256
DEBUG:test:DEBUG: 10: wcmReadPacket                   | buffer has 240 bytes
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=180
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=180 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=216
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=216 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=252
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=252 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: wcmReadPacket                   | fd=7
DEBUG:test:DEBUG:  1: wcmReadPacket                   | pos=0 remaining=256
DEBUG:test:DEBUG: 10: wcmReadPacket                   | buffer has 240 bytes
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=288
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=288 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=324
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=324 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=360
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=360 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=396
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=396 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: wcmReadPacket                   | fd=7
DEBUG:test:DEBUG:  1: wcmReadPacket                   | pos=0 remaining=256
DEBUG:test:DEBUG: 10: wcmReadPacket                   | buffer has 216 bytes
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=432
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=432 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=468
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=468 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG: 10: usbParseEvent                   | 
DEBUG:test:DEBUG:  6: usbDispatchEvents               | 3 events received
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[0]->type=4 code=0 value=1193046
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[1]->type=3 code=2 value=504
DEBUG:test:DEBUG: 11: usbDispatchEvents               | event[2]->type=0 code=0 value=0
DEBUG:test:DEBUG: 10: usbDispatchEvents               | Dirty flag set on channel 0; sending event.
DEBUG:test:DEBUG: 10: wcmEvent                        | channel = 0
DEBUG:test:DEBUG: 10: wcmEvent                        | c=0 i=92162 t=1 s=0x123456 x=22400 y=14800 b=0 p=4096 rz=0 tx=0 ty=0 aw=504 aw2=0 rw=0 t=0 px=1 st=0 cs=4
DEBUG:test:DEBUG: 11: wcmEvent                        | tool id=1 for Wacom Intuos Pro M Pen stylus
DEBUG:test:DEBUG: 11: check_arbitrated_control        | Event from active device; maintaining pointer control.
DEBUG:test:DEBUG: 10: commonDispatchDevice            | device type = 1
DEBUG:test:DEBUG: 10: wcmFilterCoord                  | common->wcmRawSample = 4
DEBUG:test:DEBUG: 10: wcmCheckSuppress                | level = 2 return value = 8
DEBUG:test:DEBUG: 10: wcmRotateAndScaleCoordinates    | rotate/scaled to 22400/14800
DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162    serial=1193046  button=false    buttons=0
DEBUG:test:DEBUG: 10: sendWheelStripEvents            | 
DEBUG:test:DEBUG: 10: wcmReadPacket                   | fd=7
DEBUG:test:DEBUG:  1: wcmReadPacket                   | pos=0 remaining=256
DEBUG:test.test_wacom:We have 16 events
whot commented 2 years ago

but the Python logger apparently isn't configured to actually write the output anywhere.

pytest --log-level=DEBUG should do the trick, you can ask pytest to redirect to log files etc too.

Here's the DBG output without my patch applied:

fwiw, please attach anything longer than 15 lines of noise or wider than the github box, it's a lot easier to download an attachment and look at it locally than scrolling around here. Having said that:

DEBUG:test:DEBUG:  6: wcmSendEvents                   | abs o_prox=1    prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0   id=92162        serial=1193046  button=false    buttons=0                                                                               

the wheel: ... is missing here which means the flag is not set, so the driver itself doesn't pass it on. But when I run this with:

$ sudo ./test/wacom-test-env.sh
root $ pytest -k test_axis_updates --log-level=DEBUG
...
DEBUG    test:__init__.py:196 DEBUG:  6: wcmSendEvents                   | abs o_prox=1 prox=1  x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 0, wheel: -709  id=92162    serial=1193046  button=false    buttons=0

Note how the wheel: -709 is present here? The local diff on top of bcd984bdc353f2b4524debe36a11f58d0e81f346 is this:

diff --git a/test/__init__.py b/test/__init__.py
index 70a3c186..cefd140d 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -44,6 +44,7 @@ logger = logging.getLogger(__name__)

 class PenId(enum.IntEnum):
     ARTPEN = 0x100804
+    CINTIQ_13_PEN = 0x16802

 @attr.s
diff --git a/test/test_wacom.py b/test/test_wacom.py
index f7dffd35..4233a476 100644
--- a/test/test_wacom.py
+++ b/test/test_wacom.py
@@ -146,7 +146,8 @@ def test_relative_motion(mainloop, opts, rotate):
     assert all([m == motions[0] for m in motions])

-@pytest.mark.parametrize("axis", ["x", "y", "pressure", "tilt_x", "tilt_y", "wheel"])
+#@pytest.mark.parametrize("axis", ["x", "y", "pressure", "tilt_x", "tilt_y", "wheel"])
+@pytest.mark.parametrize("axis", ["wheel"])
 def test_axis_updates(mainloop, opts, axis):
     """
     Check that the various axes come through correctly
@@ -175,7 +176,8 @@ def test_axis_updates(mainloop, opts, axis):
             return axes[map[axis]]

         ev = [
-            Ev("ABS_MISC", PenId.ARTPEN),
+            #Ev("ABS_MISC", PenId.ARTPEN),
+            Ev("ABS_MISC", PenId.CINTIQ_13_PEN),
             Ev("MSC_SERIAL", 0x123456),
             Sev("ABS_X", 50 + axval("x")),
             Sev("ABS_Y", 50 + axval("y")),
@@ -218,3 +220,5 @@ def test_axis_updates(mainloop, opts, axis):
                 assert first[name] < current[name]
             else:
                 assert first[name] == current[name]
+
+    assert False

The assert False at the end of the test to make it fail and dump the output. The only difference in the two test outputs is the result of a6828caa94f5fd9c81880eb11da294eed9cc48af which suggests you're not running on top of master (could be that 5d4ef8ac9088427dabbe5b6d5e367bb44c1d59bc is the fix then)

skomra commented 2 years ago

Thanks Peter, as you suggested, I was neglecting to build the test before running it. Even though I could change the tests without doing the build, I needed to rebuild to catch the changes you made to the system.

skomra commented 2 years ago

Hi Peter, I've found that whether or not I get the wheel valuator depends on if I include "wheel" in the map:

+    map = {
+        "x": 0,
+        "y": 1,
+        "pressure": 2,
+        "tilt_x": 3,
+        "tilt_y": 4,
+        "wheel": 5,
+    }

Xintput test doesn't show the wheel value with my code (branch just updated) ,

EVENT type 17 (RawMotion)
    device: 2 (23)
    detail: 0
    flags: 
    valuators:
          0: 22400.00 (22400.00)
          1: 14800.00 (14800.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 24.00 (24.00)

but if I have wheel in this struct I automatically get wheel in the test output.

DEBUG test:__init__.py:196 DEBUG: 6: wcmSendEvents | abs o_prox=1 prox=1 x: 22400, y: 14800, pressure: 0, tilt-x: 0, tilt-y: 24, wheel: -900 id=92162 serial=1193046 button=false buttons=0

Perhaps I don't fully understand how the test is supposed to work.

whot commented 2 years ago

pytest runs the test with one of the parametrize as argument axis. So for one test run, axis == "wheel". The map dictionary maps "wheel" to axis number 5 (this is the index into the axes array below, a purely test-internal number). In the for i in range() this results in axes == [0, 0, 0, 0, 0, i, 0, 0...], i.e. only index 5 is set to the current range value.

All ev = [... events below use the form of 50 + axval("axisname") - since we're running for "wheel" this means that all events end up being 50% of range, only the wheel axis changes each iteration to 50%, then 52%, then 54%, etc.

In other words: this mapping and the loop give us a way to send identical (and thus unchanging) events for all axes but the one we want to test - thus allowing the test to be parametrized instead of rewriting it for each axis. The easier-to-understand but harder to read version of this would be this repeated for each axis:

  wheel_value = 50;
  if axis == "wheel":
      wheel_value += i;
  Sev("ABS_Z", wheel_value)

Anyway, events are written to the device,the Monitor collects them and we then run through the events to check that all but our current axis have not changed, and that our axis is larger than the first event (could give a false positive, we're only comparing to the first event, not the previous event).

first ends up being a dictionary of { "wheel": event.axis.wheel, "x", event.axis.x, ...} for whatever the first event is in the list. current the same, just inside the loop.

Long story short: if wheel isn't in the map, the ABS_Z event never changes value which means the driver never sends any updates for it either. We should have assert axis in map to avoid this potential bug.

skomra commented 2 years ago

Hi Peter,

Thanks for your help here, bear with me here.

It seems to me that, in order to be able to test that the wheel valuator is no longer present I would need to:

  1. copy pasta your test_axis_updates() test (including changes to add the wheel)
  2. change the pen type
  3. leave "wheel" (unused) in the map
  4. remove the parametrize parameter "wheel"
  5. edit: comment out the wheel Sev : #Sev("ABS_Z", 50 + axval("wheel")),
  6. assert that I don't see the wheel in the events received by the driver in the test

This isn't working for me though because, although the wheel no longer shows up in "xinput test-xi2", I still see "wheel" values returned in the test.

If I remove "wheel" from the map of my copy pasta test described above, and roll back my patch, the test passes anyway. So I feel like I'm not testing anything if I do that.

Hope that explains where I'm stuck.

Thanks, Aaron

Pinglinux commented 2 years ago

Close this PR. The actual fix is in #270