1

I use an under-clocked Rasberry Pi 4 to save power using these settings in /boot/config.txt:

arm_freq=700
arm_freq_min=100
core_freq=250
core_freq_min=75
sdram_freq=400
over_voltage=0
# source
# https://www.foxplex.com/sites/raspberry-pi-over-und-underclocking/

and only 1 cpu (maxcpus=1 in /boot/cmdline.txt). Unfortunately, the shell command sleep 10 (and the equivalent commands in Python or Julia) now waits 43 seconds instead of 10. Any ideas how this can be corrected?

When the CPU is under-clocked I get these timings (as suggested by @Seamus):

pi@drifter02:~ $ date +%M:%S:%N; sleep 10.; date +%M:%S:%N
42:18:636998788
43:21:810109674
pi@drifter02:~ $ date +%M:%S:%N; sleep 10.; date +%M:%S:%N
43:24:804538802
43:34:815360222
pi@drifter02:~ $ date +%M:%S:%N; sleep 10.; date +%M:%S:%N
43:36:331290110
43:46:341481104
pi@drifter02:~ $ date +%M:%S:%N; sleep 10.; date +%M:%S:%N
43:49:616077991
44:54:628062596

Even if the the two timestamps of date report 10 s (2nd and 3rd test), it does not correspond to what I see with a stop watch. Or using the time command over ssh, I get more consistent timings (but consistently wrong)

$ date +%M:%S:%N; ssh  [email protected] sleep 10.; date +%M:%S:%N;
50:07:581271832
50:34:179524391
$ date +%M:%S:%N; ssh  [email protected] sleep 10.; date +%M:%S:%N;
50:35:132595217
51:07:345482960
$ date +%M:%S:%N; ssh  [email protected] sleep 10.; date +%M:%S:%N;
51:08:313846466
51:36:433839692
$ date +%M:%S:%N; ssh  [email protected] sleep 10.; date +%M:%S:%N;
52:03:028000964
52:37:534952569

Just executing pwd takes about 0.5 s, so the time it take to make a SSH connection cannot be blamed.

$ date +%M:%S:%N; ssh  [email protected] pwd; date +%M:%S:%N;
54:03:634693731
/home/pi
54:04:184457211

Without under-clocking, the timings are correct.

More infos:

  • Raspberry Pi 4 Model B Rev 1.5
  • Linux 5.15.61-v8+, aarch64
  • Debian GNU/Linux 11 (OS reported in /etc/issue)
  • Installation image: Rapberry Pi OS Lite (64-bit)
3
  • sleep 2.326 ... is there a command to sleep a number of milliseconds or a number of microseconds?
    – jsotola
    Feb 20, 2023 at 21:56
  • @jsotola: Yes - that's it: sleep 2.326
    – Seamus
    Feb 20, 2023 at 22:55
  • I added the information about the OS. Is there anything else needed? Thanks!
    – Alex338207
    Feb 21, 2023 at 19:58

1 Answer 1

0

The issue is the option arm_freq_min=100. Apparently, lowering this frequency is not supported (and not reducing significantly the power consumption anyways):

Minimum value of arm_freq used for dynamic frequency clocking. Note that reducing this value below the default does not result in any significant power savings and is not currently supported.

https://www.raspberrypi.com/documentation/computers/config_txt.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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