![]() |
#1 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
geekmaster formula 42 (the dithermatron demo)
UPDATE: Now that I debricked my K4, I just realized that when I run SSH from wifi, the pixels are the wrong color! Black and white are reversed. The cosmegg demo draws a BLACK egg! I am certain that it draws a white egg when run from diags SSH. My "geekmaster formula 42" assumes that 8-bit framebuffer has black value 0 pixels 4-bit framebuffer has value 0 white. Now the K4 does it BOTH WAYS with a 8-bit framebuffer -- sometimes 0 is white, and sometimes 0 is black. Hmm... Not nice. :
UPDATE 2: I figured this out by putting all the eink fixed and virtual vars for all eink kindles in a spreadsheet and comparing them. The old eink_fb device driver used by DX, DXG, K3, and K4main uses white value 0, but the mxc_epdc_fb device driver used by K4diags, K5main, and K5diags uses black value 0. That means that I when I initialize my eink vars I need to set my black and white color values based on the eink driver and not the bits-per-pixel like I am now, but the formula breaks with the 8-bit inverted. This is more complicated than I thought. Why did the k4 booted from main (which I was not using before -- I used diags SSH) have to be SO different from all other kindles, when diags was just fine? UPDATE 3: K4 main boot has another eink complication. If supports the /proc eink updates like other devices that use the old driver, but accessing the procs does not insert the delays as it did on K3 and earlier. So it needs to delay like the non-proc eink updates. K4 acts more like a K3 in main boot, but more like a K5(touch) in diags boot. Spoiler:
I spent a lot of time watching this graphical animation demo program run, and you might too. It gets much faster as it runs to completion, so it is worth watching "all the way" at least one time. Feel free to modify this code to do OTHER cool graphical stuff, now that we have fast "grayscale" pixels to play with (and easy to use, too). Executable binary demo program in download below. Enjoy and learn! EDIT: Because the speed is determined by the display update routines, you really need to watch this on the newer K4(mini) or K5(touch) to see it run at full speed (less than 2 minutes to completion). But it runs okay on a DX too -- just not in "real-time". ![]() Last edited by geekmaster; 01-10-2013 at 07:08 PM. |
![]() |
![]() |
![]() |
#2 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 59
Karma: 57554
Join Date: Jan 2012
Location: Romania
Device: Kindle Touch
|
![]()
The animation was fast. Quite a lot of fps. I like where this is going. Who said eInk is slow?
![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 99
Karma: 30196
Join Date: Dec 2011
Device: Kindle Touch
|
Awesome as always. I am glad you share your knowledge with us, GeekMaster!
By the way, did you notice any valuable changes (or maybe even quirks) in the eips utility on the latest KT firmware update? Thanks in advance. |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 58
Karma: 63518
Join Date: Apr 2012
Device: KT
|
E-Ink allways makes me think about Etch a Sketch so: I'm wondering if heavy animations and a lot of refreshes will "damage" the screen?
We already have seen Videos playing on E-Ink screens, but they are not designed for that - so can E-Ink handle that? (Other examples of similiar behaivior would be a flash-memory or a light bulb) |
![]() |
![]() |
![]() |
#5 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Scientifically, these screens use eink made of many tiny beads filled with zinc oxide powder mixed into a dark oil. Oil viscosity changes with temperature, making the zinc particles move slower when cold and faster when warm. And the oil is hermitically sealed and should not "wear out". So, I would say no, it will not wear out, and using it will only make it better. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
![]() I just tested it on my K3 and DX, and it works there. Ahh... I see that I put an old executable in the .gz file... I will rezip it... Last edited by geekmaster; 04-17-2012 at 12:36 PM. |
|
![]() |
![]() |
![]() |
#7 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Updated to v1.1, which fixes a bug that made the program on a K4(mini) or K5(touch) quit much too early (when the box touched the bottom of the screen). I also made it begin at a faster speed (as though both objects had already touched the bottom).
If you thought the incomplete run was interesting, watch this one. ![]() |
![]() |
![]() |
![]() |
#8 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
![]()
Here is another "geekmaster formula 42" demo. You can guess this one from the name.
Spoiler:
Enjoy and learn! ![]() Last edited by geekmaster; 04-18-2012 at 03:54 AM. |
![]() |
![]() |
![]() |
#9 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
cosmegg - geekmaster cosmic egg demo
Another "geekmaster formula 42" demo. And another one you can guess from its name.
![]() Spoiler:
Enjoy and learn! ![]() Last edited by geekmaster; 04-18-2012 at 12:17 PM. |
![]() |
![]() |
![]() |
#10 |
Time Waster
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 422
Karma: 289160
Join Date: May 2011
Device: Kobo Glo and Aura HD
|
What do you think is making the newer models' screen faster? the cpu? maybe we could try to overclock a little to get them even speedier...
|
![]() |
![]() |
![]() |
#11 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
On my DX, I need to run these in the background, or they quit when my telnet connection drops with "Connection closed by foreign host." error (common on long telnet connections to kindles -- ssh is more reliable).
For example, /mnt/us/dithermatron & /mnt/us/eLips & /mnt/us/cosmegg & That way it keeps running to completion even after my telnet connection drops. ![]() And it helps a LOT to clear the screen before running these: eips -c ==> this works on any eink kindle. eips -c -f ==> on K4(mini) or K5(touch), display looks much cleaner with '-f'. Enjoy and learn! ![]() ![]() Last edited by geekmaster; 04-18-2012 at 01:00 PM. |
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Really nice demos. On my K3, 50% of the CPU time is spent in the Kernel (according to unreliable "top"). Probably, the eink driver could be a bit more optimized...
Code:
[root@kindle us]# time ./cosmegg real 3m 56.15s user 2m 9.67s sys 1m 46.24s |
![]() |
![]() |
![]() |
#13 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
On the K3 and earlier, they were blocking calls, where the write to the udpate proc or the ioctl call or the eips command did not return until the display update was complete. On the K4(mini) and K5(touch), the calls all return immediately before the update even begins, and the drivers can stack up 32 pending updates, and it will try to "combine" them. This can make the updates a lot faster for small changes, but if you write to the framebuffer too soon for large changes, you can nasty screen tearing artifacts, or strange delayed "ghosting" while the eink drivers catch up on a trail of partial updates. When you wait on writes, the drivers can complete, but for animation it looks ugly if you do not wait long enough after an eink update is triggered. In my older code, I added a delay (K4DLY) to the kindles that fail opening the update proc file. The problem was that a lot of processing to create a screen already delayed it some, and the full additional delay was not needed in that case. In my newer code, I use a timer (gettmsec()) to determine WHEN it is safe to do another update (effectively setting a fixed framerate). This works quite well. In new (unfinished) code, I using double-buffered display updates. I am NOT writing directly to the framebuffer, but instead to a temp copy of the framebuffer. Then just before the update call I quickly COPY my temp copy to /dev/fb0. This prevents the eink drivers from getting all "confused" because we are writing to the framebuffer while it is trying to use it. This should increase the speed without causing extra annoying display "tearing" artifacts. At least, that is the plan... I do not think increasing the CPU speed will make the eink drivers run any faster, and that is the bottleneck right now. ![]() Last edited by geekmaster; 04-18-2012 at 02:22 PM. |
|
![]() |
![]() |
![]() |
#14 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
![]() EDIT: What goes on the display is just the same old boring stuff I have been doing since the "big iron" mainframe days of printing these on fan-fold line-printer paper and hanging them around my office. I do similar algorithms with SOUND too, by connecting an output bit to a speaker. People say the sounds are "hypnotic". I had a large collection of totally different but very interesting sound algorithms back in the day, and I could re-create most of them pretty easily. This stuff works the same for sound and light. On the K4(mini), I could PWM the power LED, and a photocell connected to amplified speakers would do the trick. ![]() What I want to know is your opinion of the "re-usability factor" of my code. Is it simple enough for beginning programmers? Is it small enough to not scare people away (i.e. "above the fold")? There are no modules to link, no header files to worry about. Just "arm-linux-gcc -o demo demo.c" and you are good to go. I try to follow the "Make it work, then make it small, then make it fast" philosophy. What is your opinion about my SOURCE CODE? Do you like these C proggies better than my /bin/sh scripts? ![]() ![]() Last edited by geekmaster; 04-18-2012 at 02:03 PM. |
|
![]() |
![]() |
![]() |
#15 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,016
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
<<What is your opinion about my SOURCE CODE? Do you like these C proggies better than my /bin/sh scripts?>> geekmaster
This is such a personal question... my 2 cents: I find your code compact and elegant. Though C is more powerful and easier to understand, Shell is more fun (minimalist language demanding plenty of ingenious techniques). In my opinion compact code can sometimes be cryptic (e.g. APL ![]() ![]() ... And by the way I liked the cosmic egg hypnotic screen effects: Spoiler:
Last edited by PoP; 04-20-2012 at 03:03 PM. Reason: enbedding image |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |