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 05-03-2012, 11:28 AM   #46
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
Apple? Neither of the "Steves" were bald -- looks like Stallman...
geekmaster is offline   Reply With Quote
Old 05-03-2012, 03:01 PM   #47
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post
Apple? Neither of the "Steves" were bald -- looks like Stallman...
But your posted question wasn't about Stallman now was it?
knc1 is offline   Reply With Quote
Advert
Old 05-05-2012, 11:45 PM   #48
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
Quote:
Originally Posted by knc1 View Post
Your correct.
The ioctl() commands, once released, are supposed to be engraved in stone.

The addition of a new (or changed) one is supposed to overlap the continued existance of the one being replaced.

So the maintainer of the e-ink driver screwed the pooch on letting that change(s) in.
Yes, that pooch is getting a sore behind from the 5.1.0 update -- that is for sure!

They inserted new fields into the middle of a critical structure used by the eink udpate ioctl, moving other critical fields, and they did not even bother to rename this new stucture layout to maintain compatibility between 5.1.x and 5.0.x firmware. That means you need different program versions that use different structure layouts to do eink updates, depending on whether you booted from the main or from the diags partitions, after you install the 5.1.0 firmware update.

I tried copying the old field values from their new location into the new fields in their old location, and of course that breaks eink updates on the new firmware. The iotcl codes are modified by the structure length, so those different structures cause different codes to be used. Grr...

That pooch won't be sitting down for quite awhile.


Last edited by geekmaster; 04-15-2016 at 03:10 AM.
geekmaster is offline   Reply With Quote
Old 05-06-2012, 02:54 AM   #49
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
My eink ioctl() updates now work for 5.1.0 firmware, which uses a critical internal structure that changed layout but kept the same name, and broke compatibility with 5.0.x firmware. Worse, the eink header file changed and it is now incompatible with 5.0.x firmware. I removed the header files from gmplay-1.5, and that gmlib code will be used in future versions of all of my eink C code.
geekmaster is offline   Reply With Quote
Old 05-10-2012, 02:43 AM   #50
kiri87
Member
kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.kiri87 knows what's going on.
 
Posts: 16
Karma: 25544
Join Date: Feb 2012
Device: Kindle 3
Here's a little demo using the code from the first post. I'm not sure if it's the right place for it, but the demo is too small to deserve it's own thread.
You really must see this running, the screens don't do justice.
Spoiler:

Code:
//====================================================
// colorOverflow 1.0 - a kindle demo 
// Copyright (C) 2012 by geekmaster, with MIT license:
// Copyright (C) 2012 by kiri, with MIT license:
// http://www.opensource.org/licenses/mit-license.php
//----------------------------------------------------
// This was tested on K3.
//----------------------------------------------------

#include <stdio.h>      // printf
#include <stdlib.h>    // malloc, free, atoi
#include <string.h>   // memset, memcpy
#include <unistd.h>  // usleep
#include <fcntl.h>  // open, close, write
#include <time.h>  // time
#include <math.h> // sin, cos
#include <sys/ioctl.h>   // ioctl
#include <sys/time.h>   // gettime
#include <sys/mman.h>  // mmap, munmap
typedef unsigned char u8;
unsigned int __invalid_size_argument_for_IOC;
#include <linux/fb.h> // screeninfo
#include <linux/einkfb.h>
#include <linux/mxcfb.h>

#define WIDTH 600
#define HEIGHT 800
#define NUM 8
#define RAD 111

typedef struct {
    float posx, posy, velx, vely;
} blob;

enum GMLIB_op { GMLIB_INIT,GMLIB_CLOSE,GMLIB_UPDATE };

// function prototypes
int gmlib(int);
inline void setpx(int,int,int);
inline int getpx(int,int);
void dblit(void);
int getmsec(void);
void updateBlob(blob *);

// gmlib global vars
static __u8 dt[64]= {
    3,129,34,160,10,136,42,168,192,66,223,97,200,73,231,105,50,
    176,18,144,58,184,26,152,239,113,207,81,247,121,215,89,14,
    140,46,180,7,133,38,164,203,77,235,109,196,70,227,101,62,188,
    30,156,54,180,22,148,251,125,219,93,243,117,211,85
}; // 0-255 dither table
__u8 *psave=NULL;     // screensave pointer
__u8 *fb0=NULL;      // framebuffer pointer
__u8 *wb0=NULL;     // workbuffer pointer
__u32 mpu=100;     // msec/update
int fdFB=0;       // fb0 file descriptor
int fdWB=0;      // wb0 file descriptor
__u32 fs=0;     // fb0 stride
__u32 fb=0;    // fb0 bytes
__u32 MX=0;   // xres (visible)
__u32 MY=0;  // yres (visible)
__u8 ppb=0; // pixels per byte
int bs=340; // border size
__u8 gs=0; // 8-bit grayscale
__u32 teu=0; // eink update time
__u32 tpu=0; // physics update time

