Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-29-2011, 11:14 AM   #1
fbdev
fbdev
fbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel is
 
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
how to tell when kindle sleeps/wakes up

does anyone know a way to programmatically determine when the kindle goes to sleep and wakes up?

i was looking at /dev/luigibutton but it is a bit difficult to decipher the ioctls for the device.
has anyone solved this problem?
fbdev is offline   Reply With Quote
Old 07-29-2011, 04:08 PM   #2
mark03
Enthusiast
mark03 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Device: Kindle 3 wifi
Once the Kindle goes to sleep, won't your program be sleeping too?

Or do you mean to "register" your app somehow so it gets notified during the going-to-sleep process?

Keyword searches in the kernel source might turn up something useful. I don't have the link handy, but there is a complete set of mainline->amazon kernel diffs for the K3 posted somewhere. The only hitch is that they have many versions of their custom hardware drivers in the bundle, for each Kindle version and also for some internal dev platforms. Looking for "luigi" is a good rule of thumb, but it can still be tricky to know you're looking at the right code.
mark03 is offline   Reply With Quote
Advert
Old 07-29-2011, 04:11 PM   #3
mark03
Enthusiast
mark03 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Device: Kindle 3 wifi
Here's the link I was thinking of:

http://blog.rlove.org/2010/10/kindle-3-kernel.html

I found this quite useful in understanding the hardware. Still a bunch of unanswered questions, like where is the third SD-card interface the kernel claims is there? etc...

Anyway, you should at least be able to look up the luigibutton stuff and figure out the ioctls.
mark03 is offline   Reply With Quote
Old 08-01-2011, 12:03 AM   #4
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
The command "lipc-get-prop com.lab126.powerd state" will give you the power state of the device.

"lipc-probe -av" for more interesting stuff.
mobad is offline   Reply With Quote
Old 08-01-2011, 12:05 PM   #5
fbdev
fbdev
fbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel is
 
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
thanks

that was very helpful.
fbdev is offline   Reply With Quote
Advert
Old 08-01-2011, 03:22 PM   #6
mark03
Enthusiast
mark03 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Device: Kindle 3 wifi
Please forgive my ignorance, but how is it possible that that command will ever return an answer other than "device is not sleeping"? I mean, if the device is asleep, surely you can't run the command in the first place? What am I missing here?
mark03 is offline   Reply With Quote
Old 08-01-2011, 09:20 PM   #7
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
The Kindle doesn't sleep for about a minute after you turn it off.
mobad is offline   Reply With Quote
Old 08-05-2011, 09:00 AM   #8
fbdev
fbdev
fbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel is
 
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
you can run any command programmatically from a system application; 'sleep' just means the hardware is in a low-power state, i.e., the usb subsystem is powered off, the soundcard is powered off (this part is VERY annoying), the display is powered off, the radio transmitters are off, and the processor is in its lowest power state. software may be (and is!) still running in main memory. in theory, the device could be in a standby to memory or standby to disk state, but i don't think the kindle uses these features of the linux kernel (they're high latency).
fbdev is offline   Reply With Quote
Old 08-05-2011, 12:41 PM   #9
fbdev
fbdev
fbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel is
 
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
i did some investigating and found that the kindle does enter into standby (to memory) after 2 minutes in screensaver mode. logging the output of lipc:
Fri Aug 5 12:05:33 EDT 2011
active
Fri Aug 5 12:06:03 EDT 2011
screenSaver
Fri Aug 5 12:06:33 EDT 2011
screenSaver
Fri Aug 5 12:07:03 EDT 2011
readyToSuspend

some powerd properties you can control with lipc:
w Int wakeUp
rw Int preventScreenSaver [0]
rw Str logMask [0xffff0000]
w Int suspendGrace
w Int deferSuspend
rw Str logLevel [Current log level=info
(Possible levels: all, perf, debug[9-0], info, warn, error, crit, none)]
w Int touchScreenSaverTimeout
r Str state [active]
w Int abortSuspend
r Int isCharging [1]
r Int battLevel [100]
w Int rtcWakeup

for instance, if you want to wakeup the device using this command:
lipc-set-prop com.lab126.powerd wakeUp 1
fbdev is offline   Reply With Quote
Old 08-05-2011, 01:35 PM   #10
mark03
Enthusiast
mark03 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Device: Kindle 3 wifi
Cool.

Does anyone know what lipc actually is, or where it came from? I googled for it a while back and didn't find anything. It looks sort of like dbus in concept. Is it an Amazon-proprietary thing, or based off of some open-source project?
mark03 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to tell when kindle sleeps/wakes up fbdev Amazon Kindle 1 07-29-2011 11:14 AM
NC Suddenly wakes up botyok Nook Developer's Corner 2 01-10-2011 07:40 PM
While the Savage Sleeps a forensic/paranormal thriller Andrew Kaufman Self-Promotions by Authors and Publishers 14 09-03-2010 03:33 AM
My cat sleeps like this... pagansoul Lounge 85 06-02-2009 01:46 PM


All times are GMT -4. The time now is 08:22 AM.


MobileRead.com is a privately owned, operated and funded community.