Pi Zero CPU command issue? Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
fr3ak
Posts: 7
Joined: Thu Mar 11, 2021 1:26 pm

Pi Zero CPU command issue?

Post by fr3ak »

Hi,

Firstly I would like to say a huge 'Thank You!' for this amazing distro. This is the 1st Linux distro I have used with cli only, and has been amazingly simple to setup. I recently purchased a Raspberry Pi Zero (non-wifi), and have set it up with a 2tb USB HD, USB TV Tuner, and Netgear 4G Router (via USB). Software installed is TvHeadend, Samba Server, qBitorrent, ProtonVPN, Pi-Hole, and is all working perfectly.

In dietpi-config, I have set the governor to 'conservative' and reduced the minimum CPU frequency to 300mhz. Running htop shows ~5% CPU usage, with htop accounting for most of that. When I run 'sudo cpu' the output is:

─────────────────────────────────────────────────────
DietPi CPU Info
Use dietpi-config to change CPU / performance options
─────────────────────────────────────────────────────
Architecture | armv6l
Temperature | 31'C : 87'F (Cool runnings)
Governor | conservative
Throttle up | 50% CPU usage

Current Freq Min Freq Max Freq
CPU0 | 1000 MHz 700 MHz 1000 MHz

[ INFO ] DietPi-CPU_info | CPU current frequency, may be affected by this script, due to the processing required to run it.

So I'm not sure if 'sudo cpu' is returning bad info, or dietpi-config isn't applying the 300mhz min frequency, or if I've set something up wrong. If anyone has any advice on what could be happening, I would be grateful.

Thanks in advance. :)
User avatar
MichaIng
Site Admin
Posts: 3087
Joined: Sat Nov 18, 2017 6:21 pm

Re: Pi Zero CPU command issue?

Post by MichaIng »

Many thanks for your report.

Yeah currently on all non-RPi4 the config option seems to be ignored since it implies some instability: https://github.com/raspberrypi/firmware ... -732214981

Actually the major instability issues have been fixed, but in some circumstances, when lowering the overvoltage (manually) on some RPi models it can still hang or crash the system. I personally don't see it as issue anymore since lowering overvoltage below a certain level will always lead to an instable system, so that is and was try & fail anyway. But the kernel dev chose to disable it and for now seems to not deal with the issue anymore.

Since I feel like I over-posted the above linked issue already, it would be great if you could awake it and kindly ask if this topic can be picked up again.

Also the official docs do not contain a word that arm_freq_min would not work on models other than RPi4: https://www.raspberrypi.org/documentati ... locking.md
fr3ak
Posts: 7
Joined: Thu Mar 11, 2021 1:26 pm

Re: Pi Zero CPU command issue?

Post by fr3ak »

Thank you very much for your fast reply.

I will bump that thread a little, to see if there's any news on a fix.

So 'sudo cpu' always reports that it's 1000mhz, regardless of CPU load, which is bad for me as I was aiming for the lowest possible power draw. I live off-grid, so every little counts, and I have disabled the HDMI & LED to drop it as far as possible. Is there a patched kernel anywhere, or some setting that could be tweaked to manually lower the CPU speed?

Thanks again.
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Pi Zero CPU command issue?

Post by Joulinar »

best to my knowledge, cpu command is raising cpu frequence at the time of execution. This as well is stated on the command output

[ INFO ] DietPi-CPU_info | CPU current frequency, may be affected by this script, due to the processing required to run it.

can you check following

Code: Select all

cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
fr3ak
Posts: 7
Joined: Thu Mar 11, 2021 1:26 pm

Re: Pi Zero CPU command issue?

Post by fr3ak »

Ah, yes - I posted my own answer without reading it properly, sorry!

dietpi@DietPi:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
700000 7744920
800000 103592
900000 38038
1000000 264752

It would seem that all is well, and it's scaling from 700-1000mhz as expected.

Thank you for your help :)
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Pi Zero CPU command issue?

Post by Joulinar »

yep looks good, 95% of the time you are on 700 MHz
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply