Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-24-2011, 03:55 PM   #31
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
OK, I've optimized my open book detection just about as much as I can with this method.
The only faster way using file descriptors would be to assume that the file descriptor will stay constant even after it is removed, I don't think that's a valid assumption though.

Flash disabler
http://pastebin.com/FvVppgEe

Progress bar remover
http://pastebin.com/aMD48vNv

If anyone has any ideas/improvements/suggestions, please share.

Last edited by mobad; 07-24-2011 at 09:59 PM.
mobad is offline   Reply With Quote
Old 07-24-2011, 06:36 PM   #32
Enthir
Junior Member
Enthir began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2011
Device: Kindle 3
I tried your latest changes and I am getting full menu corruption in all books and on the home page almost every time I try to pull the menus up (sym, menu, Aa etc). I am also getting faded passages in my books after page change. I am on a kindle 3 wifi.

I realize that I am too much of a noob to actually be of any help and will be uninstalling this for now.
I love the work you are doing and will try to not use this until (if) there is a version that works more or less flawlessly.
Sorry to be a bother.

Last edited by Enthir; 07-24-2011 at 06:43 PM. Reason: noobing
Enthir is offline   Reply With Quote
Old 07-24-2011, 07:30 PM   #33
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
Whoops, I was mainly testing the progress bar disabler script and I forgot to add the menu fix to the flash disabler.
http://pastebin.com/FvVppgEe
That should work (I've fixed the other post too).

It doesn't work very well though...
It looks nice most of the time but it's slow and messes up a a lot.
There is that faster way that I was using in an earlier script but it doesn't look as good.

Progress bar disabler works well though.

Update:
Made the progress bar remover a bit better by buffering the first row blank.
http://pastebin.com/aMD48vNv
Just hit menu and the progress bar will appear again.

Last edited by mobad; 07-24-2011 at 09:59 PM.
mobad is offline   Reply With Quote
Old 07-25-2011, 02:34 PM   #34
khmann
Enthusiast
khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.
 
Posts: 43
Karma: 1658
Join Date: Jul 2011
Device: b006
Quote:
Originally Posted by mobad View Post
By the way, the reason that your script worked so well with timing was because it's running as fast as the Kindle can run it which will drain the battery and slow things down.
I respectfully disagree... the script blocks on reading from the pipe when it is empty, confirmed by top. I am happy that you've taken the concept and made it more functional.

To summarize for others hacking at this, there seem to be 3 different trade-offs between speed and quality/effect. I maintain that waiting for the kernel to tell us when it has been requested to update a page is a more reliable, quicker option, but keyinput detection is almost certainly still required to deal with the artificats the menus cause.

I think the "next level" in hacking all of this would be to somehow bypass the kindle doing any kind of refresh on its own, and build our own transition/refresh image - like the eink hardware invert-flash, but subtler, and more intelligent, draw that, and then put up the regular page. Perhaps changing the "power level" of the panel to "sleep", convincing the eink that the page was full black (even though it never updated), and then letting it over-clear the display (all actions on eink seem relative anyway).

anyway, mad props to everyone here; Amazon will probably implement something along these lines in k4 if for no other reason that Nook uses it as a marketing ploy. I think I actually prefer it to flash every time than just once every 6 pages because I get used to it.

If Amazon does bring something like this to future products, it would be really cool if they back-port this feature... seems like there is no hardware reason it can't be done. And for them to show a willingness to support their older products would improve their image in my mind - nobody likes to buy a product that will be abandoned when the new model is released.
khmann is offline   Reply With Quote
Old 07-25-2011, 11:01 PM   #35
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
Yup, you are right. I was testing with /var/log/messages itself, which would cause "head -n1" to run as fast as the Kindle can, as I didn't want to change the config file.

Yeah, there is no reason why the Kindle can't do no flash updates, in fact it does when you move menus and other little things that have to be done quickly.

I've combined the two methods now and it works perfectly every time (unless you change the page really quickly.)
First it waits for a key then it checks if a book is open then it checks for a change in /var/log/messages (the pipe method is much better but I can't think of a better method that won't require changing a system config file)
It should work perfectly in menus outside of a book but it will mess up book menus.

Anyway here they are:
Progress bar remover
http://pastebin.com/9fS9hKQ8
Flash disabler
http://pastebin.com/pS83izMi
mobad is offline   Reply With Quote
Old 07-25-2011, 11:59 PM   #36
stoke451
Junior Member
stoke451 began at the beginning.
 
Posts: 2
Karma: 12
Join Date: Jul 2011
Device: Kindle 3 Wifi KSO
Quote:
Originally Posted by mobad View Post
It should work perfectly
The last two updates have been messing with the screensaver for some reason. Gives me just a blank white screen when the kindle goes to sleep. On resume, the screensaver will flash once before returning to the book.
stoke451 is offline   Reply With Quote
Old 07-26-2011, 12:17 AM   #37
khmann
Enthusiast
khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.
 
Posts: 43
Karma: 1658
Join Date: Jul 2011
Device: b006
Quote:
Originally Posted by Enthir View Post
not use this until (if) there is a version that works more or less flawlessly.
Sorry to be a bother.
Mobad's latest pastie is _really_ close : ) And you always have [Alt][G] if things really get bad...

Quote:
Originally Posted by stoke451 View Post
The last two updates have been messing with the screensaver...
Confirmed; because the eInk controller is left in a funny mode - and then possibly the kindle is putting the eInk panel into a deeper state of sleep before the script gets a chance to refresh it.

My GF doesn't like the fadeout to white - she prefers the previous algo (which _I_ still can't make work like this : ) and then we get too dark screensaver instead of too light
Quote:
echo -n -e "19 0\n18 0\n19 7\n" > /proc/eink_fb/update_display
So maybe give the user a choice between dark refresh and light refresh; wonder if one works better on non-k3s?

A thought about Mobad status disabler... I would be interesting to see some benchmarks on the eInk... does it take longer to change the screen from full black to full white then to go from 25% to 0? Visually yes, but can the display actually be updated quicker? What if you only change one pixel, does it take the same time as the whole screen? I wonder if we could eek a microscopic performance improvement by only updating the center 580x780 with an AreaRefresh? Not that it'd be worth the trouble mind you...

Last edited by khmann; 07-26-2011 at 12:24 AM.
khmann is offline   Reply With Quote
Old 07-26-2011, 02:49 AM   #38
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
Heh, I never actually tested the screensavers.

waitforkey doesn't detect the power switch unfortunately so I'll have to find a way to detect the power state (unless anyone else knows a method)
Err just found one "lipc-get-prop com.lab126.powerd state"
(Btw "lipc-probe -av" shows some pretty cool stuff.)

I'm still not sure how I would detect a state change though...
I'd really rather not have to check every second or something, even then does it really matter?

I like the look of the current one better but I don't like the speed.
The "echo -e "19 0\n18 0\n19 7 > /proc/eink_fb/update_display" one creates blurry text.
I actually like "echo -e "18 2\n19 7 > /proc/eink_fb/update_display" the most even though it creates blocky text.

About the speed of the eink, it seems to depend mainly on the complexity.

You can play around with:
time eips -p
time eips -p 255 (well 0 to 255 but 255 looks really cool...)
time eips 10 10 "Random text"

Everything but the first one takes 0.07s and the first one takes 0.24s

There is some stuff that I found interesting but didn't have time to check out (and probably won't check out for a while):
/sys/devices/platform/eink_fb.0/promote_flashing_updates
/sys/devices/platform/eink_fb.0/eink_debug
/sys/devices/platform/eink_fb.0/vcom
(Those were from /etc/init.d/video)
/etc/init.d/functions
Hmm... in the functions file there is something that checks for the existence of /INTERNAL_FEATURES_ENABLED__DO_NOT_RELEASE I wonder what that will enable...

Last edited by mobad; 07-26-2011 at 09:56 PM.
mobad is offline   Reply With Quote
Old 07-27-2011, 01:20 AM   #39
khmann
Enthusiast
khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.
 
Posts: 43
Karma: 1658
Join Date: Jul 2011
Device: b006
Quote:
Originally Posted by mobad View Post
detect the power switch... detect the power state...
? wait for 10 minutes of inactivity, and then schedule a full flash on the next update?

Quote:
Originally Posted by mobad View Post
I actually like "echo -e "18 2\n19 7 >
oh jesus... we have to name them : ) quick-flash? I like this mode also... it's hella fast, and on some lucky material for me it is clearer. Also consider just straight 19 7 without 18 2. sometimes dark is good.

the other two, light-flash and dark-flash? I too prefer LF over DF, visually, but it's almost as slow as stock. DF however seems to have low contrast.

and as if we didn't already have enough useful choices, if you do "area updates", you gain 1 more magic update mode - Invert (21)... not that I see a lot of use right now. 3 0 0 599 799 21 > update_display.
...
reading diag /opt/eink/scripts closer, it looks like lab126 is using "1" how we have been calling "18 0" to refresh the display. Suggest to follow their lead.

Last edited by khmann; 07-27-2011 at 01:23 AM.
khmann is offline   Reply With Quote
Old 07-27-2011, 02:20 AM   #40
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
Quote:
Originally Posted by khmann View Post
? wait for 10 minutes of inactivity, and then schedule a full flash on the next update?
...
and as if we didn't already have enough useful choices, if you do "area updates", you gain 1 more magic update mode - Invert (21)... not that I see a lot of use right now. 3 0 0 599 799 21 > update_display.
10 minutes of activity wouldn't work by itself as people can still manually turn it off.
Since I can't detect the keypress I would have to basically poll the power state every X seconds and then issue a page update or something.
I really want to avoid that though...

