-
Notifications
You must be signed in to change notification settings - Fork 108
Implement Fan Thermal Curve #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
this PR appears to work for my 16V5EMS1.108 GS66-12UHS. as for the interface, maybe a leading t0=0 in the curve file would make it easier to read for humans |
|
I have been using the curve for about 2 months and can say that it works fine. The only noticeable thing is curve override after suspend. But I don't think this is driver's problem, as we can easily fix it in userspace, like this: custom_curve is just a service that pushes the curve to msi-ec. About that leading t0=0 I think I can add it, but the driver should check it to be 0 always. |
|
would you mind posting your systemd service files? |
They are just simple scripts to set up and off the curve: /etc/systemd/system/cscurve_suspend.service /bin/curve_apply /bin/curve_stop |
|
Waujito, do you plan to update the patch up to current version of msi-ec? |
This commit is an implementation of CPU/GPU fan curve
|
Yeah, the full year after the first commit, and I decided to update. I've been using this curve functionality all the year and it really works perfect. Today I have updated the code (basically rewritten), so this may have some hidden bugs. But after the review, I am pretty sure this should be included in the main branch of msi-ec. Please note, that this is implemented for and tested on only my firmware version:
Yeah, may be. Let's wait for maintainer's thoughts about it. As this PR works well, I mark it as ready for review and merge. |
|
Thank you Вадим. |
|
Ready for review @glpnk |
|
I added it into CONF28, msi Titan 18HX. It have the same count of point as Vadim setting, and the same addresses. |
|
@Waujito Hi. I will test your new functionality. Currently Bazzite devs upstreaming fan curve API for |
|
Your Katana GF76 11UC is WMI2 laptop for which this module is intended https://github.com/bazzite-org/patchwork/commits/msi/ |
Wow, this is interesting. They've found an ACPI interface allowing to control the curve without ec. And it works! I found one problem: it does not allow the fans to reach the maximum speed: msi-wmi-platform caps it in 100% while 150% seems to be the real maximum, but my fans reach their maximum speed at 120% :) To make the curve caching work I've added a DMI_MATCH in msi_quirks. |
|
Well, history of this driver started in
Some old laptops had 0-100% range (?), newer laptops have 0-150% with unclear relation of % to RPM. Not sure what Linux Fan APIs need 0-255 range or any other is okay.
It's writing to EC through Linux ACPI-WMI stack. I know that some features have support bits, which we can read to disable certain modes and features. But some of them are broken. For example - MSI have laptop series which have both RGB and monochrome KB BL, and backlight support bit is set on them. But mute leds not have support bits. Number of fans is hardcoded in text file distributed with windows apps. Also some user requested support for device, which have non standard EC layout. But WMI2 emulates certain parts of original EC. #186 UPD: because app uses both namespaces and raw addresses, msi devs mapped both. Also some interesting document about structure was found https://github.com/Sparronator9999/YAMDCC/issues/89 |
Oh yeah chineese technologies 😁 |
Like all msi computers we own. |
Hi!
I hope this PR will be helpful as a reference implementation of the fan thermal curve in further development.
So, I got tired of always having hot keys, unstable MControlCenter (it seems to have a tendency to switch to msi-ec, so it needs this feature too) and had implemented the curve myself in this module. This implementation still needs a lot of testing and is only available for my laptop now, but I think there is enough information to port it to other devices (idk about WMI1 but WMI2 seems to be ok). So, how it is:
The module creates
/cpu/curveand/gpu/curveattributes, which are plain text files with curve data. The data is stored in the following order:s0 t1 s1 t2 s2 ... t(n-1) s(n-1) t(n) s(n)\nwhere s* is a fan speed, t* is a temperature. Note that there is no t0 because it isless than t1(in fact there is likely a field for t0 in EC, which defaults to 0 but I think the behavior for temperatures less than it is undefined, so it is safer to just omit it). Previously I used to think that a more sysfs-ish way to represent the curve is a separate attribute group withs0 t1 ... sn tnattributes but this involves partial updates, while the user expects atomicity. Also there were thoughts about bin_attribute with curve representation in binary format (without spaces and each character represents curves parameter) but this involves too much overhead and is hard to read/write for the user.Also about the implementation: It is different from other attributes because it is stored in memory and syncs with EC lazily. I did this because of #138 where we confirmed that the fan speed is broken on some devices when a non-default curve is in EC in non-advanced fan_mode. So on such devices curve fallback to default values is available: in non-advanced mode the curve keeps its default value, but the end user can virtually change it. /*/curve attributes are available but do not affect EC (they goes on when advanced mode is enabled).