Cooling CPU in software S905X2/S922?

Put this line in file /storage/.config/autostart.sh

echo 100 >/sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold

In x96 I only have policy0, do I put just the first line?

Yes. just first one.

Something is wrong, it does not work. Again it is the value 50 and the frequency at 1908. After restart.

Maybe something set the value after boot - try to delay setting yours value. If doesn’t work use longer delay (20 seconds).

(
  sleep 5
  echo 100 >/sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold
)&

sorry I was wrong. i was watching by mistake on vim3 and there was 100. on s905x3 it did not change in 100, it remained at 50

I understand that these settings are not kept after reboot because they are done in the virtual file system / sys. To start with the desired settings I would have to create in / etc a rc.locale where should be the line
echo 100> / sys / devices / system / cpu / cpu0 / cpufreq / ondemand / up_threshold

I can not create rc.locale or other file in /etc, probably for security reasons this option was blocked.

Can someone guide me how can I get over this restriction?

Thanks.

As I wrote above use file /storage/.config/autostart.sh.

tried with autostart several variants, delay, with -c, -n, and others that I can not remember. only with the value 50 starts.
where do I find the file from which it loads the value 50 at startup? maybe I can edit it.
I noticed that only the value of 100 ondemand works beautifully ondemand governor. With 99 he behaves about the same as with 50.

Value 50 is set from initramfs when system boots and this can’t be changed: https://github.com/CoreELEC/CoreELEC/blob/coreelec-9.2/packages/sysutils/busybox/scripts/init#L1064

I tried with autostart.sh and it is set just fine. But you must use sleep and running it in background. Maybe instead of delaying for 5 seconds you need to use higher value. Use 15.

I used that

(
sleep 20
echo 100> /sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold
) &

does not change the value 50. something wrong?

SOLVED!!

I put sleep to 60, and passed to 100.

Thank you very much!

1 Like

60 :slight_smile:

I don’t know yet why value can’t be set without delay.

I suspect that the files from policy0 / ondemand are created a little later, and the command

echo 100> /sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold

without delay has nothing to change, the up_threshold file does not exist at the time autostart.sh is read and executed.

No, the file is there. But cat-ing it’s value just shows nothing. No value, not even 50 set from initramfs. Looks like the value is used sometime later. In my case I have to use delay of 5 seconds (4 is not enough).

Aha. I will try later on vim3 with sleep 5. Probably this value should be adjusted according to the performance of the device. CPU, sd / usb, emmc, etc.
Since I have not played yet with sleep time for X96, but this is no longer so important.

Hi Peter,
Now, after I solved with s905x3, I wanted to do the setting for vim3 (4 + 2 cores), but on my vim3 I did not have in policy0 the ondemand section. How could I activate it?
I saw that initially you had two lines, policy0 and policy2.
Thanks.

Yes, on vim3 there are two policies 0 and 2. So you need to write same settings to both. Like

echo 100 >/sys/devices/system/cpu/cpufreq/policy0/ondemand/up_threshold
echo 100 >/sys/devices/system/cpu/cpufreq/policy2/ondemand/up_threshold

There is nothing need to be done to see ondemand files.

In policy2 you can see, in policy0 you don’t see. Is that normal? It is not the ondemand folder in policy0.

It is not normal according to me. I see both:

vim3:~ # cat /sys/devices/system/cpu/cpufreq/policy*/ondemand/up_threshold
50
50