Skip to content
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

Frontlight will turn off after 1-5 min on Kindle Oasis 3 #9409

Closed
fw88 opened this issue Aug 4, 2022 · 12 comments · Fixed by #9411
Closed

Frontlight will turn off after 1-5 min on Kindle Oasis 3 #9409

fw88 opened this issue Aug 4, 2022 · 12 comments · Fixed by #9411

Comments

@fw88
Copy link

fw88 commented Aug 4, 2022

  • KOReader version: 2022.07 and 2022.06
  • Device: Kindle Oasis 3

Issue

The frontlight will turn off after 1-5 min. Every time. I've turned off the automatic dimmer.

Steps to reproduce

It happens every time for me.

crash.log (if applicable)

Koreader doesn't crash. I can turn the frontlight back on. It will turn off again after a few minutes.

Restoring version 2022.05 gets rid of this bug. I've had to revert to the old version.

@NiLuJe
Copy link
Member

NiLuJe commented Aug 4, 2022

What about the autowarmth plugin: Is that disabled, and if not how is it configured?

@fw88
Copy link
Author

fw88 commented Aug 4, 2022

I have the autowarmth set to location (sun's position). That works normally. I have auto dark mode turned on after sunset (with maximum warmth). The frontlight will turn off after a random number of minutes during dark mode as well.

This problem is only on 2022.06 and 2022.07.
2022.05 works fine.

@NiLuJe
Copy link
Member

NiLuJe commented Aug 4, 2022

Double-check that it works with the autowarmth plugin disabled; ping @zwim for actual ideas ;).

