Solved USB mouse wheel not working

YuryG

Well-Known Member

Reaction score: 23
Messages: 390

On a fresh FreeBSD-12 I've attached simple wired USB mouse.
Code:
ugen2.3: <SIGMACHIP Usb Mouse> at usbus2
ums0 on uhub2
ums0: <SIGMACHIP Usb Mouse, class 0/0, rev 1.10/1.10, addr 3> on usbus2
ums0: 3 buttons and [XYZ] coordinates ID=0
But I cannot make its wheel work in X. On Windows nearby computer it works.
I tried changing xorg.conf with different buttons numbers (from 4 and 5 to rediculous 8 and 10), but with no luck.
Code:
Section "InputDevice"
#   Option          "Protocol" "SysMouse"
   Identifier      "Mouse0"
   Driver          "mouse"
   Option          "Protocol" "auto"
   Option          "Device" "/dev/sysmouse"
#   Option          "Buttons" "7"
   Option          "ZAxisMapping" "8 10"
   Option          "Resolution" "800"
EndSection
xev do not show any mouse devices when I rotate the wheel (but just moving or pressing three buttons is shown).
And excerpt from Xorg.0.log
Code:
[  4026.139] (II) Initializing extension GLX
[  4026.158] (II) Indirect GLX disabled.(II) Using input driver 'mouse' for 'Mou
se0'
[  4028.229] (**) Option "CorePointer" "on"
[  4028.229] (**) Mouse0: always reports core events
[  4028.229] (**) Option "Protocol" "auto"
[  4028.229] (**) Option "Device" "/dev/sysmouse"
[  4028.229] (**) Mouse0: Protocol: "auto"
[  4028.229] (**) Mouse0: always reports core events
[  4028.229] (==) Mouse0: Emulate3Buttons, Emulate3Timeout: 50
[  4028.229] (**) Option "ZAxisMapping" "8 10"
[  4028.229] (**) Mouse0: ZAxisMapping: buttons 8 and 10
[  4028.229] (**) Mouse0: Buttons: 10
[  4028.229] (**) Option "Resolution" "800"
[  4028.230] (II) XINPUT: Adding extended input device "Mouse0" (type: MOUSE, id 6)
[  4028.230] (**) Mouse0: (accel) keeping acceleration scheme 1
[  4028.230] (**) Mouse0: (accel) acceleration profile 0
[  4028.230] (**) Mouse0: (accel) acceleration factor: 2.000
[  4028.230] (**) Mouse0: (accel) acceleration threshold: 4
[  4028.230] (II) Mouse0: SetupAuto: hw.iftype is 4, hw.model is 0
[  4028.230] (II) Mouse0: SetupAuto: protocol is SysMouse
May be any suggestions?
 

shkhln

Aspiring Daemon

Reaction score: 221
Messages: 692

You should be using xf86-input-mouse. I'm not sure if sysmouse even supports wheel input.
 

shkhln

Aspiring Daemon

Reaction score: 221
Messages: 692

Ah, looks like I'm a bit confused. Let me think this through.
 

shkhln

Aspiring Daemon

Reaction score: 221
Messages: 692

Try

C:
#include <assert.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/mouse.h>
#include <sys/consio.h>

int main() {

  int fd = open("/dev/sysmouse", O_RDONLY);
  assert(fd != -1);

  uint8_t buf[8];
  while (1) {
    if (read(fd, &buf, sizeof(buf)) == 8) {

      if (buf[5] != 0 || buf[6] != 0) {
        printf("%02x %02x\n", buf[5], buf[6]);
      }

    } else {
      assert(0);
    }
  }

  return 0;
}
This should print something like

Code:
00 01
7f 00
 
OP
OP
Y

YuryG

Well-Known Member

Reaction score: 23
Messages: 390

Your code just "hangs" my mouse (it lags severely), and prints nothing until ^C.
 
OP
OP
Y

YuryG

Well-Known Member

Reaction score: 23
Messages: 390

On near machine I've tested my mouse with live Ubuntu disc. Everything is O.K. And on my machine I've tested also working Genius mouse (as simple as mine) and it do not work also.
UPD. dmesg part from that Ubuntu
Code:
[    56.538] (**) evdev: SIGMACHIP Usb Mouse: Device: "/dev/input/event3"
[    56.538] (--) evdev: SIGMACHIP Usb Mouse: Vendor 0x1c4f Product 0x34
[    56.538] (--) evdev: SIGMACHIP Usb Mouse: Found 3 mouse buttons
[    56.538] (--) evdev: SIGMACHIP Usb Mouse: Found scroll wheel(s)
[    56.538] (--) evdev: SIGMACHIP Usb Mouse: Found relative axes
[    56.538] (--) evdev: SIGMACHIP Usb Mouse: Found x and y relative axes
[    56.538] (II) evdev: SIGMACHIP Usb Mouse: Configuring as mouse
[    56.538] (II) evdev: SIGMACHIP Usb Mouse: Adding scrollwheel support
[    56.538] (**) evdev: SIGMACHIP Usb Mouse: YAxisMapping: buttons 4 and 5
[    56.538] (**) evdev: SIGMACHIP Usb Mouse: EmulateWheelButton: 4, EmulateWhee
lInertia: 10, EmulateWheelTimeout: 200
[    56.538] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.
1/usb7/7-2/7-2:1.0/input/input3/event3"
[    56.538] (II) XINPUT: Adding extended input device "SIGMACHIP Usb Mouse" (ty
pe: MOUSE, id 8)
[    56.538] (II) evdev: SIGMACHIP Usb Mouse: initialized for relative axes.
[    56.538] (**) SIGMACHIP Usb Mouse: (accel) keeping acceleration scheme 1
[    56.538] (**) SIGMACHIP Usb Mouse: (accel) acceleration profile 0
[    56.538] (**) SIGMACHIP Usb Mouse: (accel) acceleration factor: 2.000
[    56.538] (**) SIGMACHIP Usb Mouse: (accel) acceleration threshold: 4
[    56.538] (II) config/udev: Adding input device SIGMACHIP Usb Mouse (/dev/inp
ut/mouse0)
And just the same (working wheel) with this live disc Ubuntu on my machine.
 

Martin Paredes

Active Member

Reaction score: 25
Messages: 102

What's the output of grep moused /etc/rc.conf

Since your mouse has 3 buttons and the wheel

Code:
ums0: 3 buttons and [XYZ] coordinates ID=0
You should try with

Code:
Option          "ZAxisMapping" "4 5"
If you are using moused(8), use the options -d and -f to debug what is happening

Login as root in the console or a text terminal, kill the process of moused killall moused

Run moused -df -t auto -p /dev/ums0

This way you can check what moused(8) is receiving from ums(4) (move the mouse, use the scroll, click the buttons)
 
OP
OP
Y

YuryG

Well-Known Member

Reaction score: 23
Messages: 390

Code:
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  750 299488761
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  750 323485242
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  750 348598108
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  750 371530169
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  750 419489573
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  750 483496543
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  750 811494997
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  750 851499641
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  750 891504115
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  750 923504250
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  750 955498845
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  751 20621889
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  751 34861285
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  751 467514912
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  751 491504183
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  751 507511571
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  751 523507913
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  751 547503070
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  751 587590012
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0xff
moused: received char 0x0
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,ff,0,7f
moused: ts:  751 643514090
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz -1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  751 987523122
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 36680983
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 43525643
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 71973341
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 91525491
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 107502479
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 154730566
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 611528516
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 635530057
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 651530755
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 667943010
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 691526509
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 723531604
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
moused: received char 0x87
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x0
moused: received char 0x1
moused: received char 0x7f
moused: assembled full packet (len 8) 87,0,0,0,0,0,1,7f
moused: ts:  752 771531887
moused: flags:80000000 buttons:00000000 obuttons:00000000
moused: activity : buttons 0x00000000  dx 0  dy 0  dz 1
I've got something like this. Last messages during solely wheel moves.
 
OP
OP
Y

YuryG

Well-Known Member

Reaction score: 23
Messages: 390

Hooray! It works now. There was leftover in rc.conf with moused_type (was set to ps/2) and moused_port (was set to /dev/psm0), which prevented mouse wheel to work.

UPD. (The leftover was due to my attempts to make PS/2 mouse work, which was unsuccessful, not only in FreeBSD. Latest BIOS for the motherboard seem not to work with PS/2 mouse, only PS/2 keyboard, also in manual to the motherboard it is said only about mouse in that port..)
 
Top