-
Notifications
You must be signed in to change notification settings - Fork 305
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
Add support for Apple Silicon #137
Conversation
-Update classes to read correct Apple Silicon CPU sensor -Update project to compile a Universal 2 binary. Upgraded Sparkle to 2.1.0 as that was the latest and supports ARM64. -Add MacBookPro18,1 to Machines.plist
…omSleep will set the previous selection on wake
I, can you compile a test version on your fork ? best |
i am interested in this also, i did a Fork and will try to update. what is notice in my Monterey M1 MacBookPro17,1 13" 2020 is that it does not read well the max-speed , so the slider for speed has random values like 5 digits or so, and if i enter let's say 2000 it says it's not good value. I think it's not reading good data from SMC. on ./smc -f it gets ok: Fan #0: also the Temperature does not read at all from SMC. [2022-10-17 19:47:50:196] [thread 1194274] [TempSensorProvider.cpp#68] TemperatureSensorProvider::loadAvailableSensors |
@georgedimac Can you download https://crystalidea.com/macs-fan-control/download and check what the Maximum speed is? The values look correct on my "MacBookPro18,1" It might be worth changing the temperature sensor from 'Tp0D' to 'TCXC' to see if that helps.
|
Added to the PR description. Update: Removed now that this is merged |
yes, that app gets the speed right 7199, the same as ./smc , but the smcFanControl does not get it right look how are the values on mine:
i tried but it doesn't work. as you can see from the previous post the sensors on M1 are different names. the problem is described here : "Yeah, the issue is that the older code is using the SMC to get temperatures and M1 Macs don't have a SMC. They share the sensor layout with iOS devices for things like the CPU. This means you need to talk to IOKit to get the info." |
@georgedimac It might be worth resetting the app. "Info & Support" -> "Reset..." as that will delete these 2 files which might have been generated using an older smcFanControl app?
Interesting info regarding the temperature. I ran "smc -l" and found a sensor which roughly matches the 46 degree temperature that "Macs Fan Control" displayed
|
thanks. the reset helped the Fan min_max value to read proper now. as for the temp it still does not read it , if i do "./smc -t" , it shows blank . on "./smc -l" i don't have any Tp0D , maybe my machine (MacBookPro17,1 13" Pro 2020) is different. i attach the output from apple_sensors yeah, it seems that on your 18,1 (16" m1 pro 2021) there are different sensor names, that's why it works with Tp0d on your case. on mine there isn't that sensor. |
@georgedimac Nice one! I've changed the code to use a private IOKIT API for the temperatures. Can you recompile and try it? The IOKIT Temperature readings seem about 10°C lower than https://crystalidea.com/macs-fan-control & https://github.com/exelban/stats. The temperature is similar to https://github.com/macmade/Hot though. |
yes, but the implementation that you did averages around 20 sensors. what i saw that other programs do is : calculate a 'SOC Die Average' using this 3 values/sensors: PMGR SOC Die Temp : 0,1,2 . I replaced in 'CFSTR("PMU"))' : PMU with PMGR and works perfect now. thanks for your work. |
@georgedimac Thanks! My "MacBookPro18,1" doesn't have "PMGR" sensors. Sensor output:
|
@georgedimac Can you please confirm if the CPU temp reading from https://github.com/exelban/stats is correct for you? Thanks Looking through the code the temperature is read from the smc EDIT: I've updated the code to only use IOHID based on a whitelist. Can you please test that out? Thanks |
if you look in exelban README it says that for M1 (only) you have to enable IOHID to display them and that's only how it works on this M1, it also states that it consumes energy for polling HID i guess. So i think that for M1 to IOKIT is a better choice instead of SMC. the implementantion was good like you did it in first place with IOKIT but with PMGR instead of PMU , and with selection on all M1 (mac mini,air,imac) i guess not only Pro. IOHID is not needed. |
@georgedimac It's the same implementation. It's actually the IOHID api that is being called. For now, users will need to add these devices to the OHID whitelist. |
@hholtmann Thanks for merging. Do you have a release date planned for the next version of this app? Thanks |
I will try to find some timer over the new year to test the app on Apple Silicon. Also I think there are some adjustments necessary to the UI for machines where the fan speed is forced (= no minimum fan speed can be set, when the fan is not active). |
Great work, thanks for this patches. MacBookPro18,3 @ Sonoma
Also this better than TGPro, because support fan speed control, not only off and go fast :) |
closes #126 Add support for Apple Silicon
-Updated classes to read correct Apple Silicon CPU sensor
-On Apple Silicon set the fan to Auto before sleeping. systemDidWakeFromSleep will set the previous selection on wake
-Updated the project to compile a Universal 2 binary. Upgraded Sparkle to 2.1.0 as that was the latest and supports ARM64.
-Add MacBookPro18,1 to Machines.plist
This has only been tested on a Macbook Pro 16" M1 Pro. Please test that this still works on Intel.
It's also worth merging #133 as that allows printing of temperatures using
smc -t
. It's not required for the Mac MenuBar app to function which is why I haven't cherry-picked that commit.Known Issues:
-[FIXED] When a user sets the fan speed, the fans remain on when the Macbook is put to sleep. I'm unsure if this is Mac ARM specific.
-[FIXED] Use IOHID private API for MacBook Pro M1 as SMC is unavailable.
Note: XCode warns that Sparkle wasn't built for MacOS 10.7, but I have left the MACOSX_DEPLOYMENT_TARGET unchanged to maintain backwards compatibility.
Dylib (./Sparkle.framework/Sparkle) was built for newer macOS version (10.13) than being linked (10.7)
I also noticed these Sparkle errors. Given that https://www.eidac.de/smcfancontrol/smcfancontrol.xml is down, these can be addressed at a later date.
2022-04-05 20:44:07.214425+0100 smcFanControl[41957:179479] [Sparkle] Error: Serving updates without an EdDSA key and only using Apple Code Signing is deprecated and may be unsupported in a future release. Visit Sparkle's documentation for more information: https://sparkle-project.org/documentation/#3-segue-for-security-concerns 2022-04-05 20:44:07.388922+0100 smcFanControl[41957:179479] Metal API Validation Enabled 2022-04-05 20:44:09.937719+0100 smcFanControl[41957:180407] [boringssl] boringssl_context_handle_fatal_alert(1967) [C1.1:2][0x1226438a0] write alert, level: fatal, description: protocol version 2022-04-05 20:44:09.938141+0100 smcFanControl[41957:180407] [boringssl] boringssl_context_error_print(1957) [C1.1:2][0x1226438a0] Error: 4651506696:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:/AppleInternal/Library/BuildRoots/66382bca-8bca-11ec-aade-6613bcf0e2ee/Library/Caches/com.apple.xbs/Sources/boringssl/ssl/tls_record.cc:242: 2022-04-05 20:44:09.942152+0100 smcFanControl[41957:180407] [boringssl] boringssl_session_handshake_incomplete(86) [C1.1:2][0x1226438a0] SSL library error 2022-04-05 20:44:09.942268+0100 smcFanControl[41957:180407] [boringssl] boringssl_session_handshake_error_print(41) [C1.1:2][0x1226438a0] Error: 4651506696:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:/AppleInternal/Library/BuildRoots/66382bca-8bca-11ec-aade-6613bcf0e2ee/Library/Caches/com.apple.xbs/Sources/boringssl/ssl/tls_record.cc:242: 2022-04-05 20:44:09.942324+0100 smcFanControl[41957:180407] [boringssl] nw_protocol_boringssl_handshake_negotiate_proceed(757) [C1.1:2][0x1226438a0] handshake failed at state 12288: not completed 2022-04-05 20:44:09.943019+0100 smcFanControl[41957:180407] Connection 1: received failure notification 2022-04-05 20:44:09.943151+0100 smcFanControl[41957:180407] Connection 1: failed to connect 3:-9836, reason -1 2022-04-05 20:44:09.943298+0100 smcFanControl[41957:180407] Connection 1: encountered error(3:-9836) 2022-04-05 20:44:09.944149+0100 smcFanControl[41957:180407] Task <009ABA47-B061-4115-A235-4815B7427E43>.<1> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9836]) 2022-04-05 20:44:09.946416+0100 smcFanControl[41957:180443] Task <009ABA47-B061-4115-A235-4815B7427E43>.<1> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://www.eidac.de/smcfancontrol/smcfancontrol.xml, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <009ABA47-B061-4115-A235-4815B7427E43>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDownloadTask <009ABA47-B061-4115-A235-4815B7427E43>.<1>" ), NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://www.eidac.de/smcfancontrol/smcfancontrol.xml, NSUnderlyingError=0x60000155a400 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9836, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9836, _NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: en0, ipv4, dns}}, _kCFStreamErrorCodeKey=-9836} 2022-04-05 20:44:09.947148+0100 smcFanControl[41957:179479] [Sparkle] Encountered download feed error: Error Domain=SUSparkleErrorDomain Code=2001 "An error occurred while downloading the update. Please try again later." UserInfo={NSErrorFailingURLKey=https://www.eidac.de/smcfancontrol/smcfancontrol.xml, NSLocalizedDescription=An error occurred while downloading the update. Please try again later., NSUnderlyingError=0x60000155bae0 {Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://www.eidac.de/smcfancontrol/smcfancontrol.xml, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <009ABA47-B061-4115-A235-4815B7427E43>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDownloadTask <009ABA47-B061-4115-A235-4815B7427E43>.<1>" ), NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://www.eidac.de/smcfancontrol/smcfancontrol.xml, NSUnderlyingError=0x60000155a400 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9836, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9836, _NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: en0, ipv4, dns}}, _kCFStreamErrorCodeKey=-9836}}} 2022-04-05 20:44:09.947566+0100 smcFanControl[41957:179479] [Sparkle] Error: An error occurred in retrieving update information. Please try again later. (null) (URL (null)) 2022-04-05 20:44:09.947605+0100 smcFanControl[41957:179479] [Sparkle] Error: An error occurred while downloading the update. Please try again later. (null) (URL https://www.eidac.de/smcfancontrol/smcfancontrol.xml) 2022-04-05 20:44:09.947633+0100 smcFanControl[41957:179479] [Sparkle] Error: An SSL error has occurred and a secure connection to the server cannot be made. (null) (URL https://www.eidac.de/smcfancontrol/smcfancontrol.xml) 2022-04-05 20:44:09.949028+0100 smcFanControl[41957:179479] [Sparkle] Error: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1200.) (null) (URL (null))