(We're going to need verbose debug logs too, so feel free to catch the issue in those :)).

@zwim
Copy link
Contributor

zwim commented Aug 4, 2022

We are fishing in the dark! We need more infos.

So first of all we need some crash.log. A cash.log has a lot of infos for debugging. It is more than a crash.log (although the name suggestsit ), it is a log of whats happenig. So please go to filemamager-tools-developer options and enable all of the debuggoimg stuff.

Which plugins are enabled?

Second disable all plugins. Does it work.

If no: crash.log

if yes, enable one plugin after the other ... tell us what plugins work and what not and post a crash.log for the not working.

@fw88
Copy link
Author

fw88 commented Aug 4, 2022

Ok. So I reinstalled 2022.07, disabled the auto frontlight plugin and the auto dimmer plugin. Now I have a new problem. Adjusting the auto warmth settings cause koreader to crash. Crash.log below:

            launching...

| |/ / _ | _ \ ___ __ _ | | ___ _ __
| ' / | | | |_) / _ / _ |/ _ |/ _ \ '
|
| . \ || | _ < __/ (| | (| | __/ |
|
|__/|_| __|_,|_,|___|_|

It's a scroll... It's a codex... It's KOReader!

[] Current time: 08/04/22-22:30:09
[
] Version: v2022.07

ffi.load: blitbuffer
08/04/22-22:30:19 INFO initializing for device KindleOasis3
08/04/22-22:30:19 INFO framebuffer resolution: {
["h"] = 1680,
["w"] = 1264,
}
[ko-input] Forked off fake event generator (pid: 28184)
ffi.load: libs/libmupdf.so
ffi.load: libs/libwrap-mupdf.so
ffi.load: libs/libfreetype.so.6
ffi.load: libs/libharfbuzz.so.0
ffi.load: libs/libzstd.so.1
ffi.load: libs/libutf8proc.so.2
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=19.682 ms

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 19.682/19.682/19.682 ms
08/04/22-22:30:20 INFO Loading plugins from directory: plugins
ffi.load: sqlite3
08/04/22-22:30:21 ERROR Failed to initialize autowarmth plugin: plugins/autowarmth.koplugin/main.lua:310: attempt to compare nil with number
./luajit: plugins/autowarmth.koplugin/main.lua:310: attempt to compare nil with number
stack traceback:
plugins/autowarmth.koplugin/main.lua:310: in function 'scheduleNextWarmthChange'
plugins/autowarmth.koplugin/main.lua:274: in function 'scheduleMidnightUpdate'
plugins/autowarmth.koplugin/main.lua:806: in function 'callback'
frontend/ui/widget/spinwidget.lua:197: in function 'callback'
frontend/ui/widget/button.lua:392: in function 'handleEvent'
frontend/ui/widget/container/inputcontainer.lua:263: in function 'handleEvent'
frontend/ui/widget/container/widgetcontainer.lua:95: in function 'propagateEvent'
frontend/ui/widget/container/widgetcontainer.lua:113: in function 'handleEvent'
frontend/ui/widget/container/widgetcontainer.lua:95: in function 'propagateEvent'
frontend/ui/widget/container/widgetcontainer.lua:113: in function 'handleEvent'
frontend/ui/widget/container/widgetcontainer.lua:95: in function 'propagateEvent'
...
frontend/ui/widget/container/widgetcontainer.lua:113: in function 'handleEvent'
frontend/ui/widget/container/widgetcontainer.lua:95: in function 'propagateEvent'
frontend/ui/widget/container/widgetcontainer.lua:113: in function 'handleEvent'
frontend/ui/uimanager.lua:1099: in function 'sendEvent'
frontend/ui/uimanager.lua:52: in function 'default'
frontend/ui/uimanager.lua:1608: in function 'handleInputEvent'
frontend/ui/uimanager.lua:1694: in function 'handleInput'
frontend/ui/uimanager.lua:1744: in function 'run'
./reader.lua:333: in main chunk
[C]: at 0x00013e9d
lipc-wait-event exited normally with status: 0

@fw88
Copy link
Author

fw88 commented Aug 4, 2022

I erased koreader folder and logs completely when I went back to 2022.05 so lost the original crash.log for the randomly turning off front light bug. Doh!

@fw88
Copy link
Author

fw88 commented Aug 4, 2022

Copying the autowarmth.koplugin from version 2022.05 seems to fix autowarm settings crash.

@zwim
Copy link
Contributor

zwim commented Aug 5, 2022

Ok. So I reinstalled 2022.07, disabled the auto frontlight plugin and the auto dimmer plugin. Now I have a new problem. Adjusting the auto warmth settings cause koreader to crash. Crash.log below:

Can you add j <= #self.sched_warmths in line 310 of autowarmth.koplugin/main.lua and see if the crash is solved?

diff --git a/plugins/autowarmth.koplugin/main.lua b/plugins/autowarmth.koplugin/main.lua
index 15b31228..bd4586f5 100644
--- a/plugins/autowarmth.koplugin/main.lua
+++ b/plugins/autowarmth.koplugin/main.lua
@@ -307,7 +307,7 @@ function AutoWarmth:scheduleNextWarmthChange(time_s, search_pos, from_resume)
         if self.sched_times_s[i] <= time_s then
             actual_warmth = self.sched_warmths[i] or actual_warmth
             local j = i
-            while self.sched_times_s[j] <= time_s + delay_s do
+            while j <= #self.sched_warmths and self.sched_times_s[j] <= time_s + delay_s do
                 -- Most times only one iteration through this loop
                 next_warmth = self.sched_warmths[j] or next_warmth
                 j = j + 1

This should only fix the crash. The original problem with frontlight turning off might still consist.

@fw88
Copy link
Author

fw88 commented Aug 7, 2022

Hi. I've added this line into main.lua finally. I can confirm this stops the crash from adjusting the 'warmth and night mode settings' in the autowarmth plugin from 2022.07.

With the 2022.05 autowarmth plugin and auto frontlight OFF the screen frontlight turning off problem stopped. I'll do a bit more testing with the edited 2022.07 plugin. The front light did still appear to be adjusting to the ambient light even with the auto frontlight plugin turned off though.

@zwim
Copy link
Contributor

zwim commented Aug 7, 2022

Thank's for confirming, the crash has stopped with #9411.

For the frontlight turning off problem, a complete crash.log and your settings.reader.lua would be helpfull.

@fw88
Copy link
Author

fw88 commented Aug 7, 2022

Thanks for the suggestions.

So something strange is happening. I reinstalled the stock 2022.07 autowarmth plugin, the one that caused the crashes, for testing. It now no longer crashes. I re-enabled all plugins, including auto frontlight. The front light turning off bug doesn't happen any more either.

The only difference in the last couple of days is that the kindle auto updated to 5.14.3.0.1 from 5.14.2.

I've attached the crash.log and settings.reader.lua (renamed to a txt file to enable upload) below. Bear in mind doesn't have the frontlight turning off bug (due to a complete delete and reinstall) but does have the autowarmth plugin repeated crashes.
crash.log
settings.reader.lua.txt

@fw88
Copy link
Author

fw88 commented Aug 7, 2022

Another update. Managed to recreate the crashing with the stock 2022.07 autowarmth plugin. It happens at night (I have dark mode on as the autowarmth setting). Using the modified plugin with the altered line 310 fixes this crash.
crash.log

Frenzie pushed a commit that referenced this issue Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants