UltimateHackingKeyboard / firmware

Ultimate Hacking Keyboard firmware
Other
419 stars 66 forks source link

Trackball wake up lag #411

Closed mondalaci closed 3 years ago

mondalaci commented 3 years ago

The optical sensor of the trackball module goes to sleep after a certain period of inactivity, and afterward, it takes some time to wake up when it detects motion again.

According to my experience, after about 10 minutes of inactivity, the sensor takes about a second to wake up.

mondalaci commented 3 years ago

Please test uhk-firmware-8.10.11-trackball-lag-fix.tar.gz that solved the lag which was noticeable after 10 minutes of inactivity.

Please also test longer periods, possibly several hours, and let me know your findings.

benneti commented 3 years ago

testing since 2 days and it seems to be much better, if I don't forget will report back again in a week or two!

mondalaci commented 3 years ago

Thank you! I consider this issue resolved, and the fix has been merged. Any further issues, feel free to follow up, and I'll reopen this issue or create a new one.

jonaustin commented 3 years ago

Sorry for the late reply; wanted to give it a few days, but yep, seems to be good now on my Linux box, thanks!

jonaustin commented 3 years ago

Unfortunately this is still occurring with 8.10.11.

However, I think it may be a different issue -- it doesn't occur after 10 minutes; it can occur after just a few seconds of inactivity, but seems to be wildly random when it happens. Sometimes it will respond every quickly (within e.g. 10s of ms), other times I'll madly roll it for half a second to a second before it responds.

Happy to provide any debugging output that will help diagnose.

~As a side note -- can't for the life of me get the trackball cover off to clean it. Literally scratched it all up trying to turn it counter-clockwise with a paperclip.~ Edit: was able to get it open with a screwdriver.

Edit2: After getting the cover off, and cleaning with isopropyl, the issue appears to be far improved, so hopefully this was just a cleaning issue; will update if it comes back, but otherwise will leave this issue comment in case it helps anyone else.

Perhaps as a final QA step with the trackball module, make sure the cover comes off reasonably easily.

mondalaci commented 3 years ago

@jonaustin Does your trackball module perhaps disconnects every now and then? If so, you should be able to see it happening in Agent, and fastening module screws should fix the issue.

jonaustin commented 2 years ago

@mondalaci Sorry for the late reply; it mostly seems to be an issue of just needing to clean it fairly regularly.

I would like to watch the connection though to make sure, but honestly I'm probably not gonna sit there and watch the UHK agent UI... is there a way to watch connect/disconnect via the cli in linux that you know of?

e.g. If there's some command output I can watch (or grep for or something) then I can just setup some hacky bash loop to watch for it every 1 second or something; and log it if it's not seen. For example if the trackball showed up via lsusb then could use that, but I don't see the trackball module itself listed.

mondalaci commented 2 years ago

@jonaustin agent/packages/usb/get-module-state.ts should do what you're after. You have to build Agent to run it. Its output is fairly self-explanatory:

isEepromBusy: no | areHalvesMerged: no | leftKeyboardHalfSlot:LeftKeyboardHalf | leftModuleSlot:KeyClusterLeft | rightModuleSlot:TrackpointRight | layer:base
jonaustin commented 2 years ago

Thanks @mondalaci

I ended up just using the normal output of the agent app: npm run electron | tee /tmp/out | grep 'state changed'

Granted that could occur due to other state changes; but the main thing is that I haven't seen any state changes occur at all during normal usage, so think it's staying connected perfectly fine (fwiw, I haven't touched the screws on the module at all, so this is out-of-the-box-good).

Worth saying -- super super minor issue and fault of my greasy fingers :) -- being a vim zealot, this home-row-with-trackball is still the dream keyboard setup i've been trying to get for like 20 years (and as many keyboards), thanks for the UHK, it's just the best.

As a related aside - perhaps add something about cleaning the ball with isopropyl if it's being less responsive to the doc page: https://ultimatehackingkeyboard.com/manuals/trackball I've been using Logitech's M570 trackballs for about forever and rarely have to clean them; I think this ball simply has a much smaller surface area and so needs to be cleaned more often (and isopropyl specifically seems to help).

mondalaci commented 2 years ago

@jonaustin Thanks for your suggestion! Just amended https://ultimatehackingkeyboard.com/manuals/trackball accordingly. I agree about your reasoning regarding the Logitech Logitech M570 trackball.

I'm delighted to hear that the trackball module works for you so well!