3

I found a lot of search results for overclocking the Raspberry Pi.

In my case, I want the opposite: I need the Raspberry to run at a constant, more predictable speed, even if it's a "slow" frequency which avoids overheating.

How do I set my 3B+ to a constant speed of say 600 MHz?

2
  • You can specify which governor is used. The default on-demand throttles back on low load but there is a fixed mode.
    – Milliways
    Sep 17, 2019 at 22:43
  • 1
    to set a constant speed in config.txt, you could arm_freq=600 and arm_freq_min=600 Sep 17, 2019 at 23:48

3 Answers 3

2

easy option is to use cpu-frequtils

sudo apt install cpu-frequtils

With cpufreq-info you will get an info on what frequencies and governors are possible for your cpu.

Then set the governor to powersave to have the cpu running at the lowest frequency all the time. (according to this governor description)

sudo cpufreq-set -g powersave

or if you wanna have more control, just set the frequency settings for min (-d) and max (-u) (here both set to 600 MHz - the min frequency for a raspberry 4).

sudo cpufreq-set -u 600MHz -d 600MHz

check again with cpufreq-info if your settings been applied the way you wanted to. Also note the limits of the governor 'userspace', which will be applied when you use this command (at least on the RaspPi).

See this How To on the other possible parameters.

Set the frequency at boot

To set the setting at boot time you can use the deamon cpufreqd (seperate package, see its manpage) or use sysfsutils (I copied this info from here)

apt install sysfsutils

The sysfs values will be configured in /etc/sysfs.conf.

Here is an example for the conservative governor:

# by default it's 444, so we have to change permissions to be able to change values
mode devices/system/cpu/cpufreq/conservative = 644
devices/system/cpu/cpufreq/conservative/freq_step = 10
devices/system/cpu/cpufreq/conservative/up_threshold = 45
devices/system/cpu/cpufreq/conservative/ignore_nice_load = 1
devices/system/cpu/cpufreq/conservative/sampling_down_factor = 10

I myself wrote a small python script to change my cpu-frequency with just a click. Give me a shout if you'd like to have it.

Info

As I've just seen here: cpufrequtils will be replaced in the future by `linux-cpupower' - at least in Debian. So you might consider using this instead. (no idea yet how to use it though)

1
  • Not sure if the above is an error or if it has changed but I had to use this to install (drop the dash) sudo apt install cpufrequtils
    – MikeKulls
    Mar 18 at 4:47
1

You can see the current governor at /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

I don't know of any tool to set governor, but
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors will show supported values
conservative ondemand userspace powersave performance schedutil

These can be changed by setting the scaling_governor to one of the supported values

/sys/devices/system/cpu/cpu0/cpufreq/ has lots of settings which you can examine.

The on-demand on the Pi4 shows

scaling_max_freq            
1500000
scaling_min_freq
600000

https://www.raspberrypi.org/documentation/configuration/config-txt/overclocking.md shows some documentation.

0

In order to achieve constant frequency, this is what I tried:

  • Install linux-cpupower: sudo apt install linux-cpupower
  • Check the info: cpupower frequency-info
  • Set the governor to userspace so that we can set the frequency: sudo cpupower frequency-set --governor userspace
  • Set the maximum frequency: sudo cpupower frequency-set --max 600MHz
  • Check the info: cpupower frequency-info.

It should say: "Current policy: frequency should be within 600 MHz and 600 MHz."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.