# USB mouse stopped working after moving to 8.0



## warudemaru (Mar 4, 2010)

Hi, yes I know there has been a lot of topics like that, but mine is a harder one. First of all I almost never had problems with my mouse under 7.x and then after upgrade to 8.0 (followed by 8-STABLE) USB mouse just stopped working. The configuration was ok under 7.x so why it shouldn't be now? In case you ask about the obvious: I know perfectly that _hald_ and _dbus_ must be running, _moused_ must be disabled in _rc.conf_ and the options _AutoAddDevices_ and _AutoEnableDevices_ must be turned on in _xorg.conf_, etc. But believe me it doesn't matter at all as I have tried nearly every combination of configs: enabling/disabling options and devices in xorg.conf, playing with HAL's fdi files, recompiling Xorg without HAL, even compiling usb mouse support as an external module. Of course all ports have been recompiled after the upgrade(running Xorg-7.4 now). This is what I receive after plugging the mouse in or after starting Xorg with mouse already plugged in:

```
(**) Option "Protocol" "Auto"
(**) USBMouse0: Device: "/dev/ums0"
(**) USBMouse0: Protocol: "Auto"
(**) Option "AlwaysCore"
(**) Option "SendCoreEvents" "true"
(**) USBMouse0: always reports core events
(**) Option "Device" "/dev/ums0"
(==) USBMouse0: Emulate3Buttons, Emulate3Timeout: 50
(**) Option "ZAxisMapping" "4 5 6 7"
(**) USBMouse0: ZAxisMapping: buttons 4, 5, 6 and 7
(**) USBMouse0: Buttons: 11
(**) USBMouse0: Sensitivity: 1
(II) XINPUT: Adding extended input device "USBMouse0" (type: MOUSE)
(**) USBMouse0: (accel) keeping acceleration scheme 1
(**) USBMouse0: (accel) filter chain progression: 2.00
(**) USBMouse0: (accel) filter stage 0: 20.00 ms
(**) USBMouse0: (accel) set acceleration profile 0
(II) USBMouse0: SetupAuto: hw.iftype is 5, hw.model is 0
(II) USBMouse0: SetupAuto: protocol is SysMouse
(WW) fcntl(14, F_SETOWN): Inappropriate ioctl for device
```
Note the last line with warning _Inappriopriate ioctl_, may it point any problem? I must say that other USB devices are working great: usb stick, soundcard, external hdd. I have really no idea, even don't know if my efforts were reasonable because the mouse is not working under console by any configuration, and don't believe it's because that's actually not a true USB mouse but a PS/2 connected via PS2/USB adapter...


----------



## jailed (Mar 4, 2010)

Forgive me for suggesting that but please try

```
moused_enable="YES"
hald_enable="YES"
dbus_enable="YES"
```

You said that you disabled moused. Did you try to enable it? I'm using both moused, hald and dbus enabled with KDE.

I don't know about the x error but if you didn't, please try to enable moused.

I'm using FreeBSD 8.0 with usb wireless keyboard + mouse set under KDE.


----------



## phoenix (Mar 4, 2010)

If this is an upgraded box from 7.x to 8.x, then you will need to uninstall the *libusb* port, and recompile all ports that depend on it.  FreeBSD 8.x includes a libusb in the new USB stack, which conflicts with libusb from ports, and ports that depend on libusb (like HAL) will fail in weird, wonderful, and spectacular ways.  

I believe this is listed in /usr/ports/UPDATING or /usr/src/UPDATING.


----------



## jb_fvwm2 (Mar 4, 2010)

Not positive but if you are using a custom kernel
you may need an additional line or two in it if
it is basically the same from _7 to _8.  (I'd check
the Release notes and UPDATING (buildworld one) if
the above posts do not fix it, and if that is the case
(in other words your kernel is not GENERIC)


----------



## warudemaru (Mar 5, 2010)

jailed said:
			
		

> Forgive me for suggesting that but please try
> moused_enable="YES"



It doesn't matter, this is just for the console, but the USB mouse is not responding, cursor under console remains dead



			
				phoenix said:
			
		

> you will need to uninstall the *liusb* port, and recompile all ports that depend on it.  FreeBSD 8.x includes a libusb in the new USB stack, which conflicts with libusb from ports, and ports that depend on libusb (like HAL) will fail in weird, wonderful, and spectacular ways.
> I believe this is listed in /usr/ports/UPDATING or /usr/src/UPDATING.



Ok, I missed that one but actually only a few minor packages were depending on libusb and HAL was not among them (broken deps?) anyway I recompiled HAL.. without success, nothing strange as I have tried already xorg without HAL and the effect was the same - USB mouse not working.



			
				jb_fvwm2 said:
			
		

> Not positive but if you are using a custom kernel you may need an additional line or two in it if it is basically the same from _7 to _8.  (I'd check the Release notes and UPDATING (buildworld one) if the above posts do not fix it, and if that is the case (in other words your kernel is not GENERIC)



what kind of additional lines may I need? I used GENERIC as my first kernel on 8.0, and actually my custom kernel is not so much different from the generic, only some unneeded devices were removed (RAID, LAN etc.) and the USB mouse was not working of course.
Anyhow the problem must be connected with the kernel and usb stack changes to 8.0 because other way why the mouse is not working in the console without Xorg, without HAL, it shouldn't be dependant of any port at all, it's expected that USB mouse works out of the box, isn't it?


----------



## roddierod (Mar 5, 2010)

You're missing Phoenix's point. You have to uninstall libusb.

In 7 usb support was provided by this but 8 has a re-written usb stack. When you upgrade from 7 it didn't remove libusb and now its fighting with the 8 usb stack and causing problems.


----------



## warudemaru (Mar 5, 2010)

roddierod said:
			
		

> You're missing Phoenix's point. You have to uninstall libusb.In 7 usb support was provided by this but 8 has a re-written usb stack. When you upgrade from 7 it didn't remove libusb and now its fighting with the 8 usb stack and causing problems.



sorry I just wasn't enough precise, I obviously did uninstall the libusb, rebuild X and HAL after that and even the kernel in the meantime. No effect..


----------



## roddierod (Mar 5, 2010)

well this is along shot, but did you try as root. I had a similar problem with a different usb device that worked fine in 7 but not in 8. It turned that only root had permission to the device.

I had to add this to my /etc/devfs.rules


```
add path 'usb/*' mode 666 group operator
```

now everthing is fine.


----------



## achix (Mar 6, 2010)

Here is my dmesg USB mouse line in dmesg (8.0-RELEASE-p2):


> ums0: <Microsoft Microsoft 3-Button Mouse with I, class 0/0, rev 1.10/3.00, addr 2> on usbus4


Here is how /etc/rc.conf looked like when i had moused enabled:

```
moused_nondefault_enable="NO"
moused_enable="YES"      # Run the mouse daemon.
moused_type="auto"      # See man page for rc.conf(5) for available settings.
moused_port="/dev/ums0" # Set to your mouse port.
```


----------



## jb_fvwm2 (Mar 6, 2010)

There may be a third usb driver of three for v8 that is
not in GENERIC?  Good to double check, add it to 
/boot/loader.conf if so.


----------



## warudemaru (Mar 8, 2010)

&quot said:
			
		

> There may be a third usb driver of three for v8 that is
> not in GENERIC? Good to double check, add it to
> /boot/loader.conf if so.


what do you mean exactly by that? Are you talking about USB Serial devices in kernel? 

I appreciate all your answers guys, the problem was not in perms, although I checked them and now got rw perms for me for all usb*, but I tried another usb mouse, a real one, and.. it worked! This is what I received in dmesg for the real usb mouse:

```
ugen3.2: <A4Tech> at usbus3
ums0: <A4Tech USB Mouse, class 0/0, rev 1.10/0.14, addr 2> on usbus3
ums0: 8 buttons and [XYZ] coordinates ID=0
```
whereas that one is for my usb/ps2 adapter 

```
ugen3.2: <vendor 0x13ba> at usbus3
ukbd0: <vendor 0x13ba Generic USB K/B, class 0/0, rev 1.10/0.01, addr 2> on usbus3
kbd2 at ukbd0
ums0: <vendor 0x13ba Generic USB K/B, class 0/0, rev 1.10/0.01, addr 2> on usbus3
ums0: 3 buttons and [XYZ] coordinates ID=1
```
I'm wondering if the buttons and coordinates may have any meaning, and so the problem might be defined now as "usb/ps2 adapter stopped working after upgrade"


----------



## trev (Mar 19, 2012)

Similar issue with a twist. 

When I moved to 8.x a few weeks ago, my motherboard was replaced with one that only has a single PS/2 port coloured both purple and green (half 'n half).

I was using using a Belkin 2-port PS/2 KVM with FreeBSD 7.3 and a PS/2 mouse and keyboard and a two PS/2 port motherboard. No problems.

So, I acquired a PS/2 to USB converter. The KVM PS/2 outputs plug into a PS/2 -> USB converter. After some initial problems getting the USB mouse to work, I got it working (how is now unfortunately lost in the mists of time).

Then along came a PS/2 splitter cable and so I thought I'd try that - to no avail. The keyboard is recognised but not the mouse.

So I reverted to the previous setup, but now the USB mouse doesn't work and I'm at a loss.

dmesg shows:


```
ugen2.2: <vendor 0x13ba> at usbus2
ukbd0: <vendor 0x13ba Generic USB KB, class 0/0, rev 1.10/0.01, addr 2> on usbus2
kbd2 at ukbd0
ums0: <vendor 0x13ba Generic USB KB, class 0/0, rev 1.10/0.01, addr 2> on usbus2
ums0: 3 buttons and [XYZ] coordinates ID=1
```

and the system automatically starts moused with the appropriate arguments...


```
1997  ??  Ss     0:02.43 /usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
```

... but no mouse.

Any ideas?


----------



## trev (Mar 19, 2012)

*Solution*

The (new) solution was to:


```
# cd /usr/ports/sysutils/uhidd
# make install clean
```

Add the following lines to /etc/rc.conf:


```
uhidd_flags="-m"
uhidd_enable="YES"
```

And now my mouse is again working


----------