void colorOverflow(void) {
    //system("eips -c"); //clear screen
    srand ( time(NULL) );

    int i, j, n, x, y;
    blob blobs[NUM];

    for (i=0; i<NUM; i++) {
        //populate the array
        blob b = {rand()%WIDTH, rand()%HEIGHT, 10+rand()%10, 10+rand()%10};
        blobs[i] = b;
    }
    printf("blobs populated\n");

    //clear 
    for (i=0;i<WIDTH;i++)
    	for (j=0;j<HEIGHT;j++)
    		setpx(i,j,0);

    int radsq = RAD*RAD, dx, dy, dist;

    for (;;) {
        for (n=0; n<NUM; n++) {
            //draw the blobs
            updateBlob(&blobs[n]);
            x = blobs[n].posx;
            y = blobs[n].posy;

            for (j = y-RAD; j <= y; j++) {
                for (i = x-RAD; i <= x; i++) {
                    dx=x-i;
                    dy=y-j;
                    dist = (dx*dx+dy*dy);
                    if (dist<=radsq) {
                        float q = (float)dist/radsq;
                        int c = 10*q;
                        setpx(i,j,c+getpx(i,j));
                        setpx(2*x-i,j,c+getpx(2*x-i,j));
                        setpx(i,2*y-j,c+getpx(i,2*y-j));
                        setpx(2*x-i,2*y-j,c+getpx(2*x-i,2*y-j));
                    }
                }
            }
        }
        gmlib(GMLIB_UPDATE);
    }
}

void updateBlob(blob *b) {
    if (b->posx + b->velx >= WIDTH || b->posx + b->velx < 0)
        b->velx *= -1;

    if (b->posy + b->vely >= HEIGHT || b->posy + b->vely < 0)
        b->vely *= -1;

    b->posx += b->velx;
    b->posy += b->vely;
}

//====================================
// gmlib - geekmaster function library
// op (init, update, close)
//------------------------------------
int gmlib(int op) {
    static struct update_area_t ua= {0,0,600,800,fx_invert,NULL};
    static struct mxcfb_update_data ur= {
        {0,0,600,800},WAVEFORM_MODE_AUTO,0,1,TEMP_USE_AMBIENT,0
    };
    static int eupcode;
    static void *eupdata=NULL;
    struct fb_var_screeninfo screeninfo;
    if (GMLIB_INIT==op) {
        teu=getmsec();
        // save original screen
        fdFB=open("/dev/fb0",O_RDWR); // open eink framebuffer fb0
        ioctl(fdFB,FBIOGET_VSCREENINFO,&screeninfo);
        ppb=8/screeninfo.bits_per_pixel;  // pixels per byte
        fs=screeninfo.xres_virtual/ppb;  // fb0 stride
        fb=screeninfo.yres_virtual/ppb; // fb0 bytes
        MX=screeninfo.xres;            // max X+1
        MY=screeninfo.yres;           // max Y+1
        ua.x2=MX;
        ua.y2=MY;
        ur.update_region.width=MX;
        ur.update_region.height=MY;
        fdWB=open("/tmp/wb0",O_RDWR|O_CREAT); // open work framebuffer wb0
        lseek(fdWB,MY*MX-1,SEEK_SET);
        write(fdWB,"",1); // create work buffer file
        fb0=(__u8 *)mmap(0,MY*fs,PROT_READ|PROT_WRITE,MAP_SHARED,fdFB,0); // map fb0
        wb0=(__u8 *)mmap(0,MY*MX,PROT_READ|PROT_WRITE,MAP_SHARED,fdWB,0); // map wb0
        if (fb>MY) {
            eupcode=MXCFB_SEND_UPDATE;
            eupdata=&ur;
            ur.update_mode=0;
        } else {
            eupcode=FBIO_EINK_UPDATE_DISPLAY_AREA;
            eupdata=&ua;
        }
        psave=malloc(fs*MY);
        memcpy(psave,fb0,fs*MY);
        memset(wb0,0,MY*MX);
        gmlib(GMLIB_UPDATE);
        teu+=300;
        memset(wb0,255,MY*MX);
        gmlib(GMLIB_UPDATE);
        teu+=80;
    } else if (GMLIB_UPDATE==op) {
        while (teu>getmsec()); // async update needs time
        dblit();
        ioctl(fdFB,eupcode,eupdata);
    } else if (GMLIB_CLOSE==op) {
        gmlib(GMLIB_UPDATE); //sleep(3); does it really need to sleep?
        memcpy(fb0,psave,fs*MY); // restore display
        free(psave);
        gmlib(GMLIB_UPDATE);   // update display
        munmap(wb0,MY*MX);    // unmap wb0
        close(fdWB);         // close wb0
        remove("/tmp/wb0"); // remove wb0
        munmap(fb0,MY*fs); // unmap fb0
        close(fdFB);      // close fb0
    } else {
        return -1;
    }
    return 0;
}

