Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2011, 08:11 AM   #1
B_Lizzard
Member
B_Lizzard began at the beginning.
 
Posts: 10
Karma: 24
Join Date: Feb 2011
Device: Kindle 3
Getting SDL to work on DirectFB

So, I've gotten SDL compiled using DirectFB as a backend. SDL_ttf has some issue with TTF_OpenFont so I can't run nethack-newt, but fheroes2 only requires SDL and SDL_image, and seems to run well.

My problem is, I can't get anything to display on the screen. The game starts up, but the Kindle display only shows some brief garbled images here and there. I have DirectFB configured with what Amazon uses in /opt/amazon/ebook/config/wrs.ini. I've tried other configuration options but nothing seems to do the trick. I've also tried to run the game with /etc/init.d/framework stopped. No cigar.

Does anyone with more experience have any idea how to make this work? I don't really know how DirectFB works, so any help would be more than welcome.

EDIT: Of course, SDL over the normal Linux framebuffer was my original choice, but it can't be done because the fbcon driver for SDL needs VT support in the kernel.

Last edited by B_Lizzard; 02-28-2011 at 08:16 AM.
B_Lizzard is offline   Reply With Quote
Old 02-28-2011, 09:14 AM   #2
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
I think the VT-related bits only make a really small portion of the code -- most probably just for switching to a new VT upon initialization and switching back when finishing. You should be able to easily strip this dependency from SDL.

Are you sure that using DirectFB will care for driving the eink display? Most probably it doesn't and you need to communicate the dirty regions to the eink driver yourself, just as you would when using the raw framebuffer...
hawhill is offline   Reply With Quote
Advert
Old 02-28-2011, 09:26 AM   #3
B_Lizzard
Member
B_Lizzard began at the beginning.
 
Posts: 10
Karma: 24
Join Date: Feb 2011
Device: Kindle 3
Ah, I thought such logic would be built in the fbdev driver for DirectFB which included in the Kindle firmware. I'll need to look into how Amazon does it with webkit.

I'll also have to look into running Xfbdev or something, this low-level stuff isn't making my life any easier.
B_Lizzard is offline   Reply With Quote
Old 06-10-2011, 01:39 PM   #4
mark03
Enthusiast
mark03 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Device: Kindle 3 wifi
Hey b_lizzard (and others),

Were you able to make any headway on this? I'm not so much interested in SDL, but I would like to understand how the Amazon Framework is using directfb and what communication channel they are using to trigger eink refreshes via the eink hal. In other words, is it user apps triggering those refreshes, working around the rest of the directfb stuff, or does their directfb have some kind of logic to automatically do this?

In my simplistic view of the world it seems like a lot of GTK+ apps could be built for Kindle, on top of directfb.
mark03 is offline   Reply With Quote
Old 06-12-2011, 07:46 AM   #5
h1uke
Zealot
h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.h1uke can do the Funky Gibbon.
 
Posts: 121
Karma: 82565
Join Date: Aug 2010
Location: Maryland, USA
Device: dxg, k3w,k4nt,kpw
Quote:
Originally Posted by mark03 View Post
what communication channel they are using to trigger eink refreshes via the eink hal.
for example:
Code:
echo 2 >/proc/eink_fb/update_display
performs full screen update.
Have a look at attached file for more.

HTH
Attached Files
File Type: txt einkfb.h.txt (15.8 KB, 473 views)
h1uke is offline   Reply With Quote
Advert
Old 06-12-2011, 12:18 PM   #6
mark03
Enthusiast
mark03 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Device: Kindle 3 wifi
Hi h1uke,

I know you *can* refresh the display using the /proc interface. There are also ioctls that can be called to do the same thing.

My question, though, was not "does anyone know how to make the screen refresh" but rather, how the Amazon Framework is going about it. And in particular, have they modified their version of directfb to accomplish this? Or are they working around directfb, having the app trigger refreshes directly via /proc or ioctls?

Since they already have directfb on the system, and there are a ton of apps that could run under directfb (thanks to directfb-gtk support), this seems like a promising avenue of research...
mark03 is offline   Reply With Quote
Old 06-17-2011, 01:10 PM   #7
B_Lizzard
Member
B_Lizzard began at the beginning.
 
Posts: 10
Karma: 24
Join Date: Feb 2011
Device: Kindle 3
The version of SDL I compiled used the DirectFB libs shipping with the Kindle, so no. I am guessing the screen update logic goes into each toolkit, and that directfb-gtk (which, I'm guessing, is what the web-browser is using) has been patched. Or webkit itself.

I did not know of einkfb. I'll look into it and patch SDL. Maybe then we can have nethack.
B_Lizzard is offline   Reply With Quote
Old 06-17-2011, 02:11 PM   #8
mark03
Enthusiast
mark03 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jun 2011
Device: Kindle 3 wifi
Diffing Amazon's directfb-1.2.0 against the version from directfb.org is quite interesting. Probably more instructive for someone who's actually used these libraries before They've added a "SetDirtyRectangle" call to the API. I haven't looked at this long enough to see how it works though.

Their GTK+ had more extensive patches. There's a bunch of stuff in "gdk marshaling" that sailed way over my head, but I wonder if it has to do with batching up things between eink display updates?

For my bicycle-computer app I intend to work at the directfb level and trigger updates manually via the ioctls if I can't figure out the dirty-rectangle stuff.
mark03 is offline   Reply With Quote
Old 08-18-2012, 10:50 PM   #9
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
Did this ever get done. I was thinking of pursuing aalib support...

Cheers.
twobob is offline   Reply With Quote
Old 09-26-2012, 01:50 PM   #10
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
anyone. anything further on this?
twobob is offline   Reply With Quote
Old 09-26-2012, 02:00 PM   #11
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
anyone. anything further on this?
I am sure that there are LOTS of people who would be interested in WATCHING you do this. This IS a "spectator sport" isn't it? You know, like the "Kindle Developer's Channel" on cable TV?

Actually, we need more DEVELOPERS in the Developer's Corner.

And yes, I want SDL. Not enough time in a day (or a lifetime) to do all I want...
geekmaster is offline   Reply With Quote
Old 09-26-2012, 04:09 PM   #12
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
I'm digging around best I can.

It is probably a few screen to eink calls away from working
twobob is offline   Reply With Quote
Old 10-01-2012, 12:39 PM   #13
B_Lizzard
Member
B_Lizzard began at the beginning.
 
Posts: 10
Karma: 24
Join Date: Feb 2011
Device: Kindle 3
I did manage a few more tests but nothing conclusive. SDL will need to be patched for it to work, and I didn't find any time to do so, sorry.
B_Lizzard is offline   Reply With Quote
Old 10-01-2012, 12:42 PM   #14
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
no worries. I got it working for the 5 in the end. (posted)
https://www.mobileread.com/forums/sho...9&postcount=65
and
https://www.mobileread.com/forums/sho...9&postcount=66

and built for the 3. (needs 4bpp FB tweaks to be useful or aalib support which I have)

Thanks mate!

Last edited by twobob; 10-01-2012 at 12:45 PM. Reason: posts
twobob is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which one will work for me? Adramandoni Which one should I buy? 6 02-21-2011 11:43 PM
I will never get any work done now. sparrowgrass Introduce Yourself 13 07-17-2010 06:46 PM
iPad How well does it work outside? TallMomof2 Apple Devices 9 04-04-2010 06:49 PM
How does it work*? Sultan Rahi OpenInkpot 3 12-29-2009 08:59 AM
iLiad What if iLiad adopts GTK on DirectFB? ericshliao iRex Developer's Corner 1 01-26-2008 05:36 AM


All times are GMT -4. The time now is 08:12 PM.


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