If the device has natural light support (currently only KA1), use the
sysfs interface instead of the ioctl-based one. It might also be
usable on other Kobo devices for setting brightness without natural
light, but since I cannot test this, this is currently restricted to
the KA1.
By default, the ioctl interface is used for accessing the
frontlight. However, the ioctl interface has two problems: the overall
brightness seems to be lower (issue #2321), and it does not support
the natural light support from the Kobo Aura One (issue #2285). This
interface is the first step to fix both these issues.
From observing Nickel's behavior, it appears the white/green/red
intensities are roughly linear dependent on the 4th root of brightness
and warmth values. This leads to a very quick increase of the
intensities for lower brightness/warmth values, which then saturate
for larger ones. The values for gain/offset were determined by a
simple linear regression, but the plan is to create a widget so that
users may adapt these values to their liking.
Partial, as it will safe the state when suspending the reader by pressing the power-button.
However, it will still not safe the state when Pocketbooks autoPowerOff-Feature kicks in, as this does not create an event (e.g. no EVT_BACKGROUND) of any kind.
* Clean up device.lua
* Save state on suspend
* Prevent open screensaver more than one in the same time
* Add option to enable/disable background in message screensaver
* fallback to random images if this book cover is excluded feature + fix Disabled (leave screen/page as it is)
* Autostretch disable by default, more fallback options, leave screen as it is
I believe this should be `if isKobo()`, or better yet that the entire
block should be moved to `KoboPowerD:init()` because afaik that is the
only platform where the system doesn't provide trustworthy frontlight
information. But to be absolutely sure that I don't break anything (and I
don't want to spend any time on this atm) I'm temporarily excluding only
Android where this behavior is known to be problematic.
See discussion in https://github.com/koreader/koreader/issues/3118#issuecomment-334995879
References #3118 (using keyword "references" because phrases like "possibly fixes"
result in GH autoclose).
* Allow for colored rendering
Available with all engines (CRE, PDF, Images).
Needs to manually add setting: "color_rendering" = true
* Disable color for djvudocument
* Use Screen:isColorEnabled()
* Bump base
* frontlight on kobo: a few fixes
Rewritten to not update NickelConf on every change, and never
if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL = false.
Reintroduce global settings frontlight_intensity and
is_frontlight_on to keep level and state across koreader
sessions.
Fix a few of the remaining issues on kobo light.
Ensure settings are saved when rebooting/powering off from
File browser.
* Ensure untoggle works when starting with light off
* Put back fl_min=0 as it is for all other devices (the idea
fl_min should be 1 and toggling managed some other way is
not implemented in current code).
* Fix a few frontlightwidget issues
1. Android.getScreenBrightness() is used in frontend/device/android/powerd.lua to retrieve the frontlight intensity.
2. kosync.koplugin won't save settings for whisper sync.
3. batterstat.koplugin won't work correctly if several on* events are fired.
* Use PluginShare to exchange data between plugins
* Remove legacy code in reader.lua and kobo/device.lua, and move KOBO_LIGHT_ON_START to kobo/powerd.lua
* A better sync config logic
* Consider kobo without hardware frontlight toggle
* update frontlight widget once toggle is tapped.
* Force refresh when kindle is out of screensaver or usb is unpluged.
* Improve AutoFrontlight
* More plugins sub menu
* Last brightness should always be updated
* Finish autofrontlight improvement and enable it by default.
* More tets
* onFlushSettings
* MenuSorter can now correctly sort sub menus
Noticeable latency between toggling the power switch and the device
showing the screensaver has been tracked down to the two network
manager calls. This change allows the screen to be updated first.
Note that unloading the open source brcmfmac driver used on okreader
is slower than unloading the proprietary driver shipped by Kobo,
making this delay even more noticeable.
self.suspend() is scheduled after the network manager calls to avoid
race conditions.
* Start battery stat plugin
* BatteryStat & kobolight
* Several minor improvements
* Remove a useless function
* flush settings
* Some review feedbacks
* Resolve review comments
* Remaining Minutes -> Remaining Hours
* Add dump_file
* typo
* realpath
* realpath on folder
* Remove useless os.time()
* Resolve review comments
* warning
* Add BatteryStat.debugging flag
* treat log as txt
* Minor improvement
* Charging hour should be positive
* Use warn instead of info
* onSuspend in Kobo
* Charging events for kobo and kindle
* More events
* dumpOrLog
* Warnings
* Typo
* More space
* Singleton
* slightly format change
* BatteryStat singleton
* Init
* Remove debugging flag
* sleeping percentage is still negative
* Read settings
* Do not need to change was_suspending and was_charging
* Typo
* Remove debugging flag
* Not charging should happen before suspend
* Resolve review comments
* was_suspend and was_charging should be updated each time in onCallback()
Touch zone decouples screen size from gesture event registration.
The win here is each individual widget does not need to update
gesture range on screen rotate/resize anymore.
Another advantage is we now have a centralized ordered array to handle
all registered touch event listeners, makes it much easier to resolve
gesture range conflicts between multiple widgets.
This patch also includes the following changes:
* migrate readerpaging to use readerui's touch zone
* migrate readerfooter to use readerui's touch zone
* move inverse read direction setting to touch menu's setting tab
* moved kobolight widget from readerview into readerui
* various dead code cleanups and comments
This changes the behavior of the powered off transition phase for the
Kobo devices: instead of displaying a confirmation dialog, a screensaver
is used after a 2 seconds press delay.
Users can specify separate directories/files/messages for the powered
off and sleeping states through the `path` and `message` attributes of
the `{poweroff,suspend}_screensaver` settings.
Fixes#2327 and closes#2306.
The ABS_PRESSURE ABS code is also detected on some KOBO devices
if ABS_PRESSURE events are feeded to handle orientation those devices
will have a unresponsive screen as described in #2219.
This patch registers an event adjustment handler for Kindle Oasis to
adjust the ABS_PRESSURE code to ABS_OASIS_ORIENTATION code so that
it won't affect event handling on other devices.
Disable wakeup_count handling, that's often causing more harm than
anything else...
Nickel doesn't even use it, that should have been a hint ;).
Make the logging slightly less confusing.
Add commented out debug features (dumping relevant dmesg output).
Re #2188
* Fix touch input on the 3G KOA
There's an extra controller in there screwing things up for us,
because reasons, I guess?
Fix#2181
* Avoid touch_dev duplication
this should implement feature request of zoom mode for multi-columns
page in #501
This PR depends on koreader/koreader-base#435
How to use?
1. Tap the top left corner of a PDF/Djvu page to get into the flipping
mode
2. Double-tap on text block will zoom in to that column
3. Double-tap on any area will zoom out to an overview of the page
4. repeat step 2 to focus to another page block
How does it work?
1. We first find the mask of text blocks in the page. (Pic 1)
2. Then we intersect page boxes with user tap to form a page block. (Pic 2)
3. Finally we zoom the page to the page block and center current view to
that block. (Pic 3)
We pretty much always want to turn it off on suspend, and turn it on to
some measure on wakeup.
That, and nickel's FrontLightState is completely nonsensical on my device anyway...
Which I broke the last time I touched this.
NOTE: I'm not quire sure why the bbsave/bbrestore on stop/resume did a
double check (screensaver & charging), because that effectiely disabled
it when charging, which I don't quite understand...
Also makes sure the needsScreenRefreshAfterResume flag is honored on
Kindles, because we need it on FW >= 5.7.2
Note that this *breaks* the behavior with passcode enabled, which was
unwittingly fixed in said previous changes...
re #1811
* Drops support for mocking the frontlight setting internally which may
cause incorrect in-memory values.
* Adds new supported value for `KOBO_LIGHT_ON_START` (-2), which sets
'Kobo eReader.conf' as the source to update `settings.reader.lua`'s
brightness setting on startup, thus using the value from it
indirectly.
* Adds the `KOBO_SYNC_BRIGHTNESS_WITH_NICKEL` configuration variable
which updates 'Kobo eReader.conf' every time the brightness setting is
changed within koreader.
* Fixes missing call to save brightness when modifying via two-finger
swipe.
Closes#1523.
Making sure to always show up to date info.
Also fix the battery polling cache invalidation logic to actually
work?
Should make it behave properly on devices where we handle resuming
ourselves.
Currently only tested on Ubuntu-touch emulator with framework
ubuntu-sdk-14.10 for armhf.
The ubuntu-touch port is binary compatible with the Kobo port
major changes in this PR are:
1. rename the emulator device to sdl device since both the emulator
and the ubuntu-touch target use libsdl to handle input/output.
2. ubuntu-touch app has no write access to the installation dir so
all write-outs should be in a seperate dir definded in `datastorage`.
And also probably prevent a crash when trying to enable WiFi there.
We really shouldn't even show the WiFi stuff on some of these old
devices, but at least now it doesn't crash ;).
Guard against trying to get any kind of frontlight info on devices
without one.
So far the flIntensity prop has always been there, even on devices
without one, but better not assume that'll always be the case ;).
That, and be consistent with the other lipc_handle tests.
My batch of startup script tweaks should ensure PRODUCT is always
exported.
Leave the fallback in place, to avoid blowing up in weird corner-cases I
haven't thought about.
I've tested this on a N905C. I assume this implementation never
worked (since charge_now is supposed to show state of charge), but
it would be useful to get a confirmation.
in order to have debugging facilities in framebuffer:init(), we hand
over the debug function as soon as we can.
Also, set a viewport for Kobo Mini. Hopefully, it fits most people -
I can only test on my unit.
This allows for Viewport debugging. It is configured via an environment
variable, EMULATE_READER_VIEWPORT. It works with Lua table syntax, e.g.:
EMULATE_READER_VIEWPORT="{x=10,w=550,y=5,h=790}"
Events have been passed to the frontend/device (or /input) code before.
Some of them have been handled in the FFI/input code, however. That
seems to be highly critical with regard to timing, though, so we just
let it enqueue the event for our code to process later. That way, a
mutex that locks the input event queue can be freed faster.
Lots of the device-related distinction wandered into
base/ffi/framebuffer_<driver>. This eases the refresh logic in
UI manager, which basically only decides what kind of refresh
to trigger. The device specific configuration in the framebuffer
driver decides how to realize that whish.
screen.lua is gone, in its place is now the framebuffer driver.
The device abstraction decides what framebuffer driver to load.
This adds more documentation about the viewport offset calculations
for refreshing rotated viewports.
The old behaviour also was (still) buggy, even after the latest round
of fixes. Now, the offsets when rotated are hopefully calculated correct.
The calculation did not correctly calculate the offset in rotated
modes when the rotation was 90 or 270 degrees. Under these circumstances,
getWidth() and getHeight() did return rotated values for the framebuffer,
while Device.viewport did return not rotated values.
WIP, untested, can probably simplified some more.
Good news is, it should be smarter, and thus provide a smoother user
experience :).
Relies on the relevant changes in base.
FIXME!
Needs actual confirmation from people with the HW!!
Once that's done, some device checks will probably need to be
udated in the codebase to take those new devices into account ;).
This should fix#1016.
Usage for #1016:
Create a file named "custom.event.map.lua" in the koreader directory
with the following content:
return {
[102] = "LPgFwd",
}
This is a major overhaul of the hardware abstraction layer.
A few notes:
General platform distinction happens in
frontend/device.lua
which will delegate everything else to
frontend/device/<platform_name>/device.lua
which should extend
frontend/device/generic/device.lua
Screen handling is implemented in
frontend/device/screen.lua
which includes the *functionality* to support device specifics.
Actually setting up the device specific functionality, however,
is done in the device specific setup code in the relevant
device.lua file.
The same goes for input handling.