Support for Tagus Gaia (vs. Tagus Gea)
I own a Tagus Gaia, which identifies as "tagus_pokep". Incidentally, this is the same identifier as for the Tagus Gea, which is supported from #412.
However, my Tagus Gaia needs the OnyxWarmthController() for lights.
I've successfully built and tested an APK using the same drivers as used for the ONYX_POKE_PRO (Onyx/Qualcomm, OnyxWarmth).
I was going to open a PR but realize that due to this conflict it would break support for the Gea? Is there any way to distinguish these models other than the device identifier?
(Side question: is it normal that the entire screen flashes on each tap when using the on-screen keyboard or the menu? On Kobos, this doesn't happen.)
I own a Tagus Gaia, which identifies as
"tagus_pokep". Incidentally, this is the same identifier as for the Tagus Gea, which is supported from #412.However, my Tagus Gaia needs the
OnyxWarmthController()for lights.I've successfully built and tested an APK using the same drivers as used for the
ONYX_POKE_PRO(Onyx/Qualcomm, OnyxWarmth).I was going to open a PR but realize that due to this conflict it would break support for the Gea? Is there any way to distinguish these models other than the device identifier?
We need this info from Tagus Gaia and from Tagus Gea. Retrieved from eink test tool: Device info: Manufacturer: Brand: Model: Device: Product: Hardware: Platform:
If any of those fields are different we can distinguish that.
(Side question: is it normal that the entire screen flashes on each tap when using the on-screen keyboard or the menu? On Kobos, this doesn't happen.)
OldTolinoEPDController the driver used supports all modes: https://github.com/koreader/android-luajit-launcher/blob/master/app/src/main/java/org/koreader/launcher/device/epd/OldTolinoEPDController.kt#L15
Thanks, hugeo. This is what my Gaia reports:
Device info:
Manufacturer: onyx
Brand: tagus
Model: tagus_pokep
Device: tagus_pokep
Product: tagus_pokep
Hardware: rk30board
Platform: rk312x
I just saw that you already pinged Alfedi in the old PR and we already got a response, too (we can't get the info at this time). Should we just use the Model & Hardware or Model & Platform codes to identify the Gaia?
Any combination can be used and it can be more than two if needed. In this case, the hardware or platform should probably be different, since the Tagus Gea is an inferior device. Let's see what @pazos thinks about what policy we should follow in this case.
I believe it would be helpful to have all fields documented on PR tickets. If information for the Tagus Gea is not available, maybe we could consider removing it in favor of the Tagus Gaia until someone who owns a Tagus Gea can provide that information.
If information for the Tagus Gea is not available, maybe we could consider removing it in favor of the Tagus Gaia until someone who owns a Tagus Gea can provide that information.
Works for me.
@hugleo: please go ahead
@jonnyl2: please go ahead :) Add Hardware and Platform as well to identity your device and remove Tagus Gea
@hugleo, do you have any advice on how to fix these full-screen refreshes? (if it's an easy fix; if not, I'm afraid that will be beyond my capabilities.)
Also, the light settings works such that "Brightness" regulates the warm light intensity, and "Warmth" regulates cold light intensity. Anything I can do about this? (If not, no big deal to me. It's still infinitely better than no light settings.)
Maybe is your device doing these refreshes. You can test it removing your device from the driver.
If KOReader is doing the refreshes wrongly you can experiment with the parameters in the driver file https://github.com/koreader/android-luajit-launcher/blob/master/app/src/main/java/org/koreader/launcher/device/epd/OldTolinoEPDController.kt#L15 For example, you can change getMode from returning "all" to returning "full-only". You can also try adjusting the partial modes to see if a different combination works better for your device.
You can do the same for the lights doing the inversions in the file suited for your device https://github.com/koreader/android-luajit-launcher/blob/master/app/src/main/java/org/koreader/launcher/device/lights/OnyxWarmthController.kt
Once you get the driver working, just copy the files to new names and use those specifically for your device.
Thanks. I was able to find a working configuration for the EPD controller. I need help with the lights controller, though. It needs more than just a simple inversion of warm/cold light, but a function that regulates both light colors simultaneously for brightness, and some kind of mixer function that regulates the warmth while keeping brightness at approximately the same level across the spectrum.
There is also the issue that the light setting doesn't get saved across sessions. When opening a new book or the file browser, the light settings reset back to the values set outside of KOReader. I presume it has something to do with this message in ADB logcat:
E/Lights ( 424): write_int failed to open /sys/class/backlight/rk28_bl/brightness
but I'm a bit puzzled as to where that comes from, because the only reference to that brightness file I could find is in a different controller; the OnyxC67Controller.kt, so I'm not sure if that's related.
The paths to the correct brightness files are correctly assigned in OnyxWarmthController.kt:
private const val WHITE_FILE = "/sys/class/backlight/white/brightness"
private const val WARMTH_FILE = "/sys/class/backlight/warm/brightness"
although it should be noted that they are reversed on my device for some reason. white/brightness stores the warm light level, and warm/brightness the cold light.
Any help would be greatly appreciated (whoever can answer). Thank you.
The path /sys/class/backlight/rk28_bl/brightness appears to be used in OnyxC67Controller.kt. Maybe /sys/class/backlight/warm/brightness is just a symbolic link to that.
You can access your device using adb shell to test if there are other files in /sys/class/backlight and try to use those. Or some other form to write like NTX_IO_FILE in TolinoNtxController.kt. Other than that you could decompile an APK/framework and use the a Java class that works as is with some other light drivers.
Some devices don't grant permission if you are not rooted and even if you are rooted they may still not allow it.
But maybe there is a bug somewhere since if the light is saved normally in the e-ink test. You can add some logs to the KOReader files to figure out why. There also might be a problem with the mixer algorithm.
Yes, the files in /sys/class/backlight/white and .../warm are working correctly and are openly accessible. When changing the lights in a book it works as expected. But I don't know why KOReader is apparently trying to save the levels to ../rk28_bl/.. on exiting or suspend, even though that path is not mentioned in the OnyxWarmthController.kt, the controller assigned to my device in LightsFactory.kt.
Btw, is there some way to test the APK on my Linux PC? I assume I need some Android VM? What would be the best way? (Obviously I'd need it to be able to pretend to be a Tagus Gaia, as well.)
There's no need to simulate an apk on a PC.
You can simply place some logs in strategic locations within KOReader and view the logs on your PC using adb logcat. Or koreader tools:
./kodev run android-arm64
You can also filter the logs using grep:
./kodev run android-arm64 | grep -i lights
It’s possible that the issue is not with KOReader, but rather that your device is using this path for weird reasons.
Check if there are any symbolic links with:
adb shell ls -l /sys/class/backlight/
In KOReader, the only relevant reference is:
grep -ilr 'rk28_bl' ./* 2>/dev/null
./platform/android/luajit-launcher/app/src/main/java/org/koreader/launcher/device/lights/BoyueS62RootController.kt./platform/android/luajit-launcher/app/src/main/java/org/koreader/launcher/device/lights/OnyxC67Controller.kt
To determine if the issue lies with KOReader try changing the path in these driver files or removing all references in LightsFactory.kt in case your device is mistakenly matching those drivers for some reason.