Hmm with that invert option I think I've figured out how the Kindle updates the page. First it loads the page into the buffer then it runs a very quick invert then back to white.

If go to the next page and check "/proc/eink_fb/recent_commands" you see a bunch of commands being sent and I think they are numbers...
I tried just copying the characters and sending but that didn't work. Converting to base 10 and sending the ascii didn't work so I'm thinking they need to be sent as actual numbers not text.

I found something interesting as well.
After a refresh /proc/eink_fb/power_level shows on for a minute, but you can echo 2 > /proc/eink_fb/power_level to make it go in to standby.
I wonder if that would save battery life? (I doubt it though as I would think Amazon would have done that if it did) I see no difference in page refresh time when it's on or in standby.

Edit:
Hmm if you run the ";debugOn" then there are a lot more specific eink log messages in /var/log/messages

Last edited by mobad; 07-27-2011 at 08:00 PM.
mobad is offline   Reply With Quote
Old 08-09-2011, 06:16 AM   #41
meem
A Reader who can think..!
meem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileRead
 
Posts: 255
Karma: 65662
Join Date: Jul 2010
Location: Earth Planet
Device: Kindle 3 WiFi - Kindle DX (B004)
I tried khmann's script (from updated first post): http://pastebin.com/pS83izMi

and seaniko7's scripts: "test" and "exittest" (from post 14): http://db.tt/4godtYa

Both methods are very bad with me, especially with PDF files which was very deformed !

Sorry, but that what happened to me.
I tried them on Kindle 3.1 (B008).

Maybe I should use Duokan for this feature, or I plan to replace Kindle with Nook Touch or Kobo Touch..
meem is offline   Reply With Quote
Old 08-19-2011, 10:27 PM   #42
meem
A Reader who can think..!
meem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileReadmeem has read every ebook posted at MobileRead
 
Posts: 255
Karma: 65662
Join Date: Jul 2010
Location: Earth Planet
Device: Kindle 3 WiFi - Kindle DX (B004)
So, no comment ?!

How can I restore page location for Amazon books?
I just lost them after I tried those scripts.
meem is offline   Reply With Quote
Old 08-20-2011, 06:18 AM   #43
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
Just try restarting the Kindle.
If that doesn't work it's not the scripts.

Yes the scripts are bad, it was more of a proof of concept for me and I think it makes things much worse.

I do like the progress bar remover script though.

I don't even notice the black flash anymore and I kind of like it, as if you look away from the book for a split second and change the page you don't know if you actually switched the page and the black flash makes the page turns more noticeable for me.
mobad is offline   Reply With Quote
Old 08-20-2011, 10:17 AM   #44
khmann
Enthusiast
khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.
 
Posts: 43
Karma: 1658
Join Date: Jul 2011
Device: b006
: ) I do not think the scripts are "bad", but results are algorhythm/content-specific, and I do not use them myself either. I still think it would be possible to do a "very-good" job by calculating a transition image less jarring then the full-screen-invert-flash, but it will be awhile before I personally get around to messing with that. I'm curious to see what K4 brings... And if I ever run across a copy of Nook STR eInk firmware I'll probably try loading that into the panel.

Regarding "hide progress bar", I wonder if we could just lie to the device and say resolution was 800x650, get it to draw the bar off-screen?
khmann is offline   Reply With Quote
Old 08-20-2011, 08:51 PM   #45
mobad
Enthusiast
mobad began at the beginning.
 
Posts: 27
Karma: 23
Join Date: Jan 2011
Device: Kindle 3 WiFi
But it's not a firmware issue, the Kindle can do non-flashing updates fine and does them all the time with menus.
It's the actually book reader program that adds the image in to the buffer then calls something to update the screen. (Or so I believe)

If someone was willing to reverse engineer the Kindle book reader program then maybe release a patch or something... I'm not sure about the legality of a patch though.

I suppose it's possible if you make the user decompile and edit the file themselves...
mobad is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-650 Flashing the firmware ShellShock Sony Reader Dev Corner 167 08-08-2011 02:34 AM
Classic Why is my screen flashing at random intervals? elizilla Barnes & Noble NOOK 1 04-15-2011 11:41 AM
Opus Flashing LED Jorick Bookeen 3 11-19-2010 07:54 AM
Kobo screen flashing when plugged in but no image! Weblady Kobo Reader 2 05-11-2010 08:27 PM
Flashing screen question johngreen99 Which one should I buy? 6 01-12-2008 07:54 PM


All times are GMT -4. The time now is 06:24 PM.


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