hirschmann / nbfc

NoteBook FanControl
Other
2.89k stars 487 forks source link

Current progress on controlling the fan of a Samsung NP550P5C-S02AE #708

Closed AdelKS closed 4 years ago

AdelKS commented 5 years ago

Hello,

First of all, thank you @hirschmann for your concise and helpful wiki on how to make a config file by explaining more about what's going on under the hood for fan control.

I have been working on my laptop for a few weeks to enable maximum fan speed and I believe I have reached somewhat of a dead end on my own, so I will give all the information I gathered and maybe your feedback will help me progress.

Laptop information

General info

Laptop: Samsung NP550P5C-S02AE, i7-3610QM, Nvidia GT 650M

Issue: After a BIOS update (or maybe moving to windows 8 then 10, from windows 7), the fan max speed is way lower than it used to be. I want to win control over the fans and put them to the highest speed to be able to play games without throttling: currently my GPU is hitting 90 degrees in few minutes, after launching a game, and throttles to stay at 90 degrees.

Fan

It's an "FCN brushless motor FBBP DC 5V", controlled with three cables: red, black and white. Though both the fan and the motherboard have have an additional pin/input channel that isn't being used.

fanimage

I had the chance to borrow an oscilloscope to check what kind of signal goes through the red, black and white cables:

Bios

After a lot of work, I could successfully hack the bios to show the hidden option menus. It's an AMI Aptio IV. Here are some pictures about what is to me related to the fan control: "Thermal configuration". I don't know if hacking the BIOS was necessary, I did it before discovering what an EC is and that it usually controls the Fans, I thought that the fan was BIOS Controlled (Which is maybe still true).

