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
WIP: [Android] Boox NovaPro sys natural backlight support #5331
WIP: [Android] Boox NovaPro sys natural backlight support #5331
Conversation
Wow, that's weird. Thanks for your time!
Yeah, some of the powerd code is now triplicated (it was duplicated before between Kobo and Cervantes). I will leave the abstraction out of the equation here unless you want to take a look on other devices powerd implementations. But yeah, something to figure out in the future. |
BTW @ColinKinloch: are you aware of #4551 (comment)? The SDK that onyx provides takes care of lights too among eink updates and other things. Feel free to give it a try if you wish. Anyways until somebody integrates the onyx sdk with https://github.com/koreader/android-luajit-launcher this PR can help! |
The |
However they only seem to map to the boox frontlight config dialog. |
Yeah, they're free to It works this way:
That's weird. Does this happens on every app? As I said, feel free to workaround this as you like. But I find your current implementation (writtind directly to sys nodes instead of using WRITE_SETTINGS permission) simpler and less hackier. |
I'm writing and verifying the values using |
Yes. |
I just give a quick look at the sdk. It seems that the methods used to retrieve and set light values are (for rk32xx) in https://github.com/buggins/coolreader/blob/master/android/src/com/onyx/android/sdk/device/RK32XXDevice.java#L797-L817 Edit: But, as you can see just above the hightlight, it seems that first needs to open the frontlight and to close once its done, so it seems exactly the same that you already implemented as just access to the /sys file descriptors via jni / framework methods. |
About e-ink devices: It seems that an already supported epd update routine does work on rk32xx devices. You can test that with EinkTest. If the method called "ntx" works on your device you can add it to our list of supported devices as |
01e9bfa
to
3dec2f5
Compare
The UI on the Nova Pro has two independant sliders to control white and warm frontlights seen here. Initialising / updating the brightness / warmth values from the hardware values for koreader is not a simple problem. Would a simpler equation, per device equation or an option for a 0 - 255 slider per backlight colour be possible? koreader/frontend/device/sysfs_light.lua Lines 86 to 97 in 840d05b
|
@ColinKinloch: you're using (part) of the interface for devices that have separate green and red leds. You might want to replace frontlight_red with frontlight_mixer to apply the code path: koreader/frontend/device/sysfs_light.lua Lines 68 to 80 in 840d05b
This makes things a lot of easier than calculting warmth with a mix of R/G leds |
frontend/device/android/device.lua
Outdated
hasLightLevelFallback = no, | ||
frontlight_settings = { | ||
frontlight_white = "/sys/class/backlight/white", | ||
frontlight_red = "/sys/class/backlight/warm", |
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.
use frontlight_mixer = "/sys/class/backlight/warm"
instead
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.
On mixer devices does writing to the /sys/class/backlight/x/color
change the backlight colour or change the brightness of a separate set of LEDs?
The two brightness files on the Nova Pro control independent sets of LEDs.
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.
We don't do that but probably the system does something like that (ie: adjust brightness intensity based on warmth level). See #4291 (comment).
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 feel like I cannot help because I don't know nothing about your device. Do you found some issues with your current implementation?
@ColinKinloch: please ping me when you want a review. I will also ping @NiLuJe since he implented the frontlight mixer and has awesome reviewer skills 😄 |
Superseded by #6426 @ColinKinloch: feel free to submit an updated PR. You can implement your own controller using one of the existent as a template. See GenericController and TolinoWarmthController. |
I recently bought a Boox Nova Pro (Android eInk device).
It doesn't respect the android system brightness settings.
It has two frontlight types white and orange at
/sys/class/backlight/white/brightness
and/sys/class/backlight/warm/brightness
respectively.Much of the code in this merge request is copied from the kobo frontend.
I feel much of the auto warmth code should be move to the generic frontend.
Any pointers on how this code could be improved would be appreciated.
white/device/uevent
andwarm/device/uevent
contain:https://github.com/torvalds/linux/blob/master/Documentation/ABI/stable/sysfs-class-backlight
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight/lm3630a_bl.c
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight/backlight.c
This change is