-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PocketBook support #47
Conversation
Missing vinfo alignment trickery, and possibly model ID via InkView Also, the wait_for_complete mystery, too.
Should clear up the WAIT_FOR_UPDATE_COMPLETE mess...
In a dlopen/dlsym/dlclose block, to limit the damage it could do because of its crappy _init & _fini...
Here's a test binary, I'd be grateful if someone with a PB could check that it behaves (especially as far as device identification is concerned: that means I'm interested in the console output ^^) ;). i.e., (I've attached all the other utils, but those may not be a great idea on PB, and we don't really have a use for 'em anyway, so, play with them if you want, but it's not critical ^^). |
If this behaves, that means we can finally enable fancy OTA feedback & the crash screen on PB in KOReader ;). |
I'm hoping there aren't any rotation shenanigans involved, but do warn me if stuff ends up being printed sideways ;p. |
We've been handling other platforms than NTX & Kindle for a while ^^.
Hello appeared (landscape). Regarding inkview, it's possible to prod the task manager into "bring us into foreground" via ipc queue that is stable across inkview versions. This is the route used in an old pocketbook root exploit - https://github.com/ezdiy/pbjb/blob/v6/jailbreak.c#L34 Dealing with input is harder. While real linux evinput exists, it's hogged by the monitor proccesses that then signals individual apps via sysv ipc (acts as hub/subscriber). What happens once we stomp on it is uncertain but if we could, it would possibly mean getting rid of inkview entirely, just sending few os integration ipcs by hand. |
@ezdiy: Ah. Was afraid of that given the rotation discussion we had earlier ^^. So, new question: Landscape in which orientation? Bottom of the text on the left or the right side of the device (when the device itself is physically in Portrait in front of you)? (I wouldn't mind having a look at the console output regardless ;)). Thankfully, I don't really have to deal with input in FBInk itself, so, wheee \o/. |
Top right corner is 0,0. ie need to rotate 90 CCW, but this might be model specific. Fun trick: echo 1 > /sys/class/graphics/fb0/rotate sets portrait rotation (and koreader can enjoy faster blits) .... until any other inkview app paints anything and it gets reset back to landscape (2). I'm not sure whether it's some ioctl doing it, or monitor/inkview writing to the variable itself, or whether we could affect that without need for root. EDIT: It seems that 'rota' utility can set rotation, without need for root:
Would be nice if koreader could do the same? |
Huh. Well, if something is essentially preventing making use of HW rotations, I won't have to bother with a finer-grained check then (silver lining and all that ^^). This one should print the right way round. |
Seems like inkview just brute sets FBIOPUT_VSCREENINFO right before it sends update request (ie presumable it does that before it blits into framebuffer). Rotation values when viewed from portrait: |
This is what we use on Kobo to avoid the perf hit, but, of course there's a twist: it's extremely device-dependent on Kobo, and that's with actual mostly-accurate kernel sources on hand. So So, if there's a way to figure that out on PB (or it turns out it's always 1... one could hope ;p), then, yeah, that's definitely viable (I mean, the touch translation might have been to be fixed to handle it, but that's worth the effort), but it might be easier said than done. Plus, that's assuming nothing randomly stomps on the rotation behind our backs? I haven't ever used a PB device, so I have no idea what/when InkView might try to do just that ;). |
I presume if we spam the FBIOPUT_VSCREENINFO per update just like inkview does it's fine - if they steal our focus they paint correctly, and so do we if we steal focus back. The touch translation will be the annoying part indeed. |
Fair point ;p. That feels a wee bit dirty, though, but, oh, well ^^. And that's assuming we actually know which rotation is the right one, as I said earlier. (That's the point of the |
The autodetection is only 50% - one can discern rotation for portrait vs landscape from reported screen res - however one cannot for upside down :/. Guess just user configurable knob for that will suffice. Also, the r2 fbink just does:
in infinite loop. |
Huh. Can you drop the (And, yeah, right now the plan was only to get Upright, well, right ;p). |
Still hangs:
|
Yeah, I'd forgot a few important bits inside the PB ifdef ;p. This should do it: |
No hang, but draws nothing, huh:
|
That means I probably got the rotation wrong ^^. If yo do a simple full-screen refresh right after, it'll probably show up, possibly upside down or something:
|
Indeed it appeared. Also the centering is wrong (appears in center of top left quadrant, looks like the source axes for centering are flipped), and oriented in hw landscape still. Maybe just forgo sw rotate and set hw rot? |
This comment has been minimized.
This comment has been minimized.
Ah, lightbulb moment. The (blitting) code currently bypasses rotation @ 8bpp >_<". |
Okay, this should finally work ^^. |
Yup, does the right thing. |
Yay \o/. Many thanks for testing this :). Off to bed now, and I'll probably merge this and the KOReader stuff tomorrow ;). |
I may ultimately take you up on that offer, but not right now ;). Things are going to be pretty hectic on my end until at least winter break ;). |
This has been bothering me for quite a while, and given the work & progress done in KOReader thanks to @ezdiy & @pazos, I figured it was finally time to give it a final push over the finish line ;).
Obviously, I still don't have a PB to test, so I could only vaguely check that it didn't horribly implode ^^.
In particular, I tried something as regards device identification to avoid a hard-dependency on InkView, hoping that this would help alleviate the various issues we've had with its crappy initialization and old dependencies in KOReader...
Since I'm not quite sure it'll necessarily help in every case, InkView handling can be disabled entirely at runtime by setting
FBINK_NO_INKVIEW
in the env.The only thing we actually "need" device identification for is basically just setting a fancy codename and choosing the right DPI, so it's not the end of the world if we get it wrong.
(The only real exception being the weird Color Lux, which is broken by default if we can't ID it).
This change is