ryodeushii / qmk-firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families - fork is Focused on NuPhy Gem80 | Halo75V2 | Air75V2 CFW. If you want to support development of the CFW for Nuphy keyboards - you're welcome here https://buymeacoffee.com/ryodeushii
https://qmk.fm
GNU General Public License v2.0
57 stars 7 forks source link

[Bug] Backlight blinks after waking up from deep sleep on v1.1.1 #1

Closed zak-hsieh closed 4 months ago

zak-hsieh commented 5 months ago

Describe the Bug

Just notice flashing v1.1.1 the keyboard backlight will flash once in a short time after flashing v1.1.1 when I connect gem80 via Bluetooth. It is a little bit annoyed. Is it possible to fix it? Thanks.

Keyboard Used

Gem80 Tri-mode

Link to product page (if applicable)

No response

Operating System

No response

qmk doctor Output

No response

Is AutoHotKey / Karabiner installed

Other keyboard-related software installed

No response

Additional Context

No response

ryodeushii commented 5 months ago

Hi! I probably mentioned about it in v1.1.1 release notes (now I'm not really sure). But anywho, this is tradeoff I decided to live with. Long story short, in case someone uses KVM switch and/or externally-powered USB hub - when keyboard loses connection with host (only in USB mode) but power is left - it would wake in very long period (or may require power cycle for keyboard, or rapid spam during 2-3 seconds to wake). Another issue was also, if you reboot your host with keyboard connected - keyboard won't initialize properly and in 80%+ cases would require power cycle to become working again. In this case there is no additional blinking of backlight, keyboard wakes aka immediately

So this was one case. And another case is situation you described, when keyboard takes a bit more time to wake up and blinks LEDs once. This blink is part of wakeup process, but now it's more noticeable due to changed sleep and wakeup logic.

There was also some discussion about this case in help_corner in discord.

In case something is not clear yet feel free to reply :)

ryodeushii commented 5 months ago

@zak-hsieh If I answered your question, please close this one, or I'll do it next week as stale. Thanks in advance.

zak-hsieh commented 5 months ago

Thanks for your explain. I'd ready liked the firmware you made. The performance is much better than official release, so that's the reason I fire this issue to you. I can understand that is a trad-off by your descriptions. But to be honest, the blinking is not a good user experience. It is noticeable obviously and annoyed when I come back to my desk to type something. Does the issue you describe happen on USB mode or on Bluetooth neither? Is it possible to enable such trade-off impls on USB mode only?

ryodeushii commented 5 months ago

@zak-hsieh after some investigation I'd say in USB mode this blink is kinda different. It's related to USB driver reinitialization. While on BT and RF there is similar blink (but shorter) and this one is mostly related to wakeup procedure, in order to wake up RGB matrix I had to use this flush which is causing RGB matrix to blink once before it will return to your configured color and/or effect. I'll try to play with it a bit more, but no promises :)

ryodeushii commented 5 months ago

@zak-hsieh After I removed force refresh for RGB matrix it still blinks. This is probablyh proper behavior and it's related to the fact, than my firmware uses "deep sleep" where power is cut off to all possible components, to preserve battery, while official firmware uses "light sleep" where only side leds & RGB matrix being turned off. So this blink happens due to return of power to the RGB matrix, and there's nothing to do. Only thing I can propose is to wait some time, in few weeks (maybe earlier) I plan to implement choice of sleep mode. In current setup if board is in wireless mode, but connected to USB or if it's in USB mode it'll use light sleep. Otherwise in wireless mode it'll use deep sleep (when timeout happens or connection is lost due to host sleep).

Now we have checkboxes in VIA to toggle overall sleep and USB sleep + timeout selection. I plan to add another flag to toggle deep sleep vs light sleep usage in RF mode. This should help with this blink behavior, but it'll reduce overall battery life.

ryodeushii commented 4 months ago

closed as stale