4JX / L5P-Keyboard-RGB

Cross platform software to control the RGB/lighting of the 4 zone keyboard included in the 2020, 2021, 2022 and 2023 lineup of the Lenovo Legion laptops. Works on Windows and Linux.
GNU General Public License v3.0
325 stars 41 forks source link

Multiple profiles dont get saved #103

Closed Rodrxx closed 1 year ago

Rodrxx commented 1 year ago

I tried to set up 2 different profiles "Profile 0" and "Profile 1" for "SmoothWave" and "Ripple" effects respectively so i can interchange between them with Win+AltGr, when i try to setup Profile 0 with SmoothWave, Speed 4, Brightness 2 and Direction Right, is everything ok (last time i was using only one default profile that was saved on a file "default.json" for Smooth Wave, Speed 2, Brightness 2 and Direction Left), when i set up the Profile 1, for Ripple effect, Speed 5, Brightness 2 and yellow color, again is everything ok, but somehow when i use Win+AltGr for change between profiles, Profile 0 is instead the one i have in default.json (S 2, B 2 D Left), and when i use Win+AltGr to change to Profile 1, the ripple effect gets resetted to a white color and not the yellow one.

Tried saving both profiles into their separate files, Smoothwave being default.json and Ripple being profiles.json, and loading them back on, when loading profiles.json, the app shows an error telling me the file isnt compatible with the program version or the file is corrupted.

Then i deleted both Profiles 0 and 1 to start from scratch but the program crashes when i try to add a new profile, so i downloaded a new fresh version from github (v0.18.0), so now i can create profiles, good, but the behavior is pretty much the same, so i cant set up 2 effects correctly with the profiles.

I dont know if im doing something wrong here or just isnt supported (i use the program to thinker with it only 1 time to setup everything and let it run alone)

4JX commented 1 year ago

Can you try using https://github.com/4JX/L5P-Keyboard-RGB/actions/runs/4746596729 ? It's the next version with better support for Profiles, lmk how it fares.

Rodrxx commented 1 year ago

Uhm, tried new version, maybe its normal to be using 10% CPU (Ryzen 5800H) while the GUI is opened? My fans are going crazy when the app is showing its GUI.

Ripple effect is broken, im pressing keys but no ripple is showing.

Will elaborate further about the profile saving, but at quick glance looks like it is solved. But i cannot use Win+Space to change between.

Edit: looks like the CPU is keeping the 10% of use even when the app is in tray or background, it doesnt seem to go down like it used to

4JX commented 1 year ago

But i cannot use Win+Space to change between.

It's currently set to LeftWin + AltGr, dunno which one to pick.

maybe its normal to be using 10% CPU (Ryzen 5800H) while the GUI is opened

Ah, linked a version without the fix (for the most likely reason), see if this one is better https://github.com/4JX/L5P-Keyboard-RGB/actions/runs/4747218092

Rodrxx commented 1 year ago

Tested it and CPU usage is finally fixed, even when running the program in foreground.

Sadly, Ripple effect is still broken, a specific thing, when switching through profiles (i have 2, Normal and Ripple, Normal is smoothwave, and Ripple is by itself), Im sitting right in Normal profile, pressing Win+AltGr switches to Ripple Profile, which is expected (Ripple still broken), but when pressing Win+AltGr again, it should go back to the first profile which is Normal Profile, but instead of doing that the program crashes itself so i have to reopen it.

Edit: for some reason it is fixed now but i will keep testing on switching profiles if something goes wrong again.

Edit2: Still crashes for some reason when going back to Normal Profile or Profile1, is random and i dont know exactly what causes this

Edit3: I think i found the reason, looks dumb but when pressing Win+AltGr the program changes profiles as expected, but when doing the inverse, with AltGr+Win, the program instantly crashes, as far as i know, it should detect fine both combinations or maybe im wrong

Rodrxx commented 1 year ago

Found something new, you can open multiple instances of the app, making the keyboard lightning entering a glitched status of repetitive flickering, it can be solved by closing one instance and leaving the other running fine.

Next, when i open the app from the folder i have the .exe located (and .json files for the profiles), the app gets loaded in with all the profiles i created and saved perfectly.

But when searching from the windows search and typing "rgb" and opening the .exe from that location, the program doesnt show any profiles that i've created, and when i press to load a profile, the embeded file explorer gets it default directory in System32, also, when loading the .json that contains Normal and Ripple profiles (see above comment for context), only the Normal profile appears iluminating the keyboard with the correct settings (speed and direction) and in the GUI there is no trace of such profile's names (Normal and Ripple), Win+AltGr does nothing too since it doesnt detect any profiles.

This only happens when opening the program through windows search, it does not happen when opening the .exe in the directory i have it from file explorer.

4JX commented 1 year ago

Can you upload the settings.json file with the two profiles that make the program crash?

Found something new, you can open multiple instances of the app, making the keyboard lightning entering a glitched status of repetitive flickering, it can be solved by closing one instance and leaving the other running fine.

Must've broken recently, the check is technically still there.

the program doesnt show any profiles that i've created ... in System32 ...

The program looks for the file in the directory it's currently stored in, perhaps some windows shenanigans with how it executes it may be happening there. Though the latter part of your comment makes me feel as though its something else (or rather a combination of that and another issue)

As for Ripple I've been testing on using another library to detect user input for Linux compatibility's sake, but it seems to be more broken than the previous one so I'll probably just roll that back.

Can you try to see running the program from a console window and seeing if anything gets printed out?

Rodrxx commented 1 year ago

settings.txt Here it is Launching from the console it just says "No subcommands found, starting in GUI mode. To view the possible subcommands type "legion-kb-rgb.exe --help".", after that, i cannot type anything in the console, after when i close the program from the tray i can type in the console.

Since you asked specifically for the settings.json i uploaded it, but i cannot load settings.json into the program, instead i load this for the profiles default.txt

4JX commented 1 year ago

Launching from the console it just says "No subcommands found, starting in GUI mode. To view the possible subcommands type "legion-kb-rgb.exe --help".", after that, i cannot type anything in the console, after when i close the program from the tray i can type in the console.

Meant after causing the program to crash by switching profiles

Rodrxx commented 1 year ago

I open the program via cmd just after the crash, the program starts like normal and the command line doesnt say anything

4JX commented 1 year ago

Can you check how broken https://github.com/4JX/L5P-Keyboard-RGB/releases/tag/v0.19.0 is for you with regards to the issues described here?

Rodrxx commented 1 year ago

I was testing the ripple effect and there is something strange with the Ñ key (spanish layout), it is near the L key and when i press it, the ripple goes like i was pressing the A key for example, with a sweep from left to right, from my end there is nothing more to report, everything is fine