[Guide] How to make the Rock 5b fan work properly - Joshua Riek's Ubuntu 24.04

Let’s be frank, the default fan curve in the rockchip kernel is abysmal.

To make the official Radxa fan spin in the right situations and not make much noise, do this:

  1. Go to a folder (Documents, let’s say), create a file called fanctrl-my.dts with this content:
/dts-v1/;
/plugin/;
/ {
        fragment@0 {
                target = <&fan0>;
                __overlay__ {
                        cooling-levels = <141 141 141 141 141 141 146 146 151>;
                };
        };
};
  1. save the file, open terminal in that directory and write dtc -O dtb -o fanctrl-my.dtbo fanctrl-my.dts
  2. sudo cp fanctrl-my.dtbo /lib/firmware/6.1.0-*-rockchip/device-tree/rockchip/overlay/
  3. edit the file /etc/default/u-boot as explained here: https://github.com/Joshua-Riek/ubuntu-rockchip/discussions/686#discussioncomment-9064653
  4. validate that the overlay is detected
  5. reboot

The constant speed changing on the default curve is responsible for the terrible coil whine. This overlay keeps the CPU almost always below 65 °C during any torture tests (ambient ~25 °C) and makes little noise.

4 Likes

I’ve updated the overlay to deal with higher ambient temperatures. This can be thought of as a “Summertime” fan profile. Still quite silent.

/dts-v1/;
/plugin/;
/ {
        fragment@0 {
                target = <&fan0>;
                __overlay__ {
                        cooling-levels = <146 146 146 146 146 146 149 149 151>;
                };
        };
};
2 Likes

It seems something changed again and we are even more limited in the speeds that don’t cause coil whine.
Only 123, 158 and 230 and above are usable. Here is my current overlay:

/dts-v1/;
/plugin/;
/ {
        fragment@0 {
                target = <&fan0>;
                __overlay__ {
                        cooling-levels = <158 158 158 158 158 158 158 158 230>;
                };
        };
};

If you want to find the speeds that work for you, use these commands:

echo user_space | sudo tee /sys/class/thermal/thermal_zone0/policy #switch to manual mode
for ((i=255; i>=80; i--)); do echo $i | sudo tee /sys/devices/platform/pwm-fan/hwmon/hwmon?/pwm1; sleep 2; done #decrease the pwm value by 1 every 2 seconds to find values that don't cause hissing