View Single Post
Old 12-27-2011, 12:28 PM   #1
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Eink Framebuffer Update Trigger

Kindles have a built-in eips command that can clear the screen, can print to the screen, can scroll the text screen, and can display PNG files to the screen. Text is limited to 50 lines of 40 characters. It is used by the diagnostic mode scripts, and its output can be viewed in diagnostic mode menus and tests. It can also be used from scripts and native mode apps while the normal GUI framework is running, and can even display contents on top of normal GUI screens.

In my apps, I reset the screen to its previous contents by saving a copy before I change it, then before my app exits I copy the saved contents back onto the framebuffer, and then I trigger a display update.

You can find the bits/pixel and bytes/line with:
eips -i

On the older kindles a framebuffer display update can be triggered with an ioctl call from within a native app. Scripts can trigger a display update with:
echo 1 > /proc/eink_fb/update_display

On the kindle touch, the only way I have found (so far) to trigger a framebuffer display update is:
eips -g . > /dev/null

On the kindle touch, the framebuffer is 8 bits/pixel, 608 pixels wide (right 8 pixels not visible). On the kindle 4 (non touch), the framebuffer is 8 bits/pixel, 600 pixels wide. On prior kindles, the framebuffer is 4 bits/pixel, width depending on model. Display orientation also affects width.

From a script, you can copy the framebuffer like this example for a kindle touch:
dd if=/dev/fb0 bs=608 count=800 > /mnt/us/fb0.raw
and restore it to previous contents like this:
cat /mnt/us/fb0.raw > /dev/fb0
eips -g . > /dev/null


A little tip: raw 8-bit images copied directly from the framebuffer with dd can be loaded into IrfanView as a raw image. IrfanView will ask for bit depth and line width (8 bits and 608 pixels for kindle touch, 8 bits and 600 pixels for the K4NT). For older kindles with a 4-bit framebuffer, you could tell IrfanView that you have 8-bit images that are half-width (300 instead of 600), and see the image good enough to get an idea of what it represents.

Request for assistance: I would like to find a better way to trigger a framebuffer update to the display, especially one that uses an ioctl call. If anybody has found a better way, please let us know. Thanks.

Last edited by geekmaster; 06-09-2012 at 10:42 AM.
geekmaster is offline   Reply With Quote