smcFanControl
smcFanControl copied to clipboard
Cannot Write Values to SMC Keys
First and foremost, thanks for making smc.c available and I'll be happy to contribute to this project (e.g., switching from OSSpinLock to os_unfair_lock).
After upgrading the internal disk of my iMac (Retina 5K, 27-inch, Late 2014), its fan runs at a higher RPM making it noisy. To slow down the fan, I am following the instructions you've provided in README but other than F0Mn it fails to write (or has no effect) for all other keys (I'm using sudo).
$ ./smc -f
Total fans in system: 1
Fan #0:
Fan ID : Main
Actual speed : 1922
Minimum speed: 1152
Maximum speed: 2700
Safe speed : -1
Target speed : 1925
Mode : auto
# getting errors for all value (01, 00, 0001, 0000), showing one example:
$ sudo ./smc -k 'FS!' -w 01
Error: SMCWriteKey() = e00002bc
# apparently, there is no 'FS!' or it has no data
$ ./smc -r -k 'FS!'
FS! [ ] no data
# getting no errors, but having no effect
$ sudo ./smc -k 'F0Tg' -w 0400
$ ./smc -f | grep Target
Target speed : 1924
$ sudo ./smc -k 'F0Tg' -w 0600
$ ./smc -f | grep Target
Target speed : 1924
$
# only works for F0Mn
$ sudo ./smc -k 'F0Mn' -w 0100
$ ./smc -f | grep Min
Minimum speed: 64
$ sudo ./smc -k 'F0Mn' -w 1000
$ ./smc -f | grep Min
Minimum speed: 1024
I have the same issue with FS!
, so the other settings are not effective.
I'm using 2018 Mac Mini, and the key to manually control fan speed is F0Md
(from source code of smc.c)
The commands in #89 may be useful to you.
If I set the minimum speed to e.g. the double of the default minimum with
sudo smc -k 'F0Mn' -w ${$(([#16]3600<<2))/*\#}
using zsh
for nested parameter expansion it actually works as expected!
I get the minimum and target speed both set at that exact value, the fan can be heard spinning up just a little bit and the actual speed is more or less that.
Fan #0:
Fan ID : Exhaust
Actual speed : 3600
Minimum speed: 3600
Maximum speed: 5500
Safe speed : 0
Target speed : 3600
Mode : auto
There has to be a blank space in the key for forced mode:
smc -k "FS! " -w 0001
After this command setting target speed has an effect.
It appears that settings some keys (such as F0Mx
) has no discernable effect. F0Mx
does not prevent the fan exceeding that speed if FS!
is true and F0Tg
is set high enough though. I think at least some of them (such as F0Mx
) are constantly updated by macOS, so it would overwrite any change you made.
Thanks @Dirk-! It seems (only) the FS thing needs sudo (and must only be set once). WFM:
sudo /Applications/smcFanControl.app/Contents/Resources/smc -k "FS! " -w 0001
/Applications/smcFanControl.app/Contents/Resources/smc -k F0Tg -w $(printf "%x" $(echo $(($1 << 2))))
There has to be a blank space in the key for forced mode:
smc -k "FS! " -w 0001
After this command setting target speed has an effect.