BartoszCichecki / LenovoLegionToolkit

Lightweight Lenovo Vantage and Hotkeys replacement for Lenovo Legion laptops.
GNU General Public License v3.0
4.64k stars 221 forks source link

[BUG]: Keyboard backlight goes automatically to blue when opening/turning on laptop and ignore preset #661

Closed ianfousdesign closed 1 year ago

ianfousdesign commented 1 year ago

Version

2.11.2

OS

Windows 11 22621 build

Device

Legion 5 Pro 16IAH7H

BIOS version

J2CN49WW

What's wrong?

I have 3 presets for my keyboard backlight, preset 1 for some reason isn't working properly. When im in the application, changing colors in preset 1 works on my keyboard however it shows black color on the app for the 4 zones, and when turning on my laptop or opening the lid, keyboard gets back to the default blue backlight and ignore the preset i have, so i have to change it manually every time.

As you can see in the screenshot, it shows black colors even tho the color im using is red.

Screenshot 2023-04-08 102034

How to reproduce the bug?

  1. Make your preset, for me it's changing the keyboard color when on battery
  2. Remove the charger
  3. Keyboard goes blue

What is the behavior that you expected?

It should turn to red when unplugging the charger and use quiet mode, everything works as expected except the keyboard who keeps getting back to the default color layout, cyan blue.

Logs

No logs.

Do you have Lenovo software installed?

Did you disable any Lenovo software using Lenovo Legion Toolkit?

Additional information

No response

BartoszCichecki commented 1 year ago

Logs please.

ianfousdesign commented 1 year ago

Logs please.

Sorry, here it is. Just reproduced the issue.

log_2023_04_08_11_23_20.txt

BartoszCichecki commented 1 year ago

Hmm the log looks all good; we need to do more digging.

  1. Is it only for preset 1 and others are fine?
  2. When you select some color other than black, for example red, does LLT show correct color? When exactly (after sleep, restart, reopen LLT) does it turn black again?
  3. Try to: close LLT, go to %LOCALAPPDATA%\LenovoLegionToolkit, delete rgb_keyboard.json, start LLT and try again.

Also, when the squares turn black, please upload the new, recreated rgb_keyboard.json file here.

ianfousdesign commented 1 year ago

Hmm the log looks all good; we need to do more digging.

  1. Is it only for preset 1 and others are fine?
  2. When you select some color other than black, for example red, does LLT show correct color? When exactly (after sleep, restart, reopen LLT) does it turn black again?
  3. Try to: close LLT, go to %LOCALAPPDATA%\LenovoLegionToolkit, delete rgb_keyboard.json, start LLT and try again.

Also, when the squares turn black, please upload the new, recreated rgb_keyboard.json file here.

  1. Yes only for preset 1, the rest works fine as intented.
  2. No it stays black no matter the color i choose, again only in preset 1, the other presets show the colors as intented. If the laptop is already powered on the actions to change the keyboard color works, but when the lid is closed or the laptop is completely turned off, it doesn't work and the laptop turns on with either a blue keyboard (default color) or completely off backlight.
  3. Done. After deleting the file it showed the colors however as soon as i used my red color it went black again, i did try something however : If i put RED at 100 or more it shows a bit of red, if it's a low value let's say 50 or 20 it stays black.
  4. It doesn't let me upload the file it says it's not supported so i made it a zip. rgb_keyboard.zip
BartoszCichecki commented 1 year ago

as i used my red color it went black again

What colors are you trying to set?

ianfousdesign commented 1 year ago

as i used my red color it went black again

What colors are you trying to set?

I tried with Red and Blue.

BartoszCichecki commented 1 year ago

I mean which RGB values, because if you are settings a color R:20 G:0, B:0, then yes, it's pretty much pure black.

ianfousdesign commented 1 year ago

I mean which RGB values, because if you are settings a color R:20 G:0, B:0, then yes, it's pretty much pure black.

Yes it’s usually under 20 for low brightness. However this has nothing to do with the fact that the preset don’t get applied? Because when i enable it manually i can see the backlight instead of it being completely off or in default blue.

BartoszCichecki commented 1 year ago

Yes it’s usually under 20 for low brightness

Then yes, if you set the color to RGB 20,0,0, it will show as almost black on the UI that is correct.

However this has nothing to do with the fact that the preset don’t get applied?

Well, I am not sure if it gets applied or not, I can see that LLT is applying the preset correctly after you resume from sleep. Taken from the log above:

[08-04-2023 11:24:21.855] [45] [RGBKeyboardBacklightController.cs#73:SetLightControlOwnerAsync] Taking ownership...
[08-04-2023 11:24:21.877] [42] [RGBKeyboardBacklightController.cs#83:SetLightControlOwnerAsync] Ownership set to True, restoring profile...
[08-04-2023 11:24:21.877] [42] [RGBKeyboardBacklightController.cs#88:SetLightControlOwnerAsync] Restoring preset...
[08-04-2023 11:24:21.905] [45] [RGBKeyboardBacklightController.cs#93:SetLightControlOwnerAsync] Restored preset
ianfousdesign commented 1 year ago

Yes it’s usually under 20 for low brightness

Then yes, if you set the color to RGB 20,0,0, it will show as almost black on the UI that is correct.

However this has nothing to do with the fact that the preset don’t get applied?

Well, I am not sure if it gets applied or not, I can see that LLT is applying the preset correctly after you resume from sleep. Taken from the log above:

[08-04-2023 11:24:21.855] [45] [RGBKeyboardBacklightController.cs#73:SetLightControlOwnerAsync] Taking ownership...
[08-04-2023 11:24:21.877] [42] [RGBKeyboardBacklightController.cs#83:SetLightControlOwnerAsync] Ownership set to True, restoring profile...
[08-04-2023 11:24:21.877] [42] [RGBKeyboardBacklightController.cs#88:SetLightControlOwnerAsync] Restoring preset...
[08-04-2023 11:24:21.905] [45] [RGBKeyboardBacklightController.cs#93:SetLightControlOwnerAsync] Restored preset

That’s weird because trust me it doesn’t after opening the lid or turning on the laptop, it only works when the screen is already on and i unplug the charger, that’s when my keyboard turns red.

BartoszCichecki commented 1 year ago

OK, let's continue debugging.

  1. When you set the colors, try switching between Preset 1 and Preset 2 manually. Does the keyboard change?
  2. Try to reproduce the issue again with the build linked below; I added more logs so maybe this will help us figure out what's up.

LenovoLegionToolkitSetup.zip

ianfousdesign commented 1 year ago

OK, let's continue debugging.

  1. When you set the colors, try switching between Preset 1 and Preset 2 manually. Does the keyboard change?
  2. Try to reproduce the issue again with the build linked below; I added more logs so maybe this will help us figure out what's up.

LenovoLegionToolkitSetup.zip

  1. Yes when i do change presets manually the backlight colors changes as expected.
  2. I’ll do it tomorrow after work and let you know.

    Thank you very much for your time.

ianfousdesign commented 1 year ago

OK, let's continue debugging.

  1. When you set the colors, try switching between Preset 1 and Preset 2 manually. Does the keyboard change?
  2. Try to reproduce the issue again with the build linked below; I added more logs so maybe this will help us figure out what's up.

LenovoLegionToolkitSetup.zip

Hello, just got back from work. I reproduced the issue with the build you sent me. When opening the lid my keyboard backlight is red as it should be, however as soon as i log in the backlight turns off automatically and i have to turn it on manually. Here are the logs. log_2023_04_10_15_33_06.txt

BartoszCichecki commented 1 year ago

however as soon as i log in

So as I understand, if you wake up the laptop, the backlight stays red, and if you wait like a minute or something it doesn't change to blue, but it stays red and the moment you log in it will change to blue?

Do you have any ImController processes running on your laptop?

The fact that it changes on log in, could indicate that some leftover lenovo crap is running for whatever reason.

ianfousdesign commented 1 year ago

however as soon as i log in

So as I understand, if you wake up the laptop, the backlight stays red, and if you wait like a minute or something it doesn't change to blue, but it stays red and the moment you log in it will change to blue?

Do you have any ImController processes running on your laptop?

The fact that it changes on log in, could indicate that some leftover lenovo crap is running for whatever reason.

Yes. I do have a set of several actions, when im running on battery it’s supposed to be on quiet mode, low brightness, other stuff and use red keyboard backlight. When i open my lid or turn on my computer the backlight is indeed red, if i keep it on the lockscreen it stays red as intended, however as soon as i log in with my pin and get to my desktop it either turn blue (default colors) or turns off completely before i manually change it back to red.

I don’t have any controller process running.

BartoszCichecki commented 1 year ago

Could you send me the output of tasklist? Just type it in cmd.

The fact that this happens on log in is weird, because the RGB controller needs "reset" on resume, but nothing happens on log in.

ianfousdesign commented 1 year ago

tasklist

Here is it, by the way it happened also with preset 2 today. I logged in while my laptop was plugged to my charger and it's supposed to be using a deep blue keyboard backlight when charging, it did on the lockscreen however as soon as i logged in it completely turned off. Tasklist.txt

BartoszCichecki commented 1 year ago

You have Vantage leftovers running for some reason. Lenovo.Modern.ImController is runnning.

ianfousdesign commented 1 year ago

You have Vantage leftovers running for some reason. Lenovo.Modern.ImController is runnning.

That's odd because it's completely uninstalled from my laptop, should i try to disable it from LLT settings?

BartoszCichecki commented 1 year ago

You can try or make sure you have all Lenovo services stopped.

ianfousdesign commented 1 year ago

You can try or make sure you have all Lenovo services stopped.

Will do, thanks a lot for your time and patience.

BartoszCichecki commented 1 year ago

No problem. Let me know if the issue gets resolved.

ianfousdesign commented 1 year ago

No problem. Let me know if the issue gets resolved.

Just stopped the process and delete the application from file location. Still the same issue, now it turns off the keyboard backlight even when the laptop is plugged. Same behavior but now with charger as well.

BartoszCichecki commented 1 year ago

There must be something left because the behavior you are describing indicates that something else is changing the backlight. LLT doesn't react to login. Only to resume.

ianfousdesign commented 1 year ago

There must be something left because the behavior you are describing indicates that something else is changing the backlight. LLT doesn't react to login. Only to resume.

Then i’ll do more digging and try to clean up this mess since it’s not LLT. Will do it tonight or tomorrow when i have some more time and will keep you update.

Again thanks a lot for your time.

BartoszCichecki commented 1 year ago

Closing the issue for now, but feel free to comment when you find something.

ianfousdesign commented 1 year ago

Closing the issue for now, but feel free to comment when you find something.

Good morning. For some reason it fixed itself, i guess after deleting the controller.exe left on the system and doing some software updates it's working perfectly fine in the last 24 hours, i tried both plugged in and unplugged with no issue.