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 08-03-2016, 08:26 AM   #16
NullNix
Guru
NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.
 
Posts: 929
Karma: 15576314
Join Date: Jan 2013
Location: Ely, Cambridgeshire, UK
Device: Kindle Oasis 3, Kindle Oasis 1
Quote:
Originally Posted by NiLuJe View Post
That error message is fairly straightforward: your app depends on libX11.

You need to build libX11 . Which may or may not depend on a full XOrg install, can't recall, and not on a Linux box to check right now.
You need a bunch of proto headers and other libs (xcb, xtrans), but nothing more than that: only a small percentage of the full X11 tree. xcb needs Python, but only at build time. It's much better than the old days of xmkmf when all you had was 'make World'.
NullNix is offline   Reply With Quote
Old 08-03-2016, 08:57 AM   #17
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
Try this one, it is already built:
https://packages.debian.org/jessie/a...jongg/download

There has been a lot of posts here on un-packing and running Debian packages in user storage (without a chroot).
knc1 is offline   Reply With Quote
Advert
Old 08-03-2016, 09:16 AM   #18
Hanspeter
Connoisseur
Hanspeter doesn't litterHanspeter doesn't litter
 
Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
Quote:
Originally Posted by knc1 View Post
Try this one, it is already built:
https://packages.debian.org/jessie/a...jongg/download

There has been a lot of posts here on un-packing and running Debian packages in user storage (without a chroot).
Thanks, will give it a try.
Hanspeter is offline   Reply With Quote
Old 08-03-2016, 09:20 AM   #19
Hanspeter
Connoisseur
Hanspeter doesn't litterHanspeter doesn't litter
 
Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
Quote:
Originally Posted by NiLuJe View Post
That error message is fairly straightforward: your app depends on libX11.

You need to build libX11 . Which may or may not depend on a full XOrg install, can't recall, and not on a Linux box to check right now.

Once it's installed, it should be in a standard path (provided you configured it with the right --prefix), and you won't have to tinker (more than usual) with CPPFLAGS/LDFLAGS.

Did I mention that building GUI stuff risked getting hairy fairly rapidly? ^^.
Hm, that's worth then I expected. I hoped that I only need to copy some header files and some libs from the kindle to the tool chain.
Now know why there is less documentation here about how to work with the tool chain. The tool chains I worked with before had all the libs and headers that are available on the device already included.
So I only needed to add or compile the tools that where not already on the device manually.

Hanspeter
Hanspeter is offline   Reply With Quote
Old 08-03-2016, 09:58 AM   #20
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
It builds native on your pc, so use the a copy of the headers that are installed there.

Copy the libraries required from the Kindle itself.

No need to re-build X11 (it would probably just come out wrong anyway).
knc1 is offline   Reply With Quote
Advert
Old 08-03-2016, 10:13 PM   #21
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 Hanspeter View Post
- - - - -
So I only needed to add or compile the tools that where not already on the device manually.

Hanspeter
Things have changed, this is not as difficult as it may seem.

You have a fairly recent Linux distribution (Ubuntu did you say?).
You will want a flavor that is running the same or at least nearly the same kernel version as the newer touchscreen devices (3.0.x).

Install full binfmt_misc support (which should include qemu-static).

Now you can simply execute any arm binary on your Intel/PC.

Then install an armel (Debian/Jessie is a good match for recent touchscreen devices) distribution in your directory tree.

Add qemu-static to that tree.

Now when you chroot into that directory, everything will 'just work' and you can do native builds for the Kindles.

There are lots and lots of 'HowTo' documents on the 'net for the above process.
knc1 is offline   Reply With Quote
Old 08-04-2016, 03:23 AM   #22
Hanspeter
Connoisseur
Hanspeter doesn't litterHanspeter doesn't litter
 
Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
Quote:
Originally Posted by knc1 View Post
Things have changed, this is not as difficult as it may seem.

You have a fairly recent Linux distribution (Ubuntu did you say?).
You will want a flavor that is running the same or at least nearly the same kernel version as the newer touchscreen devices (3.0.x).

Install full binfmt_misc support (which should include qemu-static).

Now you can simply execute any arm binary on your Intel/PC.

Then install an armel (Debian/Jessie is a good match for recent touchscreen devices) distribution in your directory tree.

Add qemu-static to that tree.

Now when you chroot into that directory, everything will 'just work' and you can do native builds for the Kindles.

There are lots and lots of 'HowTo' documents on the 'net for the above process.
I wasn't aware of that approach. You are right my last cross compile is about 8 years ago. It was for the VDR project on the Siemens M740AV DVBT/SAT receiver http://open7x0.org/

I understood what the idea of the new setup is and I like it. Will have to dig into it and document my results. So I can add it to the Wiki when I find the time later on.
Because that was the first place, after the forum, where I tried to find information or a how to about compiling code for the kindle. But this will take some time as my spare time for this projects is limited.

HaPe
Hanspeter is offline   Reply With Quote
Old 08-04-2016, 05:39 PM   #23
Hanspeter
Connoisseur
Hanspeter doesn't litterHanspeter doesn't litter
 
Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
Quote:
Originally Posted by knc1 View Post
Try this one, it is already built:
https://packages.debian.org/jessie/a...jongg/download

