Active Topics

 


Reply
Thread Tools
Posts: 262 | Thanked: 315 times | Joined on Jun 2010
#1
We all know that many processes run in the background constantly. Some of the worst offenders are:
  • scim-panel-gtk
  • browserd
  • tracker
  • image-viewer
  • ...

dbus-scripts (see the excellent Maemo Wiki page) is a nifty tool to listen to internal system events and respond accordingly.

Now, in catching the D-Bus messages for screen dimming and especially screen lock, we can 'pause' these processes using the standard Unix 'SIGSTOP' signal, meaning they shouldn't consume any CPU cycles/power until awoken.

Some of you might question putting browserd in there, firstly because of dsme/watchdog, and secondly because you might be downloading something and lock the screen. The good news is that I found that dsme/watchdog will not trigger a reboot if browserd is paused. As long as it is in the process list, no probs. Re downloading, I'd probably use Opera in that case.

Be sure you know what you're doing, or are prepared to reflash

How it's done:

As root:
Code:
$ root

# apt-get install dbus-scripts
Fīle: /etc/dbus-scripts.d/screen-lock
Code:
/usr/local/share/dbus-scripts/screen-lock   * * com.nokia.mce.signal tklock_mode_ind locked
/usr/local/share/dbus-scripts/screen-unlock * * com.nokia.mce.signal tklock_mode_ind unlocked
(The above should be two long lines, bear that in mind if it has word-wrapped into 4 or more)


Fīle: /usr/local/share/dbus-scripts/screen-lock
Code:
#!/bin/ash

for process in browserd scim-panel-gtk image-viewer
do
  /usr/bin/pkill -STOP $process
done

Fīle: /usr/local/share/dbus-scripts/screen-unlock
Code:
#!/bin/ash

for process in browserd scim-panel-gtk image-viewer
do
  /usr/bin/pkill -CONT $process
done
Make all of the above scripts executable!

Now restart dbus-scripts:
Code:
# killall dbus-scripts
You can do likewise for screen dimming, keyboard closing etc, to your preference. Just be sure to think through the consequences.

Last edited by Xagoln; 2011-05-13 at 18:45. Reason: added link to Wiki, plus info on installing dbus-scripts
 

The Following 21 Users Say Thank You to Xagoln For This Useful Post:
Posts: 262 | Thanked: 315 times | Joined on Jun 2010
#2
I will leave my phone locked overnight to see how it fares.

Could be worth holding off on doing this until I confirm long periods of locking don't cause any issues.
 

The Following User Says Thank You to Xagoln For This Useful Post:
hawaii's Avatar
Posts: 1,030 | Thanked: 792 times | Joined on Jun 2009
#3
FWIW, I use dbuscron as it seems to be more stable for me. With some intelligent scripting and fcron, it would be possible to grab the PID that's chewing unnecessary cycles and pause it when locked.

A lot of user spawned processes can be paused that aren't necessary; calendar, hildon-input-method, camera-ui are a few I've been doing with no issue.

Curiously, I wonder what happens if you try and issue STOP to hildon-desktop, hildon-home and hildon-status-menu...

Last edited by hawaii; 2011-05-13 at 18:49.
 

The Following 3 Users Say Thank You to hawaii For This Useful Post:
hawaii's Avatar
Posts: 1,030 | Thanked: 792 times | Joined on Jun 2009
#4
Don't bother pausing hildon-desktop or home on lock trigger. Too many processes hook into them, namely phone calls don't work :P

I've shut off osso-xterm, calendar, camera-ui, browserd, image-viewer, hildon-input-method.

I want thumbnailer and tracker to run, so renice to +19 and call it a day.
 

The Following 3 Users Say Thank You to hawaii For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#5
Originally Posted by hawaii View Post
Don't bother pausing hildon-desktop or home on lock trigger. Too many processes hook into them, namely phone calls don't work :P

I've shut off osso-xterm, calendar, camera-ui, browserd, image-viewer, hildon-input-method.