Pictures: Bios menu entries ![IMG_20190609_195918](https://user-images.githubusercontent.com/13605217/59163847-55f9a700-8b06-11e9-9628-6c22235bea83.jpg) ![IMG_20190609_195931](https://user-images.githubusercontent.com/13605217/59163848-55f9a700-8b06-11e9-9ebe-b2ca4b92d0f8.jpg) ![IMG_20190609_195937](https://user-images.githubusercontent.com/13605217/59163849-55f9a700-8b06-11e9-933f-70dc5b6549b7.jpg) ![IMG_20190609_200021](https://user-images.githubusercontent.com/13605217/59163850-55f9a700-8b06-11e9-8f41-75537c243242.jpg) ![IMG_20190609_200033](https://user-images.githubusercontent.com/13605217/59163851-55f9a700-8b06-11e9-8706-26d4f92dc17e.jpg)

EC - Super I/O

Model: I opened the laptop to check what the EC/IO Chip is (are they two different things?), it's an ENE KB90 10QF, unfortunately I couldn't find in documentation for it on the web.

IMG_20190608_005624

Software information: after monitoring the registries of the EC with RWeverything (it's way more visual than ec-probe). Here's what I found:

Screenshots ![RW-screencapture](https://user-images.githubusercontent.com/13605217/59163884-a8d35e80-8b06-11e9-9805-d897e6e000a8.png) ![Samsung-Settings-screencapture](https://user-images.githubusercontent.com/13605217/59163885-a8d35e80-8b06-11e9-983b-f73c9be683dc.png)

Note: removing the battery had drastically reduced the number of potentially useful registries, this hint should be added in the wiki I'd say.

DSDT Dump

DSTD dump.txt

My current thoughts

I feel like it's not the EC that controls the fan speed, but what else could ? Any feedback/thoughts are welcome! Otherwise I have written these here for others to see what has already been done for Samsung Laptops, apparently there's nothing, well maybe there is this repo that seems to enable fan control, but I couldn't figure out if it uses the kernels fan control discovery or it implements its own registers.

Thank you,

Adel

github-actions[bot] commented 4 years ago

This issue is stale because it has been open more than 180 days with no activity. If nobody comments within 7 days, this issue will be closed

jubilostudios commented 4 years ago

This is lot interesting

unixb0y commented 3 years ago

Hello @AdelKS, I am actually trying to make the fan quieter / less active. Since I use Linux, I can't use the tool you used, but I have CLI tools that can read any memory location as well, of course. In theory, if I write 0x0 to 0xC7, I should get the fan turning off? And what's the offset / base address for the EC data?

AdelKS commented 3 years ago

Hello @unixb0y, unfortunately the laptop doesn't work anymore and I do not have access to the tools I used. I think the registries for the EC should be on some kind of separate device you can write to. You should Google that further. You have exactly the same IO chip ? Make sure you have the same before starting to change things. Though I am not sure it's that harmful if you fiddle with things, you can just cold reboot if ever, I think. For the silent mode, you should use either the "Low" value or "Auto" value, that's where the fan spins the least. But anyway, try the three values.

unixb0y commented 3 years ago

Thanks a lot for the quick reply @AdelKS! Okay, no problem :-) I see, I will have to look stuff up when I find the time then. It's not the exact same chip, no, so I guess the registers will differ, that's why I am now looking for a tool that lets me dump them. dmidecode gives some interesting basic info, but I don't know yet if it'll lead me any further :D

AdelKS commented 3 years ago

Not the same chip, I see. You can maybe find the datasheet. Otherwise, well, you need to do some reverse engineering too. The biggest tip I can give you is to remove the battery so a lot of registries get zeroed. And try to edit only the values that do not change. The others get updated anyway.

unixb0y commented 3 years ago

Thanks for the tip, very helpful to know!

unixb0y commented 3 years ago

@AdelKS Do you know whether there are voltage-controlled fans in this formfactor? Then it would be possible to solder a pin header to somewhere near the battery and step it down to the voltage preferred to e.g. run the fan at 100% all the time, or 25% or something. What bothers me most is the constant on-off of the fan. Already cleaned out the heatsink and checked temps with sensors. The cooling solution has so little thermal capacity that any CPU usage fluctuation immediately causes the cooler to turn on. As soon as it hits like 44C or so.

AdelKS commented 3 years ago

Hello @unixb0y , as far as my experience with desktop PWM controlled fans goes, you can always give it a constant voltage (no PWM pulses, just flat), and reduce it, the fan does spin slower, then comes a point where it just stops, at least that's how it goes on my desktop PWM fans.

The weird thing is that my laptop had its fan not spinning fast enough, nearly not audible at all, you have the opposite issue. By "cleaning the heatsink" have you replaced the thermal paste and cleaned the older one ? Because after few years it just dries and makes the thermal transfer poorer. Which will make the CPU "overheat" as soon as it does something. But yes, there's no thermal capacity involved in laptops, except the copper pipe's that is right on top of it, a little, I suppose.

44 degrees shouldn't make your fan audible at all, mine was barely audible with the CPU at ~90 degrees...

unixb0y commented 3 years ago

@AdelKS good to know, will try that! At the moment, I use a 12V DC fan from a PC, connected to the laptop's 5V of the USB port and it's super silent, keeps the laptop under 40C. I'll try putting back the original fan and powering it with lower voltage, later!

Yeah, interesting that we have the opposite issue :D Yep, new noctua thermal paste, the old one was super dry, reduced temps like 5C I guess. The reading of around 40 is also accurate, felt with my hand, it's not like lInux was e.g. reporting 40 but in reality it's 80C or so ^^

AdelKS commented 3 years ago

It's super good that you checked with your finger the accuracy of the thermal reporting, you could've burned yourself haha. Keep me updated about your voltage fiddling then!

My fan used to be loud and my computer used to get very hot when I play games, and after a bios update, bam, the fan became silent. And my laptop lost a lot of performance in games, I start with 60fps then seconds later, it's struggling... Thermal throttling... Good old days. Won't game with a laptop anymore. Even newer, higher end, gaming laptops thermal throttle, had to ship back a one because that last year. Engineers aren't given the chance to properly thermal design the laptops I suppose.

unixb0y commented 3 years ago

I'm not worried that much about something like this, I burned myself so many times with soldering iron and 3D printer already, so a CPU even at its hottest wouldn't be that bad :P Plus I trust sensors 😉

Yeah it's somehow only controllable by BIOS, super weird. I might try to update it tbh, I'm not running heavy workloads.

Nah, gaming is not for laptops, ngl. They also don't age well if you need raw performance. Nowadays we have cloud computing if we need power "on the go" as well :)

rivenzo commented 3 years ago

Hi all

I am Rivenzo, Sorry for my english. I have found this thread and perhaps it is old and my machine too, but I like very much this machine. It is not same like Adelks commented above but I have saw several equal register in the EC. I have tested my SAMSUNG NP300E5A with RWEVERYTHING and I found same registers function like Adelks 0xC0, 0xC5, 0xC7. Afer this job I have found a table in the BIOS with same values that I saw in my observation of this registers, That table is inside the BIOS firmware. Anybody enteresting with this thread yet?

AdelKS commented 3 years ago

Hello @rivenzo,

Can you attach a picture of your Bios entries, in English if possible (Make your Bios in English) ? This information may be interesting for whomever wants to continue this work. Unfortunately, I will no longer work on this for the time being, I may pick it up again later. For now my laptop doesn't want to boot any system...

Adel

AdelKS commented 3 years ago

Interesting results! How did you get the BIOS dump ? Can you actually edit those values on your BIOS menu ? Or are they hidden ? Because for me I unlocked that menu in the BIOS, but editing those values did nothing on the fan behavior...

You can either edit the BIOS dump directly and flash it and see if it works, but do know that if it's actually something else, you can permanently brick your laptop: if you can't boot back into windows you can't flash the original BIOS.

The other option is to unhide the BIOS menu entries, like in the picture I attached in my first post. And see if editing those values works for you.

mirh commented 3 years ago

Putting aside those samsung laptops have quite.. the finnicky EC, did you try this?

0x97: gets updated quite frequently, I don't know really what it refers to. There's no variable for that address in the DSDT dump (though there is 0x96). There's no use to change it, it gets overwritten.

Can't that just be the tachometer, which perhaps samsung just didn't care to expose in any official way? ENE has some crazy ass way to report it, and it may not the most immediate value on the shed.

rivenzo commented 3 years ago

I have used Flash programming tool from https://www.win-raid.com/t596f39-Intel-Converged-Security-Management-Engine-Drivers-Firmware-and-Tools.html FPTw64 -D name.bin -BIOS.

Yes I can. I can edit the bios and flash it with the same tool: FPTW64 -F edited.bin -BIOS.

I have edited and reflashed the bios and I have dumped it again to check edition and it was confirmed but the fan dont change the function with my changes. I am going to test wiht a cold start taiking out charger, the batery and the coin batery. After will inform you.

mirh commented 3 years ago

My dudes, I think I found the magic, see here for the relevant snippet of the DSDT. It is in fact the EC that is being in control of the fans, but final decisions aren't being made in the registries, but in what asus laptops call WRAM. Would you believe the thing is even called VFN0? It's like hiding in plain sight.

I'm not really sure which tool allows you to write in EC RAM then, but considering the guy in the first link I sent here was able to respin an acer utility for his samsung.. I'm wondering if the PNP0C0B fan control couldn't just work out of the box in linux?

rivenzo commented 3 years ago

Putting aside those samsung laptops have quite.. the finnicky EC, did you try this?

0x97: gets updated quite frequently, I don't know really what it refers to. There's no variable for that address in the DSDT dump (though there is 0x96). There's no use to change it, it gets overwritten.

Can't that just be the tachometer, which perhaps samsung just didn't care to expose in any official way? ENE has some crazy ass way to report it, and it may not the most immediate value on the shed.

Hi Mirh

The point may be that the EC does not directly command the FAN but in my case in Samsung NP300E5A with PCH HM65 AND NP300E5C with PCH HM70 there is an intermediary that is EMC2112. I have several mainboards with different failures to repair and one of them, for example, the fan always works at full speed, possibly this failure is due to the fact that there is no communication on the i2c bus during the first 4 seconds after power-up and therefore the EMC2112 goes to full with the fan speed (normal according to datasheet). Then with respect to what you say about the tachometer, I can tell you that the changes in the 0xC5 register of the EC between 0xFF to 0x45 and 0x45 to 0xFF as the temperature rises or falls, exactly coincide with the change in noise of the fan. 0x97 register can be fine control or percentage.

rivenzo commented 3 years ago

Hello @rivenzo,

Can you attach a picture of your Bios entries, in English if possible (Make your Bios in English) ? This information may be interesting for whomever wants to continue this work. Unfortunately, I will no longer work on this for the time being, I may pick it up again later. For now my laptop doesn't want to boot any system...

Adel

Hi AdelKS, thank you very much for answering. I'm going to show you my job based on your observations from years ago. The work consisted of observing the EC registers with RWEVERYTHING loading the processor with the CPUZ benchmark. After, I looked in those registers for the values that changed with the fan noise and search theirs in the bios firmware and I found a table that gives rise to the values of these registers for the different core temperature values. This table is in the BIOS. Pls see the observations in the attached file and same values in the bios firmware. EMBEDDED CONTROLER regs for SAMSUNG NP300E5A FAN CONTROL_by Rivenzo.pdf FIRM_BIOS_09QA_with fan table.pdf

rivenzo commented 3 years ago

Hi All,

Attached yo can see EC register observing with RWeverything in a Samsung NP300E5C with PCH HM70. After, same procedure was made in the BIOS Firmware P04RAQ and a table with thats observed value was found.

EMBEDDED CONTROLER regs for SAMSUNG FAN CONTROL_NP300E5C_by Rivenzo.pdf FIRM_BIOS_P04RAQ_with fan table.pdf

rivenzo commented 3 years ago

Dear All

I can confirm my suspicions. i have changed thats parts in the bios and now i have a blower running at maximun speed, for example, every time.

AdelKS commented 3 years ago

I'm pretty sure the values you found from BIOS are the ones I unlocked the BIOS menu of, have a look at the pictures I attached on my first post: the "active trip point 0" and "active trip point 1" ones. But now that I have a solid look at it, it seems that I made the 0 higher than the 1, maybe that's why it didn't work 🤔

rivenzo commented 3 years ago

I'm pretty sure the values you found from BIOS are the ones I unlocked the BIOS menu of, have a look at the pictures I attached on my first post: the "active trip point 0" and "active trip point 1" ones. But now that I have a solid look at it, it seems that I made the 0 higher than the 1, maybe that's why it didn't work 🤔

Dear Adel I did not find any comment in this thread about "active trip point 0 or 1". Could you please show me it?

AdelKS commented 3 years ago

It's an unfoldable menu, called "Screenshots", in my first post in this thread, have a look at the bottom of this screenshot:

image

rivenzo commented 3 years ago

Dear Adel

I saw your screenshots. in your comment about the register 0xC5 inside ec you say...I didn´t get exactly what it refers to i think that is a command value for the fan, and it can to take diferents value for diferents cpu temperature as per bios table. in my case, for samsung np300e5a, if the temperature is < to 45 °C degress then command value is 0xFF, bigger or equal 45 °C then command value is 0x78, bigger or equal 55 °C then command value is 0x6A and so on. for maxiumun speed comand value is (in my case) 0x45. so, i have changed that value inside the bios table to 0x45 for all temperatures and after a cold reset my machine start working normally but with fan speed running to maximun speed all the time. and of course if you check the ec register like in your screenshot yo will can see ec register 0xC5 with 0x45 for all cpu temperature.

unixb0y commented 3 years ago

It's super good that you checked with your finger the accuracy of the thermal reporting, you could've burned yourself haha. Keep me updated about your voltage fiddling then!

My fan used to be loud and my computer used to get very hot when I play games, and after a bios update, bam, the fan became silent. And my laptop lost a lot of performance in games, I start with 60fps then seconds later, it's struggling... Thermal throttling... Good old days. Won't game with a laptop anymore. Even newer, higher end, gaming laptops thermal throttle, had to ship back a one because that last year. Engineers aren't given the chance to properly thermal design the laptops I suppose.

Hey, sorry for the late reply, maybe better late than never.. I now have the stock fan back in the laptop and 5V from one of its USB ports, going through a buck converter down to around 2V and connected to the fan. At that setting the fan just runs very quietly (can't hear it from where I work and live, laptop is under the desk) and the CPU temperature stays at around 40C at all times. I'm happy with that, all the register rewriting etc. seems quite scary :D

WiperElite commented 22 hours ago

Hi all

I am Rivenzo, Sorry for my english. I have found this thread and perhaps it is old and my machine too, but I like very much this machine. It is not same like Adelks commented above but I have saw several equal register in the EC. I have tested my SAMSUNG NP300E5A with RWEVERYTHING and I found same registers function like Adelks 0xC0, 0xC5, 0xC7. Afer this job I have found a table in the BIOS with same values that I saw in my observation of this registers, That table is inside the BIOS firmware. Anybody enteresting with this thread yet?

Hey bro, can you help me to replicate this same with mi Laptop Samsung NP500P4C? What i need? I attach a txt version of my bios c: bios.txt

Anyway, thanks for all this information.