There has been a lot of posts here on un-packing and running Debian packages in user storage (without a chroot).
I got forward with that one. Attached a wrapped Kual extension, that can start it but you do not see the window as it is below of all other windows

So that is what I have at the moment trying with two shell windows:
1st Window to start the game:
[root@kindle root]# cd /mnt/us/extensions/xmahjongg/
[root@kindle xmahjongg]# ./run.sh
^C
[root@kindle xmahjongg]#

2nd Window to try to get the window shown:
root@kindle root]# export LD_LIBRARY_PATH=/mnt/us/extensions/xmahjongg/lib:$LD_LIBRARY_PATH
[root@kindle root]# xwininfo -tree -root | awk '/xmahjongg/{print $1}'
0x1600004
[root@kindle root]# xwininfo -tree -root | grep home
0x1200026 "L:A_N:application_ID:com.lab126.booklet.home_M:fa lse_PC:TS_RC:true_WT:true_O:U_WTNB:true_WTPB:false ": () 758x899+0+125 +0+125 MapState=IsViewable
0x120004b "L_N:non-centered_ID:com.lab126.booklet.home_M:dismissible_ RD:false_FH:F_CD:true_TAC:search-bar_TAB:menu_RC:false_HIDE:background_BS:true_A:Ki ndleMenu": () 517x786+231+121 +231+121 MapState=IsViewable
[root@kindle root]# /mnt/us/extensions/xmahjongg/bin/xdotool windowreparent 0x1600004 0x1200026
[root@kindle root]#

That gets the window above the home window. You can see it, but the touches are not send to it. When you stop the game with ctrl+c in the other shell window you see that your touches where record and now send to the home window.

[root@kindle root]# /mnt/us/extensions/xmahjongg/bin/wmctrl -r xmahjongg -b toggle,above
then wait about 30 seconds and the game window will pop up. It is payable, but the graphics is messed up for whatever reason.

I call it a day now. I'm out of ideas for today.
HaPe

Last edited by Hanspeter; 08-04-2016 at 05:50 PM.
Hanspeter is offline   Reply With Quote
Old 08-04-2016, 06:20 PM   #24
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
Twobob posted a lot about how to bring the window to the top and in 'focus' -
Amazon uses a strange, encoded, window name IIRC.

Anyway, his posts are the ones to search for dealing with the native graphic stack.
knc1 is offline   Reply With Quote
Old 08-05-2016, 04:32 PM   #25
Hanspeter
Connoisseur
Hanspeter doesn't litterHanspeter doesn't litter
 
Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
I found that out later and posted it, but for whatever reason the post was not saved.

when I start:
./xmahjongg -d 0 --name L:A_N:application_ID:com.xmahjongg_O:R_PC:N -B /mnt/us/extensions/xmahjongg/data/

It is working, but the display is a little bit messed up as you cann see in picture one.
As soon as I re parent it to an existing Kindel windows the display is fine, but it dosend accept any touches any more. When I then stop the program the touches was queued somewhere and now sent to the underlining window.

Re parent command to home windows:
/mnt/us/extensions/xmahjongg/bin/xdotool windowreparent 0x1600004 0x1200026

The result is seen in picture 2

I also attach the Kual extension that start the playable app with the messed up display as in picture one.
Hope that somebody has an Idea how to tell the app, perhaps by an environment variable, to set the right color depth. I expect that is the problem.
Attached Thumbnails
Click image for larger version

Name:	screenshot_2016_08_05T20_54_46+0159.png
Views:	267
Size:	68.7 KB
ID:	150698   Click image for larger version

Name:	screenshot_2016_08_05T20_54_00+0159.png
Views:	244
Size:	52.8 KB
ID:	150700  
Attached Files
File Type: txt wininfo_screenshot_2016_08_05T20_54_46+0159.txt (4.8 KB, 237 views)
File Type: txt wininfo_screenshot_2016_08_05T20_54_00+0159.txt (4.8 KB, 259 views)
File Type: zip xmahjongg-Kual.zip (601.8 KB, 199 views)
Hanspeter is offline   Reply With Quote
Old 08-11-2016, 04:02 AM   #26
sguerrini97
Enthusiast
sguerrini97 began at the beginning.
 
Posts: 27
Karma: 12
Join Date: Jan 2016
Device: KT2
If you are still looking in how to setup a cross toolchain, it's very simple on debian (should work on Ubuntu too): https://wiki.debian.org/CrossToolchains#Installation
Just use "armel" instead of "armhf" to have a working CC for Kindle.
Look at my Makefile here, you may need to change the one in the project (e.g. use arm-linux-gnueabi-gcc instead of gcc): https://github.com/sguerrini97/gtk_s...aster/Makefile
Header files are the same across platforms afaik, but you need the libraries either from the Kindle or from the debian armel packages.

I think what knc1 suggested is a better approach, just wanted to show an easier way.

@geekmaster thank you, that repository is interesting. I tried to build SDL for kindle in the past but I had problems with the mouse (touchscreen).

Edit:
Here is what knc1 suggested https://wiki.debian.org/QemuUserEmulation
Get the xmahjong source then

Code:
./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabi
make
Binary file is "src/xmahjongg"
When I run it I get the same result as the first screenshot OP posted

Last edited by sguerrini97; 08-11-2016 at 04:38 AM.
sguerrini97 is offline   Reply With Quote
Old 08-11-2016, 08:15 AM   #27
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 sguerrini97 View Post
- - - -
Edit:
Here is what knc1 suggested https://wiki.debian.org/QemuUserEmulation
- - - -
Thanks.
I couldn't find that link when I was looking for it.
That is one of the more clearly written set of directions.

If you want a good match to the touchscreen Kindles, use Debian/Jessie ARMel distro in the chroot.
knc1 is offline   Reply With Quote
Old 08-11-2016, 03:20 PM   #28
sguerrini97
Enthusiast
sguerrini97 began at the beginning.
 
Posts: 27
Karma: 12
Join Date: Jan 2016
Device: KT2
I did some simple change to the source https://github.com/sguerrini97/xmahjongg_kindle
Anyway I don't understand other's source code very well and I have no idea about the reason why the window is displayed like that.. It seems like it gets squeezed but I'm not sure
sguerrini97 is offline   Reply With Quote
Old 08-12-2016, 03:48 PM   #29
Hanspeter
Connoisseur
Hanspeter doesn't litterHanspeter doesn't litter
 
Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
Quote:
Originally Posted by sguerrini97 View Post
I did some simple change to the source https://github.com/sguerrini97/xmahjongg_kindle
Anyway I don't understand other's source code very well and I have no idea about the reason why the window is displayed like that.. It seems like it gets squeezed but I'm not sure
Well done that you can compile it.
Take a look at the create_window function in main.cc line 378. There could be a problem with the attributes or the parent window.
https://tronche.com/gui/x/xlib/windo...ateWindow.html

First guess would be the attributes or the parent window. The Parent Window could be the problem as a reparent to a other window works.


Also Line 343 and following looks interesting as it it talking about the color depth:
Code:
    for (int i = 0; i < nv && !best_v; i++)
    if (v[i].visualid == default_visualid)
      best_v = &v[i];
  
  if (!best_v) {
    visual = DefaultVisual(display, screen_number);
    depth = DefaultDepth(display, screen_number);
    colormap = DefaultColormap(display, screen_number);
  } else {
  
    /* Which visual to choose? This isn't exactly a simple decision, since
       we want to avoid colormap flashing while choosing a nice visual. So
       here's the algorithm: Prefer the default visual, or take a TrueColor
       visual with strictly greater depth. */
    for (int i = 0; i < nv; i++)
      if (v[i].depth > best_v->depth && v[i].c_class == TrueColor)
	best_v = &v[i];
    
    visual = best_v->visual;
    depth = best_v->depth;
    if (best_v->visualid != default_visualid)
      colormap = XCreateColormap(display, root_window, visual, AllocNone);
    else
      colormap = DefaultColormap(display, screen_number);
    
  }
  
  if (v) XFree(v);
I would try to comment out or delete the if /else at the end that it always requests the DefultColormap.

Code:
  for (int i = 0; i < nv && !best_v; i++)
    if (v[i].visualid == default_visualid)
      best_v = &v[i];
  
    visual = DefaultVisual(display, screen_number);
    depth = DefaultDepth(display, screen_number);
    colormap = DefaultColormap(display, screen_number);

  
  if (v) XFree(v);
First guesses from looking inside the code quickly with no skills in x-Windows programming

Some docu about xLib programming: http://www.sbin.org/doc/Xlib/chapt_03.html

HaPe

Last edited by Hanspeter; 08-12-2016 at 04:16 PM.
Hanspeter is offline   Reply With Quote
Old 08-13-2016, 08:33 AM   #30
sguerrini97
Enthusiast
sguerrini97 began at the beginning.
 
Posts: 27
Karma: 12
Join Date: Jan 2016
Device: KT2
You were right about the color depth, with the default one the window is not messed up

I launched it from the ssh session.

Still some of the tiles are out of the screen, I tried to change some values that I tought were the sizes but I don't see any changes.
Attached Thumbnails
Click image for larger version

Name:	screenshot_2016_08_13T14_21_59+0200.png
Views:	227
Size:	42.4 KB
ID:	150907  

Last edited by sguerrini97; 08-13-2016 at 08:36 AM.
sguerrini97 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU Governor Menu (KUAL extension) knc1 Kindle Developer's Corner 41 09-16-2021 02:54 PM
kual extension to open a book shoelesshunter Kindle Developer's Corner 14 08-16-2016 12:30 PM
Is there a Kual Extension/add-on for cloud eduardomb Kindle Developer's Corner 19 07-08-2016 05:43 PM
is there any KUAL extension development guide? fangzi Kindle Developer's Corner 2 01-02-2014 10:11 AM


All times are GMT -4. The time now is 08:20 AM.


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