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 07-25-2011, 04:15 PM   #1
fbdev
fbdev
fbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel is
 
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
kindle directfb tutorial

0) set up scratchbox (http://scratchbox.org/) cs2007q3-glibc2.5-arm6 compiler.
1) ssh into your kindle. (requires usbnetwork)
2) tar the libraries on your kindle.
# cd /mnt/us
# tar cf libs.tar /usr/lib
3) scp the /mnt/usr/libs.tar into scratchbox.
4) extract the libraries into scratchbox.
# cd /
# tar xf libs.tar
5) download the attached file and extract it into scratchbox.
6) compile main.c in scratchbox.
# gcc main.c -Iusr/include -Iusr/include/directfb -ldirectfb -lfreetype
7) scp a.out onto your kindle.
8) ssh into your kindle and run a.out.
tested on a kindle 3g (v3.1).

==fortune cookie==
confuscious say:
good programmer have bad vision.
only see what right in front him.
fbdev is offline   Reply With Quote
Old 07-25-2011, 04:18 PM   #2
fbdev
fbdev
fbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel isfbdev really knows where his or her towel is
 
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
archive

archive
Attached Files
File Type: gz kindle-directfb-tutorial.tar.gz (151.5 KB, 654 views)
fbdev is offline   Reply With Quote
Advert
Old 07-25-2011, 09:02 PM   #3
khmann
Enthusiast
khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.khmann once ate a cherry pie in a record 7 seconds.
 
Posts: 43
Karma: 1658
Join Date: Jul 2011
Device: b006
thankyou. this is exactly what I was looking for.
khmann is offline   Reply With Quote
Old 08-20-2011, 06:06 PM   #4
ryran
Connoisseur
ryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with others
 
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
You so clevvvvver.
Tanksyou.
ryran is offline   Reply With Quote
Old 08-20-2011, 10:27 PM   #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 khmann View Post
thankyou. this is exactly what I was looking for.
I'm second that. Thank you, Man!
h1uke is offline   Reply With Quote
Advert
Old 11-03-2011, 11:23 PM   #6
liuto
Connoisseur
liuto is on a distinguished road
 
Posts: 50
Karma: 70
Join Date: Nov 2010
Device: Kindle DXG / Kindle 3
I cannot find directfb on DXG...
liuto is offline   Reply With Quote
Old 06-01-2014, 05:26 AM   #7
dicalp
Enthusiast
dicalp began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Aug 2012
Device: Kindle Touch 3G + Ads
I know this thread is very old but I'm curious how fast/good can directfb runs on kindle touch 5.1.2. I got the following error message. Any idea?

[root@kindle development]# ./a.out

~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.2.9 |~~~~~~~~~~~~~~~~~~~~~~~~~~
(c) 2001-2008 The world wide DirectFB Open Source Community
(c) 2000-2004 Convergence (integrated media) GmbH
----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2014-06-01 08:26)
(!) DirectFB/core/system: No system found!
(!) [ 4990: 0.000] --> Caught signal 11 (at 0x10, invalid address) <--
Aborted
dicalp is offline   Reply With Quote
Old 06-01-2014, 06:01 AM   #8
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 dicalp View Post
I know this thread is very old but I'm curious how fast/good can directfb runs on kindle touch 5.1.2. I got the following error message. Any idea?

[root@kindle development]# ./a.out

~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.2.9 |~~~~~~~~~~~~~~~~~~~~~~~~~~
(c) 2001-2008 The world wide DirectFB Open Source Community
(c) 2000-2004 Convergence (integrated media) GmbH
----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2014-06-01 08:26)
(!) DirectFB/core/system: No system found!
(!) [ 4990: 0.000] --> Caught signal 11 (at 0x10, invalid address) <--
Aborted
It probably means: -ePEBCAK

When/where/with what did you compile it?
(which compiler, compiler command line, linker command line, etc)

When/where/with what did you try to run it?

Sorry, we can't see over your shoulder from here.
knc1 is offline   Reply With Quote
Old 06-01-2014, 08:00 AM   #9
dicalp
Enthusiast
dicalp began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Aug 2012
Device: Kindle Touch 3G + Ads
Thanks for responding. What's -ePEBCAK btw?

Just did it.
scratchbox-toolchain-cs2007q3-glibc2.5-arm6.
just compile directfb in scratch box and link it with the tutorial attached in here with all the default settting. no magic.
scp the executable to kindle touch and run it.

Quote:
Originally Posted by knc1 View Post
It probably means: -ePEBCAK

When/where/with what did you compile it?
(which compiler, compiler command line, linker command line, etc)

When/where/with what did you try to run it?

Sorry, we can't see over your shoulder from here.
dicalp is offline   Reply With Quote
Old 06-01-2014, 09:05 AM   #10
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 dicalp View Post
Thanks for responding. What's -ePEBCAK btw?

Just did it.
scratchbox-toolchain-cs2007q3-glibc2.5-arm6.
just compile directfb in scratch box and link it with the tutorial attached in here with all the default settting. no magic.
scp the executable to kindle touch and run it.
(error numbers are negative, usually beginning with a capital "E")
-e http://en.wiktionary.org/wiki/PEBCAK

Hmm...
Your detailed explanation: "Just did it"
My detailed answer: "You broke it"

- - - -

Come on now - give us a chance to help -
Copy the list of actions in the first post, and then edit in your version of each.
Mention what you skipped and/or added.

(Note: having the default binary name of a.out is not expected in a working, real-life, example.)
knc1 is offline   Reply With Quote
Old 06-02-2014, 05:51 AM   #11
dicalp
Enthusiast
dicalp began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Aug 2012
Device: Kindle Touch 3G + Ads
ok .. obviously there is no free lunch. code does not work out of the box.

need to compile the libraries as so and copy everything .. including the directfb-1.2.9 directory to my kindle touch. basically the whole /usr/local/lib directory to kindle.

then add the following code into the tutorial code:
DirectFBSetOption("module-dir", "./directfb-1.2-9"); // depending on where you copy the files to.

unfortunately still not much luck ... the last repaint command gives exception.

[root@kindle development]# a.out