I want thumbnailer and tracker to run, so renice to +19 and call it a day.
You have my attention, please tell me more about this hawaii...

FYI I have 2 scripts.

1. Under-clocks and under-volts the phone to THE MAX. This is tied into the n900 'device inactive' dbus signal. I am unsure what the trigger is but it seems to appear a short while after the screen goes off. This only happens if the keyboard is closed AND the back light is off. This means if the n900 is doing something that will take a while and i don't want it to under power I just leave the keyboard open.


2. A clock and voltage back up script, this is triggered when the device is unlocked.


This means that i have been able to get rid of the kernel-power-settings script (I have a local copy loading settings). For some reason it occasionally causes my n900 to spazz out with ~8000 wake ups per second keeping it in C0.

For a while I was experimenting with stopping bme when the device was asleep however it wasnt easy to detect the 'plugged in, bme not started' condition (there is no dbus signal when BME is stopped), further more BME would just stop working after a bunch of start/stops :/ Although stopping BME was saving me around 200~wakeups/30s...
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following 2 Users Say Thank You to vi_ For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#6
Originally Posted by hawaii View Post
Don't bother pausing hildon-desktop or home on lock trigger. Too many processes hook into them, namely phone calls don't work :P

I've shut off osso-xterm, calendar, camera-ui, browserd, image-viewer, hildon-input-method.

I want thumbnailer and tracker to run, so renice to +19 and call it a day.
Also who do I have to renice to get a bl0w...the process that deals with teh phone, what is his nice and can I crank it to the max?

Also what is hawaii's opinion on the mlocker application?
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 
Posts: 346 | Thanked: 271 times | Joined on Jan 2010
#7
Simpler, if you don't want default services to be running you can look in /usr/share/applications/hildon/ and open .desktop files (the modest one for example), then comment out with a # these kind of lines:
X-Maemo-Prestarted=always
X-Maemo-Prestarted-Priority=2000
 

The Following 3 Users Say Thank You to Megaltariak For This Useful Post:
hawaii's Avatar
Posts: 1,030 | Thanked: 792 times | Joined on Jun 2009
#8
Originally Posted by vi_ View Post
Also who do I have to renice to get a bl0w...the process that deals with teh phone, what is his nice and can I crank it to the max?

Also what is hawaii's opinion on the mlocker application?
omhd already takes care of setting priority for daemons and applications that handle incoming calls.

I use mlocker for the X server and I automatically set hildon-home, hildon-desktop and a few other core processes to FIFO or RR real time status when using the BFS scheduler.

I have no idea why you'd want to stop BME?
 

The Following 3 Users Say Thank You to hawaii For This Useful Post:
Posts: 68 | Thanked: 13 times | Joined on Oct 2010
#9
Any chance of making a script/app that you can choose witch process to stop and setup the trigger behavior!!!

I love my N900 and read all the TMO just for increase my batt life!

Good work you all!
 

The Following User Says Thank You to dimbert For This Useful Post:
Posts: 262 | Thanked: 315 times | Joined on Jun 2010
#10
Originally Posted by Megaltariak View Post
Simpler, if you don't want default services to be running you can look in /usr/share/applications/hildon/ and open .desktop files (the modest one for example), then comment out with a # these kind of lines:
X-Maemo-Prestarted=always
X-Maemo-Prestarted-Priority=2000
Thanks for the tip.

Some of these services, like scim-panel-gtk, are very useful to have when using the phone interactively. And totally redundant when the device is locked.

Also, I'd be weary of dsme/watchdog. Out of ignorance, a few weeks ago I renamed the actual browserd executable, frustrated that it would always run and seemed to often keep my CPU busy even when I'd closed all my browser windows. The dsme rebooted the phone within 5 seconds, and I ended up with a reboot loop.

Would adjusting those values satisfy dsme and stop it rebooting?
 
Reply


 
Forum Jump


All times are GMT. The time now is 01:56.