-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Initial Kindle PW5 support #8856
Conversation
Pending a minor refactor of the FL widget because that thing's a mess. Stuff requiring further investigation:
|
Did you find an exploit to jailbreak, or was entry via serial? :) |
I'm not the exploit finder, and it won't be published until Amazon manages to ship a patched FW, because responsible disclosure and all that ;). But, no, it's a good old chain of sneaky *nix trickery, quite fun :). AFAIK, serial is a no-go on recent devices, secure boot and all that jazz :/. |
time to buy one now before they ship with updated firmware :)
as much as i hate thier software, amazon does come out with some of the best hardware.
|
Disagree, 8 GB storage with no (micro)-SD is grossly underspecced and nigh unusable. Edit: to be clear, 32 GB on the Kobo Libra 2 is also an affront. But, you know, it's not 8 GB. |
The Signature has 32GB storage, IIRC (it's wildly too expensive, though ;)). |
frontend/ui/widget/textboxwidget.lua
Outdated
function TextBoxWidget:setText(text) | ||
if text == self.text then | ||
return | ||
end | ||
|
||
self.text = text | ||
|
||
if self.use_xtext then | ||
self:_measureWithXText() | ||
else | ||
self:_evalCharWidthList() | ||
end | ||
self:_splitToLines() | ||
|
||
self:update() | ||
end | ||
dbg:guard(TextBoxWidget, "setText", | ||
function(self, text) | ||
assert(type(text) == "string", | ||
"Wrong text type (expected string)") | ||
end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this sneaky stuff? :-P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match TextWidget's API, because Button might call it since the multi-line support pr ;).
(Also, I needed it too ;p).
frontend/ui/widget/textboxwidget.lua
Outdated
function TextBoxWidget:setText(text) | ||
if text == self.text then | ||
return | ||
end | ||
|
||
self.text = text | ||
|
||
if self.use_xtext then | ||
self:_measureWithXText() | ||
else | ||
self:_evalCharWidthList() | ||
end | ||
self:_splitToLines() | ||
|
||
self:update() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I would trust this. Seems a few more things may be done in :init() like dealing with height, that doing this quick fake-init() might mess ?
To me the most important thing is to fit in my pocket :) |
Big pockets. ;-)
…On Sun, Mar 6, 2022 at 4:33 PM yparitcher ***@***.***> wrote:
Disagree, 8 GB storage with no (micro)-SD is grossly underspecced and nigh
unusable.
Edit: to be clear, 32 GB on the Kobo Libra 2 is also an affront. But, you
know, it's not 8 GB.
To me the most important thing is to fit in my pocket :)
Otherwise it is is not portable,
so a bigger screen while still fitting in my pocket, kinda outweighs
storage concerns.
no one else make a pocketable > 6" screen
—
Reply to this email directly, view it on GitHub
<#8856 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRQBPSKDAWTDL3WGKUSSLU6TF5LANCNFSM5PPP3H7Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
frontend/ui/widget/textboxwidget.lua
Outdated
self:_computeDimensions() | ||
self:_updateLayout() | ||
if self.editable then | ||
self:moveCursorToCharPos(self.charpos or 1) | ||
end | ||
self.dimen = Geom:new(self:getSize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit unconfortable with these kind of changes. It might be all right, but after a few minutes looking around, I can't say I'm 100% sure - it's less readable that how it was before (_computeDimensions actually renders the text, so this naming is hiding abit the whole core of what's really happening).
And what about this self.dimen here that won't get updated by your setText() if you give it larger text that makes a few more lines ?
I'd be more confortable if you just did in your setText() : free() and then :init(). That's what we do in InputText:initTextBox()
- it would feel less risky, and the wee additional recomputing this would do vs. your splitting would be bearable for the rare users of this new setText().
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I like catching design/implementation bugs with stuff like that ;o).
Note to self: Mostly done testing this on the KOReader side (as in, haven't looked into the driver merging behavior nor the stock UI hangs). Note to self: check if those aren't simply wait_for_any timeouts. Note to self: and/or weird interaction with the new React UI, because there be lotsa new services I know nothing about running. So, just have to check that the warmth API tweaks didn't horribly break on Kobo ;o). |
@@ -151,6 +152,26 @@ function TextBoxWidget:init() | |||
self.text_height = self.lines_per_page * self.line_height_px | |||
end | |||
|
|||
self:_computeTextDimensions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, we're doing more than "computing text dimensions": we render the text...
And now that you're not even using this TextBoxWidget in FrontlightWidget, it feels unnecessary to hack this module and leave in there some code paths we're not even taking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's kind of implied by the verb (same as _measureText
) ;).
There's nothing really left of concern in init vs this, AFAICT.
And Button can take this path, so I'll take something that appeared to work just fine over a crash ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's nothing really left of concern in init vs this
Except readability (not having to jump around to see what's happening) and messing my git history :)
And Button can take this path, so I'll take something that appeared to work just fine over a crash
Which you could have solved with a dumber setText() doing :free() + :init().
Huh. Good hunch ;).
Not quite sure what the best way to handle that will be... (Especially since that kernel facility seems to be a moving target, it might not behave in the same way on 5.14.2) |
(We cannot support USBMS, so doing FM stuff on UsbPlugOut makes no sense).
Untested.
It's a custom wrapper that will update the stock UI properly, too. (In addition to doing the date + hwclock dance)
Handle it via a sysfs poke, like on Cervantes.
Always honor the native scale, and dislpay it as-is
barely ever called on most platforms.
Might help w/ the ioctl timeouts?
Whelp, not forgetting to disable the "fast mode" thingy on exit appears to have helped, yay. |
setWarmth / self.fl_warmth are "public" (-ish, as far as the second one is concerned), and always in the [0, 100] range. setWarmthHW is private, local to each implementation, and always uses the platform's native scale.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 16 files at r1, 5 of 8 files at r2, 3 of 4 files at r4, 1 of 1 files at r6, 8 of 8 files at r7, 3 of 3 files at r8, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @Frenzie, @NiLuJe, @poire-z, and @yparitcher)
frontend/device/kindle/device.lua, line 64 at r6 (raw file):
Previously, yparitcher wrote…
This should probably be named
isWifiOn
orisWifiUp
as it only checks if the wireless interface is up not if it is connected.
Done.
Whelp, finally done with this :). |
One question: What does the now not so mysterious device show on |
It might not be directly useful, for a couple reasons:
That said, I'll give it a poke the next time it's plugged ;). (What I can say is that it's hilariously more power efficient, even completely awake: a Sage/Elipsa in suspend drains more power than an idle PW5 at reasonable light levels (!). Computational spikes also drain way, way less power). |
Just got my PW5 (5.14.0.1) It (just) fits my pocket :) waiting for the JB to try this wink wink ;) |
InputText: Add debug guards to catch bad callers not passing strings ;). Fix koreader#8899
* Rejig frontlight warmth API to more closely match the existing API, and, hopefully, clarify some of its quirks, and reduce boilerplate and duplicate code in platform implementations. * Tweak Kindle:setDateTime to prefer using the platform's custom script, as in interacts better with the stock UI. And make the fallbacks handle old busybox versions better. * Add Kindle PW5 support ;). * Add warmth support to the Kindle platform. * Random TextBoxWidget cleanups: make sure we immediately free destroyed instances. * FrontLightWidget: Refactor to make it slightly less obnoxious to grok and update; i.e., separate layout from update, and properly separate brightness from warmth handling. Move to simpler widgets instead of reinventing the wheel. * TextBoxWidgets: Implement `setText` to match TextWidget's API, as some callers may be using the two interchangeably (i.e., Button). * NaturalLightWidget: Make sure we pass a string to InputText * InputText: Add debug guards to catch bad callers not passing strings ;).
of granularity. Fix koreader#8913 Regression since koreader#8856
@@ -104,6 +126,7 @@ local Kindle = Generic:new{ | |||
-- NOTE: We can cheat by adding a platform-specific entry here, because the only code that will check for this is here. | |||
isSpecialOffers = isSpecialOffers(), | |||
hasOTAUpdates = yes, | |||
hasFastWifiStatusQuery = yes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good morning, thank you for that especially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, good to see you (alive) ! How are you ?
(And where were/are you living? We all got very faimiliar with Ukraine geography lately :/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, so-so, still migrating. Hope to appear here more frequently if I can.
Requires koreader/koreader-base#1457
(Oh, hello there, "mystery" device ;p).
setText
to match TextWidget's API, as some callers may be using the two interchangeably (i.e., Button).This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)