I had a brown out while doing reliability testing on our player for Jetson Nano. When the brown out occurred the power mode changed for max to normal(playback speed decreases a lot). How can I monitor and restore the power mode to max power using a systemd service or writing a C code application. Thanks.
Hi Tom, here is a post about creating a simple systemd service that will run a shell script of your choosing at boot as root: https://askubuntu.com/a/919059
You could point this to a script that ran these commands:
nvpmodel -m 0
By changing the power mode from max back to normal, I’m not sure if you mean the nvpmodel got changed from mode 0 (10W) to mode 1 (5W), or that the jetson_clocks behavior was reset (it is normal for jetson_clocks to be reset after reboot). The two commands above will maximize the performance of your Nano, but you may or may not want to run the jetson_clocks script (which disables dynamic frequency scaling and locks the clocks to their maximums as defined by the current nvpmodel mode).
I really need to have a monitor service that checks those values, not just setting them which I already do using a systemd player startup service.
So the questions is how to monitor them? Is there a way to get an event when they have changed?
That would be ideal otherwise I’ll have to poll and I hate to poll as I have a real time event mind and polling is wasteful.
Is it common for you to encounter brownout condition? If that is the case, you might want to look at your power supply or define a custom power mode in /etc/nvpmodel.conf which does not exceed your power supplies capabilities and cause the brownouts to occur. Under normal circumstances the active nvpmodel would not be changing.
In any event, it should not cause significant overhead to periodically poll nvpmodel -q to get the active mode, say once a second or every few seconds (in reality you could do it faster and probably not notice). Even if you did it more frequently, you would want to give the power supply a chance to recover in the event of a brownout anyhow.