The most annoying thing about my Librem 15v4 laptop (and perhaps other models) is the on-again-off-again fan noise. At least, it does vary the fan speed based upon current need, but the maximum speed is too close to a tornado for my liking. I suspect I’m not alone in this regard. In the longrun, I hope that Purism: (1) somehow improves the acoustics, perhaps by the use of a bigger heat spreader, more vent holes, more thermally conductive case material, better vibration isolation (like a Lexus), and low-performace-SKU cores; and (2) adds a “quiet mode” to PureOS power settings which disables Intel Turbo mode as described below.
The good news is that I found substantial fan noise relief by simply disabling Turbo fequencies on all cores. Turbo is a feature which allows a given core to exceed the frequency which is sustainable under it’s specified thermal design profile (TDP). In principle, it’s a great idea because you can safely overclock when plugged into AC. In reality, it’s more trouble than it’s worth because often only works for a matter of seconds before the thermal envelope is breached and the frequency needs to be scaled back for a while. In other words, it’s a great way to generate fan noise and warm up your lap while running your apps trivially faster.
There are numerous utilities out there which claim to let the user set power management policies, but I found that only Xfce Power Manager claims to let you manipulate frequencies. However, at least on my machine, that did not turn out to be the case. So that leaves the hard way, which is to manually alter the CPU machine status register (MSR) for Turbo control. Here’s how to do it:
sudo apt install msr-tools
sudo modprobe msr
That will install and load the package you need. First of all, see if Turbo is enabled on processor 0 by reading bit 38 of MSR 1A0:
sudo rdmsr -p0 0x1A0 -f 38:38
If it comes back as 0, then Turbo is enabled, otherwise not. This should be the same result for the other processors ("-p1", “-p2”, etc.), but you can read them all if you like.
You can disable Turbo by writing back to 1A0 with bit 38 set. But in order to do that, you need to see its entire 64-bit value, so you don’t change any other bits:
sudo rdmsr -p0 0x1A0
This returns 0000850089 in my case, so let’s set bit 38 and write back ("-a" for all processors, as opposed to “-p0” for just the one that we read):
sudo wrmsr -a 0x1A0 0x4000850089
You can repeat the first read above, and verify that bit 38 now returns 1.
Open up a bunch of browser tabs playing videos. Notice that, while the fan still runs, it runs quieter. You can even toggle Turbo in a terminal while you do so, which should result in fan speed changes a few seconds later:
sudo wrmsr -a 0x1A0 0x0000850089
sudo wrmsr -a 0x1A0 0x4000850089
The bad news is that I have no idea how to run this at startup. Yes, you can modify .bashrc (and include the modprobe above), but because this is a sudo command, you’ll get asked for your password every time you first open a terminal. Surely, there’s a better way, perhaps through sysfs or a power management app, but I haven’t found it, so please let me know if you find something.