Rem0o / FanControl.Releases

This is the release repository for Fan Control, a highly customizable fan controlling software for Windows.
Other
14.33k stars 450 forks source link

Making program start faster after sleep? #839

Closed bfrancom22 closed 1 year ago

bfrancom22 commented 2 years ago

I have my GPU pump running off the program. FanControl definitely takes a solid 10 seconds to start working after fully resumed from sleep. Yes, the "delay on startup" is at the lowest value, 1 second already. I notice if I leave the program window open before sleep, upon wake it is just blank white for about 10-15 seconds and does not run any pumps. But, it has already taken control from my BIOS config and therefore my pump does not run. My card is hitting 90c before FanControl finally takes back over.

TLDR; Can I make FanControl run faster/not have this 10-15 sec of inactivity after sleep (even thought it was never closed), aside from ensuring "delay upon startup" is at 1 second?

bfrancom22 commented 2 years ago

@Rem0o

Rem0o commented 2 years ago

Sleeping resets the fan control chip on your motherboard. During that 10 sec, FanControl is effectively shutdowned, and resets the driver to gain back control over the chip. Your pump shouldn't be stopping during that 10 sec. What kind of settings you got in your BIOS?

bfrancom22 commented 2 years ago

The pump is maxed out in the BIOS 24/7 until FC takes control. I will take a look and report back. I just know that FanControl is technically open (blank white screen), but there is no control of fans to what I understand. All my fans then start working after about 10 seconds.

bfrancom22 commented 2 years ago

Yeah so I confirmed if I terminate fan control, upon resume from sleep, I have 100% pump speed. It's only cutting out during the handshake between fan control resuming after sleep, when it takes over from the BIOS. There is about a 10-15 second period where FC seems to just blank out but technically have control. It's odd. @Rem0o

It's really a non issue upon second thought, as once the PC sits in sleep for a solid 10+ min, the radiator/block is so cool it only reaches about 60c until pump kicks in.

Rem0o commented 2 years ago

@bfrancom22 did you quit "during" that 10 sec? That's wayyyyy odd. Basically, the UI is up, but the backend is shutdown during that period. Hence if you quit the app during that period, the backend is already closed, it "shouldn't" do anything.

If the app is open and you disable your pump control card, what does it run at?

SolarVampire commented 2 years ago

Can confirm fan control is not controlling fans during sleep recovery. It's actually what brought me here. I assumed that it wasn't activating at all when I resumed from sleep, (because my chassis fan was at too high of an rpm). So my question is, during that sleep recovery is the entire computer's fan settings set to factory default, bios default, os default, or some setting that fan control detects when it is initialized (first run)

If it's going to factory, bios or os 
    that means fan control isn't taking command immediately.
        fan control is stuck in a loop doing something else, an asynchronous call to set the settings could bypass it and get 
        instant results while fan control does it's other duties.
        OR
        call the function that sets the settings before the other function.

        I lean towards probably the asynchronous option because it's probably in the middle of it's own loop from before 
        sleep mode was initiated (if i understand sleep correctly)

If it's going to whatever settings fan control detected when it was first run,
    then fan control is throwing the computer a bone while it is doing something.
        is fan control running some function found in it's first run sequence (during sleep recovery)? 
            take the function that runs during a normal boot up procedure and add a sleep recovery event detection to 
            trigger it (probably asynchronously, because I THINK the computer continues code execution from the point 
            sleep was initiated
        OR 
        is it running the same function that runs when the computer boots?
            I would be at a total loss at this branch

(coded for formatting) Sorry if I sound like a backseat driver. I'm currently in school for coding and this is an exercise for me, I may not have touched all possible branches, but this is what my perception of how things work comes up with as a possible debug flow. Doing some experimentation has proven to me that during login screen (after sleep wake up) the fans are not being controlled by fan control immediately. But it's within a few seconds. . But fan control DOES kick in DURING the login screen. signalrgb however, does not recover from sleep, leaving a number of my device's RGB values...wonky (some defaulted, some partially recovered. it's a mess). So there is a disconnect between software and hardware during sleep. But fan control DOES regain control. Seems to be a time during wakeup where ram is reloaded into the OS and that is when apps become live again. This implies it might be impossible to regain control faster than it already does. If that is the case, the alternatives might be to have a backup setting in the bios (client side only, please don't touch our bios settings permanently with your app) , because that is most likely where it is drawing it's settings from during a wake up.

AAAND that's it. I'm out of ideas. (I did a sleep-wakeup cycle half a dozen times to examine this behavior. Could use more testing on more hardware configurations to verify that it's not just 2 people having the problem.) Specs: https://www.newegg.com/samsung-1tb-980-pro/p/N82E16820147790?Item=N82E16820147790 https://www.newegg.com/gigabyte-b550-aorus-pro-ac/p/N82E16813145216?Item=N82E16813145216 https://www.newegg.com/g-skill-32gb-288-pin-ddr4-sdram/p/N82E16820232853?Item=N82E16820232853 https://www.newegg.com/amd-ryzen-7-3700x/p/N82E16819113567?Item=N82E16819113567 OS: Windows 10 (up to date)

Rem0o commented 2 years ago

@SolarVampire You got to understand how control works via a SuperIO chip. TLDR, that chip has channels which your headers are connected to. The BIOS by default pushes its own settings/config to that chip. When fancontrol starts, it will also push its settings onto the chip, overriding the ones the BIOS pushed initially. This is not modifying the BIOS. The BIOS can push back its setting whenever it needs. Wake from sleep being one.

Upon wake from sleep, the SuperIO chip is reset and the BIOS will push again its own config to it. FanControl is then in a state where it's opened, was in control, but got the steering wheel yanked out of its hands. Thus, the software is out of sync. So, it closes the driver, waits a delay, and reinitialize like if you just started the software.

By the way, the way the BIOS interacts with the chip is NOT standard. From motherboard to motherboard, it might be different. This is just a best guess, "works for 95% of people" way to handle the wake from sleep state.

SolarVampire commented 2 years ago

@Rem0o Understood. Thank you for the clear definition.

bluespresso commented 2 years ago

There seems to be a general issue with sleep. The problem only occurs when my pc sleeps for a longer time, at least 30 minutes or so. Then on wakeup FanControl does not display any fans or curves. It is not responding and I cannot forcefully shut the application it down. During this hanging state the fans do spin (most likely the rpm before sleep) but rpm does not increase with load. So it is possible to overheat CPU or GPU. A restart is required to fix the hanging.