Downclocking or limiting i.MX8MP? (interim fix for suspend)

I found a safe way to blank the screen, switch to a unused virtual terminal and do setterm, on resume, restore the previous virtual terminal.

Update both the script and the config file.

2 Likes

Just had an incident where the system would not come back from the sudo suspend state. I tried it again when restarting and it worked. I wonder if the amount of time it was suspended was the main issue, or because it was charging when suspended and then when I tried waking it was not charging. I know the big Reform had some stuff I observed that seems to be based on that.

Just tested it again. It seems anything longer than 5 minutes will crash when trying to disable the script. (resuming)

Have you noticed this?

1 Like

It works longer than 5 minutes for me.

Is there something on journalctl -u psuspend after that happens?

Copy the psuspend script again, and disable the ā€œnetworkā€ module on your configuration file. Next time something happens you can access by ssh or at least know kernel didnā€™t explode if Pocket responds to ping.

Finally, you still can disable all modules and enable them one by one until find where it hangs.

1 Like

This is what the log is showing:

Aug 11 12:53:36 pocket001 systemd[1]: Started psuspend.service - MNT Pocket R>
Aug 11 12:53:36 pocket001 psuspend[801]: evtest: No such file or directory
Aug 11 12:53:37 pocket001 systemd[1]: psuspend.service: Deactivated successfu>
Aug 11 12:53:37 pocket001 systemd[1]: psuspend.service: Scheduled restart job>
Aug 11 12:53:37 pocket001 systemd[1]: Started psuspend.service - MNT Pocket R>
Aug 11 12:53:37 pocket001 psuspend[862]: evtest: No such file or directory
Aug 11 12:53:37 pocket001 systemd[1]: psuspend.service: Deactivated successfu>
Aug 11 12:53:37 pocket001 systemd[1]: psuspend.service: Scheduled restart job>
Aug 11 12:53:37 pocket001 systemd[1]: Started psuspend.service - MNT Pocket R>
Aug 11 12:53:37 pocket001 systemd[1]: psuspend.service: Deactivated successfu>
Aug 11 12:53:38 pocket001 psuspend[898]: evtest: No such file or directory
Aug 11 12:53:37 pocket001 systemd[1]: psuspend.service: Scheduled restart job>
Aug 11 12:53:37 pocket001 systemd[1]: Started psuspend.service - MNT Pocket R>

missing file or directory?

One thing I did do was enable the service with systemctl. I am wondering if that was a mistake, for reasons I canā€™t explain.

You should run it within a systemd unit, otherwise it will freeze itself if running under an interactive user session. Maybe that is why you did suspend, but not able to resume previously, and running within a systemd unit will solve that.

Regarding the ā€œno such file or directoryā€ error, it is evtest $input_device failing, what is your input_device variable value? Does it exist? Should be pointing to /dev/input/by-id/usb-MNT_Pocket_Reform_Input_RP2040-event-kbd, and it should exist at the time that the systemd unit starts.

I also added feedback by turning on/off the keyboard leds, so one knows when suspend and resume do start and end.

I am not sure I know what you mean here. I invoking the script via the keyboard combo and not directly via a terminal. I just ran the script for about 20 minutes and everything worked really. The percentage was still pretty high though in the loss department.

I think I had about a 7% drop in battery life with psuspend active. Still it seems to work really well. Seems to average out to just under 4 hours in that psuspend state.

Are you seeing something similar?

check out powertop, specifically
powertop --auto-tune
there are a few pcie and usb autosuspend settings that could be enabled to save some power. running normally it shaves about 0.2-0.3 watts from the idle power usage. I think those properties should be set during normal usage - but having the suspend script set them would probably be good too.

1 Like

I really canā€™t wait for true suspend. I know that power savings might similar but if it helps to cut heat and save battery it will be super welcome.

1 Like

You previously said that you did suspend but could not resume. I meant that for the script to be able to resume it must be run from systemd, not manually, but anyway you already started doing that, and so this problem was solved for you :).

Because the voltage drops as the battery depletes, the current goes high to mantain the wattage (please correct me if I am wrong). I am measuring a full battery depletion with and without this pseudo suspend, tomorrow Iā€™ll have some something to comment with.

@nanocodebug thank you for the powertop suggestion! I didnā€™t try that because for some reason I always thought powertop was an intel thing only.

I will measure power consumption differences with powertop to try to squeeze something.

1 Like

I have been doing tests this week, with everything I could find, this is what Iā€™ve found:

  • running stock system, with no user programs, just a graphical session and the display off consumes aproximately 3.9W.
  • with the uploaded script more or less consumes the same.
  • with an updated script (which turns wifi radio off and sets screen brightness to zero) we can save like 200-400mW. I just uploaded it the updated version.

I am not able to save more than that. Best case scenario, the script saves a few hundreds of mW compared to an idle state, besides not allowing the computer to consume more than that, because no background programs or network activity is allowed while suspended.

Right now I donā€™t know anything else I can try.

EDIT: I put this and some other random script on GitHub - amospalla/reform: Personal MNT Pocket Reform scripts

4 Likes

Just wanted to report back that your script enables the Pocket to get through about 4 hours of ā€œstandbyā€ through the script. This is pretty impressive. If you have a powerbank in tow you can easily get through a work day with this.

One thing that is puzzling me though is how the SoC does not seem to cool down at all while the script is active. I mean the back of the display is still hot no matter how long it is has been ā€œsuspendedā€. I wonder if this just because the disabling of things is really only happening in software and not in the hardware? I would think that if we were downclocking that things would cool down. That they are not is puzzling.

2 Likes

I had the subjective impression that the metal plate was a few degrees down, but canā€™t really know if that was true.

The SoC is fully running, at lowest frequency and with 3 cores disabled at the OS level, but does not cool down that much as you say.

It was mentioned on IRC that investigating the GPU clock might be very much worth it.

1 Like

Thank you, Iā€™ll take a look. Any hint on what dates this conversation took on in the IRC?

Also, I updated the script. To use it now you need to:

  • update the psuspend script itself.
  • copy the file reform-libs.sh to the same path where this script resides.
  • update psuspend.conf also.
1 Like

where does reform-libs.sh reside normally?

By updating, Iā€™m assuming I can just wget everything from above again, and then Iā€™ll be updated. Would this be correct?

1 Like

Yes, you can just download them all again: GitHub - amospalla/reform: Personal MNT Pocket Reform scripts. There you can find the expected paths for the files.

one more question: I donā€™t need to restart to use this. Just placing everything there with the service already enabled and running should take advantage of it. Right?

Also downclocking the GPU to 200Mhz while the script is active would probably be a great way to cut down on heat, and potentially net some more power savings.

Right, download, and run systemctl restart psuspend. That would do it. I updated the readme so you can easily copy and paste to update.

Iā€™m playing with the gpu thing right now.