![]() |
#31 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
UPDATE 2: Another complication... When I copy a raw 600x800 image to the framebuffer with dd, which was saved from a JPG image using IrfanView, it displays CORRECTLY on my K5(touch) using this command:
PHP Code:
![]() UPDATE 3: Okay, I just ran the "hoser" demo below, then I used the above command copying from /tmp/wbo instead of from barn.raw, and the result was ONLY 16 COLORS on the eink display (even though the original was a full color JPEG, and it was converted directly to 8-bit grayscale with IrfanView). That means that IrfanView MUST HAVE dithered it down to 16-colors even though I selected 256 color. The wb0 screenshot below shows that it really does contain 256 different shades of gray when viewed on a CRT/LCD display. Hmm... Does this really need to be this complicated? ![]() I just loaded barn.raw into Irfanview and did its histogram function -- 16 spikes showing it only has 16 colors. Hmm... But it looks pretty darned good for 16 colors (amazing how well dithering works when you have tiny little pixels like on these eink displays). To test K4(mini) and K5(touch) 8-bit framebuffers, I just changed my paldemo program to put the 0-255 color values directly into the framebuffer, and although a SCREENSHOT of the resulting framebuffer shows all 256 shades of gray, the eink display only show 16 shades of gray. Worse, they are not balanced: values 0-17 display as pure black, but ONLY value 255 displays as pure white. And what is VERY STRANGE, by viewing the eink screen in a bright light with magnification, you can CLEARLY see that those shades of gray are created by the eink drivers with an ordered dither between two adjacent shades of 4-bit gray. Now that really begs the question: IF the kindle hardware can only do 16 shades of gray AND the eink drivers use an ordered dither to get JUST THE RIGHT shade of gray, then WHY did they not just dither ALL 256 shades of gray? This lack of REAL 8-bit support astounds and befuddles me. ![]() Here is a screenshot copied from the framebuffer, and a photo of the K5(Touch) eink display (differences are most visible on the bottom "white" row due to CRT/LCD display gamma): Spoiler:
UPDATE: I just tested this on a K4 booted from main (with the old eink drivers). It acts differently from a K3 and from a K5 (not unexpected). Each line of the displayed palette is a solid color, so the color quantizing is balanced, but it has ANOTHER problem. The rows for 4-bit colors 11 and 12 are identical, so it can only do 15 shades of gray, not 16. However, I see no dithering, so it appears to be using the shades of gray provided directly by the hardware, with no color or gamma correction like the newer eink drivers appear to be doing. The K4 also displays the palette "upside down" with the whites at the top (values 0-15) and the blacks at the bottom (values 240-255). This just keeps getting more "interesting". Normally, these details are hidden from us inside eips and the Xorg color management layers. Direct hardware access (or at lease low-level framebuffer access) often has these complications, but there is real personal satisfaction obtained by overcoming them. ![]() Last edited by geekmaster; 04-23-2012 at 09:39 PM. |
![]() |
![]() |
![]() |
#32 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
hoser-2.0 - eink demo, all-new dither, K3 speed++
MAJOR UPDATE:This version adds the eink update method used in sparkle-1.0 (which is WHY it was so fast). On a K3 there is such a HUGE speed increase, it deserved a major version number upgrade. K3 owners - rejoice!
All new eink dither routines based on total redesign to support hybrid K4 main boot eink mode (K3 eink drivers but 8-bit framebuffer). These dither routines are optimized to dither an entire framebuffer (not just a moving object), so every time you see any movement on the display, that was just the result of an entire screen of dithered pixels being created from the image in /tmp/wb0. This demo runs full throttle with no delays, so it shows some eink artifacts ("ball in tube" after-images on newer kindles), but it is an interesting effect. The older "non-Pearl" eink display on the DX shows a DIFFERENT "ball in tube" artifact that leaves a white spot ghosted on the surface of the hoses (caused by a sudden black-to-white transition). The speed of this demo is limited ONLY by the system eink update logic. The dither routines can go a lot faster than the eink display. EDIT: The K5(touch) is MUCH faster than the K4(booted from main), and the K3 is much slower than the K4 (UPDATE: hoser-2.0 runs about the same speed on the K3 and K4), and the DX is even slower than that. You really should see it hustle on the K5(touch). ![]() This program writes all updates to an 8-bit virtual framebuffer using 256 shades of gray. While it is running, you can use dd to copy 256-color screenshots from /tmp/wb0, or you can copy dither screenshots from /dev/fb0. The virtual framebuffer (wb0 work buffer) is updated as fast as the program can fill it, but this will be speed-limited in future code. The screenshots: Spoiler:
The source code: Spoiler:
Enjoy and learn! ![]() EDIT: This demo really needs to be viewed on a K5(Touch) to appreciate the speed of my new dither routines. Somebody should post a youtube video showing it running on a K5. I will give a bunch karma points for a youtube link. ![]() NOTE: I just realized that the gmlib CLOSE function should probably delete the workbuffer file from RAMdisk (rm /tmp/wb0). It is consuming nearly 1MB of RAM on a 1200x824 DX or DXG, and they only have 128MB of RAM. Newer kindles use a smaller workbuffer and have more RAM, so not much of a problem. Oh well, the next version will do that if I do not forget... ![]() ![]() EDIT: I just decided to give you a little bonus golden nugget of knowledge. ![]() ![]() ![]() Last edited by geekmaster; 04-24-2012 at 02:22 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
|
Hi,
This looks really cool. I only have K3 but it is pretty fast. So the speed is completely limited by full screen update, correct? Now you can play videos easily if you put successive frames in the image buffer, correct? Thanks, James |
![]() |
![]() |
![]() |
#34 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Perhaps the reason that I like dithered eink images is that I am a big fan of charcoal drawings on textured paper. That is my favorite artistic medium, closely followed by eink.
![]() |
![]() |
![]() |
![]() |
#35 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
I got about 5 FPS fullscreen, or 12 FPS updating only a 640x360 rectangle (the size of old DivX movies). For "talking heads" video (mostly dialog, like TV talk shows), you just need to update mostly the face area at high speed. Also, you can pre-filter the video to smooth any changes in time and space (averaging successive frames in a "long persistence" way), and other video filter tricks such as "deshaking". That makes it a LOT more eink-friendly. The key is to minimize (or ignore) unimportant changing areas on the screen, so the eink drivers do not fall behind the video causing nasty (self-correcting over time) display artifacts. On the K5, you can update as fast as you want, but if you do it too fast the eink drivers can just shut down for your process (white screen). Opening another SSH session and doing eips '' commands shows that the framebuffer is changing, because the NEW process still gets eink requests honored. It appears that the eink drivers detect "abusive" eink updates and start ignoring requests from that process. So we need to add delays before eink update requests, in some cases. Last edited by geekmaster; 11-25-2012 at 11:01 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#36 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
![]()
UPDATE: The demo kernel from the original sparkle-1.0 was added to the "dithermation" framework used by other demos in this thread. Now it works on all the eink kindles! On the K4(touch) the trail of ghosts is as long as on the old DX (but moving much faster).
![]() Here we have a little piece of geekmaster history, dusted off and polished up a bit (a bunch of commented-out code removed). It is relevant now because it broke the bounds of what many still believe is even possible on a Kindle 3. Check out the frame rate. ![]() This program was created in 2011 November, when geekmaster got his first kindle. It was his first kindle program (after the traditional "Hello World!" program to test the build tools). It formed the basis of his eink opinions expressed in mobileread forums since the beginning. This demo uses spatiotemporal random dithering. The "temporal" aspect appears as "sparkle" on the eink display. This method was abandoned for displaying live video because of significant display artifacts, which are very interesting from an "eye candy" point of view, so it is being presented for public viewing here and now. This predates the newer kindles with 8-bit framebuffers (K4 and K5), but it works great on the DX, DXG, and K3. UPDATE: the "new and improved" version 2.0 now supports ALL eink kindles! The interesting effect here is that on newer Pearl eink displays, the moving objects have a "snake-like" trail of alternating light and dark ghosts following them, taking two seconds to fade out. On the DX with the older eink technology, the trail of alternating fading ghosts gets so long it occupies much of the display, making a rather dazzling (but unintended) visual effect. sparkle-2.0 source code: Spoiler:
sparkle-1.0 source code: Spoiler:
Enjoy and learn! ![]() ![]() Last edited by geekmaster; 04-24-2012 at 02:07 AM. |
![]() |
![]() |
![]() |
#37 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
![]() MAJOR UPDATE for K3 owners! The "partial area" updates used in Sparkle-1.0 (for which the source code had been lost and was recently found), are MUCH faster on a K3 than using eips, and much faster than using the /proc update interface. After replacing the eink update method for 4-bit screens (DX, DXG, K3), hoser-2.0 is many times faster on a K3, EVEN THOUGH it is not recommended for FULL SCREEN updates like this. That means that it will be EVEN FASTER if we use it to only update known changed (dirty) areas of the screen. It does not make the DX or DXG run any faster though -- they use older 2.x firmware. Perhaps it would be faster on a DXG that was updated to 3.x firmware. If you have a K3, go get hoser-2.0 now! Soon, I will update all the old demos to run MUCH faster on the K3. Things will only get BETTER with this new change in update method. Enjoy! ![]() ![]() Last edited by geekmaster; 04-24-2012 at 01:19 AM. |
![]() |
![]() |
![]() |
#38 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 16
Karma: 25544
Join Date: Feb 2012
Device: Kindle 3
|
This is awesome on so many levels. After running sparkle-1.0, I was impressed, but after running hoser-2.0 on my K3, my mind blown
![]() |
![]() |
![]() |
![]() |
#39 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Okay, now sparkle-1.0 has been updated to use the "dithermation framework" so it supports ALL the eink kindles (see sparkle-2.0 above). Now you can see that cool K3 eye-candy on all the kindles. On the K4, there are almost no ghost trails though -- just the sparkle.
![]() We need to update the old demos to 2.0 version just like I did for hoser -- just a few lines of code in a couple of places. Use a version comparison tool to see the changes in hoser-1.0 and hoser-2.0, then do those to the other demos too. I will be away most of the next day or so. I hope to see 2.0 versions of ALL the demos posted here when I get back. ![]() Remember, this huge speed increase only affects the K3. I *LIKE* where this code is headed. Remember, *demos* are just toys to show what this code can do and how to do it, but the real purpose of this code is to use it in *tools*. ![]() ![]() Last edited by geekmaster; 04-24-2012 at 02:02 AM. |
![]() |
![]() |
![]() |
#40 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
When are we going to see some youtube videos of these things running? Screenshots are a very poor substitute for the DITHERMATION demos. Dithered animation is just too cool -- it is just like seeing a charcoal drawing come alive!
Let's see something like this, except videos of the "Dithermation" demos from this thread: By the way, the reason that the face is being drawn upside-down in the above video is to bypass the facial-recognition filters in the artist's visual processing centers, so that fine detail can be seen and reproduced, which is normally well below a human's conscious level of awareness. The end result is a much more accurate representation containing much more subtle accurate detail that is well below conscious awareness but which greatly increases image fidelity, as can be seen in the final image. ![]() Last edited by geekmaster; 04-24-2012 at 09:44 AM. |
![]() |
![]() |
![]() |
#41 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
I actually tried this partial update method now used in hoser-2.0 awhile ago on older animation code and it was SLOWER than eips and the /proc interface. It could be that to use it effectively for full screen updates, you may need to double-buffer by using a virtual framebuffer like I did in hoser (/tmp/wb0) where all the changes are written, and then when time to update the eink it gets dithered to the real framebuffer (/dev/fb0). I also thought of another potential speedup by relieving even more contention between my code and the system eink drivers when using the same /dev/fb0 buffer at the same time. I could use a second virtual framebuffer with identical dimensions to the real framebuffer, then just before an eink update I would dither to that second virtual buffer instead of to /dev/fb0, and only at the last instant do a fast COPY of the entire dithered virtual buffer to the real /dev/fb0 framebuffer. At least, I *think* that should make it all faster, and faster is better, right? ![]() ![]() Last edited by geekmaster; 04-24-2012 at 03:32 AM. |
|
![]() |
![]() |
![]() |
#42 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 128
Karma: 5792
Join Date: Mar 2011
Location: Australia
Device: Kindle 3
|
I'm a total noob. What do these things do and can I play with them on my K3?
|
![]() |
![]() |
![]() |
#43 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
The individual demos themselves just draw pixels on the eink display, so they are safe to run. They draw cool things with animated effects. Just download the attachment and run the executable (the file without the ".c" on the end of the filename) on your kindles. And watch what they do. Usually they are named in a way that hints at effect they will show you. Some of them have a screenshot that shows a sample of what you see at some time during the demo. Be sure to click the "Show" buttons in these posts to see what is hidden behind them. If you read the comments in the first few lines of source code for each demo program, they say that they work on ALL eink kindles. Many of them also say that in their posting. You should read the posts first, then scan the code for any comments that may give a clue, then run the program on your kindle (or just skip the reading and run the program to enjoy the unfolding surprise). Each demo has custom code that is contained in a function called from main(). The demo function calls functions provided by my library code that does the "heavy lifting" to give you simple access to all eink kindles. The organizing of my function library is evolving. I call the whole package of dithered animation support "Dithermation". The library of all of geekmaster's function is called "gmlib" and that includes a larger code base for everything, not just eink support. What else can I say? ![]() Last edited by geekmaster; 04-24-2012 at 09:28 AM. |
|
![]() |
![]() |
![]() |
#44 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7
Karma: 2614
Join Date: May 2012
Device: Kindle Touch
|
Interesting Side-effect of your algorithms: I ran first the Hoser demo on Kindle Touch, and after that tried the Sparkle demo. Wenn running the second, the lower part of the screen still showed the rest of the "Hoser" image - one could leaf through a book and see for a short moment the page and then again the lower part was overwritten with the Hoser image and the top part contionued to scribble the Sparkles...
Impressive speed! |
![]() |
![]() |
![]() |
#45 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Troubleshooting Kindle and math formula | DrShakalu | Amazon Kindle | 12 | 12-11-2011 07:25 AM |
Formula Plots | PuxyYunm | General Discussions | 9 | 05-15-2011 04:19 AM |
Demo: Jetbook mini official demo | bookwarm | Ectaco jetBook | 36 | 09-21-2010 12:18 PM |