Idle optimization


notaz

Certified Guru
Joined
Aug 23, 2005
Messages
4,913
Location
Lithuania
Website
notaz.gp2x.de
As my pandora spends most of it's time idle waiting for me to do some occasional hacking (something becoming more and more rare), I've decided to do a few hacks on background processes to reduce their activity. The other rather obvious thing to reduce idle power usage was to dim the power LED (which turned out quite significant, no idea why it wasn't done before, you can edit /etc/pandora/conf/led.conf to customize).

cc_pandora_idle.png

If LED is ignored. the improvement is a bit hard to detect with the fuel gauge (battery monitoring) chip, as reading the chip itself requires waking up the CPU (obviously) and OMAP peripheral power domain to activate i2c. Still I think it's quite visible.

Run "Upgrade Pandora OS" to get this stuff. As usual chances are that something got broken so testing is welcome.
 
On my CC Pandora, i dit this whit the Power LED also some yeahr ago, because i ditnt want it too light whyle my Pandora lies somewhere..
I ditnt thought this should bring that much more batterietime, but its better than nothing..

Beside the Power LED: which other modifikations dit you do ??
 
I never thought about that but indeed, the led's could be dimmed down actualy. Especialy the SD loading indicator which annoys me alot when I watch a Video in the dark. ^^
Good job notaz, as usual. May all the Pandora experience you've gained help to make the Pyra even greater! :D
 
I wonder how much work it would be for me to implement a cron timer to dim the power LED at night, but put it back up to full power in the morning. During sunlight hours I have occasionally needed to shield my power LED to detect if the system is still powered up.
 
@notaz I would also like to know what else is different. Like @matzesu I have had my power LED dimmed since I got mine, so I am curious about the other stuff.
 
The update is now loadet on my cc,
There was also a Menue option "LED Settings" which works great..
No need to fiddle around whit terminal hacking..

I got some issues bevore, because somethimes, when i put my Pandora in Sleep Mode in Poket, and then something hittet one SD Card, and its ejektet, the Pandora waked up and ditnt fell in sleep, so i got about 50 % discharge on this day and its went to 4% ..
So if there is a way, to prefent the Pandora frome wake up, when a SD Cards gets ejekt, this could also help to improve the Experience whit the Pandora on its last 4 Months..
 
Beside the Power LED: which other modifikations dit you do ??
- stopped HAL sending useless messages over dbus
- hacked pndnotifyd, gconf, thunar to block indefinitely instead of doing polls every 3 seconds (or so)
- something else I forgot

I never thought about that but indeed, the led's could be dimmed down actualy. Especialy the SD loading indicator which annoys me alot when I watch a Video in the dark. ^^
You can only dim power and charger LEDs, others are on/off only.
[doublepost=1463344362,1463344112][/doublepost]
So if there is a way, to prefent the Pandora frome wake up, when a SD Cards gets ejekt, this could also help to improve the Experience whit the Pandora on its last 4 Months..
Changing SD cards while suspended can corrupt them, it would be better to just avoid it instead...
 
I will probably get this in a little bit. Thanks for sharing it with the rest of us.

Do I need to change my power LED stuff back to default to see what you set the new default to?
 
Nice Notaz! I'm a sucker for optimizations :)

I did notice, I Set my power LED brightness (normal mode) to 9 and (powersave) to 1, the led brightness increases when I close the lid.
My lid settings are set to Turn off the screen.
When I set the LID setting to low power mode the LED does dim as intended but after the wifi reconnect the wifi LED which I just disabled, turned on again and won't turn off with the LED settings menu anymore.

Edit: Just found out I have to enable the wifi led (while it's on) and then disable it again to switch the led off again.

Edit 2: Reboot fixed the wifi LED from switching on after coming out of low power mode. It stays off now
 
Last edited:
I don't know if it was current or earlier change, but when I upgraded my Pandora I noticed a proposed change to configuration file /etc/slim.conf . The proposed change was line:
Code:
current_theme       pnd-default
which was changed to
Code:
current_theme       default

I'm not sure this was intended.
I tried it out and noticed it changed the background image on login screen (there may be other changed I didn't notice) so I reverted the change (to pnd-default).
 
If LED is ignored. the improvement is a bit hard to detect with the fuel gauge (battery monitoring) chip, as reading the chip itself requires waking up the CPU (obviously) and OMAP peripheral power domain to activate i2c. Still I think it's quite visible.

Notaz, thanks for the added optimization !
Do you have any benchmark running to see how much difference it makes in battery life before/after the changes ? any rough estimation ?
 
I updated and now squashfs seems to be missing. What do I do? I can't turn on WiFi so I can't give the exact error but it says squashfs is an unknown filesystem type.
 
Have you rebooted yet? Those sort of errors are common after a kernel upgrade, since the old existing kernel is still running, but it's modules have been moved to the location for the new kernel.

Are you booting using the NAND kernel and NAND fs, or SD kernel and SD fs or a combination of the two? In the latter case you'll need to update the kernel you boot from.
 
Have you rebooted yet? Those sort of errors are common after a kernel upgrade, since the old existing kernel is still running, but it's modules have been moved to the location for the new kernel.

Are you booting using the NAND kernel and NAND fs, or SD kernel and SD fs or a combination of the two? In the latter case you'll need to update the kernel you boot from.
I did reboot yes. When I type lsmod it shows no modules loaded at all. I was using the smartreflex enabled kernel, but going back to the one from the rootfs.tar.bz2 download fixes nothing.
 
What would the Pandora do without Notaz :)

Benchmarking this stuff takes a lot of time, mostly because the battery drains so slow in Idle.
This appears to be saving about 30%, which would mean 30% longer idle time (which is great).
 
I did notice, I Set my power LED brightness (normal mode) to 9 and (powersave) to 1, the led brightness increases when I close the lid.
That's because idle mode now has separate LED brightness configuration, it was just not added to the GUI. Try running the update again, it should be configurable now.
Odd you had problems with wifi LED config, seems to work correctly here.

I'm not sure this was intended.
I don't know how the theme is selected really. The slim package comes with it set to "default", it's the same in a fresh rootfs. Must be some evil ED's script changing it during first boot, or something.
[doublepost=1463432383,1463432211][/doublepost]
Do you have any benchmark running to see how much difference it makes in battery life before/after the changes ? any rough estimation ?
Like TeDaDeS said it's quite hard to measure, and I'm not curious enough to reflash back to old firmware to measure it.
 
I've managed to squeeze some more by finding a way how to disable the 5V supply:
cc_pandora_idle_5v.png

The 5V supply feeds the EHCI (aka big) USB port, audio amp and (on CC units only) the LCD. So now when all those are not used the 5V voltage converter is also turned off. This means that there is no longer power on USB port while USB is off.

While at it, I've also disabled the expansion port power supply and added some new controls:
  • /proc/pandora/always_enable_5v - set to 1 to get the old behavior with always powered big USB port (if you want to use idle pandora as a portable battery pack, to charge a phone or something)
  • /proc/pandora/exp_power_mv - set the expansion port voltage in millivolts: 0 (default), 1500, 1800, 2500, 2800 or 3000.
So go "upgrade pandora OS" and test, I hope I got all the code right.
 
Very awesome! Can't thank you enough for keeping enhancing the Pandora! Because of you, I won't abandon my Pandas anytime soon even after Pyra comes out. :)
 
Back
Top