Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,772,571 Members 51,583 Now Online
XDA Developers Android and Mobile Development Forum

eInk update modes

Tip us?
 
Renate NST
Old
(Last edited by Renate NST; 18th March 2012 at 01:53 AM.)
#1  
Renate NST's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 792
Posts: 1,967
Join Date: Feb 2012
Location: Boston
Smile eInk update modes

There seems to be very little actual documentation on the various eInk update modes.
Most of the information seems to have been extracted from working code.
Some of that code does not seem to be optimal in any case.

I'd like to start this thread on a discussion of the update modes.

You can look at all the code posted, but the bottom line is that eInk mode is configured by passing six discrete pieces of information to the EPD driver.
These six pieces may be wrapped up into a single static entity.
  1. Name of entity requesting change (for logging purposes only)
  2. Region, one of enumRegion[] (Region 4-7)
  3. A rectangle, normally {0, 0, 600, 800}
  4. Wave, one of enumWave[] (GC, GU, DU, A2, GL16, AUTO)
  5. Mode, one of enumMode[] (INACTIVE, ACTIVE, ONESHOT, CLEAR, ACTIVE_ALL, ONESHOT_ALL, CLEAR_ALL)
  6. Threshold, an int 1-15, only applies to A2 mode

A2 is the one bit, fast drawing method. It leaves ghosting behind.
In some applications, you would like to enable faster scrolling in A2 mode and then have it revert to "normal" upon completion.
I have an application with a full screen scroll.
After experimenting with the values, these two configs seem to do the job nicely.

Code:
      configA2Enter = makeConfig(rpc, waveEnums[WAVE_A2], regionEnums[REGION_6], modeEnums[MODE_ACTIVE_ALL], THRESHOLD);
      configA2Exit = makeConfig(rpc, waveEnums[WAVE_AUTO], regionEnums[REGION_6], modeEnums[MODE_ACTIVE_ALL], 0);
No user intervention is necessary, it scrolls quickly and redraws a clean image when done.
(A view.invalidate() is necessary after you invoke configA2Exit)

Does anybody have any further insight into these values or suggestions for improving them?
The Following 3 Users Say Thank You to Renate NST For This Useful Post: [ Click to Expand ]
 
Renate NST
Old
(Last edited by Renate NST; 18th March 2012 at 03:26 AM.) Reason: Oops!
#2  
Renate NST's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 792
Posts: 1,967
Join Date: Feb 2012
Location: Boston
Some additional information on the A2 ("no refresh", 1 bit) mode.

Some of the other modes can be selectively applied to portions of the screen.
The A2 mode may only be applied to the entire screen.

The threshold value, which some may construe as "brightness" or "contrast"
is the cutoff threshold between black and white of the original image.
A value of 1 will only generate black in the darkest areas of the original image.
A value of 15 will only generate white in the whitest areas of the original image.
That is, 1 will give you a light image, 15 a dark image.
The Following 2 Users Say Thank You to Renate NST For This Useful Post: [ Click to Expand ]
 
marspeople
Old
#3  
Member
Thanks Meter 97
Posts: 69
Join Date: Jul 2011
Quote:
Originally Posted by Renate NST View Post
Some additional information on the A2 ("no refresh", 1 bit) mode.

Some of the other modes can be selectively applied to portions of the screen.
The A2 mode may only be applied to the entire screen.

The threshold value, which some may construe as "brightness" or "contrast"
is the cutoff threshold between black and white of the original image.
A value of 1 will only generate black in the darkest areas of the original image.
A value of 15 will only generate white in the whitest areas of the original image.
That is, 1 will give you a dark image, 15 a light image.
Nice find! I didn't know that was a B/W threshold. But I think you meant "1 gives a light image and 15 a dark image".

I've just tried using this in NoRefreshToggle, but the result was not as good as before. The image is much more just solid black and white because you can't see the dither patterns that represent grey (they appear only at very specific white levels, which would be nice to tweak too).

What I actually use for "contrast" adjustment in NoRefreshToggle is a different approach. Using a fixed threshold of 14 (dark image), I've managed to lower the black level (turning it more greyish) to achieve a smaller color range. This way, the dither patterns appear more often. However, my technique to achieve this effect is not so elegant: I overlay the entire screen with a semi-transparent white pane. This has the inconvenient of controlling the pane visibility: whenever A2 mode is turned off (by user or system), I need to hide the pane View.

If I could temporarily avoid the automatic changing of screen modes by the system, this would be much simpler. I've had no success at this issue so far.
The Following 2 Users Say Thank You to marspeople For This Useful Post: [ Click to Expand ]
 
Renate NST
Old
(Last edited by Renate NST; 18th March 2012 at 04:18 AM.)
#4  
Renate NST's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 792
Posts: 1,967
Join Date: Feb 2012
Location: Boston
Quote:
Originally Posted by marspeople View Post
I think you meant "1 gives a light image and 15 a dark image".
Yup, good catch. The preceding two sentences were correct. I edited the third.
I have a demo panning grayscales. It's easy to see where the threshold is occurring. Shown below.

Oh! I did see something about the dither modes.
They would certainly be useful for video, less so for text.

I think a system-wide use of A2 would be a bit counterproductive.
The fonts look better with 16 shades.
The best use would be to have browsers and viewers use A2 for panning and zooming.

And another thing:

I don't know how you are getting the dither in there, but since you are doing an overlay anyway,
maybe you should try a halftone screen approach to see how it would work.
The simplest halftone screen would be a checkerboard with two different transparencies.
That wouldn't sacrifice too much resolution.
Attached Thumbnails
Click image for larger version

Name:	demo.jpg
Views:	572
Size:	26.8 KB
ID:	952378  
 
mrWax
Old
#5  
Senior Member
Thanks Meter 19
Posts: 147
Join Date: Jan 2012
Quote:
Originally Posted by Renate NST View Post
I think a system-wide use of A2 would be a bit counterproductive.
i seems to me that n-r mode would be much more usefull if would could regulate when its on a and when off. Its quite pain running the app again and again. it seems to me that quicker reaction is much better than nicer pictures in average use - pdf reading, browsing, video, managing system...
 
staylo
Old
#6  
Junior Member
Thanks Meter 3
Posts: 26
Join Date: May 2011
Quote:
Originally Posted by marspeople View Post
I've just tried using this in NoRefreshToggle, but the result was not as good as before. The image is much more just solid black and white because you can't see the dither patterns that represent grey (they appear only at very specific white levels, which would be nice to tweak too)
I don't think the dithering can be 'tweaked' as such. It's caused by the reduction of 24-bit color images to the 16-bit colorspace of the OS. Dithering is performed by the graphics hardware to prevent obvious colour banding, and there's no OpenGL functions to control dithering parameters.

The A2 mode seems to choose a threshold value for black in the 16-bit colorspace. Values above this are white. In order to obtain black and white dithering we have to pick values in the 24-bit colorspace which all lie in the same 16-bit band.

The easiest way I've found is to keep the R and G values at 255 and vary the B value. I think the default threshold lies at 255,255,198. If you start at that and increase the B value you get 7 dithered grey shades before you reach white.
 
domi.nos
Old
(Last edited by domi.nos; 18th March 2012 at 08:34 PM.)
#7  
Senior Member
Thanks Meter 65
Posts: 308
Join Date: Jan 2011
Location: Warszaw
Guys, as far as i know, eink display is build of tiny capsules, much smaller that one pixel is, and a chip is joining them into pixels. So mayby there is a way to divide single pixel into 2 or even 4? It is much much work, but it would make us easier draw some tones of monochrome? Example: to get dark gray, instead of displaying one of five black pixels white, we can make one's "subpixels" 3/4 black, 1/4 white.


Does it make sense/do you get it?
 
marspeople
Old
#8  
Member
Thanks Meter 97
Posts: 69
Join Date: Jul 2011
Quote:
Originally Posted by Renate NST View Post
I think a system-wide use of A2 would be a bit counterproductive.
The fonts look better with 16 shades.
The best use would be to have browsers and viewers use A2 for panning and zooming.
I agree with you. But having temporary exclusive control of A2 mode would make my application more efficient. I don't intend to use A2 system-wide.

Quote:
Originally Posted by Renate NST View Post
And another thing:

I don't know how you are getting the dither in there, but since you are doing an overlay anyway,
maybe you should try a halftone screen approach to see how it would work.
The simplest halftone screen would be a checkerboard with two different transparencies.
That wouldn't sacrifice too much resolution.
I just tried this but I've got nothing more than a simply darker and checkered image. I don't understand how it would be better.
 
Renate NST
Old
#9  
Renate NST's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 792
Posts: 1,967
Join Date: Feb 2012
Location: Boston
Quote:
Originally Posted by marspeople View Post
I don't understand how it would be better.
Well, halftone screens have been around forever.
Think of it this way, it would give you two different thresholds.
With a bigger pattern you would get more thresholds but a coarser pattern.
That is always the way with dithering or halftone.
Probably a screen would not work well with an underlying dither.
 
staylo
Old
#10  
Junior Member
Thanks Meter 3
Posts: 26
Join Date: May 2011
A useful observation from http://forum.xda-developers.com/show...502723&page=11 is that by listening to the screen you can hear screen activity.

After a quick test I suspect ONESHOT mode allows the screen to enter a power saving mode (in which the screen is completely silent) after a few hundred ms of inactivity, while ACTIVE prevents it. No idea whether there are other issues involved.

The Following User Says Thank You to staylo For This Useful Post: [ Click to Expand ]
Tags
eink, epd, norefresh, refresh
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes