Skip to content

Hide frontlight controls on Xiaomi Reader and Moaan Mix7 (both RK3566) - #619

Merged
Frenzie merged 3 commits into
koreader:masterfrom
jkl16:hide-frontlight-xiaomi-moaan
Sep 15, 2026
Merged

Frenzie merged 3 commits into
koreader:masterfrom
jkl16:hide-frontlight-xiaomi-moaan

Conversation

@jkl16

@jkl16 jkl16 commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The Xiaomi Reader (rk3566_eink) and Moaan Mix7 have a frontlight, but the launcher has no driver for it. They fall through to GenericController, which adjusts the window brightness attribute. That has no effect on these panels, so KOReader shows a Frontlight menu entry, gesture actions and a footer brightness item that do nothing.

The RK3566 lights driver from #573 does not work here either. It writes to the lm3630a_leda / lm3630a_ledb sysfs backlight nodes and InkBook system properties, which these devices do not expose.

Change

  • Add QUIRK_UNSUPPORTED_LIGHTS in DeviceInfo.kt for devices that have lights no available driver can control. This is deliberately separate from QUIRK_NO_LIGHTS, whose entries all lack frontlight hardware, so the existing list keeps its literal meaning.
  • Device.hasLights is now false when either quirk is set. KOReader reads this through android.hasLights() and hides its frontlight UI.

Why hide rather than add a driver

On these devices the system already offers a good frontlight experience. Brightness and warmth are one swipe away in the system quick settings, and the firmware has an auto brightness option that adjusts to ambient light.
A KOReader driver would compete with that: it would have to write through a private vendor API, and any level it sets would be overridden as soon as the system's auto brightness or cached settings kick in. Leaving the light to the system is the simpler and more reliable behaviour, and hiding the non-functional controls makes that explicit.

Notes

  • Moaan Mix7 is included because it runs the same Moaan firmware as the Xiaomi Reader.
  • Tested on Xiaomi Reader: the Frontlight entry, gesture actions and footer item are gone; system brightness control is unaffected.

This change is Reviewable

@hugleo

hugleo commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@Frenzie

Frenzie commented Sep 5, 2026

Copy link
Copy Markdown
Member

But maybe add a tiny one-line comment saying it doesn't actually have no lights but that there's no added value to controlling them.

@jkl16

jkl16 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

I did consider adding them to QUIRK_NO_LIGHTS. I kept a separate quirk because I prefer code that documents itself: every device in QUIRK_NO_LIGHTS has no frontlight hardware, while the Xiaomi Reader and Moaan Mix7 do have one that we just can't drive. Merging them would make the "devices without lights" list untrue.

That said, this is a small thing and I don't want to hold up the PR over naming. If you'd both rather keep a single list, I'm happy to fold the two entries into QUIRK_NO_LIGHTS with a comment on each line, just say so and I'll update the branch.

@hugleo

hugleo commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Yes, a QUIRK_NO_LIGHTS with a comment will do it

…so KOReader shows brightness controls that do nothing.

Add QUIRK_UNSUPPORTED_LIGHTS, separate from QUIRK_NO_LIGHTS which lists devices without frontlight hardware, and make Device.hasLights false when either quirk is set so KOReader hides its frontlight UI.
EPD_AUTO (0) is dropped as invalid by MainActivity.einkUpdate(), so
full refreshes requested by KOReader never reached the panel.

Same fix as in koreader#611.
@jkl16
jkl16 force-pushed the hide-frontlight-xiaomi-moaan branch from 51ff63c to 1e7025b Compare September 14, 2026 07:55
@jkl16

jkl16 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Updated the branch:

  • Moved both devices into QUIRK_NO_LIGHTS as suggested.
  • Also added the RK3566 getWaveformFull fix. It returned EPD_AUTO (0), which MainActivity.einkUpdate() drops as invalid, so every full refresh was a no-op on these devices. The same fix is part of Add Rockchip e-ink device support: RK357x EPD controller, RK3566 full-refresh fix, OBOOK R501, Flow Mini #611, but that PR has been sitting without approval and bundles several unrelated device additions. Including it here gets the RK3566 devices a working full refresh without waiting on that one.

@hugleo

hugleo commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Looks like RK35xxEPDController.kt is already working for the Xiaomi 7 Reader: #478

You may break other devices if you change EPD_AUTO globally. It would be better to use a separate driver for this.

Also, I don't think the changes here will have any effect, because setMode is commented out and the code only calls sendOneFullFrame():

https://github.com/koreader/android-luajit-launcher/blob/master/app/src/main/java/org/koreader/launcher/device/epd/rockchip/RK35xxEPDController.kt#L57C19-L57C26

@jkl16

jkl16 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

What I did in #478 those 2 years ago only made EPD test procedure work properly for all RK3566 devices. Due to EPD_AUTO being interpreted as "invalid" (as described in #611) full screen refresh does not work on any RK3566 devices when requested directly by KOReader (another proof of this faulty behaviour is #608).
TLDR: EPD_AUTO value inside getWaveformFull() is a global bug for all RK3566 based readers - you only get a refresh in the test mode.

When it comes to sendOneFullFrame(), then it IS a proper way to do a refresh on those devices. Call to setMode would change the refresh algorithm, which is a totally different thing.

@hugleo

hugleo commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

All right, now I understand. getWaveformFull with 0 doesn't even call sendOneFullFrame because is ignored in some if/else clause...

@Frenzie
Frenzie merged commit 3767a02 into koreader:master Sep 15, 2026
3 checks passed
Frenzie added a commit to koreader/koreader that referenced this pull request Sep 28, 2026
Closes #16134, closes #14423.

* Add Onyx Boox Faraday 2 support and switch Poke3 to ADB lights (koreader/android-luajit-launcher#609) @hugleo 
* Fix EPD full refresh not working and add test entries for Lenovo Smart Paper (koreader/android-luajit-launcher#608) @4285f4
* Add Onyx Boox Go 6 Gen 2 support (koreader/android-luajit-launcher#616) @afzafri 
* Onyx Boox Go 10.3 Gen II (Lumi) (koreader/android-luajit-launcher#613) @SirProdigle
* Add e-ink refresh support for Topjoy E602. (koreader/android-luajit-launcher#618) @meeraez64-rgb 
* Change lights for Onyx Leaf and Onyx Poke3 (koreader/android-luajit-launcher#617) @hugleo 
* Nook GL4 Plus: make warmth survive B&N's colour temperature service (<koreader/android-luajit-launcher#620>) @backcountrymountains
* Apply android.supports_size_changes to the main activity (koreader/android-luajit-launcher#615) @xeropresence 
* Hide frontlight controls on Xiaomi Reader and Moaan Mix7 (both RK3566) (koreader/android-luajit-launcher#619) @jkl16 
* Ridi Paper 3: switch EPD controller to Nook/NTX (koreader/android-luajit-launcher#621) @nar-io
benoit-pierre pushed a commit to benoit-pierre/koreader that referenced this pull request Sep 29, 2026
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 this pull request may close these issues.

3 participants