AlexIII / tcc-g15

Thermal Control Center for Dell G15 - open source alternative to AWCC
GNU General Public License v3.0
471 stars 20 forks source link

Questions about Thermal_Information method. #46

Closed kuu-rt closed 3 weeks ago

kuu-rt commented 1 month ago

Hello!

I'm in the process of developing a Linux Kernel driver for the WMI device AWCCMethodFunction and I wanted to thank you for the non-USTT thermal profile codes, as my computer doesn't have those. I have some questions and I will be very grateful if you could help me with them.

I discovered that the Thermal_Information method has the following behavior when taking the following arguments:

0x0603 returns QUIET_PROFILE_ID 0x0703 returns BALANCED_PROFILE_ID 0x0803 returns PERFORMANCE_PROFILE_ID 0x0903 returns FULLSPEED_PROFILE_ID 0x0A03 returns LOWPOWER_PROFILE_ID 0x0B03 returns GMODE_PROFILE_ID

and

0x0A returns BALANCED_PROFILE_ID

Reading previous Issues you mentioned your model doesn't support USTT thermal profiles. Could you help me verifying what those codes return on your computer? This way I can extend support to more models.

Thank you so much.

EDIT: fixed the codes.

AlexIII commented 1 month ago

Hi!

Could you help me verifying what those codes return on your computer? This way I can extend support to more models.

Sure! What commands do you want me to run to do that?

kuu-rt commented 1 month ago

Hi!

Could you help me verifying what those codes return on your computer? This way I can extend support to more models.

Sure! What commands do you want me to run to do that?

Hi!

All these codes should be passed to Thermal_Information. Most important ones, with their expected behavior are:

0x0A -> get balanced profile ID 0x0B -> get current thermal profile

On a previous issue you mention you have a Dell G15 5515, that should have 2 fans and 2 sensors so:

0x0403 to 0x0503 -> should return avaliable thermal codes (balanced and gmode)

Also, why did you prefix profiles 160-165 with USTT? and do you know any models that support codes 150 (Quiet), 152 (Performance), 153 (Full Speed)?

Thank you for your help.

AlexIII commented 1 month ago

I'm still not sure I understand what you're asking, but I ran this script

import wmi
awccClass = wmi.WMI(namespace=r"root\WMI").AWCCWmiMethodFunction
awcc = awccClass()[0]
Thermal_Control = getattr(awcc, 'Thermal_Control')
args = [0x0603, 0x0703, 0x0803, 0x0903, 0x0A03, 0x0B03, 0x0A, 0x0B, 0x0403, 0x0503]
for arg in args:
    print(f'{arg:04X} {Thermal_Control(arg)}')

which returned

0603 (-1,)
0703 (-1,)
0803 (-1,)
0903 (-1,)
0A03 (-1,)
0B03 (-1,)
000A (-1,)
000B (-1,)
0403 (-1,)
0503 (-1,)

Please give the actual code to run if I understood you incorrectly.

Also, why did you prefix profiles 160-165 with USTT?

Do you mean public enum ThermalMode from WMI-AWCC-doc.md? Those are the exact names that I got from decompiling AWCC.

and do you know any models that support codes 150 (Quiet), 152 (Performance), 153 (Full Speed)?

No, sorry, I only own one model.

kuu-rt commented 1 month ago

I'm still not sure I understand what you're asking, but I ran this script

import wmi
awccClass = wmi.WMI(namespace=r"root\WMI").AWCCWmiMethodFunction
awcc = awccClass()[0]
Thermal_Control = getattr(awcc, 'Thermal_Control')
args = [0x0603, 0x0703, 0x0803, 0x0903, 0x0A03, 0x0B03, 0x0A, 0x0B, 0x0403, 0x0503]
for arg in args:
    print(f'{arg:04X} {Thermal_Control(arg)}')

I think this is correct, just replace Thermal_Control with Thermal_Information.

which returned

0603 (-1,)
0703 (-1,)
0803 (-1,)
0903 (-1,)
0A03 (-1,)
0B03 (-1,)
000A (-1,)
000B (-1,)
0403 (-1,)
0503 (-1,)

Please give the actual code to run if I understood you incorrectly.

Also, why did you prefix profiles 160-165 with USTT?

Do you mean public enum ThermalMode from WMI-AWCC-doc.md? Those are the exact names that I got from decompiling AWCC.

Yes, that's what I meant. Thank you so much.

and do you know any models that support codes 150 (Quiet), 152 (Performance), 153 (Full Speed)?

No, sorry, I only own one model.

No worries. It seems those codes are not implemented in any model, but I could be wrong.

AlexIII commented 1 month ago

Results from calling Thermal_Information

0603 (0,)
0703 (0,)
0803 (0,)
0903 (0,)
0A03 (0,)
0B03 (0,)
000A (151,)
000B (151,)
0403 (151,)
0503 (0,)
kuu-rt commented 1 month ago

Results from calling Thermal_Information

0603 (0,)
0703 (0,)
0803 (0,)
0903 (0,)
0A03 (0,)
0B03 (0,)
000A (151,)
000B (151,)
0403 (151,)
0503 (0,)

Thank you very much, this is very useful information.

I don't own a G-Series laptop, so try this at your own risk if you want to experiment, as this might mess with your configuration. Method GameShiftStatus has the following codes:

0x01 -> toggles G-Mode 0x02 -> get G-mode status

This method probably just changes power profiles and leaves fans unchanged.

If you end up experimenting, please tell me your results.

Thank you again for all your help.

AlexIII commented 1 month ago

Sure, no problem Running

print(GameShiftStatus(0x01))
print(GameShiftStatus(0x02))

returns

(1,)
(1,)

Running the second time returns

(0,)
(0,)

It switches between 1<->0. I've run FurMark while the GameShiftStatus was 0 and then 1, there wasn't any difference in FPS.

AlexIII commented 1 month ago

One addition, switching between G-mode and Balanced affects print(GameShiftStatus(0x02)). It returns 1 when G-mode is on and 0 when Custom or Balanced.

kuu-rt commented 1 month ago

Sure, no problem Running

print(GameShiftStatus(0x01))
print(GameShiftStatus(0x02))

returns

(1,)
(1,)

Running the second time returns

(0,)
(0,)

It switches between 1<->0. I've run FurMark while the GameShiftStatus was 0 and then 1, there wasn't any difference in FPS.

So it works as expected (except for the benchmark), interesing. When calling with 0x01, do the fans switch to full speed?

AlexIII commented 1 month ago

So it works as expected (except for the benchmark), interesing. When calling with 0x01, do the fans switch to full speed?

No, no visible changes.

kuu-rt commented 1 month ago

Thank you for your help, all this information is very useful!