[RESPONDED] Changing the fan temperture points with ectool

fw-fanctrl was the reason I looked into the code, it’s a great tool. But I was concerned about what might happen if userspace crashes / hibernates / … so I wanted to see if the embedded controller could handle it.

The corresponding ec code would be this function that translates low/high/current temperature into fan %.
I don’t think a linear function is great for this, so fw-fanctrl does have an advantage here, but the simplicity and stability of an ec managed fan were key for me.

4 Likes

@Rene_Treffer Thanks for the info! I was looking for a way to improve the fan noise. After you changed the setting, how was your fan now? Have you seen the noise was improved?

The corresponding ec code would be this function that translates low/high/current temperature into fan % .

Maybe Framework is not using the main branch, and it is only used to synchronize the code from the upstream project. Maybe Framework uses the hx20 (For Intel 11 gen main board?), and hx30(for Intel 12gen mainboard?) branches. But the function is the same on these branches too.

I created an updated version of TamtamHeros fw-fanctrl which enables automatic switching between two fan curves depending on if the laptop is charging or discharging. I created a pull request for this. Until its merged into the original fw-fanctrl version mabye try the updated version.

The current charging status of the laptop is read from the following file:
/sys/class/hwmon/hwmon2/device/status
On my Framework Laptop running Pop OS 22.04 this works. I don’t know yet if this path works for all Framework Laptops on all Linux distributions. So any feedback is appreciated.

That is a valid path on EndeavourOS (arch derivative) as well. The same status variable/file is also at
/sys/class/power_supply/BAT1/status

I am not sure which path is more stable and least likely to change. Consider having a hard-coded default path for charging status read, that is also can be overridden by config file?

1 Like

Good idea, just committed that change. By default the charging status is now read from /sys/class/power_supply/BAT1/status. It can be overwritten by providing a path inside the config file.

1 Like

I took a minute to look at your code. I am wondering, instead of separate system service, could the two separate fan speed maps be triggered by tlp’s sensing of “on AC” vs “on batt” instead? Might be more complexity than the overhead savings is worth, but I thought I would mention the idea.

I would have to take a look at how tlp works. Right now the service accesses the file once per second. The CPU time compared to the rest of the system should be almost unmeasurable. I guess the reason for the existence of the system service is primarily the convenient automatic load of the python script at start up.

@junaruga yeah, the machine is way more silent now. It still depends on workloads on how it behaves in detail. But normal browsing can be silent.

It’s such a pity that undervolting is locked on the 11th gen even with unlocked BIOS.

For the fan curve this is just a linear one. I would have preferred a non-linear one, e.g. the square of the value, like 100 * (cur - low) * (cur - low) / ((high - low) * (high - low)). Or a mix with the current one.

The downside is always that the machine will run hotter. Keep that in mind.

1 Like

@Rene_Treffer thanks for sharing it! I’m happy to see your machine is more silent.

May I ask if you are using the 11th gen or 12th gen model? Looking to install on my Framework Laptop running PopOS too.

I use a 11th Gen Mainboard.

You can check the thread below. My CPU temperature is always less than 60 degrees by setting it up.

1 Like

I wonder if there are any long-time experiences. @Rene_Treffer Are you still using this? Have you experienced any issues?

@real_or_random been using it all the time. No complications, laptop runs hotter but more silent. Only annoyance is that I sometimes need to manually reapply this.

2 Likes

I am running the fw-fanctrl service on 12th gen FW and in deaf mode but sometimes it tells me I don’t have any battery left and shuts down not long afterwards.

I keep on using it though

Curious, are you able to take screenshot when this happens?

I’ll try and post it here although there isn’t much to see.

I get a battery critically low notification and something like 10 seconds later the laptop shuts down.

I am running Fedora’s cinnamon spin so it may be a Cinnamon bug ? It wouldn’t be the first bug I get

Edit: @Loell_Framework So yeah it happens too fast for me to screenshot it. Another piece of information is that I am maxing out my battery at 60% in the UEFI since it’s stationary.

Edit 2: Actually there’s a Cinnamon setting to “Do nothing” when the battery is extremely low (which I never let happen anyways). So I guess I jsut “fixed” my issue

1 Like

Any updates about fw-fanctrl? AFAIK the fan control monitors the cpu_f75303@4d which is NOT the CPU temperature, the actual CPU temperature is cpu@4c but the fan only starts when the CPU is already thermal shutdown(103 C and 105 C), as shown

$ sudo ectool temps all
--sensor name -------- temperature -------- ratio (fan_off and fan_max) --
local_f75303@4d       319 K (= 46 C)          20% (313 K and 343 K)
cpu_f75303@4d         321 K (= 48 C)          25% (319 K and 327 K)
ddr_f75303@4d         315 K (= 42 C)        N/A (fan_off=401 K, fan_max=401 K)
cpu@4c                365 K (= 92 C)           0% (376 K and 378 K)

Is it possible for fw-fanctrl to use the temp reading of cpu@4c and edit the fan curve on that one accordingly?

I’ve been using this systemd service for a while, and I’m happy with it:

Use this at your own risk, of course.

I’ve been having issues with my framework 16 overheating and shutting down, so I tried to follow the advice in this thread to configure my fans to be a bit more aggressive.

I managed to install ectool (I’m running NixOS, so I just installed the default version of fw-ectool available on nixpkgs), but it’s giving me a rather odd output, with a bunch of zeroes.

> sudo ectool thermalget
sensor  warn  high  halt   fan_off fan_max   name
  0      363   363    378      0       0     ambient_f75303@4d
  1      363   363    378      0       0     charger_f75303@4d
  2      363   363    378    320     335     apu_f75303@4d
  3      381   381    400    320     335     cpu@4c
  4        0     0      0      0       0     gpu_amb_f75303@4d
  5      344     0      0    323     347     gpu_vr_f75303@4d
  6        0     0      0      0       0     gpu_vram_f75303@4d
  7        0     0      0    323     353     gpu_amdr23m@40

Can anyone help me figure out what is going on here, and how I can make my laptop not overheat?

1 Like