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

Tolino Vision 6 Illumination Control #8429

Closed
DominikSchmidbauer opened this issue Nov 8, 2021 · 16 comments
Closed

Tolino Vision 6 Illumination Control #8429

DominikSchmidbauer opened this issue Nov 8, 2021 · 16 comments

Comments

@DominikSchmidbauer
Copy link

Illumination and light color can not be adjusted via the KOreader slider on the new Tolino Vision 6

@pazos
Copy link
Member

pazos commented Nov 8, 2021

It is a known issue for all e-ink android readers. See #5364 (a bit old, some stuff changed a lot).

Resumed in: If your device use non standard lights then you need to workaround yourself. We can't help without the device.

Saying that: it should work with TolinoWarmthController.

I'm not very fan of keeping a separate ticket for each device. I think we can push a LightsTestActivity and use a single ticket for all requests. It seems to work fine in #4551. (the epd counterpart).

I'll see if I get a couple of free hours to play with it

@pazos pazos added Android firmware help-wanted We'd like help with this issue labels Nov 8, 2021
@zwim
Copy link
Contributor

zwim commented Nov 8, 2021

@DominikSchmidbauer Thank you for your feedback.
Is the rest working? Screen refresh? No ghosting? Coverimage (screensaver)?

@pazos The Vision 6 seems to use Android 8.1 (all the other Tolinos have 4.4). The tolino reading app seems to be the same except the version number 15.1.0 vs 14.2.0.
I have asked the Tolino company very politly for a test device, but they are not interrested. Period.
Sorry I won't be of any help here, as I will definitly not buy a Vision 6. I like the bigger screen of my Epos2.

To your suggestion not to have a ticket for every device: +1
Maybe we should have one pinned ticket for EPD and one for other device quirks?

@zwim
Copy link
Contributor

zwim commented Nov 8, 2021

@DominikSchmidbauer Just a suggestion if @pazos does not find a solution (I strongly believe he will!).

Your name sounds familiar to me. If you live in Tyrol ("Unterland"), we could meet in person. You could lend me your device for a few days and we get that.

@DominikSchmidbauer
Copy link
Author

Today I checked again and suddenly the brightness controller was working.

The rest looks quite good so far, but I haven't checked the coverimage so far, it's just the standard tolino image.

@zwim Yes, indeed. How do you know me?

@zwim
Copy link
Contributor

zwim commented Nov 12, 2021

@DominikSchmidbauer : I don't know you personally, but an other Schmidbauer.

@pazos
Copy link
Member

pazos commented Dec 6, 2021

Test activity updated with both epd and light tests. We won't keep tickets opened for each one of the unsupported devices/drivers.

If somebody with the device wants to write a driver for it please follow instructions in #8482:

If you want to do the port yourself and need help please open a new ticket in https://github.com/koreader/android-luajit-launcher/issues and attach the report saved on your device in /sdcard/test.log

@pazos pazos closed this as completed Dec 6, 2021
@pazos pazos removed the help-wanted We'd like help with this issue label Dec 6, 2021
@t-8ch
Copy link

t-8ch commented Jan 11, 2022

I looked at my device and this is the data (With firmware 15.2.0, unrooted):

Manufacturer: rakuten kobo inc
Brand: rakutenkobo
Model: tolinovision 6
Device: e70p14_android
Product: e70p14_android
Platform: virgo

The existing driver does not work out of the box, because the backlight devices have different names and for Android APIs Koreader is missing the necessary settings permissions.
It is however possible to configure both brightness and temperature without root permissions via ADB shell.
The backlight devices are mxc_msp430.0 for brightness and lm3630a_led for color.
I can submit a patch to the existing TolinoWarmthController or submit a new driver that only contains the necessary logic for this device. (Without the calls to the Android APIs, shelling out to chmod, etc)

@pazos
Copy link
Member

pazos commented Jan 12, 2022

I can submit a patch to the existing TolinoWarmthController or submit a new driver that only contains the necessary logic for this device. (Without the calls to the Android APIs, shelling out to chmod, etc)

A new driver would be great.

It is however possible to configure both brightness and temperature without root permissions via ADB shell.

