View Single Post
Old 12-08-2012, 07:56 PM   #800
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
@dave2008, I've compiled KPV with KT support from your repo (commit cc38d9e6) and run it with
Code:
/mnt/us/kindlepdfviewver/kpdf.sh /mnt/us/documents
Some patching was required:
Spoiler:

This patch is in public domain.
Code:
diff --git a/frontend/ui/device.lua b/frontend/ui/device.lua
index 915b604..454453a 100644
--- a/frontend/ui/device.lua
+++ b/frontend/ui/device.lua
@@ -67,7 +67,7 @@ end
 
 function Device:isTouchDevice()
 	local model = self:getModel()
-	return (model == "Kindle4") or (model == "KindlePaperWhite") or util.isEmulated()
+	return (model == "Kindle4") or (model == "KindlePaperWhite") or (model == "KindleTouch") or util.isEmulated()
 end
 
 function Device:intoScreenSaver()
diff --git a/frontend/ui/inputevent.lua b/frontend/ui/inputevent.lua
index efd2a58..a7b52f5 100644
--- a/frontend/ui/inputevent.lua
+++ b/frontend/ui/inputevent.lua
@@ -239,16 +239,20 @@ function Input:init()
 	else
 		input.open("fake_events")
 		local dev_mod = Device:getModel()
-		-- open event0 for all models
-		input.open("/dev/input/event0")
-		if dev_mod ~= "KindlePaperWhite" then
-			-- we don't have event1 in KindlePaperWhite
+		if dev_mod ~= "KindleTouch" then
+			-- event0 in KindleTouch is "WM8962 Beep Generator" (useless)
+			input.open("/dev/input/event0")
+		end
+		if dev_mod ~= "KindleTouch" and dev_mod ~= "KindlePaperWhite" then
+			-- event1 in KindleTouch is "imx-yoshi Headset" (useless)
+			-- and we don't have event1 in KindlePaperWhite
 			input.open("/dev/input/event1")
-		elseif dev_mod == "KindlePaperWhite" then
+		end
+		if dev_mod == "KindlePaperWhite" then
 			print("Auto-detected Kindle PaperWhite")
 		elseif dev_mod == "KindleTouch" then
-			input.open("/dev/input/event2")
-			input.open("/dev/input/event3")
+			input.open("/dev/input/event2") -- Home button
+			input.open("/dev/input/event3") -- touchscreen
 			print("Auto-detected Kindle Touch")
 		elseif dev_mod == "Kindle4" then
 			print("Auto-detected Kindle 4")

With this patch input events are intercepted and recognized (taps are taps with handler "onGesture", Home button is ["key"] = "Home" with handler "onKeyPress").

But, unfortunately, KPV interface isn't displayed on screen at all.

Here is my eips -i:
Spoiler:
Code:
[root@kindle kindlepdfviewer]# eips -i

Fixed framebuffer info
    id:              mxc_epdc_fb    smem_start:       0x75400000
    smem_len:            2179072    type:          PACKED_PIXELS
    type_aux:                  0    visual:   STATIC_PSEUDOCOLOR
    xpanstep:                  1    ypanstep:                  1
    ywrapstep:                 0    line_length:             608
    mmio_start:       0x00000000    mmio_len:                  0
    accel:                     0

Variable framebuffer info
    xres:                    600    yres:                    800
    xres_virtual:            608    yres_virtual:           3584
    xoffset:                   0    yoffset:                   0
    bits_per_pixel:            8    grayscale:                 1
    red.offset:                0    green.offset:              0
    red.length:                8    green.length:              8
    red.msb_right:             0    green.msb_right:           0
    blue.offset:               0    transp.offset:             0
    blue.length:               8    transp.length:             0
    blue.msb_right:            0    transp.msb_right:          0
    nonstd:                    0    activate:                128
    width:                    -1    height:                   -1
    accel_flags:               0    pixclock:           32000000
    left_margin:              17    right_margin:            172
    upper_margin:              4    lower_margin:             18
    hsync_len:                15    vsync_len:                 4
    sync:                      0    vmode:                     0
    rotate:                    1

EDIT: I have Kindle Tocuh 5.1.2
EDIT2: Output of strace eips '' has ioctl(3, 0x4048462e, 0xbed0baf8) = 0.

EDIT3: It works. So:
  • einkfb.c should be updated. Kindle Touch has 8-bit framebuffer and 800x600 screen, but it requires kindlePWeinkUpdate(), not the kindle4einkUpdate()
  • tap coordinates (both X and Y) reported by touchscreen input device have range 0-4095, so they should be adjusted to screen resolution (so that X will be in range 0-600 and Y will be in range 0-800).

Last edited by eureka; 12-09-2012 at 04:33 AM.
eureka is offline   Reply With Quote