//========================================
// setpx - draw pixel to 8-bit work buffer
// x,y:screen coordinates, c:color(0-255).
//----------------------------------------
inline void setpx(int x,int y,int c) {
    if (x>=WIDTH || x<0 || y>=HEIGHT || y<0)
        return;
    wb0[y*MX+x]=c;
}

//========================================
// getpx - returns the value of a pixel 
// from the 8-bit work buffer
// x,y:screen coordinates, returns:color(0-255).
//----------------------------------------
inline int getpx(int x,int y) {
	//all offscreen pixels are returned as white
    if (x>=WIDTH || x<0 || y>=HEIGHT || y<0) return 255;
    return wb0[y*MX+x];
}

//==========================
// dblit - dither wb0 to fb0
//--------------------------
void dblit(void) {
    int x,y,ys;
    __u8 p,d,*pi,*po,*pd;
    pi=wb0-1;
    po=fb0-1;
    if (gs) { // 16-color dither
        if (ppb/2) { // 2 px/byte
            for (y=0; y<MY; y++) {
                pd=dt+(y&7)*8+7;
                for (x=0; x<MX; x+=8) {
                    pd-=8;
                    p=*pi++;
                    d=*pd++;
                    *po++=((p&240)+(d-(*pi&15)*255/15>>4&16)-16)&240|
                          ((*pi++&240)+(*pd++-(*pi&15)*255/15>>4&16)-16)/16&15;
                    p=*pi++;
                    d=*pd++;
                    *po++=((p&240)+(d-(*pi&15)*255/15>>4&16)-16)&240|
                          ((*pi++&240)+(*pd++-(*pi&15)*255/15>>4&16)-16)/16&15;
                    p=*pi++;
                    d=*pd++;
                    *po++=((p&240)+(d-(*pi&15)*255/15>>4&16)-16)&240|
                          ((*pi++&240)+(*pd++-(*pi&15)*255/15>>4&16)-16)/16&15;
                    p=*pi++;
                    d=*pd++;
                    *po++=((p&240)+(d-(*pi&15)*255/15>>4&16)-16)&240|
                          ((*pi++&240)+(*pd++-(*pi&15)*255/15>>4&16)-16)/16&15;
                }
            }
        } else { // 1 px/byte
            for (y=0; y<MY; y++) {
                pd=dt+(y&7)*8+7;
                for (x=0; x<MX; x+=8) {
                    pd-=8;
//                *po++=(*pi++&240)+(*pd++-(*pi&15)*255/15>>4&16)-16;
                    *po++=(*pi++&240)+(((*pi&15)*4080>>8)+*pd++>>4&16)-16;
                    *po++=(*pi++&240)+(((*pi&15)*4080>>8)+*pd++>>4&16)-16;
                    *po++=(*pi++&240)+(((*pi&15)*4080>>8)+*pd++>>4&16)-16;
                    *po++=(*pi++&240)+(((*pi&15)*4080>>8)+*pd++>>4&16)-16;
                    *po++=(*pi++&240)+(((*pi&15)*4080>>8)+*pd++>>4&16)-16;
                    *po++=(*pi++&240)+(((*pi&15)*4080>>8)+*pd++>>4&16)-16;
                    *po++=(*pi++&240)+(((*pi&15)*4080>>8)+*pd++>>4&16)-16;
                    *po++=(*pi++&240)+(((*pi&15)*4080>>8)+*pd++>>4&16)-16;
                }
                po+=(fs-MX);
            }
        }
    } else { // 2-color dither
        if (ppb/2) { // 2 px/byte *** broken (high contrast) ***
            for (y=0; y<MY; y++) {
                pd=dt+(y&7)*8+7;
                ys=(y&7)*8;
                for (x=0; x<MX; x+=8) {
                    pd-=8;
                    p=*pi++;
                    d=*pd++;
                    *po++=d-p>>4&240|*pd++-*pi++>>8&15;
                    p=*pi++;
                    d=*pd++;
                    *po++=d-p>>4&240|*pd++-*pi++>>8&15;
                    p=*pi++;
                    d=*pd++;
                    *po++=d-p>>4&240|*pd++-*pi++>>8&15;
                    p=*pi++;
                    d=*pd++;
                    *po++=d-p>>4&240|*pd++-*pi++>>8&15;
                }
            }

        } else { // 1 px/byte
            for (y=0; y<MY; y++) {
                pd=dt+(y&7)*8+7;
                for (x=0; x<MX; x+=8) {
                    pd-=8;
                    *po++=*pd++-*pi++>>8;
                    *po++=*pd++-*pi++>>8;
                    *po++=*pd++-*pi++>>8;
                    *po++=*pd++-*pi++>>8;
                    *po++=*pd++-*pi++>>8;
                    *po++=*pd++-*pi++>>8;
                    *po++=*pd++-*pi++>>8;
                    *po++=*pd++-*pi++>>8;
                }
                po+=(fs-MX);
            }
        }
    }
}

