Re2: [QtExtended] Proper way to invoke suspend?

2009-01-04 Thread Martin Bernreuther
Hello Lorn,

thank you for the fast answer.

Am Sonntag, 4. Januar 2009 22:58 schrieb Lorn Potter:
> > What is the proper way to suspend the Freerunner for QtExtended?
> > (Probably the last one. But is there more to be done?)
> 
> Proper way is to just let it suspend on it's own.

My problem is, that sometimes it won't...
(see http://lists.openmoko.org/pipermail/community/2008-December/038807.html)
Let's assume the "On Battery" Power Management settings for
"Dim light", "Display off" and "Suspend" are 10s, 30s and 1min
and after using the phone, I'll put it in a pocket. The touch screen will be 
touched
all the time... and "Suspend" (or even "Display off" etc) might never be 
reached!
And that's very bad for the operating time!

> > The next question will be how to configure the lock icon (padlock.png for 
> > finxi)
> > on the home screen (the rightmost icon on the bottom) to be connected with 
> > the
> > suspend command/service... (instead of Screen Lock)
> 
> You would have to edit the code and recompile, as this is not how the screen 
> lock currently works.

Screen lock currently will only lock the screen, but won't assure the
"Suspend" (or "Display off", if "Suspend" is disabled etc) to happen.
(If nothing will touch the screen, I don't need a screen lock.)
Why is the Screen lock not setting the display to "Display off" or even
invoke a suspend (if this is enabled) after a couple of seconds.
That's better for the battery, or not?

Therefore the idea to manually suspend the FR...
and to have an icon for that, which is easy to reach and not needed any more,
since the screen of a suspended FR needs not to be locked.

Regards,
Martin Bernreuther
-- 
Martin Bernreuther  martinb...@web.de

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [QtExtended] Proper way to invoke suspend?

2009-01-04 Thread Lorn Potter
Martin Bernreuther wrote:
> Hello,
> 
> on a Linux system (with ACPI) it is possible to invoke a suspend through
> 
> echo -n mem > /sys/power/state
> 
> (see http://ols.fedoraproject.org/OLS/Reprints-2008/brown-reprint.pdf 
> (chapter 5, 6th page 42);
>  http://www.linux.com/articles/54610, 
> http://acpi.sourceforge.net/documentation/sleep.html,
>  http://www.columbia.edu/~ariel/acpi/acpi_howto.txt (section 23.2),
>  
> http://www.linux-magazin.de/heft_abo/ausgaben/2004/02/einschlaf_hilfen/(offset)/2
>  (german),...)
> 
> Qt Extended on the Neo Freerunner
> (http://moko.mwester.net/download/uImage-gta02-g291a9d50_mwester-stable.bin +
>  
> http://other.lastnetwork.net/OpenMoko/qtextended-4.4.2-gta02-rootfs-release-working-with-SystemRingTones.jffs2)
> seems to be APM based
> (/sys/power/state is also present and `echo mem > /sys/power/state` works)
> and `cat /proc/apm` shows some information.
> Working on a console (if you have one, which is not default for QtExtended), 
> section 12.18.8.1.1
> of 
> http://www.uibk.ac.at/linuxdoc/LDP/LDP/Mobile-Guide/html/mobile-guide-p2c1s8-apm.html
> shows a nice way to keep an eye on the battery state through the command 
> prompt:
> export PS1="\$(cat /proc/apm | awk '{print \$7}') \h:\w\$ "
> Invoking a suspend on a APM based systems can be done with
> 
> apm -s
> 
> I noticed /etc/apm/suspend.d/gsm_suspend, which executes
> echo "1" >/sys/devices/platform/neo1973-pm-gsm.0/flowcontrolled
> Is this also needed for a proper suspend? (It seems to work without that.)
> 
> 
> In contrast to the information about e.g. how to turn on/off LEDs 
> (http://wiki.openmoko.org/wiki/FreeRunner/Buttons_and_LEDs)
> I didn't find this in the OpenMoko Wiki. Maybe because OpenMoko offers the
> "Ompower" Power management daemon:
> 
> http://wiki.openmoko.org/wiki/Ompower
> 
> This service seems not to be available for QtExtended:
> 
> r...@om-gta02:~# dbus-send --system --print-reply --dest=org.openmoko.Power / 
> org.openmoko.Power.Core.ListResources
> Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.openmoko.Power 
> was not provided by any .service files
> 
> which is not astonishing since
> "ompower is a suspend handling daemon talking dbus installed by default since 
> Om 2008.8"
> but apparently not by QtExtended (and /usr/share/dbus-1/services/ is empty).
> 
> QtExtended offers (formerly QCop and now Qtopia IPC based) services 
> (http://doc.trolltech.com/qtextended4.4/services.html),
> which include a pre-defined suspend service 
> (http://doc.trolltech.com/qtextended4.4/suspendservice.html)
> (also cmp. /opt/Trolltech/Qtopia/services)
> The qcop command-line tool 
> (http://doc.trolltech.com/qtextended4.4/qcop-tool.html) should also be 
> capable to do the job:
> export LD_LIBRARY_PATH=/opt/Trolltech/Qtopia/lib
> export PATH=/opt/Trolltech/Qtopia/bin:$PATH
> 
> qcop service send Suspend 'suspend()'
> 
> 
> There might be more ways to do a suspend...
> 
> 
> What is the proper way to suspend the Freerunner for QtExtended?
> (Probably the last one. But is there more to be done?)

Proper way is to just let it suspend on it's own.

> 
> The next question will be how to configure the lock icon (padlock.png for 
> finxi)
> on the home screen (the rightmost icon on the bottom) to be connected with the
> suspend command/service... (instead of Screen Lock)

You would have to edit the code and recompile, as this is not how the screen 
lock currently works.


-- 
Lorn 'ljp' Potter
Software Engineer, Systems Group, Qt Software, Nokia Pty Ltd



___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


[QtExtended] Proper way to invoke suspend?

2009-01-04 Thread Martin Bernreuther
Hello,

on a Linux system (with ACPI) it is possible to invoke a suspend through

echo -n mem > /sys/power/state

(see http://ols.fedoraproject.org/OLS/Reprints-2008/brown-reprint.pdf (chapter 
5, 6th page 42);
 http://www.linux.com/articles/54610, 
http://acpi.sourceforge.net/documentation/sleep.html,
 http://www.columbia.edu/~ariel/acpi/acpi_howto.txt (section 23.2),
 
http://www.linux-magazin.de/heft_abo/ausgaben/2004/02/einschlaf_hilfen/(offset)/2
 (german),...)

Qt Extended on the Neo Freerunner
(http://moko.mwester.net/download/uImage-gta02-g291a9d50_mwester-stable.bin +
 
http://other.lastnetwork.net/OpenMoko/qtextended-4.4.2-gta02-rootfs-release-working-with-SystemRingTones.jffs2)
seems to be APM based
(/sys/power/state is also present and `echo mem > /sys/power/state` works)
and `cat /proc/apm` shows some information.
Working on a console (if you have one, which is not default for QtExtended), 
section 12.18.8.1.1
of 
http://www.uibk.ac.at/linuxdoc/LDP/LDP/Mobile-Guide/html/mobile-guide-p2c1s8-apm.html
shows a nice way to keep an eye on the battery state through the command prompt:
export PS1="\$(cat /proc/apm | awk '{print \$7}') \h:\w\$ "
Invoking a suspend on a APM based systems can be done with

apm -s

I noticed /etc/apm/suspend.d/gsm_suspend, which executes
echo "1" >/sys/devices/platform/neo1973-pm-gsm.0/flowcontrolled
Is this also needed for a proper suspend? (It seems to work without that.)


In contrast to the information about e.g. how to turn on/off LEDs 
(http://wiki.openmoko.org/wiki/FreeRunner/Buttons_and_LEDs)
I didn't find this in the OpenMoko Wiki. Maybe because OpenMoko offers the
"Ompower" Power management daemon:

http://wiki.openmoko.org/wiki/Ompower

This service seems not to be available for QtExtended:

r...@om-gta02:~# dbus-send --system --print-reply --dest=org.openmoko.Power / 
org.openmoko.Power.Core.ListResources
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.openmoko.Power 
was not provided by any .service files

which is not astonishing since
"ompower is a suspend handling daemon talking dbus installed by default since 
Om 2008.8"
but apparently not by QtExtended (and /usr/share/dbus-1/services/ is empty).

QtExtended offers (formerly QCop and now Qtopia IPC based) services 
(http://doc.trolltech.com/qtextended4.4/services.html),
which include a pre-defined suspend service 
(http://doc.trolltech.com/qtextended4.4/suspendservice.html)
(also cmp. /opt/Trolltech/Qtopia/services)
The qcop command-line tool 
(http://doc.trolltech.com/qtextended4.4/qcop-tool.html) should also be capable 
to do the job:
export LD_LIBRARY_PATH=/opt/Trolltech/Qtopia/lib
export PATH=/opt/Trolltech/Qtopia/bin:$PATH

qcop service send Suspend 'suspend()'


There might be more ways to do a suspend...


What is the proper way to suspend the Freerunner for QtExtended?
(Probably the last one. But is there more to be done?)

The next question will be how to configure the lock icon (padlock.png for finxi)
on the home screen (the rightmost icon on the bottom) to be connected with the
suspend command/service... (instead of Screen Lock)

Thanks,
Martin Bernreuther
-- 
Martin Bernreuther  martinb...@web.de

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community