Giacomix02 / fanControl

fan control for hp victus
GNU General Public License v3.0
6 stars 1 forks source link

Inconvenient Control bar scale? #3

Open drajabr opened 1 month ago

drajabr commented 1 month ago

First if all, thanks for bundling this up in this beautiful interface, which helps me dump all of HP Omen bloatware and shitty useless services. My laptop is Victus 15, Turbo switch works, and changing the mode seems to work too. However I noticed the control slider bar doesn't seem to make sense?

The quietest fan speed I get is when I set it to either "Cool" or "Extreme" mode, which is counter intuitive I guess, as there supposedly "Quite" and "Eco" modes with expectation to get lower fan speed or operate silently for longer period of time than "default" mode.

I would love to help debugging or testing, and again thanks for this tool! <3

Giacomix02 commented 1 month ago

Thank you for using my app,

unfortunately I'm not the creator of the code that interfaces to the BIOS, and there is no much documentation. You can find the code here, it is created by him. So i don't really know what the code does, it only change values inside memory.

In the future i also want to implement RPM slider, but i don't understand how the function really work.

Other infos:

 // Performance Mode List
    public enum PerformanceMode {
        Default =       0, // 0x0000 = 0b0000000000000000
        Performance =   1, // 0x0001 = 0b0000000000000001
        Cool =          2, // 0x0002 = 0b0000000000000010
        Quiet =         3, // 0x0003 = 0b0000000000000011
        Extreme =       4, // 0x0004 = 0b0000000000000100
        L8  =           4, // 0x0004 = 0b0000000000000100
        L0  =          16, // 0x0010 = 0b0000000000010000
        L5  =          17, // 0x0011 = 0b0000000000010001
        L1  =          32, // 0x0020 = 0b0000000000100000
        L6  =          33, // 0x0021 = 0b0000000000100001
        L2  =          48, // 0x0030 = 0b0000000000110000
        L7  =          49, // 0x0031 = 0b0000000000110001 
        L3  =          64, // 0x0040 = 0b0000000001000000
        L4  =          80, // 0x0050 = 0b0000000001010000
        Eco =         256, // 0x0100 = 0b0000000100000000
    }
'-SetFanMode' {
            $Value = [Byte] $Args[$NextArg]
            Write-Information $('Set Fan Mode to: ' + $Value)
            Send-OmenBiosWmi -CommandType 0x1A -Data @(0xFF, $Value)
            # Byte #0: 0xFF - Constant (?)
            # Byte #1: Default/Eco → L2 (0x30), Cool → L4 (0x50), Performance → L7 (0x31)
            # All fan modes as defined in HP.Omen.Core.Common.PowerControl.PerformanceMode:
            # 0x00 - Default/Eco, 0x01 - Performance, 0x02 - Cool, 0x03 - Quiet, 0x04 - Extreme (L8)
            # 0x10 - L0, 0x20 - L1, 0x30 - L2, 0x40 - L3, 0x50 - L4, 0x11 - L5, 0x21 - L6, 0x31 - L7
        }

You can find all commands into this file

Thank you for your help, let me know!

drajabr commented 1 month ago

Thanks for letting me know about the base project, I found and used OmenMon from him too.

The same behavior happens in OmenMon, but it's telling me more about the underlying stuff.

What I concluded is, and I may be wrong: it seems the hardware itself (BIOS or EC not sure which one) doesn't have a definition to theses modes, so when selecting one of them using OmenMon it reverts to one of the supported modes there.

I had little time to read the awesome docs he made, I guess it is possible to make a "map" using the xml file to tell OmenMon where the rpm readings or the modes are available from either the EC or BIOS. What I liked about OmenMon is the "programs" I did make a program to get a quieter fan, at cost of warmer laptop, with my casual usage I get CPU temp ~60~65 while keeping the fans around ~20krpm is perfect for me, the default profile would run it around 35k which is louder. At end of day, I reverted to your tool which I liked for its dead simple interface, set it up on cool mode, which is a little bit louder than the manual program I made with OmenMon, but it seems to be the best balance between CPU temp and Loudness of the fans.

I really appreciate your work and the guy behind OmenMon, but If you allow me to add one last suggestion to your tool: Keep it dead simple; 4 circle shape buttons to select either "OFF - QUIET - DEFAULT - MAX" would be suitable for dummy people like me who just want to choose the current mode and don't care about rpm or temperature number and other advanced parameters behind the scene, I mean, OmenMon exists with almost everything savage users may want, so maybe keep this tool as simple as possible without the fancy rpm counters or temp meters : )

That was my personal opinion with no dictations, requirements, or obligation on the development of this tool.

With all love to your work guys, both of your tools obviously supersede HP Omen hub shit bloatware. <3

Giacomix02 commented 1 month ago

hi, sorry for being late, but i'm studying for an exam. Yes, the guy behind OmenMon did a good job and i really appreciate it. Tank you also for the "OFF - QUIET - DEFAULT - MAX" suggestion, I will keep it in mind and do it when I have time.

Thank you for testing my software and giving me advice, have a good day!

Giacomix02 commented 2 days ago

@drajabr Hi, i'm trying to apply your suggestion, but i have a problem: If you set a specific fan speed you can't return to original fan profile ( I have to restart my pc )

If you have time, can you help me?

drajabr commented 2 days ago

@drajabr Hi, i'm trying to apply your suggestion, but i have a problem: If you set a specific fan speed you can't return to original fan profile ( I have to restart my pc )

If you have time, can you help me?

I don't remember exactly why I reverted back to using OmenMon, but it turned out more stable, and I don't usually switch between profiles. I think it doesn't make sense to set speed manually, you can tune your custom profile if you want, It took me some time to get a good balance between noise and temp, here is my custom profile in omenmon.xml:

            <Program Name="MyCustomProfile">
                <FanMode>Default</FanMode>
                <GpuPower>Default</GpuPower>
                <Level Temperature="00"><Cpu>00</Cpu><Gpu>00</Gpu></Level>
                <Level Temperature="55"><Cpu>16</Cpu><Gpu>16</Gpu></Level>
                <Level Temperature="56"><Cpu>16</Cpu><Gpu>16</Gpu></Level>
                <Level Temperature="57"><Cpu>16</Cpu><Gpu>16</Gpu></Level>
                <Level Temperature="58"><Cpu>17</Cpu><Gpu>16</Gpu></Level>
                <Level Temperature="59"><Cpu>17</Cpu><Gpu>17</Gpu></Level>
                <Level Temperature="60"><Cpu>18</Cpu><Gpu>17</Gpu></Level>
                <Level Temperature="61"><Cpu>18</Cpu><Gpu>18</Gpu></Level>
                <Level Temperature="62"><Cpu>19</Cpu><Gpu>19</Gpu></Level>
                <Level Temperature="63"><Cpu>20</Cpu><Gpu>20</Gpu></Level>
                <Level Temperature="64"><Cpu>20</Cpu><Gpu>20</Gpu></Level>
                <Level Temperature="65"><Cpu>21</Cpu><Gpu>21</Gpu></Level>
                <Level Temperature="66"><Cpu>22</Cpu><Gpu>22</Gpu></Level>
                <Level Temperature="67"><Cpu>22</Cpu><Gpu>22</Gpu></Level>
                <Level Temperature="68"><Cpu>23</Cpu><Gpu>23</Gpu></Level>
                <Level Temperature="69"><Cpu>24</Cpu><Gpu>24</Gpu></Level>
                <Level Temperature="70"><Cpu>25</Cpu><Gpu>25</Gpu></Level>
                <Level Temperature="71"><Cpu>26</Cpu><Gpu>26</Gpu></Level>
                <Level Temperature="72"><Cpu>27</Cpu><Gpu>27</Gpu></Level>
                <Level Temperature="73"><Cpu>28</Cpu><Gpu>28</Gpu></Level>
                <Level Temperature="74"><Cpu>29</Cpu><Gpu>29</Gpu></Level>
                <Level Temperature="75"><Cpu>30</Cpu><Gpu>30</Gpu></Level>
                <Level Temperature="76"><Cpu>31</Cpu><Gpu>31</Gpu></Level>
                <Level Temperature="77"><Cpu>33</Cpu><Gpu>33</Gpu></Level>
                <Level Temperature="78"><Cpu>34</Cpu><Gpu>34</Gpu></Level>
                <Level Temperature="79"><Cpu>35</Cpu><Gpu>35</Gpu></Level>
                <Level Temperature="80"><Cpu>36</Cpu><Gpu>36</Gpu></Level>
                <Level Temperature="81"><Cpu>38</Cpu><Gpu>38</Gpu></Level>
                <Level Temperature="82"><Cpu>39</Cpu><Gpu>39</Gpu></Level>
                <Level Temperature="83"><Cpu>41</Cpu><Gpu>41</Gpu></Level>
                <Level Temperature="84"><Cpu>42</Cpu><Gpu>42</Gpu></Level>
                <Level Temperature="85"><Cpu>44</Cpu><Gpu>44</Gpu></Level>
                <Level Temperature="86"><Cpu>45</Cpu><Gpu>45</Gpu></Level>
                <Level Temperature="87"><Cpu>47</Cpu><Gpu>47</Gpu></Level>
                <Level Temperature="88"><Cpu>49</Cpu><Gpu>49</Gpu></Level>
                <Level Temperature="89"><Cpu>50</Cpu><Gpu>50</Gpu></Level>
                <Level Temperature="90"><Cpu>52</Cpu><Gpu>52</Gpu></Level>
            </Program>