ADB shell has different SELinux context than unprivilegied apps. You can do a lot of things on adb shell that you won't be able to do in user apps.

Hopefully you won't need to write to sysfs nodes directly and just find the call used by the Tolino app that does that and the arguments needed for that call. If they implemented it using a Settings wrapper you might need to get runtime permissions for WRITE_SETTINGS.

If they wanted to avoid 3rd party apps to use that feature (and implemented it well) it won't be possible without root. AFAIK nobody cared about restricting it in the first place.

@pazos
Copy link
Member

pazos commented Jan 18, 2022

FWIW these are the permissions granted for the shell https://github.com/aosp-mirror/platform_frameworks_base/blob/master/packages/Shell/AndroidManifest.xml#L25

😭

@Frenzie
Copy link
Member

Frenzie commented Jan 18, 2022

Heh, are any missing? 🤣

@ChristophHeilmann
Copy link

I don't understand the problem here. The system settings for the frontlight are screen_brightness and screen_brightness_color. Only a runtime permission is needed to change these settings.

@pazos
Copy link
Member

pazos commented Feb 17, 2022

I don't understand the problem here. The system settings for the frontlight are screen_brightness and screen_brightness_color. Only a runtime permission is needed to change these settings.

The problem is always the same. The maintainer (me) doesn't have the specific device and relies on actual users of the device to add support for it.

Add support doesn't mean write the code yourself but document how the stuff works on that specific device (which you just did) and the parameters used as min/max brightness/warmth.

Ofc writting yourself a new controller and testing how it works makes my job much easier.

In that specific case it's a bit harder: the light controller interface exposes a boolean method requiresPermission (or similar, Im talking from memory) but it's not wired to the frontlight widget behaviour, mainly because no current driver relies on a runtime permission.

But if you get a new driver that works fine once you granted WRITE_SETTINGS permission elsewhere I will be happy to wire the stuff together so the fronlight widget/gestures will prompt you on the first run.

@t-8ch
Copy link

t-8ch commented Feb 17, 2022

@pazos Do you have a hint on how to find out which calls the stock firmware is doing?

@cl0rm
Copy link

cl0rm commented Nov 12, 2022

Issue still persists. Device is shown as unknown in the compatibilty tester

@cl0rm
Copy link

cl0rm commented Jan 3, 2023

I have done further research:
the Device /sys/devices/platform/soc/twi1/i2c-1/1-0038/backlight/lm3630a_led works for controlling both brightness and color temperature on mine (tolino vision 6, latest firmware, no root).

To change:
brightness: write to /sys/devices/platform/soc/twi1/i2c-1/1-0038/backlight/lm3630a_led/brightness (range 0 to 100)
ct: write to /sys/devices/platform/soc/twi1/i2c-1/1-0038/backlight/lm3630a_led/color (range 0 to 10) (0 is ww, 10 is cw)

There are also symlinks to this device somewhere, but I don't exactly know where. Probably better use those to access it.
Edit: Symlinks are going to
/sys/class/backlight/lm3630a_led/color
/sys/class/backlight/lm3630a_led/brightness
and /sys/class/backlight/mxc_msp430.0/brightness

Is this only a define somewhere that tells that the device is unknown?
Because the file does get mentionened in TolinoWarmthController.kt (COLOR_FILE_VISION4HD)

private const val ACTUAL_BRIGHTNESS_FILE = "/sys/class/backlight/mxc_msp430_fl.0/actual_brightness" is of course slightly wrong for this reader. (0.0, not fl.0)

I am more than willing to test it, so in where and how to define the reader as known, and where can I see which driver it's trying to use? The tester says unknown device, tolino NTX or root does not work there. But I don't know if the App even tries in the background. I doubt, because at least it should work with the color temp.

Edit: more Testing: the ntx_io variant does NOT seem to work without root on this device. The file can only be accessed with root

@t-8ch
Copy link

t-8ch commented Sep 2, 2024

I looked into how the stock reader does it and it works exactly as described in koreader/android-luajit-launcher#351 (comment)

Looking at the source of /dev/ntx_io showed that it won't be of any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants