TamtamHero / fw-fanctrl

A simple systemd service to better control Framework Laptop's fan(s)
BSD 3-Clause "New" or "Revised" License
183 stars 35 forks source link

Fans keep working after suspend #6

Closed emrebicer closed 1 year ago

emrebicer commented 1 year ago

I cloned the repository on my Arch Linux system and ran the install script. It works as intended however the fans will keep working after suspend (sleep), Is there a way to make fans stop and start them on resume?

TamtamHero commented 1 year ago

Weird ! Maybe you could write a systemd script that starts/stops the fw-fanctrl service when suspending/resuming, like this: https://www.addictivetips.com/ubuntu-linux-tips/run-scripts-and-commands-on-suspend-and-resume-on-linux/ I guess that'd work, even though it's probably not the prettiest way :')

emrebicer commented 1 year ago

This is exactly what I thought, but unfortunately stopping the service does not stop the fans, after stopping the service I believe the fans will keep spinning at the last set fan speed value. But now that I see #7 is merged maybe I can change the strategy to a custom sleep strategy before sleeping and then back to the default strategy on resume. Just out of curiosity, does it work as expected on Ubuntu / other distros?

TamtamHero commented 1 year ago

Ah! Yes you're right ! Indeed a custom sleep strategy could help you.

Just out of curiosity, does it work as expected on Ubuntu / other distros?

Yup, something like 99.99% of the time for me on Ubuntu. It happened to me once or twice that the fans keep blowing after going to sleep but waking up and sleeping again always fixed it...

emrebicer commented 1 year ago

With this commit I finally could stop fans on suspend (by hot swapping to a sleep strategy) and continue fans with the default strategy on resume. If you see fit I can open a pull request, otherwise feel free to close this issue.

TamtamHero commented 1 year ago

Nice, well done ! Please open a PR :)

TamtamHero commented 1 year ago

Actually, I discovered when testing your PR that I also have your issue ! I live in a temperate climate and I always use the lazyest mode, so whenever my laptop goes to sleep, the cpu load drops and the fan goes silent (the lazyest profile switches off the fan when cpu is under 45°C)

So I naïvely tried current code with deaf mode like a sort of control group, and it just continued spinning like hell. Yes, I wrote all these profiles but never used them for more than a few seconds x) So, thanks a lot for fixing this amateur work !