EDIT: Code formatting. Edit 2: Probably you don't need all these steps in the profile, also, to understand it correctly, the level temperature is the highest temperature of all sensors, you may want to limit the used sensors for this, for example if one is spiking a lot making fan speed noticeable spike speeds in unstable way, for me I only rely on CPUT, and GPUT values, as the others are not stable, thus that in my xml file I have:

        <Temperature>
            <Sensor Name="CPUT" Source="EC" />
            <Sensor Name="GPTM" Source="EC" />
            <Sensor Name="RTMP" Source="EC"  Use="false" />
            <Sensor Name="TMP1" Source="EC"  Use="false" />
            <Sensor Name="TNT2" Source="EC"  Use="false" />
            <Sensor Name="TNT3" Source="EC"  Use="false" />
            <Sensor Name="TNT4" Source="EC"  Use="false" />
            <Sensor Name="TNT5" Source="EC"  Use="false" />
        </Temperature>
Giacomix02 commented 2 days ago

ok, thx, in my version I can't insert xml files (or I didn't find a way to do it) , probably i have to switch to the modern version of OmenMon to implement it. I can use only this commands:

OmenHwCtl
 [-GetBornOnDate] [-GetOcSupport] [-GetSmartAdapterStatus] [-GetSysDesignData]
 [-GetFanCount] [-GetFanLevel] [-GetFanTable] [-GetFanType] [-GetMaxFanStatus]
 [-GetGfxMode] [-GetGpuStatus] [-GetTemp] [-GetThermalThrottlingStatus]
 [-GetBacklight] [-GetBacklightSupport] [-GetColorTable] [-GetKbdType] [-GetLedAnim]
 [-GetBiosUndervoltSupport] [-GetMemOcSupport] [-SetMemXmp] [-OmenKeyOff|-OmenKeyOn]
 [-BacklightOff|-BacklightOn] [-SetColor4 <RGB0:RGB1:RGB2:RGB3> (RGB#: 000000-FFFFFF)]
 [-MaxGpuPower|-MedGpuPower|-MinGpuPower] [-MaxFanSpeedOff|-MaxFanSpeedOn] [-SetIdleOff|-SetIdleOn]
 [-SetFanLevel <00-FF:00-FF>] [-SetFanMode <0x00-0xFF>] [-SetFanTable <00-FF>+ (# < 128)]
 [-SetConcurrentCpuPower <0-254>] [-SetCpuPower <0-254>] [-SetCpuPowerMax <0-254>]
 [-MuxFix] [-MuxFixOff|-MuxFixOn] [-SetGfxMode <0x00-0xFF>] [-SetLedAnim] [-Silent]

[-SetFanTable <00-FF>+ (# < 128)] want an array of byte, that is very strange and difficult to do

 '-SetFanTable' {
            Write-Information 'Set Fan Table'
            [Byte[]] $FanTableData = [Byte[]] @($Args[$NextArg] `
                    -Replace '[^a-fA-F0-9]+', '' `
                    -Replace '..', '0x$& ' `
                    -Replace ' $', '' -Split ' ' `
                    | ForEach-Object { $_ })
            [Byte[]] $FanTable = @(
                [Byte[]] $FanTableData `
                + [Byte[]] @($(New-Object Byte[] $(128 - $FanTableData.Length)))
            )
            Send-OmenBiosWmi -CommandType 0x32 -Data $FanTable
            # Note: This appears to be a desktop-only functionality
        }
drajabr commented 1 day ago

ok, thx, in my version I can't insert xml files (or I didn't find a way to do it) , probably i have to switch to the modern version of OmenMon to implement it. I can use only this commands:

OmenHwCtl
 [-GetBornOnDate] [-GetOcSupport] [-GetSmartAdapterStatus] [-GetSysDesignData]
 [-GetFanCount] [-GetFanLevel] [-GetFanTable] [-GetFanType] [-GetMaxFanStatus]
 [-GetGfxMode] [-GetGpuStatus] [-GetTemp] [-GetThermalThrottlingStatus]
 [-GetBacklight] [-GetBacklightSupport] [-GetColorTable] [-GetKbdType] [-GetLedAnim]
 [-GetBiosUndervoltSupport] [-GetMemOcSupport] [-SetMemXmp] [-OmenKeyOff|-OmenKeyOn]
 [-BacklightOff|-BacklightOn] [-SetColor4 <RGB0:RGB1:RGB2:RGB3> (RGB#: 000000-FFFFFF)]
 [-MaxGpuPower|-MedGpuPower|-MinGpuPower] [-MaxFanSpeedOff|-MaxFanSpeedOn] [-SetIdleOff|-SetIdleOn]
 [-SetFanLevel <00-FF:00-FF>] [-SetFanMode <0x00-0xFF>] [-SetFanTable <00-FF>+ (# < 128)]
 [-SetConcurrentCpuPower <0-254>] [-SetCpuPower <0-254>] [-SetCpuPowerMax <0-254>]
 [-MuxFix] [-MuxFixOff|-MuxFixOn] [-SetGfxMode <0x00-0xFF>] [-SetLedAnim] [-Silent]

[-SetFanTable <00-FF>+ (# < 128)] want an array of byte, that is very strange and difficult to do

 '-SetFanTable' {
            Write-Information 'Set Fan Table'
            [Byte[]] $FanTableData = [Byte[]] @($Args[$NextArg] `
                    -Replace '[^a-fA-F0-9]+', '' `
                    -Replace '..', '0x$& ' `
                    -Replace ' $', '' -Split ' ' `
                    | ForEach-Object { $_ })
            [Byte[]] $FanTable = @(
                [Byte[]] $FanTableData `
                + [Byte[]] @($(New-Object Byte[] $(128 - $FanTableData.Length)))
            )
            Send-OmenBiosWmi -CommandType 0x32 -Data $FanTable
            # Note: This appears to be a desktop-only functionality
        }

I'm referring to the new OmenMon with GUI, it has default omenmon.xml file in the installation directory where you can add your custom profile and set it the default profile to set at startup

EDIT: https://omenmon.github.io/config

Giacomix02 commented 1 day ago

ok, so i have to upgrade to the newer version of bios interface 🙃, thx for help

edit: i have to use this: https://omenmon.github.io/cli