fryysyd Posted May 27, 2019 Share Posted May 27, 2019 11 hours ago, vector sigma said: Hi guys, today I've created the "development" branch where I'll put new code from now on. What's on the new branch? The Fan control from HWMonitorSMC2 for all kexts that support writing SMC keys, Apple or not. W836x.kext (Nuvoton and Windbond chips) is highly modified and uses the NVRAM to store settings across reboots, and this is how it works: Install the FakeSMC.kext and W836x.kext from the dmg attached. Will not work with old FakeSMC.kext. To enable the Fan control you have to add the new kernel flag -fanCtrl and reboot. Use the new HWMonitorSMC2.app, always from the attached dmg. Go to the preferences and enable "Fan Control", restart the app for the changes to take effect. If you want to show min and max values you have to enable "Show Min/Max speed" as well. How W836x.kext knows the min and max rpms can do a fan? Simply by calibrating them during the first attempt ever made, by slow down at minimum your fans... so it will know the minimum rpms, and so the same for the max values. Values will be saved to the NVRAM, so next times this will not happen again. You can recalibrate fans by setting the following nvram variable to the max: sudo nvram HW_fanControl=%ff ..and you will hear your fans slow down firstly, and then go at max for some seconds. The third stage is to restore the motherboard defaults, so that you can decide if enable the fan control for a specific fan.... directly in HWMonitorSMC2.app: pay attention that you have to enable the PWM checkbox otherwise you will not be able to edit its value. (By disabling the PWM checkbox... the fan will be in auto mode, or to be more precise how is set in the BIOS) --------------------------------------------------------------------------------------------------------------------------- Hi,@vector sigma, I downloaded the 199 version of hwsensors, replacing the old sensor file, but did not display the fan content after rebooting into the system, even the motherboard related content is not displayed. nvram and cache have been cleaned up the problem remains. Switching back to the old sensor file and Fakesmc will display the fan speed and motherboard temperature. I uploaded my ioieg file, please help me to see where the problem is? Thank you! My motherboard sensor model New and old contrast iMacPro 1,1-Ioieg.zip Link to comment Share on other sites More sharing options...
Slice Posted May 27, 2019 Author Share Posted May 27, 2019 14 hours ago, vector sigma said: Hi guys, today I've created the "development" branch where I'll put new code from now on. What's on the new branch? The Fan control from HWMonitorSMC2 for all kexts that support writing SMC keys, Apple or not. W836x.kext (Nuvoton and Windbond chips) is highly modified and uses the NVRAM to store settings across reboots, and this is how it works: Install the FakeSMC.kext and W836x.kext from the dmg attached. Will not work with old FakeSMC.kext. To enable the Fan control you have to add the new kernel flag -fanCtrl and reboot. Use the new HWMonitorSMC2.app, always from the attached dmg. Go to the preferences and enable "Fan Control", restart the app for the changes to take effect. If you want to show min and max values you have to enable "Show Min/Max speed" as well. How W836x.kext knows the min and max rpms can do a fan? Simply by calibrating them during the first attempt ever made, by slow down at minimum your fans... so it will know the minimum rpms, and so the same for the max values. Values will be saved to the NVRAM, so next times this will not happen again. You can recalibrate fans by setting the following nvram variable to the max: sudo nvram HW_fanControl=%ff ..and you will hear your fans slow down firstly, and then go at max for some seconds. The third stage is to restore the motherboard defaults, so that you can decide if enable the fan control for a specific fan.... directly in HWMonitorSMC2.app: pay attention that you have to enable the PWM checkbox otherwise you will not be able to edit its value. (By disabling the PWM checkbox... the fan will be in auto mode, or to be more precise how is set in the BIOS) Warning: as you can see my CPU Fan is controllable while "Fan 0" isn't and have equal min and max values. Why? This fan is not a PWM one because only have a 3 pin connector. In Fact to be controllable fans must have 4 pins: Legacy and new SMC keys In 2018 Apple introduced new SMC keys that sobstitute the old "FS! ", and in new models keys are in the format of "F1Md". This latest is the default method, but you can switch back in using the old one by adding the kernel flag "-legacyFan" Why the nvram to store settings? Is persistent across reboots for all the users. You don't have to save a file somewhere or install scripts and daemons. nvram saving will only be used if HW_fanControl variable is already present in nvram... in this case published by W836x.kext. If this var is not present the app will try to write smc keys directly, but it is not persistent without a daemon that save/read somewhere smc keys involved at power off and/or power on time. Also that means that in real Mac, or with other plugins, nvram will be not touched. How other projects should be able to use the nvram variables saved by HWMonitorSMC2.app and use the same method? The driver must post the nvram variable HW_fanControl with a value in byte >= 0 (but less then 0xff). This way HWMonitorSMC2.app knows that we want to use nvram method. being able to read and parse the HW_fanControlData variable in nvram composed by 44 bytes: // example with only one fan, Fan at index 1, and with PWM turned on UInt8 nvFanControls[44] = { 0x02, 0x00, /* 16 bits, bit at index 1 enabled for fan at index 1. Value for 'FS! ' or 'F1Md'*/ 0x00, 0x00, /* UInt16 value, fan at index 0 target speed */ 0x05, 0xdc, /* UInt16 value, fan at index 1 target speed, in this case 0x05dc i.e. 1500 rpm */ 0x00, 0x00, /* UInt16 value, fan at index 2 target speed */ 0x00, 0x00, /* UInt16 value, fan at index 3 target speed */ 0x00, 0x00, /* UInt16 value, fan at index 4 target speed */ 0x00, 0x00, /* UInt16 value, fan at index 5 target speed */ 0x00, 0x00, /* UInt16 value, fan at index 6 target speed */ 0x00, 0x00, /* UInt16 value, fan at index 0 min speed */ 0x03, 0xE8, /* UInt16 value, fan at index 1 min speed in this case 0x03e8 i.e. 1000 rpm */ 0x00, 0x00, /* UInt16 value, fan at index 2 min speed */ 0x00, 0x00, /* UInt16 value, fan at index 3 min speed */ 0x00, 0x00, /* UInt16 value, fan at index 4 min speed */ 0x00, 0x00, /* UInt16 value, fan at index 5 min speed */ 0x00, 0x00, /* UInt16 value, fan at index 6 min speed */ 0x00, 0x00, /* UInt16 value, fan at index 0 max speed */ 0x07, 0xd0, /* UInt16 value, fan at index 1 max speed in this case 0x07d0 i.e. 2000 rpm */ 0x00, 0x00, /* UInt16 value, fan at index 2 max speed */ 0x00, 0x00, /* UInt16 value, fan at index 3 max speed */ 0x00, 0x00, /* UInt16 value, fan at index 4 max speed */ 0x00, 0x00, /* UInt16 value, fan at index 5 max speed */ 0x00, 0x00 /* UInt16 value, fan at index 6 max speed */ }; // max 7 fans supported. Tested only with nuvoton chips as I don't own other mobos. HWSensors-3_r199.dmg.zip @Slice, tell me if is ok for you. Hi, I think the changes are good but I have no Winbond/Nuvoton to test. It is possible to do the same for ITE chips because Navi at past did this. I will look if others are still good. 1 Link to comment Share on other sites More sharing options...
Guest Posted May 27, 2019 Share Posted May 27, 2019 Hi @vector sigma thank you for latest improvement for HWSensorSMC R199 -fanCtrl flag is a boot arg parameter? Have you tested it in new OpenCore bootloader? It seems an invalid parameter for it thank you in advance Link to comment Share on other sites More sharing options...
Guest Posted May 27, 2019 Share Posted May 27, 2019 (edited) In clover bootloader it is working Edited May 27, 2019 by Guest Link to comment Share on other sites More sharing options...
vector sigma Posted May 27, 2019 Share Posted May 27, 2019 4 hours ago, fryysyd said: New and old contrast iMacPro 1,1-Ioieg.zip Hi and thanks for testing. From your ioreg I'm sure W836x.kext is not even loaded so it is normal that fans didn't show up. Causes? Not sure, wrong FakeSMC version (require FakeSMC.kext v3.5.2 from the same dmg), a bug or any. Please post a DarwinDumper log with only the kernel log (kernel buffer messages). Link to comment Share on other sites More sharing options...
vector sigma Posted May 27, 2019 Share Posted May 27, 2019 1 hour ago, fabiosun said: -fanCtrl flag is a boot arg parameter? Yes, is what goes in Boot->Arguments in Clover and or in nvram under 'boot-args'. 1 hour ago, fabiosun said: Have you tested it in new OpenCore bootloader? no, I don't even know what is it. 1 hour ago, fabiosun said: It seems an invalid parameter for it Sorry but this is a boot argument for the kernel, not for the bootloader. You have to ensure the kext is loaded or not and the boot argument is really given. In IoRegistryExplorer.app you can simply evaluate that by selecting IOService and scroll to the end and see if a reference to W836x exists. This to ensure the kext is really loaded. Also I compile them using Xcode 10.2, but with the 10.11 SDK, so a possible cause is that something goes wrong with the compilation. We can ensure this looking at the kernel log (DarwinDumper). But I also must to say that this should not be bootloader dependent. 2 hours ago, Slice said: It is possible to do the same for ITE chips because Navi at past did this. Sure, just I need time and testers. 2 hours ago, Slice said: I will look if others are still good. good! Link to comment Share on other sites More sharing options...
Guest Posted May 27, 2019 Share Posted May 27, 2019 41 minutes ago, vector sigma said: Yes, is what goes in Boot->Arguments in Clover and or in nvram under 'boot-args'. no, I don't even know what is it. Sorry but this is a boot argument for the kernel, not for the bootloader. You have to ensure the kext is loaded or not and the boot argument is really given. In IoRegistryExplorer.app you can simply evaluate that by selecting IOService and scroll to the end and see if a reference to W836x exists. This to ensure the kext is really loaded. Also I compile them using Xcode 10.2, but with the 10.11 SDK, so a possible cause is that something goes wrong with the compilation. We can ensure this looking at the kernel log (DarwinDumper). But I also must to say that this should not be bootloader dependent. Sure, just I need time and testers. good! Hi @vector sigma In clover all is fine as you can see in attachment Problem for now is in OpenCore bootloader for me, but maybe I have to understand better how to use in it -fanCtrl parameter by the way: OpenCore bootloader link on IM here: https://www.insanelymac.com/forum/723-opencore/ Link to comment Share on other sites More sharing options...
fryysyd Posted May 27, 2019 Share Posted May 27, 2019 (edited) 1 hour ago, vector sigma said: Hi and thanks for testing. From your ioreg I'm sure W836x.kext is not even loaded so it is normal that fans didn't show up. Causes? Not sure, wrong FakeSMC version (require FakeSMC.kext v3.5.2 from the same dmg), a bug or any. Please post a DarwinDumper log with only the kernel log (kernel buffer messages). Thank you for your reply! I reset the HWMonitorSMC2, then restarted the computer and it showed up. But only CPU Fan 2 has a display setting Target, CPU Fan 1 does not? My CPU cooler is connected to two fans, and both fans are PWM. How to solve it? Edited May 27, 2019 by fryysyd Link to comment Share on other sites More sharing options...
jinbingmao Posted May 27, 2019 Share Posted May 27, 2019 “GPU Memory Clock” “GPU Core Clock“ Link to comment Share on other sites More sharing options...
vector sigma Posted May 27, 2019 Share Posted May 27, 2019 5 hours ago, fryysyd said: But only CPU Fan 2 has a display setting Target, CPU Fan 1 does not They are just wrong values? Create a folder to your Desktop called HWBadSensors and restart the app. Show me a picture. Also I need a ioreg if possible, thanks. 3 minutes ago, jinbingmao said: “GPU Memory Clock” “GPU Core Clock“ What do you mean? Link to comment Share on other sites More sharing options...
jinbingmao Posted May 27, 2019 Share Posted May 27, 2019 6 minutes ago, vector sigma said: 他们只是错误的价值观?创建一个名为HWBadSensors的桌面文件夹, 然后重新启动应用程序。给我看一张照片 如果可能的话我也需要一个ioreg,谢谢。 你什么意思? Hope to add these two 1 Link to comment Share on other sites More sharing options...
vector sigma Posted May 27, 2019 Share Posted May 27, 2019 (edited) 7 hours ago, fabiosun said: Fan control is not enabled. Where did you put -fanCtrl? forgot me, is well working. Just a lot of values to see Edited May 27, 2019 by vector sigma Link to comment Share on other sites More sharing options...
jinbingmao Posted May 27, 2019 Share Posted May 27, 2019 (edited) 一切都感觉很好。 Edited May 27, 2019 by jinbingmao add 1 Link to comment Share on other sites More sharing options...
Pavo Posted May 27, 2019 Share Posted May 27, 2019 Can someone link the latest build of HWMonitorSMCv2 please? Link to comment Share on other sites More sharing options...
vector sigma Posted May 27, 2019 Share Posted May 27, 2019 2 minutes ago, jinbingmao said: Hope to add these two Core Clock is already present if published by the Apple drivers, usually for NVIDIA. Doing it for every gpu in commerce is hard. Who knows 3 minutes ago, Pavo said: Can someone link the latest build of HWMonitorSMCv2 please? already in this page, just some posts above . Link to comment Share on other sites More sharing options...
jinbingmao Posted May 27, 2019 Share Posted May 27, 2019 ioreg -l |grep \"PerformanceStatistics\" | cut -d '{' -f 2 | tr '|' ',' | tr -d '}' | tr ',' '\n'|grep 'Temp\|Fan\|Clock\|Power' Link to comment Share on other sites More sharing options...
vector sigma Posted May 27, 2019 Share Posted May 27, 2019 (edited) 18 minutes ago, jinbingmao said: ioreg -l |grep \"PerformanceStatistics\" | cut -d '{' -f 2 | tr '|' ',' | tr -d '}' | tr ',' '\n'|grep 'Temp\|Fan\|Clock\|Power' Ok, now I've understood you ,. In the mean time you can try to create this two folders inside your Desktop and restart the application? HWBadSensors HWGraphics See if values show up and please, post a ioreg and the "HWGraphics" folder only. Edited May 27, 2019 by vector sigma typo Link to comment Share on other sites More sharing options...
jinbingmao Posted May 27, 2019 Share Posted May 27, 2019 10 minutes ago, vector sigma said: 好的,现在我已经了解你了 。与此同时,您可以尝试在桌面内创建这两个文件夹并重新启动应用程序? 看看是否显示值,请发布ioreg和“HWGraphics”文件夹。 11 minutes ago, vector sigma said: 好的,现在我已经了解你了 。与此同时,您可以尝试在桌面内创建这两个文件夹并重新启动应用程序? 看看是否显示值,请发布ioreg和“HWGraphics”文件夹。 HWGraphics.zip Link to comment Share on other sites More sharing options...
vector sigma Posted May 27, 2019 Share Posted May 27, 2019 Is "Core Clock" visible when HWBadSensors is in your Desktop? 1 Link to comment Share on other sites More sharing options...
jinbingmao Posted May 27, 2019 Share Posted May 27, 2019 1 minute ago, vector sigma said: 当HWBadSensors在您的桌面时,“核心时钟”是否可见? NO 2 minutes ago, vector sigma said: 当HWBadSensors在您的桌面时,“核心时钟”是否可见? No Link to comment Share on other sites More sharing options...
vector sigma Posted May 27, 2019 Share Posted May 27, 2019 (edited) 12 minutes ago, jinbingmao said: NO I think that I've understood why. In the source code is written: if let coreclock = PerformanceStatistics.object(forKey: "Core Clock(MHz)") as? NSNumber { and looks ok, but there's an hidden character, so "Core Clock(MHz)" is not the same as "Core Clock(MHz)". Tomorrow I'll give you a modified one. Now I need to sleep, see you. Edited May 27, 2019 by vector sigma Link to comment Share on other sites More sharing options...
jinbingmao Posted May 27, 2019 Share Posted May 27, 2019 2 minutes ago, vector sigma said: 我想我明白了为什么。我的来源写道: 但是有一个隐藏的字符,因此“核心时钟(MHz)” 与“核心时钟(MHz)”不同。明天我会给你一个修改过的。现在我需要睡觉,看到你。 OK Link to comment Share on other sites More sharing options...
fryysyd Posted May 28, 2019 Share Posted May 28, 2019 (edited) 6 hours ago, vector sigma said: They are just wrong values? Create a folder to your Desktop called HWBadSensors and restart the app. Show me a picture. Also I need a ioreg if possible, thanks. Hi,vector sigma,As you said, I created the HWBadSensors folder on my desktop, then closed and reopened the app, as follows: This is the ioieg file, please check! iMacPro 1,1.zip Edited May 28, 2019 by fryysyd Link to comment Share on other sites More sharing options...
jinbingmao Posted May 28, 2019 Share Posted May 28, 2019 https://bjango.com/ Link to comment Share on other sites More sharing options...
vector sigma Posted May 28, 2019 Share Posted May 28, 2019 On 5/27/2019 at 9:36 PM, jinbingmao said: HWGraphics.zip Try this: HWMonitorSMC2.app.zip 1 Link to comment Share on other sites More sharing options...
Recommended Posts