2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

23 Commits

Author SHA1 Message Date
zwim
e4c9409f97
[plugin] Add a caching mechanism for CoverImage (#7510) 2021-04-22 08:38:49 +02:00
Martín Fernández
53234fcdc1
add hasSystemFonts device property (#7535)
Add system + user paths to the ReMarkable (has normal linux paths)
2021-04-19 09:04:31 +02:00
gbyl
32802ee7f2
reMarkable: Remove refresh before poweroff (#7563)
This is now handled in a platform-agnostic manner (#7558).

Co-authored-by: gbyl <gbyl@users.noreply.github.com>
2021-04-18 01:02:59 +02:00
Glen Sawyer
b6b332e311
Fix for PR #7415 breaking reMarkable touch input (#7536)
The Wacom pen reports sane CLOCK_REALTIME timestamps, but the Touchscreen reports timestamps frozen at the boot time ts (in REALTIME) :s.

So, make everyone use synthetic CLOCK_MONOTONIC timestamps in order to make gesture detection behave.
2021-04-12 18:54:12 +02:00
NiLuJe
6d53f83286
The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415)
* ReaderDictionary: Port delay computations to TimeVal
* ReaderHighlight: Port delay computations to TimeVal
* ReaderView: Port delay computations to TimeVal
* Android: Reset gesture detection state on APP_CMD_TERM_WINDOW.
  This prevents potentially being stuck in bogus gesture states when switching apps.
* GestureDetector:
  * Port delay computations to TimeVal
  * Fixed delay computations to handle time warps (large and negative deltas).
  * Simplified timed callback handling to invalidate timers much earlier, preventing accumulating useless timers that no longer have any chance of ever detecting a gesture.
  * Fixed state clearing to handle the actual effective slots, instead of hard-coding slot 0 & slot 1.
  * Simplified timed callback handling in general, and added support for a timerfd backend for better performance and accuracy.
  * The improved timed callback handling allows us to detect and honor (as much as possible) the three possible clock sources usable by Linux evdev events.
    The only case where synthetic timestamps are used (and that only to handle timed callbacks) is limited to non-timerfd platforms where input events use
    a clock source that is *NOT* MONOTONIC.
    AFAICT, that's pretty much... PocketBook, and that's it?
* Input:
  * Use the <linux/input.h> FFI module instead of re-declaring every constant
  * Fixed (verbose) debug logging of input events to actually translate said constants properly.
  * Completely reset gesture detection state on suspend. This should prevent bogus gesture detection on resume.
  * Refactored the waitEvent loop to make it easier to comprehend (hopefully) and much more efficient.
    Of specific note, it no longer does a crazy select spam every 100µs, instead computing and relying on sane timeouts,
    as afforded by switching the UI event/input loop to the MONOTONIC time base, and the refactored timed callbacks in GestureDetector.
* reMarkable: Stopped enforcing synthetic timestamps on input events, as it should no longer be necessary.
* TimeVal:
  * Refactored and simplified, especially as far as metamethods are concerned (based on <bsd/sys/time.h>).
  * Added a host of new methods to query the various POSIX clock sources, and made :now default to MONOTONIC.
  * Removed the debug guard in __sub, as time going backwards can be a perfectly normal occurrence.
  * New methods:
    * Clock sources: :realtime, :monotonic, :monotonic_coarse, :realtime_coarse, :boottime
    * Utility: :tonumber, :tousecs, :tomsecs, :fromnumber, :isPositive, :isZero
* UIManager:
  * Ported event loop & scheduling to TimeVal, and switched to the MONOTONIC time base.
    This ensures reliable and consistent scheduling, as time is ensured never to go backwards.
  * Added a :getTime() method, that returns a cached TimeVal:now(), updated at the top of every UI frame.
    It's used throughout the codebase to cadge a syscall in circumstances where we are guaranteed that a syscall would return a mostly identical value,
    because very few time has passed.
    The only code left that does live syscalls does it because it's actually necessary for accuracy,
    and the only code left that does that in a REALTIME time base is code that *actually* deals with calendar time (e.g., Statistics).
* DictQuickLookup: Port delay computations to TimeVal
* FootNoteWidget: Port delay computations to TimeVal
* HTMLBoxWidget: Port delay computations to TimeVal
* Notification: Port delay computations to TimeVal
* TextBoxWidget: Port delay computations to TimeVal
* AutoSuspend: Port to TimeVal
* AutoTurn:
  * Fix it so that settings are actually honored.
  * Port to TimeVal
* BackgroundRunner: Port to TimeVal
* Calibre: Port benchmarking code to TimeVal
* BookInfoManager: Removed unnecessary yield in the metadata extraction subprocess now that subprocesses get scheduled properly.

* All in all, these changes reduced the CPU cost of a single tap by a factor of ten (!), and got rid of an insane amount of weird poll/wakeup cycles that must have been hell on CPU schedulers and batteries..
2021-03-30 02:57:59 +02:00
Glen Sawyer
15ef1a3a1b
reMarkable 2 clean wakeup from sleep (#7345) 2021-03-06 21:03:20 +01:00
Martín Fernández
4a89c93290
Remarkable1 wifi (#7216)
* add wifi support to Rm1
* remarkable: common suspend for all models
2021-02-02 03:19:37 +01:00
Glen Sawyer
34b177aa69
Wifi toggle for reMarkable 2 (#7122)
reMarkable 1 is no-op for the moment
2021-01-19 21:09:17 +01:00
NiLuJe
dffe86dfe9
Cleanup eye-gouging madness around io.read calls (#7149)
* Don't reinvent the wheel when reading a one-line int or string from sysfs

* Simplify a whole other bunch of read calls
2021-01-16 04:41:46 +01:00
Glen Sawyer
3bd3493014
Fix double-pressing reMarkable 2 power button twice to wake up (#7065) 2020-12-28 19:09:10 +01:00
Glen Sawyer
578f92e424
Time-adjust on all reMarkable events, not just EV_ABS (#7066) 2020-12-28 19:08:28 +01:00
gbyl
d2379fc6e6
remarkable: poweroff.png ghosting fix (#7051) 2020-12-27 14:13:23 +01:00
NiLuJe
09c1f35191
rM: Unbreak PowerEvents (#7043)
Most of this is scheduled with delays for reasons, so this was a stupid
idea, my bad ;).

Fix #7033
2020-12-24 02:36:05 +01:00
Frans de Jonge
db9b485e2d
[chore] Minor formatting fixes (#7009)
Cf. <https://github.com/koreader/koreader/pull/6992>.
2020-12-18 23:28:39 +01:00
ddvk
77ac32d4ac
remarkable2 support (#6992)
Fixes https://github.com/koreader/koreader/issues/6792
2020-12-18 23:12:34 +01:00
zwim
52f66a89d2
CoverImage plugin: enable on Remarkable and PocketBook (#6906) 2020-11-28 13:58:44 +01:00
NiLuJe
ac6b121c85
Disable HW inversion on rM (#6779)
Turns out it's being weird like on Mk. 7 Kobos with a crapload of PxP
processing flags.
Except without the "crapload of flags", part :D.
2020-10-10 21:43:24 +02:00
NiLuJe
b932b97b20
A few reMarkable QoL fixes (#6772)
* Enable AutoSuspend plugin on rM

Fix #6769
Re: #6028

* Use the PowerEvent handler on rM

It makes much more sense than the fire & forget & hope for the best
approach copied from the Kindle platform, because we *are* controlling
suspend ourselves (mostly), unlike on Kindle ;).

Fix #6676

* Enable HW inversion on the rM

I mean, we kinda forgot to ever test that, but I don't really see why it
wouldn't work ;).
2020-10-09 19:23:57 +02:00
Martín Fernández
2e731dd4dd
[chore] Device abstraction (#6280)
* generic Device:info() function which returns the model

* add Device:canSuspend() and make it true in all devices that have suspend routines and the emulator

* also enable fake poweroff/reboot on the emulator

* add Device.home_dir

* add Device:hasExitOptions() and update menus & comments
2020-06-19 09:41:50 +02:00
dfhall
04ca12bb7f
Fix remarkable pen input (#6031)
fixes #6030
2020-04-08 08:06:23 +02:00
Thomas Spurden
6f849c5285
A couple of minor remarkable port fixes (#5834)
* remarkable: remove unnecessary screen invalidate on resume

This is handled in uimanager if needsScreenRefreshAfterResume is enabled
(which is the default).

* remarkable: pass a path argument to reader.lua

Otherwise if lastfile is not set in the settings (e.g. install and then
exit without opening a file) koreader will just refuse to start.

* remarkable: pass koreader.sh args (if any) through to reader.lua
2020-02-08 18:07:09 +01:00
Frans de Jonge
1177baaf01 [CI] Ignore unscaled size check on mt_width/height (#5829)
See https://github.com/koreader/koreader/pull/5828#issuecomment-583677718

* fix luacheck too
2020-02-08 10:08:13 +01:00
Martín Fernández
67627ce2d9
Remarkable port (#5828)
Touchscreen is mirrored in X & Y and has a different resolution from the eink panel.

Uses systemd for time/date/suspend/poweroff/reboot
Two systemd units for platform integration. button-listen is a very
simple launcher.
to-do: add support for wifi by implementing  a wpa supplicant dbus client.

Authored-by: Thomas Spurden <tcrs@users.noreply.github.com>
2020-02-08 01:58:10 +01:00