-
Notifications
You must be signed in to change notification settings - Fork 73
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
fan smoothing and syncing #139
Conversation
00081ca
to
27415a4
Compare
Sensor graphs2 minutes of prime95 single threadGeekbench 5 CPU benchmark runboard.mk values# sync GPU fan speed to CPU fan speed
CFLAGS+=-DSYNC_FANS=1
# smooth the fan speed updates such that 0 to full speed happens over this period (divide by 4 for seconds)
CFLAGS+=-DFAN_SMOOTHING=50
# Custom fan curve
CFLAGS+=-DBOARD_HEATUP=3
CFLAGS+=-DBOARD_COOLDOWN=10
CFLAGS+=-DBOARD_FAN_POINTS="\
FAN_POINT(65, 25), \
FAN_POINT(70, 50), \
FAN_POINT(75, 75), \
FAN_POINT(80, 100), \
" |
I think you have a better solution than mine. If I'm understanding you correctly, even FAN_POINT(80, 100) shouldn't actually hit 100% fan speeds at 80C if it starts ramping up slowly and smoothly, which may bring the temps back down before it gets too hot. Along with the boot entries/nvram issue and this improved fan curve, I am looking forward to the next firmware update. :) |
@ZeddieXX on a machine with an adequate cooling system (like a big tower), this might be able to prevent the CPU from ever hitting 80C, but tiny laptops like our Galago Pros lack the cooling capabilities to do the same. In reality, our CPUs exceed 80C within a second! No joke, 40C to 80C in a second. My fan points do their best to keep the CPU below 80C, but under load they'll still dance around the 88C thermal ceiling of "balanced" power mode. |
For myself, I've found that I prefer a quicker ramp up and a slower ramp down of fan speeds and this commit allows for that configuration. Happy to include that in this PR if it's not too messy. |
I generally like this. Is there a reason to re-enable interpolation? Interpolation was disabled so that fan noises would be more steady under load, with this change I would think it would oscillate upwards and downwards |
@jackpot51 in my experience, there's nothing more annoying than a constant workload that sits on a fan point, causing the fan speed to infinitely loop between lower speed (thereby increasing temp) and higher speed (decreasing temp). You are of course correct that with interpolation turned on, a non-constant workload runs a high risk of fluctuating but I'd argue that with the default fan points, you're unlikely to have the fans on for an extended duration without the presence of a fairly constant workload. Ultimately, the interpolation doesn't NEED to be tied to smoothing and could be broken out to its own flag. |
@jackpot51 revisiting this today as I read other redditors wish they had smoother fans. What do you think about including this commit in the PR: curiousercreative@b39bb7f? These are the values I'm running and liking: https://github.com/curiousercreative/ec/blob/galp5/src/board/system76/galp5/board.mk#L40 |
@curiousercreative Yes, you can add that commit. I'll take a look today. I'd like to replace SYNC_FANS with a test for the GPU being present. I can do that in another commit |
7bb2842
to
a50d7c1
Compare
@jackpot51 updated |
Will this be merged upstream so all GALP5 owners will get it? Or is this considered a custom firmware that needs to be compiled and flashed by those who know to seek it out? I hope by having @jackpot51 commenting here, there's a good chance us non-dev people will get the benefits of @curiousercreative work. |
@jackpot51 now with a dGPU galp5 in my hands, I think that I'd prefer fan syncing for both iGPU and dGPU galp5 and here's an idea that COULD be satisfactory or ideal for all laptops actually:
ExampleExample GPU fan curve
Example CPU fan curve
Mock scenarios
|
I agree, given that all the supported laptops have a shared heatpipe system between the CPU and GPU. Increases in CPU heat should result in spinning the GPU fan a bit more and vice versa. |
@jackpot51 updated with smarter fan syncing. Feel free to edit for any reason. I've flashed it and so far so good. These are the build flags I'm using (I generally keep that branch updated with what I'm running, rebased off the latest firmware release for galp5). NOTE: I've also cherry-picked this: #142 |
@jackpot51 anything I can do to get this PR ready for review? |
@curiousercreative this pull request breaks building for any model without a dgpu (maybe even every model other than galp5) src/board/system76/common/dgpu.c:106: error 112: function 'PWM_DUTY' implicit declaration I am trying to figure out how to fix it, I'll let you know if I find a fix. EDIT: It is an easy fix, in dgpu.c the fan.h should be included regardless of HAVE_DGPU since that is where PWM_DUTY is defined. |
@gregor160300 thanks! What model was the build failing for (so that I may verify the fix)? |
I tried with both darp7 and lemp10 both failed before only tried again with darp7 after the fix, I did add the fansmoothing up and down flags to the makefile of darp7 so it might be worth testing also without adding extra cflags |
@gregor160300 thanks again for testing this out. I've updated with your fix and another that I found. |
Does this mean it's ready to be merged? ^_^ |
I don't think it uses or needs board_detect, that could be removed. |
@jackpot51 will do. Do we want to continue defaulting to independent fan speeds and unsmoothed or should we default to synced fans and smoothing? I'd say synced and smoothed makes sense and removing the board detect would imply that being a default... |
@jackpot51 some fun observations regarding the galp5 fans (from psensor):
|
@jackpot51 Any updates on this? Very excited to see this on the next official EC firmware update. |
@jackpot51 I just saw a new firmware just dropped for the GALP5. It doesn't list smoother fan curves or syncing, however. Is this implemented? If not, what is preventing this from going into the production firmware? |
@ZeddieXX Released firmware is typically based on the |
So there's no plan in fan smoothing and syncing for the master branch? |
@curiousercreative I'd like to see the change for syncing CPU and DGPU fan speeds in a separate PR, to make it easier to release these changes |
@jackpot51 sure, I can work on that. I'll update this PR to include just smoothing and I'll open a new PR based off this one (so including fan smoothing) |
@curiousercreative I would prefer the other way around. A PR that just implements syncing, nothing else. The smoothing is actually far more complicated for me to approve |
@jackpot51 sure, I can do it that way as well. I understand it being complicated, but I'd bet the fan smoothing is by far the more important of the two features given what I see on the subreddit. |
@jackpot51 please see #177 for fan syncing |
@jackpot51 speaking of fan smoothing. from this review that was just shared on reddit: https://www.reddit.com/r/linuxhardware/comments/ms8h4k/i_ditched_hp_in_favor_of_system76_here_are_my/
|
Warning: This PR broke the CPU and GPU temperature monitors when I merged this to master on my local. Reverting the merge fixed this issue. |
@MilesBHuff what's your board.mk look like when you observed the issues? This is what my galp5 is running with good results (including psensor CPU and GPU sensor readings): https://github.com/curiousercreative/ec/blob/galp5/src/board/system76/galp5/board.mk#L44 |
@MilesBHuff did you have the fan smoothing build flags in there when things weren't working? |
@curiousercreative Ah Christ, I'm an idiot. No. But that shouldn't have affected the CPU/GPU temperature sensors. |
@MilesBHuff shouldn't, but could be a regression. I don't know if I've ever run the build without the fan smoothing flags, so I can give that a shot at some point. But to your previous comment about interpolation not working, it's only enabled with fan smoothing flags set. You can try it again with smoothing flags and report back. |
@curiousercreative I'm mildly afraid to run it knowing it may break the sensors, like before. The CPU runs very hot, and I'm afraid that the lack of sensor data might impact the ability of the fan curve to function properly. As well, I've already hard-coded a smooth fan curve in my |
@MilesBHuff ok, no worries. FWIW, I wouldn't worry about running too hot. The CPU package internally has thermal protections, it should be pretty difficult to do it any serious harm, especially in a short time window. |
I've seen no mention of the Serval WS (serw12 I think) which has atrocious fan noise for no apparent reason. Can this please be ported to that series? |
Sorry, but the Serval WS does not run open EC, so that won't be possible. |
closing in favor of newer implementation #190 |
NOTES
CHANGES
I wrote this for my new galp5 to address a common complaint of the fans jumping from 0 to 100 and back abruptly. This PR adds support for new build flags:
SYNC_FANS
will read target fan speeds from both CPU and GPU fan curves, take the max and set both fans to this speed.FAN_SMOOTHING
sets the number of fan speed event loops that a 0 - 100 speed ramp should be smoothed across. Effectively, this determines the maximum fan speed adjustment for each event loop to prevent audible stepping. A high number yields a slower and smoother ramp while a low number yields a fast response.FAN_SMOOTHING_UP
sets the fan smoothing (as described above) for the fan speed increasesFAN_SMOOTHING_DOWN
sets the fan smoothing (as described above) for the fan speed decreasesSee updated galp5 board config for an example of these new values: https://github.com/system76/ec/pull/139/files#diff-198f0231dadddcc1692e1557f98782a282a0e540eb1664fd95402cb0574caab8R43
Attempts to fix system76/firmware-open#149 and system76/firmware-open#148