qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
17.73k stars 37.95k forks source link

[Bug] Backlight issue with Split Keyboards #14851

Open iraytrace opened 2 years ago

iraytrace commented 2 years ago

Split keyboard only turns backlight per-key LEDs of on half that is directly connected to the computer when host system sleeps

Describe the Bug

When the system sleeps, the half of the split keyboard not directly connected to the computer leaves the backlights on.

Quefrency keyboard Rev3 with latest QMK. Host computer sleeps/powers down and the connected half of the keyboard turns off the per-key backlight LEDs. On the other half of the keyboard the backlight LEDs stay lit.

System Information

Additional Context

drashna commented 2 years ago

Can confirm that this is happening. No idea why, though.

mb1986 commented 2 years ago

Can confirm the same behavior for Keebio Levinson rev3.

moroz-slavomir commented 2 years ago

I have the same problem with kyria + elite-c.

moroz-slavomir commented 2 years ago

I think this is related to the fact that split keyboard communication is part of matrix_scan(), and how suspend is handled on avr + lufa platform.

When in suspend and NO_USB_STARTUP_CHECK is not defined, the board

If your remote device is sleeping instead of shutdown and can be awoken by USB, then the loop attempts to wait for suspend_wakeup_condition(), which internally also invokes matrix_scan() that synchronizes rgb config and rgb suspend state.

In my case, if I put my PC to sleep, both halves turn off their rgb lights, but when I shutdown the computer, the slave won't. When I added an extra execution of matrix_scan() on suspend for split keyboards, the issue disappeared for my keyboard and both halves turned off the rgb.

stephaje commented 2 years ago

Also seeing this problem on the keebio/iris/rev6.