//====================================
// getmsec - get msec since first call
// (tick counter wraps every 12 days)
//------------------------------------
int getmsec(void) {
    int tc;
    static int ts=0;
    struct timeval tv;
    gettimeofday(&tv,NULL);
    tc=tv.tv_usec/1000+1000*(0xFFFFF&tv.tv_sec);
    if (0==tc) {
        ts=tc;
    }
    return tc-ts;
}

//==================
// main - start here
//------------------
int main(void) {
    gmlib(GMLIB_INIT);
    gs=0; // 0 for binary dither, 1 for grayscale dither
    colorOverflow();
    gmlib(GMLIB_CLOSE);

    return 0;
}
Attached Thumbnails
Click image for larger version

Name:	screen_shot-8835.gif
Views:	258
Size:	43.3 KB
ID:	86281   Click image for larger version

Name:	screen_shot-8833.gif
Views:	232
Size:	52.6 KB
ID:	86282  
Attached Files
File Type: zip colorOverflow.zip (10.5 KB, 168 views)

Last edited by kiri87; 05-10-2012 at 02:45 AM.
kiri87 is offline   Reply With Quote
Advert
Old 05-10-2012, 02:56 AM   #51
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
Quote:
Originally Posted by kiri87 View Post
Here's a little demo using the code from the first post. I'm not sure if it's the right place for it, but the demo is too small to deserve it's own thread.
You really must see this running, the screens don't do justice.
[SPOILER]
With this being a "derivative work" from the first post source code, of course this is the right place for it.

It is running on my K5 -- it looks like I spilled liquid on the screen and it leaked into the eink.
geekmaster is offline   Reply With Quote
Old 05-10-2012, 07:22 AM   #52
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post
With this being a "derivative work" from the first post source code, of course this is the right place for it.

It is running on my K5 -- it looks like I spilled liquid on the screen and it leaked into the eink.
Looks like a great enhancement to the "Your Kindle needs repair" message.

Maybe splice in a "fade to white, top-to-bottom" so it ends with the e-ink running out the bottom of the screen.
knc1 is offline   Reply With Quote
Old 06-13-2012, 03:57 PM   #53
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
3D - An Interactive animated projection of an object on a 2D screen

As suggested by geekmaster I ported my demo to C, using gmlib 1.5a and newtrix 2.0 routines (and compiled with tccmake). I have been away the forum for a while and didn't read if there were more currrent updates from geekmaster.

It -- of course -- runs much faster now : while pressing the keyboard keys you can interact with the plotting in real time.

The 3D.c code is much more readable than the previous contrieved 3D.sh code. C being a "natural" for the job, I found the port less interesting but for the object structure which I kept identical forcing me into array indexing, type casting and rounding fun.

Happy to share it:
Attached Files
File Type: zip 3D_5.0.zip (9.7 KB, 196 views)

Last edited by PoP; 06-13-2012 at 04:03 PM.
PoP is offline   Reply With Quote
Old 06-13-2012, 04:44 PM   #54
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
Quote:
Originally Posted by PoP View Post
As suggested by geekmaster I ported my demo to C, using gmlib 1.5a and newtrix 2.0 routines (and compiled with tccmake). I have been away the forum for a while and didn't read if there were more currrent updates from geekmaster.

It -- of course -- runs much faster now : while pressing the keyboard keys you can interact with the plotting in real time.

The 3D.c code is much more readable than the previous contrieved 3D.sh code. C being a "natural" for the job, I found the port less interesting but for the object structure which I kept identical forcing me into array indexing, type casting and rounding fun.

Happy to share it:
The latest dithering code is in the raw2gmv and gmplay video player programs... It supports both 5.0.x and 5.1.x firmware...

I have a newer version that does parallel processing (it dithers 32-bit words, with no lookup table). I need to finish that and publish it in some demo framework... Too many things to do.

But even the OLD versions are a bit faster than a script plotting pixels with "dd".

EDIT: Newtrix contains 256-color to 16-color dithering code too, so that is a good place to start for general usage as you have here. Now if you get bored, you can add texture mapping and multiple light sources too.

Last edited by geekmaster; 10-13-2012 at 01:04 PM.
geekmaster is offline   Reply With Quote
Old 09-27-2012, 03:23 PM   #55
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Would like to think we could weld this into SDL or (something) in the RSN.

by We I mean me, with help. Cheers
twobob is offline   Reply With Quote
Old 10-13-2012, 11:59 AM   #56
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Okay.... small question.
needs a
[root@kindle root]# while :; do eips ''; usleep 80000; done;

to do screen updates on my 5... is that expected behaviour?
twobob is offline   Reply With Quote
Old 10-13-2012, 01:09 PM   #57
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
Quote:
Originally Posted by twobob View Post
Okay.... small question.
needs a
[root@kindle root]# while :; do eips ''; usleep 80000; done;

to do screen updates on my 5... is that expected behaviour?
No. What is your firmware version? You reported a larger framebuffer too (four pages instead of my two pages). Perhaps your particular 5.x firmware now has a third incompatible ioctl structure. Hmm... With a minor change you can force the eips fallback in GMLIB. You can try that.

I wonder if their are incompatible ioctl differences between US and UK kindles?

I will take a look at it soon to get the newest most compatible GMLIB that should be easy to use in new programs.

Last edited by geekmaster; 10-13-2012 at 01:17 PM.
geekmaster is offline   Reply With Quote
Old 10-13-2012, 01:47 PM   #58
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
okay mate. Yeah. given then weird DIAGs action and now this I think there HAS to be something going on. Cheers

EDIT: THIS is an "INTERNATIONAL" kindle AFAIK.

Probably not that many kicking about. (I could be wrong)
twobob is offline   Reply With Quote
Old 10-13-2012, 02:46 PM   #59
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post
No. What is your firmware version? You reported a larger framebuffer too (four pages instead of my two pages). Perhaps your particular 5.x firmware now has a third incompatible ioctl structure. Hmm... With a minor change you can force the eips fallback in GMLIB. You can try that.

I wonder if their are incompatible ioctl differences between US and UK kindles?

I will take a look at it soon to get the newest most compatible GMLIB that should be easy to use in new programs.
I think his B011 image has some prototype 5.2 stuff in it.

He definitely has the "disappearing diags sshd" problem.

His version info is:
Code:
System Software Version: 004-juno_2_0_1_yoshi-167953
Tue Jul 17 17:00:45 PDT 2012
Kindle 5.1.2 (~~otaVersion~~)
I am still "reading code" but don't let that put off anyone else, extra eyes into this lab126 scripting always helps.
knc1 is offline   Reply With Quote
Old 10-13-2012, 03:23 PM   #60
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
Newtrix doesn't work on my 5.2.0 Paperwhite, but gmplay does. So if the international k5 is "almost" 5.2.0, perhaps newtrix fails on it and gmplay works too. We are close. I just need to backport the gmplay GMLIB to newtrix.

I wish they would stop fscking with the eink ioctl stuff with minor firmware updates.

Last edited by geekmaster; 10-13-2012 at 03:26 PM.
geekmaster 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
geekmaster vacation geekmaster Kindle Developer's Corner 2 03-19-2012 09:18 PM


All times are GMT -4. The time now is 10:15 AM.


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