tdakhran / razer-ctl

A tray icon for controlling Razer Blade 16
MIT License
18 stars 4 forks source link

Support for Razer Blade 15" - 2019 Advanced #9

Open rainyskye opened 5 months ago

rainyskye commented 5 months ago

Device/Specs:

RZ09-03017E01
i7-9750H
RTX 2070 Max-Q
Windows 11 24H2 (IoT Enterprise LTSC) (26100.712)
PID: 0x0245

Found this project after considering having a go at my own, Synapse is sh*t so kind of need an alternative.

I've been able to get razer-cli enumerate to show the RazerDevice instances, and with manually specifying, or compiling librazer with the PID for my laptop, I can get every function working as far as I know (Fan Control, Performance Modes, Logo Control, Keyboard Backlight).

However trying to run razer-cli info ends up spitting out a Error: Command not supported or Error: Command failed with unknown status: 01, which are the same errors returned by attempting to use functions that don't exist on my model (Battery Care) (There may be more but I'm not sure).

razer-cli itself works (excl info), and I expect razer-tray may be failing due to not getting a valid response from an info check?

Any help on getting this SKU supported would be appreciated, thanks for all your work so far :)

rainyskye commented 5 months ago

I expect razer-tray may be failing due to not getting a valid response from an info check?

As jank as it is, my temporary workaround is basically commenting out all references to battery care in the tray app, and it seems to run perfectly fine. With all functions working.

I might have a go tomorrow (later today) at making the battery care function a soft requirement or something.

tdakhran commented 5 months ago

Hi @rainyskye, thanks for opening the issue, and I'm glad to see you managed to make it work for you. I merged today #2 which adds some infrastructure to support more devices.

Different laptops have different sets of features, e.g. battery health, boost, and overclock might not be present on some models.

Folks here came up with compatibility spec and I'll need to come up with something similar.

Let me think over the weekend about how to integrate such functionality. It touches both cli and tray apps.

RoastedHobnai1 commented 5 months ago

@rainyskye , could you please share a bit more about manually specifying the PID in code? I was able to find some lines related to this, but due to a lack of experience with rust, I'm not sure how to get things to work as you did.

rainyskye commented 5 months ago

@rainyskye , could you please share a bit more about manually specifying the PID in code? I was able to find some lines related to this, but due to a lack of experience with rust, I'm not sure how to get things to work as you did.

Manually specifying the PID in code is essentially the same as -p 0xPID0, in my case, if I run razer-cli enumerate, the output will look something like this

RazerDevice { pid: 0x0245, path: \\<path goes here>} }

++ more instances repeated

So if all you want to do is attempt to make your machine work with no other changes, you can use razer-cli -p 0x0245 <command> (replacing 0x0245 with your PID).

rainyskye commented 5 months ago

Hi @rainyskye, thanks for opening the issue, and I'm glad to see you managed to make it work for you. I merged today #2 which adds some infrastructure to support more devices.

Different laptops have different sets of features, e.g. battery health, boost, and overclock might not be present on some models.

Folks here came up with compatibility spec and I'll need to come up with something similar.

Let me think over the weekend about how to integrate such functionality. It touches both cli and tray apps.

Sounds good, I think specifying a feature set in the PID list is the easiest way, obviously implementation isn't as simple, but let me know if I could perhaps help at all. :)

Would make future support as easy as potentially an auto detect for which are supported, then they can be strictly defined, that is assuming Razer haven't used the same PID across multiple models with unique feature sets.

RoastedHobnai1 commented 5 months ago

@rainyskye , oooh, got it. Though, the cli-only implementation is a bit clunky. Initially, I thought that you recompiled the whole -tray app with the necessary PIDs adjusted to yours.

Nevertheless, tried using only the CLI and it worked just fine:

PS C:\Users\Vladimir\Downloads> .\razer-cli.exe -p 0x023a fan manual PS C:\Users\Vladimir\Downloads> .\razer-cli.exe -p 0x023a fan rpm 5000

Thanks! Now I need to figure out how to get the tray app to work with my PIDs.

tdakhran commented 5 months ago

Now I need to figure out how to get the tray app to work with my PIDs.

tray app relies on autodetect and uses hardcoded PIDs from this list https://github.com/tdakhran/razer-ctl/blob/69817b18dcf0a360d6644f0c8e1ae186ed621bed/librazer/src/device.rs#L12-L23

However, it still might not work, because it queries all information that is hardcoded now. As discussed here https://github.com/tdakhran/razer-ctl/issues/12#issuecomment-2156023690, PID is not sufficient to differentiate between laptop models and I plan to move to Razer Model IDs.

my temporary workaround is basically commenting out all references to battery care in the tray app, and it seems to run perfectly fine. With all functions working.

If the aforementioned changes made razer-cli info work, then adding PID to the table and removing battery health-related stuff from razer-tray should make it work.