UraniumDonut/nbfc-revive

Configuration registers for HP Victus 16-e0xxx

MrBilut opened this issue · 22 comments

I wanted to give something back since this program really saved my ass from hours and hours of annoyance with my noisy laptop :)

So here are some registers and tips for controlling HP Victus directly from it's EC:

  • default values in FAN PWM registers are 0xFF - this will keep automatic controll enabled
  • any other value will be treated as PWM percentage (effective range is from 20% up to 100%) it will override automatic laptop algorithm
  • at any point you can write back 0xFF to restore automatic fan controll
  • fans are independent
  • 0x2C - left fan PWM, 0x2E - left fan RPM (in percentage, same as PWM)
  • 0x2D - right fan PWM, 0x2F - right fan RPM
  • there is a CPU temperature (Tctrl in C) register at 0x57, more temperatures are in higher registers (didn't bother to decode them all)
  • 0x96 is battery charge percentage (not 100% sure about this, but seem very highly plausible, deviations were +-1% compared to system reporting, maybe it's an internal thing only)
  • 0x95 is LAPTOP POWER MODE - no longer have to use OMEN hub for this (0x00 default, 0x01 max performance, 0x03 silent)
  • 0xEC is a OMEN HUB fan switcher (0x00 normal fan mode, 0x0C/0x04 max fan mode) it will work only with 0xFF in FAN PWM registers
  • 0x5F - touchpad disable, windows key disable (0x08 = touchpad disable, 0x10 = win key disable, 0x00 default) it works, but pressing disable key normally also modifies 0xA2 register
  • 0xA0 - last special key pressed (works for brightness, volume, etc) only informational
  • 0xBA - charger mode (0x00 unplugged, 0x02/0x03 change detection, 0x04 plugged)

Here is my config file. It makes sure whenever switching off NBFC controll to restore automatic fan curve. I suggest keeping that behaviour on - OTHERWISE YOU CAN FRY YOUR LAPTOP.


<?xml version="1.0"?>
<FanControlConfigV2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NotebookModel>HP Victus by HP Laptop 16-e0xxx</NotebookModel>
  <Author>Bilut</Author>
  <EcPollInterval>1000</EcPollInterval>
  <ReadWriteWords>false</ReadWriteWords>
  <CriticalTemperature>95</CriticalTemperature>
  <FanConfigurations>
    <FanConfiguration>
      <ReadRegister>46</ReadRegister>
      <WriteRegister>44</WriteRegister>
      <MinSpeedValue>0</MinSpeedValue>
      <MaxSpeedValue>100</MaxSpeedValue>
      <IndependentReadMinMaxValues>false</IndependentReadMinMaxValues>
      <MinSpeedValueRead>0</MinSpeedValueRead>
      <MaxSpeedValueRead>0</MaxSpeedValueRead>
      <ResetRequired>true</ResetRequired>
      <FanSpeedResetValue>255</FanSpeedResetValue>
      <FanDisplayName>Left</FanDisplayName>
      <TemperatureThresholds>
        <TemperatureThreshold>
          <UpThreshold>0</UpThreshold>
          <DownThreshold>0</DownThreshold>
          <FanSpeed>32</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>65</UpThreshold>
          <DownThreshold>50</DownThreshold>
          <FanSpeed>46</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>76</UpThreshold>
          <DownThreshold>58</DownThreshold>
          <FanSpeed>50</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>86</UpThreshold>
          <DownThreshold>79</DownThreshold>
          <FanSpeed>70</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>88</UpThreshold>
          <DownThreshold>83</DownThreshold>
          <FanSpeed>80</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>90</UpThreshold>
          <DownThreshold>87</DownThreshold>
          <FanSpeed>100</FanSpeed>
        </TemperatureThreshold>
      </TemperatureThresholds>
      <FanSpeedPercentageOverrides />
    </FanConfiguration>
    <FanConfiguration>
      <ReadRegister>47</ReadRegister>
      <WriteRegister>45</WriteRegister>
      <MinSpeedValue>0</MinSpeedValue>
      <MaxSpeedValue>100</MaxSpeedValue>
      <IndependentReadMinMaxValues>false</IndependentReadMinMaxValues>
      <MinSpeedValueRead>0</MinSpeedValueRead>
      <MaxSpeedValueRead>0</MaxSpeedValueRead>
      <ResetRequired>true</ResetRequired>
      <FanSpeedResetValue>255</FanSpeedResetValue>
      <FanDisplayName>Right</FanDisplayName>
      <TemperatureThresholds>
        <TemperatureThreshold>
          <UpThreshold>0</UpThreshold>
          <DownThreshold>0</DownThreshold>
          <FanSpeed>32</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>65</UpThreshold>
          <DownThreshold>50</DownThreshold>
          <FanSpeed>46</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>76</UpThreshold>
          <DownThreshold>58</DownThreshold>
          <FanSpeed>50</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>86</UpThreshold>
          <DownThreshold>79</DownThreshold>
          <FanSpeed>70</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>88</UpThreshold>
          <DownThreshold>83</DownThreshold>
          <FanSpeed>80</FanSpeed>
        </TemperatureThreshold>
        <TemperatureThreshold>
          <UpThreshold>90</UpThreshold>
          <DownThreshold>87</DownThreshold>
          <FanSpeed>100</FanSpeed>
        </TemperatureThreshold>
      </TemperatureThresholds>
      <FanSpeedPercentageOverrides />
    </FanConfiguration>
  </FanConfigurations>
  <RegisterWriteConfigurations />
</FanControlConfigV2>

Great, I just started decoding it on HP Spectre x360 Convertible 14-ea0xxx - intel 11th.
And then I found your list. I think registers are very similar.

The actual fan speed seems to be:
Fan1 speed - 0xB1 (range 0-33)
Fan2 speed - 0xB3 (range 0-32).
Perhaps values are 100x to get RPMs...

0x2E, 0x2F are a "target" speed between 0 and 100.
0x2C, 0x2D fan speed control registers are saturated to 100 on mine. (They revert back if value is too high. 255 (off value) is an exception to that).

Interestingly requesting 100% manually doesn't give maximum speed! It only gets to 2600RPM (assuming 100x multiplier) and I can hear it is not very fast.
When I switch Power Mode (0x95 register) to Cool Mode (0x2), the actual fans max out at around 3200 RPM

I think 0x95 register will be all I need to fix my HP fan troubles without using buggy HP Command Center. Especially because that is the only way to get full range of the RPM.
I presume 0x95 also changes CPU/GPU profiles, but I already adjust CPU that via ThrottleStop.

I will see - maybe I will use:

  1. Cool mode if CPU is above 95C,
  2. Quite mode if CPU is below 60C
  3. Performance mode for everything else.
    image

In my laptop in B0:B3 range are definitely some kind of measurements. I guess B1 and B3 could be RPM - but in very low range (maxed at 0x13). I was assuming it was lower byte of 2 byte values - but maybe not.

I've also found curious little register 0xF9. Normally 0x00. Setting it to 0xFF or 0xF0 gets fans to full blast regardles of any other settings/controlls. And ramp to 100% is instant. Like some kind of panic mode... Fans do go a bit faster than 100% or Omen HUB max fan mode. TBH it kinda resembles PWM override by direct mosfet gate.

P.S.: Wait, actually in my EC this B0-B3 region IS 16bit rpm values! B1:B0 is fan1, B3:B2 is fan2. Math checks out, I just got confused by byte ordering. Great find!
I get (for fan1):

  • 20% = 800rpm
  • 30% = 1300rpm
  • 40% = 1750rpm
  • 50% = 2150rpm
  • 60% = 2550rpm
  • 70% = 3000rpm
  • 80% = 3450rpm
  • 90% = 3650rpm
  • 100% = 4300rpm
  • turbo from 0xF9 reg = 4700rpm

Fan 2 is a bit faster (+250rpm).

Yes. I too just realised RPM in 16bits. LSB; MSB. I think that makes it Little endian. For NoteBook FanControl it is probably better to use MSB byte only though.

Good find with the 0xF9 - this might be useful for creating a good profile. RPMs are not updated during the override.

Original profiles are frustrating on Spectre.
Balanced has a range roughly 0 -90% rpm range, but never uses 10% 😠
Quiet is the one that uses 10%.
Cool is the only one that uses 100%.

Do you know how to increase the GPU TDP limit? I tried changing 0x95 to 0x01 but it still limited at 60w :(

Do you know how to increase the GPU TDP limit? I tried changing 0x95 to 0x01 but it still limited at 60w :(

60? My silent mode tdp is 30. Normal is 80 and max is 95. Changing 0x95 from 03 to 00 is working (30w->80w)- however 01 does not bump the limit from 80 to 95. I think there had to be some kind of firmware update that broke that. Because if I do it from OMEN hub it changes 0x95 to 01 and nothing else, but limit goes properly to 95w instead of capping at 80. So maybe there is also something in the nv driver that gets switched now.

Do you know how to increase the GPU TDP limit? I tried changing 0x95 to 0x01 but it still limited at 60w :(

60? My silent mode tdp is 30. Normal is 80 and max is 95. Changing 0x95 from 03 to 00 is working (30w->80w)- however 01 does not bump the limit from 80 to 95. I think there had to be some kind of firmware update that broke that. Because if I do it from OMEN hub it changes 0x95 to 01 and nothing else, but limit goes properly to 95w instead of capping at 80. So maybe there is also something in the nv driver that gets switched now.

That's sad, btw mine is RTX 3050ti so the base TDP is 60, with boost is 75

Great, I just started decoding it on HP Spectre x360 Convertible 14-ea0xxx - intel 11th. And then I found your list. I think registers are very similar.

The actual fan speed seems to be: Fan1 speed - 0xB1 (range 0-33) Fan2 speed - 0xB3 (range 0-32). Perhaps values are 100x to get RPMs...

0x2E, 0x2F are a "target" speed between 0 and 100. 0x2C, 0x2D fan speed control registers are saturated to 100 on mine. (They revert back if value is too high. 255 (off value) is an exception to that).

Interestingly requesting 100% manually doesn't give maximum speed! It only gets to 2600RPM (assuming 100x multiplier) and I can hear it is not very fast. When I switch Power Mode (0x95 register) to Cool Mode (0x2), the actual fans max out at around 3200 RPM

I think 0x95 register will be all I need to fix my HP fan troubles without using buggy HP Command Center. Especially because that is the only way to get full range of the RPM. I presume 0x95 also changes CPU/GPU profiles, but I already adjust CPU that via ThrottleStop.

I will see - maybe I will use:

  1. Cool mode if CPU is above 95C,
  2. Quite mode if CPU is below 60C
  3. Performance mode for everything else.
    image

Can you tell me what software this is?

https://apps.microsoft.com/store/detail/hp-command-center/9P92N00QV14J this. It will look differently depending on the HP laptop model it is installed on.

apps.microsoft.com/store/detail/hp-command-center/9P92N00QV14J this. It will look differently depending on the HP laptop model it is installed on.

ye, mine only shows "system info" and "about"

Fan speed control with this config also seems to work on OMEN 16-c0xxx on linux. Tested on OMEN 16-c0077ng with 8902 mainboard and F.19 BIOS. Fans are basically inaudible at 1000-1500 rpm.

Hey, firstly thanks all for this tool and @MrBilut for victus 16 config.

I've got a serious issue that is fans not running enough and i cant restore bios ec fan controller after trying this config. Im using 1.7.1 version with the config given by op, on win 10 hp victus 16 e0x. Installed Nbfc, it was working, controlling fans ok suddenly bsod occurred after few minutes (dump file indicates "PAGE_FAULT_IN_NONPAGED_AREA (50)" ). This may have been occurred because hwinfo was running at the same time, not sure. Anyway windows restarted, i closed nbfc even stopped/disabled it's service to check if default ec working ok. While keep monitoring the temps, did couple short cpu stress tests. Cpu temp going above 95c even staying at 100c for couple seconds but fans not starting. They start running at 50% only after temp stays above ~70c for about 20-30 secs.

image

Looks like somehow laptop's default ec configs is messed? Given the current state, i ve got a few questions. Appreciate your insights and help on this problem. Many thanks.

1- How can i restore back ec default config, easiest way, alternative ways? Apparently stopping/disabling service or closing app not working. I think i read somewhere that one way is something like holding down power button for 15 seconds.

2- Can nbfc or any other app mess/break bios ec permanently or there is always easy restore option?

3- What happens if fans not working enough due to ec config and cpu temp goes very high, any protection on board or cpu that shut itself down before any damage? Laptop would turn itself off in such an event, right?

Pls note that nbfc can still control fans as expected when enabled but bios ec cant properly. Need to make sure it works ok too.

  1. You need to physically unplug battery for a while. It's a pain - you need to pry open bottom cover. But it helped me when I fucked up EC values while trying to debug registers (and power modes were stuck in very weird configurations).
  2. No idea.
  3. First throttling. Then at around 105-110C it should shut itself down. Not gonna test it tho... but there is also definitely some kind of uber low power mode. I've seen it when I was drastically reducing CPU tdp. I don't know if it is some kind of failsafe, but CPU was clocking 400MHz and I think also clock stretching on top of that.

As for the bsods. There is deffinitely some kind of hazard and concurrency while accessing EC. I bet nvidia driver is looking there too. Not to mention HP software. I've seen drastic changes in bsod/driver crashes frequency after updates. So they are still messing there around. There are events in event viewer pointing out bad EC communications. But they are not very helpful for tracking down culprits.

Unfortunately there is still no full workaround for setting power levels without HP shit services.
You can use ryzenadj to tweak CPU/iGPU powers. Level of customization is great on my Victus. I've got profiles from 10W to 55W and use them depending on workloads. But discrete RTX tdp cannot be modified by any command line utility. Even own nvidia stuff doesn't work on those models - and it is a known issue. So to change that you need omen suite.

Ok, i've noticed a few things so far since nbfc installed

Most critical one; despite nbfc service is stopped, default ec fan control somehow seem to be messed up and can not be restored. Will try to reset ec with power button trick or removing battery.
Update: Holding down power button didnt reset ec. Its such a pain to remove this laptop's case and battery.

Random occasional acpi errors and warnings in system event log e.g": The embedded controller (EC) did not respond within the specified timeout period...." This occurs even when nbfc service is stopped. It wasnt happening before nbfc installed.
Edit: I think this only occurs when reading ec directly from nbfc or any other tool like rweverything.

Power source changed event log ac off and 5 seconds later ac on events occur despite ac power already plugged. As a result this has symptoms like brief change of brightness/power modes etc. I think this event occurs only when reading ec directly from nbfc or any other tool.

Appreciate answers on below critical questions. Many thanks.

1- Why nbfc fail to restore/reset ec back to default? I'm using the same config file, @MrBilut mentioned writing to 0xFF restore automatic fan control. Is this not happenning automatically during closing app or stopping the service? How can i restore default automatic fan control manually, should i change write register to 255 on config file to achieve this?

2- Any way to save export all ec config/registers at any point of time and restore them later, how? This would also help to reset ec defaults.

Update: Tried below commands to restore ec default fan curves as mentioned by OP but didnt work.
"ec-probe write 0xFF 50"
"ec-probe write 0xFF 99"
after each command "ec-probe read 0xFF" output: 49 (0x31)

  1. You need to physically unplug battery for a while. It's a pain - you need to pry open bottom cover. But it helped me when I fucked up EC values while trying to debug registers (and power modes were stuck in very weird configurations).
  2. No idea.
  3. First throttling. Then at around 105-110C it should shut itself down. Not gonna test it tho... but there is also definitely some kind of uber low power mode. I've seen it when I was drastically reducing CPU tdp. I don't know if it is some kind of failsafe, but CPU was clocking 400MHz and I think also clock stretching on top of that.

As for the bsods. There is deffinitely some kind of hazard and concurrency while accessing EC. I bet nvidia driver is looking there too. Not to mention HP software. I've seen drastic changes in bsod/driver crashes frequency after updates. So they are still messing there around. There are events in event viewer pointing out bad EC communications. But they are not very helpful for tracking down culprits.

Unfortunately there is still no full workaround for setting power levels without HP shit services. You can use ryzenadj to tweak CPU/iGPU powers. Level of customization is great on my Victus. I've got profiles from 10W to 55W and use them depending on workloads. But discrete RTX tdp cannot be modified by any command line utility. Even own nvidia stuff doesn't work on those models - and it is a known issue. So to change that you need omen suite.

@MrBilut hello, are you sure writing any value to register 0xff will cause returning to default ec fan curve? ff value always show 30 hex. i tried a few values on register ff via rweverything but it goes back to value 30 automatically in a sec.

I need to make sure if nbfc crashes or stopped manually then default bios fan curve will be active again. I think this is very crucial to prevent any damage to laptop.

Btw, how is your ec behaving since running nbfc? Is your default fan curve take over when nbfc stopped? Do you have weird stuff going when reading ec like power source events (ac plug off/on, which changes brightness/performance etc. as a result )? Thanks

are you sure writing any value to register 0xff will cause returning to default ec fan curve? ff value always show 30 hex.

You need to write 0xFF to FAN speed registers. Not 'anything' to 0xFF register.
Write 0xFF to 0x2C and 0x2D to return to automatic operation. This always worked (and is working) on my Victus.

This is my config in a nutshell:
image

Had no issues with stopping nbfc and restoring default curve. It works like stock when I disable it or switch to read-only mode.

Ok thanks, i got it wrong, quite new to acpi/ec stuff. Seems like those 2 register values are already set to 0xff. Im confused a bit as my laptop curve seem to be wrong. As seen on screenshot i uploaded earlier, cpu temp goes to 100c in 5-10 secs during stress test but fans not spinning at all. In 100-101c it throttles a bit goes down to 85-90c and then fans start spinning at around 50%. Not going over 50% even temp reach 100c again. Is somehow fan curve methods in acpi tables/bios uefi etc messed? I even upgraded the bios to latest version it didnt help. I think default fan curve is managed by methods in bios/uefi firmware and we cant alter it, right? And what nbfc does is kind a hack, controlling the fans directly from ec. If so, how is default fan control in bios/uefi and nbfc app not conflicting each other?

how is default fan control in bios/uefi and nbfc app not conflicting each other?

Simply put - it works because this specific EC logic treats those registers as override of built in logic.

As for the other stuff. Use hwinfo to gather metrics. You will get throtling reasons there, TDP %, etc.

And most importantly - builtin fan curve uses mostly something called 'skin temperature'. So it's quite normal to see max temp on CPU during load. It also normal behaviour to throttle down power target. That's why I've suggested ryzenadj earlier - this utility let's you control those parameters. CPU tdp, fast and slow limits, skin temp, etc.

On the other hand Victus cooling system is not able to cool 65W cpu load. From my tests - around 60W constant is max - and it will still be at 100C.

I use this ryzenadj command for my tests:
image

And it gives this result during cinebench run (at around 11500pts):
image

Fans go full tilt using my profile - but on stock - they work at 56% only. And that is directly because skin temp is low (around 40C). If you manage to get higher skin temp, or heat up dGPU - stock fan speed will increase.

P.S.: Stock fan curve is so bad, that using that ryzenadj profile I get down to around 8000pts in that cinebench run (because of forced throttling). Welcome to excellent laptop engineering in 2022 :) Absolutely pathetic.

Great this explains everythin very well now. Thanks a lot, i confirmed it too, im relieved :). Oh boy so loud fans get during demanding games. Anyway, i think i dont need to reset ec anymore. Such a pain to unscrew/screw those bunch of screws and pry open back cover, unplugging bat cable another story.

Really bad engineering on thermal management. Actually i believe fix is easy just matter of changing a few lines of code on bios/uefi firmware? Maybe they would sort this with fw updates in the future.. That would be really nice. a decent balanced fan curve is a must on computers. I think i'll use my laptop at 90-99% via max process state in power settings for everything other than cpu demanding games.

Hello! Sorry for my amateur question, but how could I control HP Victus directly from it's EC? Got a problem with victus laptop - it's battery discharges when ac charger is PLUGGED IN while GPU-intense tasks (games) are running. Discharge rate is about 8-10% per hour. Socket wattmeter shows consumption around 150 w. Factory charger is rated 200w, I bought another 230w original hp charger and laptop acts kinda strange - when consumption gets higher than 150 w, battery becomes the source of power for a while. So these switches between 230w charger and battery occurs randomly for a random amount of time. Recently I physically disconnected battery, tested both chargers and these power switches are gone. During 30 min full system stress test power consumption was 180-190w and no errors, power drops, bugs occured. HP hardware diagnostics shows status 2 error (charger power is below requirements) after charger tests. Seems that EC apparently can't recognise that 230w charger is rated 230w and switches power source to battery. I need to manually write correct charger power to EC registers so that my laptop could work fine. Another solution is for EC to disconnect battery while gaming with plugged in charger to avoid discharging. Please help if you can.

@lexaboec

  1. It is probably futile. EC will be communicating with a charger continuously. So every static modification you do will disapear after few seconds. Unless this modification triggers some kind of hardcoded action - like hibernating/sleeping.
  2. If you want to try - download tool called rweverything. Fire up EC reader and have at it. But be aware that you might need to physically disconnect the battery if you badly configure EC.
  3. I know there are registers for battery percentage and remaining time. I also know some registers change contents depending if charger is plugged in or not - but I wasn't able to decipher them. And it also wasn't important to me - so I gave it a rest after it fucked up my laptop behaviour when unplugged (needed to disconnect battery to fix it).

You can also try using utilities to undervolt you components to fit into smaller power envelope. Inlet XTU or ryzen adj for cpus. It would probably be easier to manage such a solution on a regular basis - since constant communication with EC might trigger bluescreens.

image
I have this set to auto to have my own custom curvature, is it ok to do this?