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 11-11-2020, 03:53 PM   #256
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
I was thinking "what novelty could fbink do today?"

That came to mind:
Click image for larger version

Name:	screen photo.JPG
Views:	308
Size:	682.8 KB
ID:	183324
Code:
#cd /mnt/us
#./turn -F mcr
#screenshot
Click image for larger version

Name:	screenshot_2020_11_11T15_20_25-0500.png
Views:	220
Size:	11.0 KB
ID:	183325
But wait! Why do frame buffer rotations mess screenshots? @NiLuJe Care to shed some light?
Attached Files
File Type: zip 2020-11-11 turn v0.20.zip (2.3 KB, 205 views)
PoP is offline   Reply With Quote
Old 11-11-2020, 04:35 PM   #257
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: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
I have no idea how the stock screenshot tool works, but it's either going through X, or not expecting hardware rotations.

Use fbgrab, it doesn't rotate anything, so at least the dump will be correct, you may just have to rotate it yourself afterwards, although that shouldn't be necessary on Kindle if it's taken at the original rotation (i.e., whatever matches UR, which is most likely not going to be 0, and is likely to be device-specific to some extent ;p).

Last edited by NiLuJe; 11-11-2020 at 04:38 PM.
NiLuJe is offline   Reply With Quote
Old 11-11-2020, 08:09 PM   #258
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by NiLuJe View Post
...Use fbgrab...
I did:
Code:
[root@kindle root]# cd /mnt/us
[root@kindle us]# ./turn -F mcr
[FBInk] Detected a Kindle PaperWhite 3 (0G1 -> 0x201 => Muscat on Wario)
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 300 dpi
[FBInk] Variable fb info: 1072x1448, 8bpp @ rotation: 3 (Counter Clockwise, 270°)
[FBInk] Fixed fb info: ID is "mxc_epdc_fb", length of fb mem: 6782976 bytes & line length: 1088 bytes
[FBInk] Fontsize set to 24x24 (IBM base glyph size: 8x8)
[FBInk] Line length: 44 cols, Page size: 60 rows
[FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels
[FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background
...         
[root@kindle us]# fbgrab grab.png
Skipping 0 bytes
Resolution: 1088x1448 -> 1072x1448 (cropping: 16 rightmost pixels) @ depth 8 (invert: no)
No conversion needed
Now writing PNG file (compression 4)
[root@kindle us]#
Same output:
screenshot: Click image for larger version

Name:	screenshot_2020_11_11T20_03_14-0500.png
Views:	266
Size:	9.2 KB
ID:	183329 fbgrab:Click image for larger version

Name:	grab.png
Views:	224
Size:	10.8 KB
ID:	183328

Last edited by PoP; 11-11-2020 at 08:15 PM. Reason: post both outputs
PoP is offline   Reply With Quote
Old 11-11-2020, 10:03 PM   #259
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: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
It's possible something's actually writing to the framebuffer during the runtime (status bar?), I'll double-check on a Kobo tomorrow .

Does a plain refresh wreck it the same way? (i.e., fbink -s -f).
NiLuJe is offline   Reply With Quote
Old 11-12-2020, 06:30 AM   #260
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
The framework is stopped at that time, so no status bar, or other activity.

And yes, after fbink -s -f the physical eink screen is messed up and it matches the screenshot.
PoP is offline   Reply With Quote
Old 11-12-2020, 10:13 AM   #261
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: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Okay, a good night's sleep does wonders for your brain .

Yes, this is perfectly normal: a rotation doesn't actually rotate the framebuffer's *content*. It's still the same block of memory, it just gets addressed differently.

Some kernels *may* just zero the full region after a rotation to hide some of that away, but that doesn't seem to be the case on a Kindle.

So, essentially, this works because eInk, where what's on the screen can be completely different than what's on the framebuffer. It works because each and every time, you're refreshing *just* the right region .

As a quick test, if you display an full-screen image, and just *invert* the rotation, that "works", because the memory layout is identical (a scanline is still the same length). But as soon as you change the layout, things start getting funky .

Last edited by NiLuJe; 11-12-2020 at 10:16 AM.
NiLuJe is offline   Reply With Quote
Old 11-12-2020, 06:33 PM   #262
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
"The FB contents doesn't get rotated, just the address space." Thanks, makes perfect sense.

Thankfully the Kindle not zeroing after a rotation allowed me to see the effect.

One could take a screenshot before a rotation, rotate the screenshot and fbink the new text over that screenshot graphics to finally be able to capture the effect. I definitely *won't be attempting this*

"It works because each and every time, you're refreshing *just* the right region" Yeah.

"As a quick test" Indeed.

Also of interest?? The PW3 has 3-0-1-2 top-right-bottom-left clockwise rotations and the K3 has 3-0-1-2 right-top-left-bottom counter-clockwise rotations. Go figure.

Insights much appreciated.
PoP is offline   Reply With Quote
Old 11-12-2020, 08:48 PM   #263
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: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Quote:
Originally Posted by PoP View Post

Also of interest?? The PW3 has 3-0-1-2 top-right-bottom-left clockwise rotations and the K3 has 3-0-1-2 right-top-left-bottom counter-clockwise rotations. Go figure.
This is... complicated. This is related to the way the panel itself is physically mounted, the way the touch layer itself is mounted, and whether it needs a translation or not, and a number of just plain heinous fuckery at the software level in the kernel.

It's mostly irrelevant on Kindle, because no-one cares about fb-level hardware rotation because X11, and the kernels are generally very sane, but it's fresh hell on Kobo, where having a bit of an idea of what the hell the current state is *is* kinda helpful, despite the kernels being wildly bonkers .

Last edited by NiLuJe; 11-12-2020 at 08:50 PM.
NiLuJe is offline   Reply With Quote
Old 11-14-2020, 10:54 AM   #264
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by PoP View Post
One could take a screenshot before a rotation, rotate the screenshot and fbink the new text over that screenshot graphics to finally be able to capture the effect. I definitely *won't be attempting this*
Thanks to ImageMagic, I lied (again):
Code:
./turn -F mcr -S 4
Click image for larger version

Name:	PW3 fbgrab.png
Views:	251
Size:	9.5 KB
ID:	183382

[EDIT 2020-11-18] updated to v0.40 to support K3
[EDIT 2020-11-20] updated to v0.50 to stop parsing the lyrics (thanks NiLuJe)
[EDIT 2020-11-20] updated to v0.60 use "eval" don't parse
Attached Files
File Type: zip 2020-11-13 turn v0.30.zip (2.6 KB, 212 views)
File Type: zip 2020-11-18 turn v0.40.zip (2.7 KB, 203 views)
File Type: zip 2020-11-20 turn v0.50.zip (2.7 KB, 204 views)
File Type: zip 2020-11-20 turn v0.60.zip (2.6 KB, 194 views)

Last edited by PoP; 11-20-2020 at 03:11 PM. Reason: v0.60
PoP is offline   Reply With Quote
Old 11-19-2020, 01:11 PM   #265
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Writing miror images of text: another day another novelty.
Code:
/mnt/us/miror -S 10
Click image for larger version

Name:	PW3 landscape.png
Views:	265
Size:	652.7 KB
ID:	183476
Attached Files
File Type: zip 2019-11-19 miror v0.10.zip (1.72 MB, 207 views)
PoP is offline   Reply With Quote
Old 11-20-2020, 10:36 AM   #266
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: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@PoP:

(Re: a comment in mirror)

You can stop argument parsing by using the magic token -- at the *end* of your list of flags, but *before* the actual "argument".

e.g., fbink -y -1 -mph -- "Wheeee"

(That's a standard GNU behavior, btw ).

Last edited by NiLuJe; 11-20-2020 at 05:21 PM.
NiLuJe is offline   Reply With Quote
Old 11-20-2020, 10:40 AM   #267
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: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
And you can also just eval $(fbink -e), no need to try to parse the output, it's already shell-friendly .

c.f., this, where it's used for ${deviceId} .

(-e also always implies -q).
NiLuJe is offline   Reply With Quote
Old 11-20-2020, 01:50 PM   #268
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by NiLuJe View Post
@PoP:

(Re: a comment in mirror)

You can stop argument parsing by using the magic token -- at the *end* of your list of flags, but *before* the actual "argument".

i.e., fbink -y -1 -mph -- "Wheeee"

(That's a standard GNU behavior, btw ).
Ah. I didn't know ...turn script updated above, which allowed the amateur in me to faithfully respect the lyrics

Click image for larger version

Name:	K3 fbgrab -F mcr -S 4.png
Views:	239
Size:	9.5 KB
ID:	183493
PoP is offline   Reply With Quote
Old 11-20-2020, 01:59 PM   #269
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by NiLuJe View Post
And you can also just eval $(fbink -e), no need to try to parse the output, it's already shell-friendly .

c.f., this, where it's used for ${deviceId} .

(-e also always implies -q).

I will understand this, my current parsing in the turn script is horrible.

[EDIT 15:20] Got it! Didn't realize that you structured your output for "eval" since day 1. turn script updated above again.

Last edited by PoP; 11-20-2020 at 03:22 PM. Reason: eval is amazing
PoP is offline   Reply With Quote
Old 11-20-2020, 05:21 PM   #270
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: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
That's kinda why the flag is named -e, --eval ;p.
NiLuJe is offline   Reply With Quote
Reply

Tags
eips, fbink


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FBInk: A small tool/library to print crap on your screen! NiLuJe Kobo Developer's Corner 311 06-20-2025 01:19 PM
Small print Broadback Conversion 12 12-12-2011 02:31 PM
Small Tool to change book order (PRS-x50) goaspy Sony Reader 113 10-14-2011 03:28 PM
small print breezeman Introduce Yourself 13 07-03-2011 09:02 AM


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


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