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
Android: Gestures for Warmth makes it zero #8070
Comments
Pinging @Galunid |
I'll see what I can do, but no promises, since it's not really fault with my lights controller (I run into this when I was making it, and gestures/frontlight code passed "0" as a value to set). I looked into this back then, but nothing jumped out |
I wasn't implying that. Just pinged you since I thought you would be able to reproduce on your device. Also pinging @zwim to know if he can reproduce on a Tolino. I guess he won't as the first driver for custom lights controller was written by him for its own device and he's very nit-picker about these kind of features 😄 Maybe makes sense to have a fakeController enabled on the android x86 emulator to be able to test integration with the frontend?. Otherwise I won't be able to test the behaviour. |
On my Tolinos the right swipe works as expected. |
diff --git a/frontend/device/android/powerd.lua b/frontend/device/android/powerd.lua
index 475636aa..fd368595 100644
--- a/frontend/device/android/powerd.lua
+++ b/frontend/device/android/powerd.lua
@@ -1,3 +1,4 @@
+local logger = require("logger")
local BasePowerD = require("device/generic/powerd")
local _, android = pcall(require, "android")
@@ -48,7 +49,7 @@ end
function AndroidPowerD:setWarmth(warmth)
self.fl_warmth = warmth
- android.setScreenWarmth(warmth / self.warm_diff)
+ android.setScreenWarmth(warmth * self.warm_diff / 100)
end Works as expected, and I believe it makes sense. I'm a bit lost why it used to work on tolino though, so I'll investigate a bit more to not break it there ^^ |
@Galunid |
@mergen3107 Can you try this file? Remove whatever version you have installed first |
@Galunid
|
I think this is because 2021.05 didn't have Kon-Tiki 2 added to the list of devices, which happened in this commit: 2222f25 |
@mergen3107 Sorry about that, try this one. For the record, I added the device config, but forgot to set it to use the onyx light controller in place of the default one. This one should run the latest master and android-luajit. It also added some logging and rounding to int, which may help with light not being applied. Let me know if it does the trick. Remove any previous version, before installing this. Thanks for your time trying those. |
@Galunid P.S. I don't know whether this is intended or not, but both Brightness and Warmth in KOReader have absolutely no connection to System Brightness and Warmth. I did this:
This is not an issue per se, but it jumped out on me because AFAIK in Kindle the system brightness was in sync with KOReader's brightness. |
Also, the gesture "Toggle Frontlight" toggles only KOReader's Brightness, while Warmth stays the same. Shouldn't it toggle both at the same time? |
Is not intended but not our bug. We read and write directly from/to sysfs nodes. If your vendor provides a broken environment and some of the most hacked android roms is not something easily fixable, at least for us. OTOH android devices with the generic controller should work this way: in app brightness is an override of system brightness that only applies to the app when it is on the foreground. Restarting the app should pick the (updated or not) values of the system. That's the intended behaviour that will apply to 99'999999999% of android devices. Devices outside the norm have no intended behaviour so we can consider ourselves lucky if basic brightness/warmth controls work fine in-app 😄
That was an undocumented behaviour based on how most devices work: on a kobo/cervantes et al is not possible to turn off the frontlight without turning off warmth lights. If that's not the case on your device you need to fix it your specific device implementation.
This sentence also applies to any setting that works fine on a sane device (kobo/cervantes or compliant android device) but not on hacked up AOSP devices. Patches welcome but won't fix by default :) |
@pazos Thank you for details :) |
@mergen3107, can you turn on flash_ui and press
|
@hius07 |
Yes, flash_ui it is. |
I found Onyx SDK that has Frontlight Controller example: Can this help to make a better controller? |
Nope |
OK :( Thank you! |
Issue
In the test apk, which uses Onyx driver for e-ink screen, if I control Brightness and Warmth from the Top Menu - Frontlight, everything works as intended. pidcat also reports proper values from 0 to 255 for both.
However, if I use default Gestures "swipe up/down along the right edge", Warmth is immediately set to zero. This is also confirmed by pidcat. Brightness is fine though.
I tried to manually set other increments for gesture than default, like 1, 2 - does not matter.
The text was updated successfully, but these errors were encountered: