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 07-12-2016, 10:59 PM   #1
DDRBoxman
Junior Member
DDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with others
 
Posts: 5
Karma: 2600
Join Date: Jul 2016
Device: Kindle Touch
Trouble displaying image with eips

I threw together a standalone binary that renders the weather to a jpg and calls eips to display it. I'm having issues with the Kindle displaying the image. Any help figuring out how to make it behave would be really great.

This should show the problem where the kindle is stretching the image:
https://imgur.com/a/Jrfmm

The app source is here:
https://github.com/DDRBoxman/kindle-weather

Also is there a way to prevent the system from redrawing the status bar?
DDRBoxman is offline   Reply With Quote
Old 07-12-2016, 11:44 PM   #2
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
What kindle model? What version of firmware? eips has different capabilities and different parameters across the product line. Even the parameters have changed over time for similar functions, and not all versions support images.

For example, some image support is handled with raw framebuffer images in update scripts, even though the eips command claims to support png images (which did not work for me, and apparently not for lab126 either).

These commands were not designed for our direct use. In general, eips has always worked for text, though with its limited character set.

If you want your app to run on multiple kindle models, you need it to adapt to what is available or provide your own image display utility.

You can use eips to trigger framebuffer updates, but even that is not consistent or reliable on all models.

This is why terminal programs (like Matan's) render their own text characters to the framebuffer. However, the only (native mode) program I have seen so far works consistently across the entire product line in all firmwares and modes (including main and diags) is my kindle video player, and that is my base for the menu/terminal program I am working on now (because needed for K1 and Oasis).

Last edited by geekmaster; 07-12-2016 at 11:46 PM.
geekmaster is offline   Reply With Quote
Advert
Old 07-13-2016, 12:53 AM   #3
DDRBoxman
Junior Member
DDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with others
 
Posts: 5
Karma: 2600
Join Date: Jul 2016
Device: Kindle Touch
It's a Kindle touch (K5)

On firmware 5.3.7.3
DDRBoxman is offline   Reply With Quote
Old 07-13-2016, 01:17 AM   #4
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
With ssh, you can ask eips for help "eips -h" thought the level of detail various across versions (and the image display parameter changes as well, either -b or -g, and what image formats it supports changes). Good luck. I just use raw framebuffer images myself. For 8-bit grayscale framebuffer support, be sure that the lower and upper 4-bits are identical (and use dithering for additional shades of gray).
geekmaster is offline   Reply With Quote
Old 07-13-2016, 03:42 AM   #5
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
Great job! I had the same idea but no time to execute. Depending on your desired battery usage it may be nice to enable WLAN only temporarily to fetch the NOAA data.
eips may be able to display also PNG images.
Could you also attach your weather.png and weather.jpg images? So one could simply simply "eips -g weather.png" without cross compiling and installing the code.
Yourcat is offline   Reply With Quote
Advert
Old 07-13-2016, 06:48 AM   #6
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,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@DDRBoxman: eips -f -g handles PNG8 just fine .

You do have to make sure they're reaaaal PNG8, and not indexed, but apart from that, it works. Can't remember if there's a way to make it behave with JPGs.

See this post and its two links for the one-liner I use with ImageMagick to process stuff that will work through both eips and the framework's usage of libpng.

EDIT: As for reining in the menu, look at KOReader's startup script for all the various ways to achieve that depending on the device & FW combo.

A TL;DR version that may not be too invasive: sigstop whatever's handling the screen updates (i.e;, cvm on legacy devices, awesome otherwise).

Last edited by NiLuJe; 07-13-2016 at 06:52 AM.
NiLuJe is offline   Reply With Quote
Old 07-13-2016, 07:04 AM   #7
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 NiLuJe View Post
@DDRBoxman: eips -f -g handles PNG8 just fine .
On the K1, it is 'eips -b', but for some reason it does not work with the framework shut down (hence raw usage from startup scripts). Though eips -h does show it is SUPPOSED to support PNG images, as I recall. I wonder why they did not backport eips "fixes" to newer versions of K1 firmware?

Last edited by geekmaster; 07-13-2016 at 07:07 AM.
geekmaster is offline   Reply With Quote
Old 07-13-2016, 12:59 PM   #8
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,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@GM: Possibly because those "newer" FW were still released way earlier than the actual changes? .
NiLuJe is offline   Reply With Quote
Old 07-13-2016, 08:31 PM   #9
DDRBoxman
Junior Member
DDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with others
 
Posts: 5
Karma: 2600
Join Date: Jul 2016
Device: Kindle Touch
I've attached a png that was generated and run through pngcrush.

It still has the same stretching issue from the initial post, I also changed to passing the -g and -f flags to eips.

Guess I'll start looking into direct framebuffer access.
Attached Thumbnails
Click image for larger version

Name:	reducedweather.png
Views:	322
Size:	9.2 KB
ID:	150201  
DDRBoxman is offline   Reply With Quote
Old 07-13-2016, 08:56 PM   #10
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 DDRBoxman View Post
I've attached a png that was generated and run through pngcrush.

It still has the same stretching issue from the initial post, I also changed to passing the -g and -f flags to eips.

Guess I'll start looking into direct framebuffer access.
The "stretching issue" is likely due to the fact (as I said) that pixels are doubled in 8-bit mode (each byte contains the same pixel value in top and bottom 4-bits). You may be trying to pack two pixels into each byte.

The simplest thing to do is pure black and white where each byte contains 0 or 255, and that also avoids a full flash update (how gmplay does it). If you can display images but they are "squashed" try converting to 8-bit color (but 16-color color pallete 0x00 0x11 0x22 0x33 ... 0xff, with duplicate colors to extend it evenly to 256 colors). For an example examine the color histogram of screensaver images (where you will see 16 unique colors in a palette of 256 colors).

To see how these pixels are packed, examine code in my "newtrix" demo (though its eink updates do not work on newer kindles).

Last edited by geekmaster; 07-13-2016 at 09:42 PM.
geekmaster is offline   Reply With Quote
Old 07-13-2016, 09:37 PM   #11
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,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
pngcrush will do evil things in the name of size optimization that'll definitely render it unusable for eips.

I did mention that eips was finicky, right? Don't try to outsmart it.
NiLuJe is offline   Reply With Quote
Old 07-20-2016, 03:48 PM   #12
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
You need to convert the png file to a 4-bit png file to use it directly with eips. The Kindle image viewer can display the file just fine but this does not help. I've seen no option to pass an argument to it to display an image without interaction.

https://groups.google.com/forum/#!to...ts/rSwXTj2r4J0 has an example to create 1-bit png file with Go, 4-bit shouldn't be much harder. I think we don't need compression locally, especially if you write it to memory (/tmp).
Yourcat is offline   Reply With Quote
Old 07-21-2016, 01:42 PM   #13
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
Did you use 'pngcrush -bit_depth 4 ...'? This should produce a 4-bit PNG file.
Yourcat is offline   Reply With Quote
Old 07-27-2016, 12:15 AM   #14
DDRBoxman
Junior Member
DDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with othersDDRBoxman plays well with others
 
Posts: 5
Karma: 2600
Join Date: Jul 2016
Device: Kindle Touch
Thanks for all the help everyone, I got it working. Just need to clean up the startup script that I copied from koreader and it should be good to go!
Attached Thumbnails
Click image for larger version

Name:	IMG_0608.jpg
Views:	363
Size:	1.40 MB
ID:	150501  
DDRBoxman is offline   Reply With Quote
Old 07-27-2016, 08:18 AM   #15
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 touching two, diagonally opposite, screen corners at the same time, see if that gives you a screenshot.
knc1 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Poster image on video not displaying on ipad Apostrophe Conversion 0 06-18-2014 03:02 PM
Displaying image on Kobo Aura HD axellec Kobo Developer's Corner 13 01-11-2014 04:56 PM
displaying first page or image without rule fxp33 Kobo Reader 3 03-23-2013 08:11 PM
Image not displaying StephVincent Kindle Formats 0 08-22-2011 01:48 PM
PRS-900 Having trouble displaying manga shadowdragon986 Sony Reader 2 10-08-2010 11:31 AM


All times are GMT -4. The time now is 11:27 PM.


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