Qengineering / rtop-Ubuntu

rtop, a performance monitor for the Rockchips RK3566/68/88
https://qengineering.eu/
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Use a different command for fan activity #1

Open lukaszsobala opened 2 months ago

lukaszsobala commented 2 months ago

Hello,

The current command reporting fan activity assumes that the levels reflect the actual speed (ie level 1 means 0%, level 2 means 12% etc). This is almost never true, especially if the fan profile is configured using an overlay.

I think that a better approach would be to report the actual pwm value of the kernel driver, so: cat /sys/devices/platform/pwm-fan/hwmon/hwmon9/pwm1 - the values here are from 0 to 255, so add 1 to it, divide by 256 and report as percentage.

For me, the value reported now is almost always 0 as I use pwm 146 as the first level (and many subsequent ones). But it should be about 57% instead (147/256).

Qengineering commented 2 months ago

When updating rtop, it will be implemented.

lukaszsobala commented 2 months ago

Thank you @Qengineering. Just keep in mind that the number after hwmon in the folder name sometimes changes, not sure why.

Qengineering commented 2 months ago

And that is just what I saw a minute ago. I had to use hwmon7 instead of hwmon9

lukaszsobala commented 2 months ago

A simple regex should be enough to fix it :)