Bug 20789 - evdev: no scroll-wheel reports for "trackman", but is detected fine
Summary: evdev: no scroll-wheel reports for "trackman", but is detected fine
Status: RESOLVED NOTOURBUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/evdev (show other bugs)
Version: 7.4 (2008.09)
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-21 15:25 UTC by clemens fischer
Modified: 2009-03-22 15:20 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description clemens fischer 2009-03-21 15:25:45 UTC
# Xorg -version
X.Org X Server 1.6.0
Release Date: 2009-2-25
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.28-ARCH i686 
Current Operating System: Linux spotteswoode.dnsalias.org 2.6.28-ARCH #1 SMP PREEMPT Sun Mar 8 10:18:28 UTC 2009 i686
Build Date: 02 March 2009  06:09:25PM

The trackball is a USB connected "Logitech TrackMan Wheel".  It has two buttons plus a clickable scroll-wheel.  Everything works except for the wheel.  I cannot see any wheel related events reported by either xev(1) or the evtest.c program posted here some time ago:

# evtest /dev/input/event4 
Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x46d product 0xc404 version 0x110
Input device name: "Logitech Trackball"
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 272 (LeftBtn)
    Event code 273 (RightBtn)
    Event code 274 (MiddleBtn)
  Event type 2 (Relative)
    Event code 0 (X)
    Event code 1 (Y)
    Event code 8 (Wheel)
  Event type 4 (Misc)
    Event code 4 (ScanCode)
Testing ... (interrupt to exit)
...

The Xlog.0.log says:
(==) Using config file: "/etc/X11/xorg.conf"
(**) Option "defaultserverlayout" "layout_nv"
(**) ServerLayout "layout_nv"
(**) |-->Screen "nv_on_liteon" (0)
(**) |   |-->Monitor "liteon"
(**) |   |-->Device "nv_onboard_ga_m61p"
(**) |-->Input Device "le_trackball"
(**) |-->Input Device "Mouse2"
(**) |-->Input Device "Keyboard0"
(**) Option "DontZap" "off"
(**) Option "DisableModInDev" "on"
(**) Option "AllowMouseOpenFail" "on"
(**) Option "BlankTime" "133"
(**) Option "StandbyTime" "133"
(**) Option "SuspendTime" "133"
(**) Option "OffTime" "133"
(**) Option "Xinerama" "off"
(**) Option "AllowEmptyInput" "off"
(**) Option "IgnoreABI" "off"
(**) Option "AutoAddDevices" "off"
(**) Not automatically adding devices
(==) Automatically enabling devices
...
(II) LoadModule: "evdev"
(II) Loading /usr/lib/xorg/modules/input//evdev_drv.so
(II) Module evdev: vendor="X.Org Foundation"
        compiled for 1.6.0, module version = 2.2.0
        Module class: X.Org XInput Driver
        ABI class: X.Org XInput driver, version 4.0
(II) LoadModule: "mouse"
(II) Loading /usr/lib/xorg/modules/input//mouse_drv.so
(II) Module mouse: vendor="X.Org Foundation"
        compiled for 1.6.0, module version = 1.4.0
        Module class: X.Org XInput Driver
        ABI class: X.Org XInput driver, version 4.0
...
(**) Option "CorePointer"
(**) le_trackball: always reports core events
(**) le_trackball: Device: "/dev/input/by-id/usb-Logitech_Trackball-event-mouse"
(II) le_trackball: Found 3 mouse buttons
(II) le_trackball: Found x and y relative axes
(II) le_trackball: Found scroll wheel(s)
(II) le_trackball: Configuring as mouse
(**) le_trackball: YAxisMapping: buttons 4 and 5
(**) le_trackball: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
(II) XINPUT: Adding extended input device "le_trackball" (type: MOUSE)
(**) le_trackball: (accel) keeping acceleration scheme 1
(**) le_trackball: (accel) filter chain progression: 2.00
(**) le_trackball: (accel) filter stage 0: 20.00 ms
(**) le_trackball: (accel) set acceleration profile 0
(**) Option "Protocol" "auto"
...

The configuration for the trackball in "xorg.conf" is:

...
Section "InputDevice"
  Identifier "le_trackball"
  #Driver "mouse"
  Driver "evdev"
  Option "Device" "/dev/input/by-id/usb-Logitech_Trackball-event-mouse"
  Option "Protocol" "auto"
  Option "CorePointer"
EndSection
...

I already tried the "mouse" driver with the appropriate device option and with "ZAxisMapping" set to "4 5", "5 6" etc., and the trackball operates, but not its wheel.  I tried all the tricks I could find in the web and the man pages.

The trackball itself is working perfectly at my neighbors window$ laptop, which rules out the brandnew hardware being at fault.

I wonder why the is no "ZAxisMapping" option for evdev pointers.  The bogus "YAxisMapping" from the log is reported always, but it has no effect and cannot be overridden.

As I had seen scroll-wheel related activity in the git log, I upgraded from xf86-input-evdev-2.1.2-1/xorg-server-1.5.3-4 to xf86-input-evdev-2.2.0-1/xorg-server-1.6.0-1, but this didn't fix my problem.  Other than that, everything works fine.

It would be very nice if you you'd Cc me when you need more info or have suggestions to try, because I don't regularly read this bug-list.

Regards, clemens
Comment 1 clemens fischer 2009-03-22 12:17:14 UTC
(In reply to comment #0)

In the meantime, I scraped the web and found old man pages evdev(4), which entailed the following additions to the xorg.conf:

  Option "evBits"  "+1-2"
  Option "keyBits" "~272-287"
  Option "relBits" "~0-2 ~6 ~8"

Remember in the last episode there was an unnamed neighbor telling the trackman worked "everything normal" on his window$ machine, and the reaction to this change proves that the linux kernel driver actually sends something sensible which xf86-evdev propably doesn't pick apart properly.

Now evtest.c sometimes reports wheel events, but not reliably:

Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x46d product 0xc404 version 0x110
Input device name: "Logitech Trackball"
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 272 (LeftBtn)
    Event code 273 (RightBtn)
    Event code 274 (MiddleBtn)
  Event type 2 (Relative)
    Event code 0 (X)
    Event code 1 (Y)
    Event code 8 (Wheel)
  Event type 4 (Misc)
    Event code 4 (ScanCode)
Testing ... (interrupt to exit)
Event: time 1237743309.762421, type 2 (Relative), code 8 (Wheel), value -1
Event: time 1237743309.762434, -------------- Report Sync ------------
Event: time 1237743312.274421, type 2 (Relative), code 8 (Wheel), value -1
Event: time 1237743312.274434, -------------- Report Sync ------------
Event: time 1237743313.554419, type 2 (Relative), code 8 (Wheel), value -1
Event: time 1237743313.554432, -------------- Report Sync ------------
...

This is when scrolling the wheel down, the up-motion isn't detected, and other than this output, the wheel doesn't do anything anymore.  I had tried live-CDs of chrunchbang and knoppix (two linux distributions), and in both of them the scroll-wheel would "ruckle" a little bit just one time before turning mute again, but I thought this to be statistical noise or hinting at a hardware issue.  Now I think we have evidence of needing either clever, undocumented configuration tricks or a real, but small evdev bug.

Another resource on the web hints to check
"cat/proc/bus/input/devices", which tells us:

I: Bus=0003 Vendor=046d Product=c404 Version=0110
N: Name="Logitech Trackball"
P: Phys=usb-0000:00:02.0-2/input0
S: Sysfs=/class/input/input4
U: Uniq=
H: Handlers=mouse1 event4 
B: EV=17
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103
B: MSC=10

whereas the old "mechanical", worn out PS/2 mouse describes as:

I: Bus=0011 Vendor=0002 Product=0005 Version=0051
N: Name="ImPS/2 Logitech Wheel Mouse"
P: Phys=isa0060/serio1/input0
S: Sysfs=/class/input/input6
U: Uniq=
H: Handlers=mouse2 event6 
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103

Does this tell a knowledgable person which numbers should be entered into the various "Option *bits" of the xorg.conf?  I simply cannot figure it out, even with usr/include/linux/input.h and evtest.c.  I take it the numbers above are hex and xorg options need decimal ints, but how do I shift/mask them into shape?

Regards, clemens
Comment 2 Peter Hutterer 2009-03-22 15:20:29 UTC
(In reply to comment #0)
> I wonder why the is no "ZAxisMapping" option for evdev pointers.  The bogus
> "YAxisMapping" from the log is reported always, but it has no effect and cannot
> be overridden.


The option ZAxisMapping isn't supported because it is pointless. Clients expect wheels to be buttons 4/5 (vert) and 6/7 (horiz) anyway, so remapping them is a corner use-case that can be done at runtime if needed. This option existed in the mouse driver because that driver pre-dates scroll wheels.

YAxisMapping is the button mapping for horizontal motion in wheel __emulation__ mode.



>   Option "Protocol" "auto"

Option "Protocol" is not supported, you can remove it.

>   Option "CorePointer"

That's the default anyway these days.

> In the meantime, I scraped the web and found old man pages evdev(4), which
> entailed the following additions to the xorg.conf:
> 
>   Option "evBits"  "+1-2"
>   Option "keyBits" "~272-287"
>   Option "relBits" "~0-2 ~6 ~8"

these options aren't supported anymore, so don't worry about them.
 
> Now evtest.c sometimes reports wheel events, but not reliably:

sorry, there is nothing we can do in the driver. you need to file this as a kernel bug. evtest.c uses the same data as xf86-input-evdev, so if evtest can't see wheel events, neither can our driver.

> Input driver version is 1.0.0
> Input device ID: bus 0x3 vendor 0x46d product 0xc404 version 0x110
> Input device name: "Logitech Trackball"
> Supported events:
>   Event type 0 (Sync)
>   Event type 1 (Key)
>     Event code 272 (LeftBtn)
>     Event code 273 (RightBtn)
>     Event code 274 (MiddleBtn)
>   Event type 2 (Relative)
>     Event code 0 (X)
>     Event code 1 (Y)
>     Event code 8 (Wheel)
>   Event type 4 (Misc)
>     Event code 4 (ScanCode)

the mouse reports the correct capabilities, as I said above if wheel events are reported unreliably, then this is a kernel issue.

> Does this tell a knowledgable person which numbers should be entered into the
> various "Option *bits" of the xorg.conf?  I simply cannot figure it out, even
> with usr/include/linux/input.h and evtest.c.  I take it the numbers above are
> hex and xorg options need decimal ints, but how do I shift/mask them into
> shape?

the bits aren't your problem. in fact, evtest tests these bits and prints out the configuration (LeftBtn, RightBtn, MiddleBtn, etc.). 
KEY=70000 0 0 0 0 0 0 0 0 is 0x70000 << (32 * 8), you can then binary AND this with 1 shifted by the constants defined in linux/input.h (e.g. number & (1 << BTN_LEFT) is non-zero if BTN_LEFT is provided).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.