I use a Logitech MX Master 3 mouse with the "Unifying Receiver" USB dongle on my Oryx Pro laptop. I've noticed periodic mouse stuttering for some time now. I eventually tracked it down that it co-occurs with system76-adjust-tdp running over-frequently.
The current udev rules look at power_supply subsytem change events in order to determine whether the laptop is running on battery or AC. However, the battery on my mouse also reports its status through udev events that trigger these rules too (specifically, it has both SUBSYSTEM=="power_supply" and ATTR{online}).
Steps to reproduce (if you know):
Run tail -f /var/log/syslog in order to verify the at jobs that system76-adjust-tdp creates flow past, sending "Job terminated" emails to root. Then monitor the relevant udev events, and wiggle the mouse some to use up some battery and trigger events.
system76-adjust-tdp should only be triggered when the laptop's battery is (dis)engaged, not any other power supplies with ATTR{online}. I suspect adding ATTR{type}=="Mains" would do it (at least for how these devices are set up on my laptop).
Other Notes:
My mouse stuttering may not be be specifically caused by system76-adjust-tdp running, but it doesn't hurt to make the rule correctly-specified. Researching this, it seems like a lot of Logitech peripherals report their battery status similarly, and a number of under-specified rules intended for the main power supply tend to get triggered.
Distribution (run
cat /etc/os-release
):PRETTY_NAME="Pop!_OS 20.10"
Related Application and/or Package Version (run
apt policy $PACKAGE NAME
):Issue/Bug Description:
I use a Logitech MX Master 3 mouse with the "Unifying Receiver" USB dongle on my Oryx Pro laptop. I've noticed periodic mouse stuttering for some time now. I eventually tracked it down that it co-occurs with
system76-adjust-tdp
running over-frequently.The current
udev
rules look atpower_supply
subsytem change events in order to determine whether the laptop is running on battery or AC. However, the battery on my mouse also reports its status throughudev
events that trigger these rules too (specifically, it has bothSUBSYSTEM=="power_supply"
andATTR{online}
).Steps to reproduce (if you know):
Run
tail -f /var/log/syslog
in order to verify theat
jobs thatsystem76-adjust-tdp
creates flow past, sending "Job terminated" emails toroot
. Then monitor the relevantudev
events, and wiggle the mouse some to use up some battery and trigger events.And unplug and replug the AC power to see the events that we want to respond to:
Expected behavior:
system76-adjust-tdp
should only be triggered when the laptop's battery is (dis)engaged, not any other power supplies withATTR{online}
. I suspect addingATTR{type}=="Mains"
would do it (at least for how these devices are set up on my laptop).Other Notes:
My mouse stuttering may not be be specifically caused by
system76-adjust-tdp
running, but it doesn't hurt to make the rule correctly-specified. Researching this, it seems like a lot of Logitech peripherals report their battery status similarly, and a number of under-specified rules intended for the main power supply tend to get triggered.