![]() |
#16 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
And it is a mystery to me why you would have to go outside of GTK to control the display. Please post a short example of the code which displays the problem you are trying to solve. |
|
![]() |
![]() |
![]() |
#17 |
Enthusiast
![]() Posts: 28
Karma: 13
Join Date: Apr 2014
Device: Kindle PW
|
The problem is not what I want to do, the problem is that I want to do it without ghosting.
|
![]() |
![]() |
![]() |
#18 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Attach a working sample of the code that illustrates the ghosting you do not want. Once we (any of us) can duplicate what you are seeing, we may be able to give specific guidance. |
|
![]() |
![]() |
![]() |
#19 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
I think that bulsa will probably be correct in assuming that GTK does only "fast" refreshes, which leave a bit of ghosting on the display. I'm also about sure that the GTK modification will *also* du "full" refreshes, i.e. going through a black/white transition - it'll just look too bad if they didn't. I guess they implement it similarly than I did - use some kind of limit on screen space and number of fast refreshes to trigger a full refresh.
However, even if they *did* implement it in GTK, then I'm really asking myself what way they use. It would show on an strace for the process using GTK. Plus, it would be also subject to the race condition bulsa talked about before. Then, as I consider that condition mainly being theoretical, Amazon's engineers might have chosen to go for that compromise, too. |
![]() |
![]() |
![]() |
#20 |
Enthusiast
![]() Posts: 28
Karma: 13
Join Date: Apr 2014
Device: Kindle PW
|
Since you insist on code, here is a trivial example that over time produces quite a nice pattern (imho
![]() Code:
#include <stdlib.h> #include <glib.h> #include <cairo.h> #include <gtk/gtk.h> static gboolean on_draw_event(GtkWidget *widget, GdkEvent *gdk, gpointer user_data) { GtkAllocation allocation; gtk_widget_get_allocation(widget, &allocation); int size = rand()%100+10; int width = allocation.width, height = allocation.height; int x = rand()%(width-size), y = rand()%(height-size); double color = rand()/(double)RAND_MAX; cairo_t *cr = gdk_cairo_create(widget->window); cairo_rectangle(cr, 0, 0, width, height); cairo_set_source_rgb(cr, .5, .5, .5); cairo_fill(cr); cairo_rectangle(cr, x, y, size, size); cairo_set_source_rgb(cr, color, color, color); cairo_fill(cr); cairo_destroy(cr); return FALSE; } static gboolean update(gpointer widget) { GtkWidget *darea = widget; GtkAllocation allocation; gtk_widget_get_allocation(widget, &allocation); gdk_window_invalidate_rect(gtk_widget_get_window(darea), &allocation, FALSE); return G_SOURCE_CONTINUE; } int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *darea; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); darea = gtk_drawing_area_new(); gtk_container_add(GTK_CONTAINER(window), darea); g_signal_connect(G_OBJECT(darea), "expose_event", G_CALLBACK(on_draw_event), NULL); g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); gtk_window_set_default_size(GTK_WINDOW(window), 400, 90); gtk_window_set_title(GTK_WINDOW(window), "L:A_N:application_ID:net.bulsa.example_PC:N_O:U"); gtk_widget_show_all(window); g_timeout_add(300, update, darea); gtk_main(); return 0; } |
![]() |
![]() |
![]() |
#21 |
Enthusiast
![]() Posts: 28
Karma: 13
Join Date: Apr 2014
Device: Kindle PW
|
After some more research I have finally found out I am not the only one to notice this problem *yay*...
In HackedUpReader they just insert a sleep(1) before a full refresh. Could anyone give me pointers how to find out what amazon does for their reader app? As mentioned previously I have already tried strace'ing basically everything that has an open handle on the framebuffer, but no luck there (at least no ioctls). |
![]() |
![]() |
![]() |
#22 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
It just might not have a handle open when you were scanning processes.
You could preload a wrapper to ioctl() and filter out the ones that go to the framebuffer. It's a bit messy, though, and probably needs fiddling with the rootfs. Other than that - no idea, sorry. I would still continue to fiddle with strace, and have it follow forks (-f/-ff) too. Restrict it with "strace -e trace=ioctl,open" so you don't have to wade through all the calls. I think the eink fb driver (which is open sourced and included in the kernel sources!) only has ioctl() and /proc based APIs. So it's definitely one of those. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pest Control for Organic Gardening: Natural Methods for Pest and Disease Control | joyfuldesigns | Self-Promotions by Authors and Publishers | 0 | 08-12-2013 09:12 PM |
E-Ink and Epson working on a 300ppi e-ink screen! | m-reader | News | 13 | 05-18-2011 11:38 AM |
At Last: *Front-Lit* E-Ink, Flexible E-Ink and ... E-Ink Watches! | NatCh | News | 1 | 10-27-2007 10:50 AM |
E Ink launches next-gen electronic ink: Vizplex | Alexander Turcic | News | 34 | 07-17-2007 09:25 AM |
the latest generation of E Ink's microencapsulated ink imaging film. | Jason | News | 0 | 05-09-2007 10:01 AM |