~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.2.9 |~~~~~~~~~~~~~~~~~~~~~~~~~~
(c) 2001-2008 The world wide DirectFB Open Source Community
(c) 2000-2004 Convergence (integrated media) GmbH
----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2014-06-02 09:32)
(*) Direct/Thread: Started 'Linux Input' (18375) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: WM8962 Beep Generator (1) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (18376) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: imx-yoshi Headset (2) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (18377) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: whitney-button (3) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (18378) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: zforce (4) 0.1 (directfb.org)
(!) DirectFB/Keyboard: Could not open() /dev/tty0!
--> No such file or directory
(!) Direct/Modules: Unable to dlopen `./directfb-1.2-9/gfxdrivers/libdirectfb_davinci.so'!
--> libdavinci_c64x.so.0: cannot open shared object file: No such file or directory
(*) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) FBDev/Surface: Allocated 600x800 8 bit LUT8 buffer (index 0) at offset 0 and pitch 608.
(*) Direct/Interface: Loaded 'FT2' implementation of 'IDirectFBFont'.
(!) [18374: 0.000] --> Caught signal 11 (at 0xffffffff, invalid address) <--
(!!!) *** WARNING [still objects in 'Layer Region Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Layer Context Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Surface Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
Aborted
[root@kindle development]#
dicalp is offline   Reply With Quote
Old 06-02-2014, 09:46 AM   #12
dicalp
Enthusiast
dicalp began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Aug 2012
Device: Kindle Touch 3G + Ads
instead of using this tutorial ... I tried this simple tutorial ...
http://directfb.org/docs/DirectFB_Tutorials/simple.html

it works flawlessly on my kindle touch!

guess i will not be using this code anymore.
dicalp is offline   Reply With Quote
Old 06-02-2014, 10:10 AM   #13
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 dicalp View Post
guess i will not be using this code anymore.
Not too surprising, since the code is for a K3 and you are trying to run it on a K5.
knc1 is offline   Reply With Quote
Old 06-10-2014, 09:05 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
meh. dunno what you are trying to do.

but this can totally work.

Will dig some stuff up.



CAVEAT: The attached thing IS NOT A FULLY POLISHED APP FOR THE k3. The menu wont work - you wont be able to exit easily blah blah blah.... it's just a POC for this person.... feel free to fix it and make it perfect.

Code:
[root@kindle root]# ls /var/tmp/root/.directfbrc

(nothing)

[root@kindle root]# finder directfbrc     ( you don't have "finder" btw)
/etc/directfbrc
[root@kindle root]# cat /etc/directfbrc 
no-vt
linux-input-devices=/dev/input/event0,/dev/input/event1
[root@kindle root]# cp /etc/directfbrc /var/tmp/root/.directfbrc
so copy the file like I show here to run custom directfb stuff... however, chances are it will look really rubbish as the screen will misreport the size and only show half the content (well 400 px spread over 800)

however I fixed this only this morning (somehow) will make a post on it briefly before I collapse.

EDIT:
Ah.. make this...


Code:
system = fbdev
fbdev = /dev/fb0

mode = 600x800
scaled = 600x800
depth = 8
pixelformat = LUT8
no-cursor # Disable Cursor
no-init-layer = 0 # Disable Layer Initialization
no-vt # Disable vt
no-vt-switch # Don't allow vt switching (redundant?) but meh .
smooth-upscale # Scaling
smooth-downscale
window-surface-policy = systemonly # Window surface swapping policy:
desktop-buffer-mode = backsystem # Desktop buffer mode:
linux-input-devices=/dev/input/event0,/dev/input/event1
and you will get nice output.

also you will need a:

Code:
echo 1 > /proc/eink_fb/update_display
personally I wrapped that in a timeout loop in the minesweeper app itself.

Code:

gboolean refresh_screen (gpointer data)
{
  system("echo 1 > /proc/eink_fb/update_display");

  /* Return true so the function will be called again; returning false removes
   * this timeout function.
   */
  return TRUE;
}


// and then... in the "main" loop add a:

    	 /* Add a timeout to update the screen every 750 milliseconds or so */
  gint func_ref = g_timeout_add (750, refresh_screen, vbox);
https://github.com/steshaw/gtk-examp...09.minesweeper for main code...

That should work for all simple gtk apps.


I simply compiled it with the 2007q3 arm softfloat toolchain.

I REPEAT:
CAVEAT: The attached thing IS NOT A FULLY POLISHED APP FOR THE k3. The menu wont work - you wont be able to exit easily blah blah blah.... it's just a POC for this person.... feel free to fix it and make it perfect.
Attached Thumbnails
Click image for larger version

Name:	fb0dump1.png
Views:	417
Size:	4.4 KB
ID:	123947   Click image for larger version

Name:	fb0dump2-Looks-WAY-better.png
Views:	400
Size:	5.8 KB
ID:	123948  
Attached Files
File Type: zip ch09.minesweeper-Source-code.zip (13.2 KB, 289 views)
File Type: zip minesweeper-k3.zip (10.4 KB, 259 views)

Last edited by twobob; 06-10-2014 at 10:06 PM.
twobob is offline   Reply With Quote
Old 06-10-2014, 10:24 PM   #15
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
*A wild twobob appears!*

*It's very effective!*
NiLuJe is offline   Reply With Quote
Reply

Tags
directfb, eink, freetype, kindle, programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting SDL to work on DirectFB B_Lizzard Kindle Developer's Corner 13 10-01-2012 12:42 PM
directfb fbdev Kindle Developer's Corner 5 12-16-2011 09:57 PM
Adapting Comics for the Kindle (Tutorial) davebaxter Amazon Kindle 0 07-30-2009 05:52 PM
Tutorial On Converting to Kindle? kapblp Calibre 8 03-27-2009 08:42 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 04:50 PM.


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