Day 36 - Finding a solution to Ubuntu 16.04 LTS' "mouse not working" problem

I am reading Force and Opinion, an essay that was posted on Metakgp Slack, when I posted my surprise at having found the Internet Shutdowns in India. I am still reading it, but it sounds like a solid thing to talk about in another post. I should maintain a TODO list of topics that I want to talk about. (I am now switching to Trello to create that list)

The mouse thing happened again. This Ubuntu was started only about 3 hours ago. This is extremely frustrating, I don’t want to go through the pain of re-installing Ubuntu all over again with the right configuration and I don’t want to have to keep restarting the PC. That would defeat the whole purpose of having a GOOD COMPUTER! I need to find a solution to this problem, RIGHT NOW.

AND FOUND IT! Restarting Laptop’s USB PORTS WITHOUT restarting computers Yet another lesson in effective searching of the internet! I went through the dmesg -w output right before the mouse stopped functioning and it didn’t tell me anything more than I already knew. Does it ring a bell?

[   72.058426] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure
on pipe A (start=4851 end=4852) time 545 us, min 763, max 767, scanline start
756, end 783
[  121.341228] r8169 0000:01:00.0 enp1s0: link up
[  121.341237] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready
[  197.470587] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
[ 4505.275283] perf: interrupt took too long (2540 > 2500), lowering
kernel.perf_event_max_sample_rate to 78500
[ 5778.702948] perf: interrupt took too long (3259 > 3175), lowering
kernel.perf_event_max_sample_rate to 61250
[ 6937.288611] usb 1-1.3.4: USB disconnect, device number 6
[ 6965.598679] usb 1-1.3.4: new low-speed USB device number 8 using ehci-pci
[ 6965.710831] usb 1-1.3.4: New USB device found, idVendor=093a, idProduct=2510
[ 6965.710835] usb 1-1.3.4: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 6965.710837] usb 1-1.3.4: Product: USB Optical Mouse
[ 6965.710839] usb 1-1.3.4: Manufacturer: PixArt
[ 6965.714332] input: PixArt USB Optical Mouse as
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.0/0003:093A:2510.0005/input/input18
[ 6965.715236] hid-generic 0003:093A:2510.0005: input,hidraw2: USB HID v1.11
Mouse [PixArt USB Optical Mouse] on usb-0000:00:1d.0-1.3.4/input0
[ 7765.071883] perf: interrupt took too long (4134 > 4073), lowering
kernel.perf_event_max_sample_rate to 48250
[ 8994.057705] usb 2-1: reset low-speed USB device number 2 using xhci_hcd
/[ 9175.482422] usb 1-1.3.4: USB disconnect, device number 8
[ 9184.631763] usb 1-1.3.1: new low-speed USB device number 9 using ehci-pci
[ 9184.748086] usb 1-1.3.1: New USB device found, idVendor=093a, idProduct=2510
[ 9184.748089] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 9184.748091] usb 1-1.3.1: Product: USB Optical Mouse
[ 9184.748092] usb 1-1.3.1: Manufacturer: PixArt
[ 9184.750943] input: PixArt USB Optical Mouse as
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3.1/1-1.3.1:1.0/0003:093A:2510.0006/input/input19
[ 9184.751181] hid-generic 0003:093A:2510.0006: input,hidraw2: USB HID v1.11
Mouse [PixArt USB Optical Mouse] on usb-0000:00:1d.0-1.3.1/input0
[ 9482.951029] usbcore: deregistering interface driver usbhid
[ 9515.715675] input: Barcode Reader  as
/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/0003:13BA:0018.0007/input/input20
[ 9515.775777] hid-generic 0003:13BA:0018.0007: input,hidraw0: USB HID v1.10
Keyboard [Barcode Reader ] on usb-0000:00:14.0-1/input0
[ 9515.779015] input: Barcode Reader  as
/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.1/0003:13BA:0018.0008/input/input21
[ 9515.835781] hid-generic 0003:13BA:0018.0008: input,hidraw1: USB HID v1.10
Mouse [Barcode Reader ] on usb-0000:00:14.0-1/input1
[ 9515.838679] input: PixArt USB Optical Mouse as
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3.1/1-1.3.1:1.0/0003:093A:2510.0009/input/input22
[ 9515.839827] hid-generic 0003:093A:2510.0009: input,hidraw2: USB HID v1.11
Mouse [PixArt USB Optical Mouse] on usb-0000:00:1d.0-1.3.1/input0
[ 9515.839857] usbcore: registered new interface driver usbhid
[ 9515.839858] usbhid: USB HID core driver

The point 6937.288 is where the USB stopped functioning. See how the existing mouse (connected as device 6) was disconnected and then reconnected as device number 8. This lead me to think that if only I could restart the USB module in the kernel, it would detach and reattach ALL the USB devices. That would be the best! I have my keyboard and the mouse connected on USB ports. A quick look at the AskUbuntu answer and the modprobe man page increased my confidence in the command posted there! So, this was the solution I was looking for! This will go right next to my existing restart network manager alias in my dotfiles. GREAT, this solves a huge inconvenience. This happened yesterday while I was watching a movie and wanted to download the subtitles for that movie. It was an incredibly high and unexpected amount of pain. I didn’t anticipate that.

Okay, that has itself become a long post (probably because of the dmesg output that I posted but it was totally necessary!) While I was writing that sentence, it happened again (weirdly, the frequency seems to increase after fixing it once. But frankly, I don’t care now, I will just continue to run modprobe while researching the problems that this could have. I can’t think of any really, adding and removing modules from the kernel is NOT that catastrophic really.

Okay, I am really calling it here now.

POST #36 is OVER