FORUMS

XDA Recap: This Week In Android (May 17 – 23)

Another week, another recap. The Sunday tradition marches on this week with a fresh … more

Huawei To Sell Honor Smartphones Via Indian Retail Outlets

World’s fourth largest smartphone maker Huawei plans to now sell its … more

Sunday Debate: Are Smaller Bezels Better or Worth It?

Bezels have been getting smaller and smaller as the years go by, and while devices … more

LG G4 First Impressions and Unboxing – XDA TV

The latest in LG’s signature line of “G phones” has been released. … more
Post Reply Subscribe to Thread Email Thread

[APP][4.4+][2015.02.24] CF.lumen v3.00

9th April 2014, 10:10 PM |#1  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 60,499
 
Donate to Me
More
About

CF.lumen adapts the colors on your Android device based on the position of the sun, or your custom configuration.

When using the default settings, your display will get a warmer tint (lower color temperature) when the sun is down, vastly reducing strain on the eyes. This will take some getting used to, though! The colors also match closer to common artificial light sources, than the daytime light you get from the sun. Blue light makes your brain want to stay awake, and a lower color temperatures reduces the amount of blue displayed; using this in the evening also reduces your brain's effort to keep you awake at night, and can be beneficial to your sleeping pattern. (For your laptop/computer, see find f.lux for this functionality)

During sleeping hours by default a red filter is used. Red strains your eyes the least, and retains your night vision.

Light sensor

The light sensor can be used to automagically adjust the color: switch to the sleep filter in full dark, or to the day filter (usually none) under bright lights.

Because light sensor quality varies wildly between devices, a calibration option is provided. Most devices seem to work fine with sliders set all the way to the left, others need them to be set all the way to the right. Experiment as needed, but be warned that some devices simply cannot distinguish between evening indoor lighting and full darkness, and this feature may thus not work well for you.

Color filters

Several filters are provided. Those named after a color (red, green, blue, amber, salmon) do not limit the display to those colors, but convert the displayed image to grayscale first, then display that image in levels of the selected color, instead of levels of all channels (white). This preserves details that would otherwise be lost.

Grayscale, invert colors, temperature adjustment and custom R/G/B adjustment filters are also provided.

Colorblindness

The master color filter setting also has an option for colorblindness enhancement, with settings for protanopia/anomaly, deuteranopia/anomaly and tritanopia/anomaly. These options redistribute colors across the spectrum, in theory enhancing clarity and color detail.

No claims are made to the effectiveness of these filters, but positive reports have been received from testers. Also note that these filters were thought up by Google engineers - CF.lumen just includes them.

Pro version

Upgrading to CF.lumen Pro will support my developments, remove all nags, unlock the option to start at device boot (make sure you test your configuration first), and unlocks notification options. It also enabled Tasker integration.

In Pro mode, the notification adds convenient buttons to quickly disable the current filter or switch to sleep mode, and you can switch the notification to when enabled mode, which shows the notification only when a color filter is active.

In non-Pro mode, the notification only asks you to upgrade to Pro. It may seem that notification is just there to annoy you, but it actually prevents Android from randomly killing the background service taking care of all the work. Getting rid of it without getting the service killed can be done by going to Settings -> Apps -> CF.lumen and unticking Show notifications.

As in the past CF.lumen was part of Chainfire3D, if you have the Pro package of the latter installed, Pro mode will also be enabled.

Drivers

CF.lumen currently supports three driver backends to adjust the display: the original CF.lumen driver, the KCAL kernel driver, and the rootless (non-root) overlay. See the driver section below for further details.

Performance

When no color filter is active, there should not be any noticeable performance impact. When a filter is active, impact depends on device and what you are doing. On some devices we have tested there was no performance impact at all, on others it was slightly noticeable.

Performance characteristics change based on the driver you are using. See the driver section below for further details.

History

Nightmode - now called 'sleep mode' in CF.lumen - was actually the kick-off of Chainfire3D's development, and the later arrival of the original CF.lumen additionally containing the functionality to change color temperature based on the sun's position. Completely different (and no longer possible) techniques were used to get similar results. There were fewer options, and the filters limited display to the selected channels instead of the currently used much higher quality method of displaying luminance levels on the selected channel.

Future

Keep in mind that Android's rendering system changes over time. This app was possible in the old days of Android, and then wasn't possible for a long time. Only with KitKat did it become possible to make this work again. As such, you should be aware that this app may simply stop working on future Android versions without the possibility of a fix.

Scary permissions

By far most permissions are used only for Google Maps to set your location, and Google Play to provide for In-App Purchases. I cannot make any claims as to what information the Google components do or do not send to Google servers, but no information is sent to me or anyone else (than Google).

Download

Get CF.lumen at Google Play

It needs Android 4.4 KitKat or newer!

Screenshots
Attached Thumbnails
Click image for larger version

Name:	screenshot-phone-small-ui-1.png
Views:	22949
Size:	71.8 KB
ID:	2678219   Click image for larger version

Name:	screenshot-phone-small-ui-2.png
Views:	22294
Size:	63.2 KB
ID:	2678222   Click image for larger version

Name:	screenshot-phone-small-home-day.jpg
Views:	23045
Size:	38.7 KB
ID:	2678223   Click image for larger version

Name:	screenshot-phone-small-home-sundown.jpg
Views:	22793
Size:	87.1 KB
ID:	2678224   Click image for larger version

Name:	screenshot-phone-small-home-sleep.png
Views:	22127
Size:	161.0 KB
ID:	2678225  
Last edited by Chainfire; 24th February 2015 at 12:06 PM.
The Following 156 Users Say Thank You to Chainfire For This Useful Post: [ View ]
 
 
9th April 2014, 10:12 PM |#2  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 60,499
 
Donate to Me
More
Walkthrough video



GIF



Drivers

CF.lumen currently supports three driver backends to adjust the display: the original CF.lumen driver, the KCAL kernel driver, and the rootless (non-root) overlay. Driver selection will only be presented to you if multiple drivers are actually supported on your device.

Drivers: performance background

Software compositing is when your device takes the different surfaces on screen (the app's display, the status bar, the navigation bar, a popup window, these are all surfaces), draws them into a single buffer, then lets the hardware display this buffer. Virtually all modern devices can also do hardware compositing, where these different surfaces are presented to display hardware themselves, skipping one drawing step. It should be noted however, that hardware compositing only supports three surfaces (usually), so only the most basic scenes can be rendered this way. If more than the number of supported surfaces are displayed, the system falls back to software compositing automatically. Performance is slightly lower when this happens, but it happens all the time, and I doubt you've ever noticed it without looking for it.

One specific note about this is that "secure" content (DRM protected video rendering, for example) can only be hardware composited, as the software is not allowed to gain access to the surface. So if you are experiencing video disappearing, it's because the system has switched to software compositing. This can be due to CF.lumen's driver, a color overlay, or even just a system popup pushing the number of surfaces beyond the number of supported surfaces by the hardware compositor.

Drivers: CF.lumen

The CF.lumen driver requires software compositing, as it changes the colors displayed during the software compositing step. Of course, it lets the system go back to hardware compositing if it's not actively changing colors. This can slightly impact performance.

This driver changes colors on the surface content level, and can perform all sorts of calculus before deciding what to display. This usually gives it the highest possible image quality output. For example, in the color channel modes (red - night mode, green, blue, amber, salmon), the image is first converted to a luminance-based grayscale image, and then output in the selected color channels. This dramatically improves clarity and detail over only displaying the selected channels. Taking red mode as an example, this means that green and blue image content still shows up in a shade of red, whereas normally all colors devoid of a red component would show up as full black. Because of the surface-based manipulation, the invert filter may sometimes show unexpected results.

This driver affects both full-screen screenshots as well as app screenshots. Aside from normal screenshot/cast purposes, these are also used by the system for animations and in the recent task lists, and thus it may sometimes appear like a filter is applied twice during rotation or while browsing the tasks list.

Drivers: KCAL

The KCAL driver is quickly becoming a popular kernel mod for Qualcomm devices. It allows color adjustments in the display hardware itself. There is no performance difference with this driver, but of course your kernel must support it. This is the fastest driver.

This driver changes colors on the display level, and is limited in the operations it can perform. It is fast, but the image quality can be less. In color temperature modes (probably your most used mode) there is no difference with the CF.lumen driver. In the color channel modes however, there is no luminance conversion. If you select for example the red mode, you will only see the red component of colors. Pure blue, pure green, or any color which is a mix of blue and green but not red, will appear black.

This driver affects neither full-screen screenshots nor app screenshots. It does not support the colorblind filter.

Drivers: rootless

The rootless fallback driver (for non-root users) uses a color overlay. This is an additional surface, causes at least one additional expensive full-screen rendering step, and is likely to throw your system into software compositing mode most of the time. This is the slowest (and ugliest) driver.

Image quality wise, it is no competition for the other drivers, but not everyone has root. Like the other screen color tint apps on the market (there are quite a few, and while CF.lumen is older than all of those, it is certainly not the best known or most popular one), a color overlay is used. Where the other drivers properly manipulate the displayed colors, this driver is more like putting a half-transparent colored sheet over a picture. While it somewhat does the job, it lowers contrast significantly.

This driver affects only full-screen screenshots (but not full-screen animations), not app screenshots. It does not support the grayscale, invert, or colorblind filters.

Non-GApps firmwares

This app uses Maps for manual location setting, and Play for purchasing Pro. An increasing number of users do not have GApps, for privacy, security, and other concerns. If the app is installed on such a firmware, your location will be determined using the normal location API (without manual override, so your phone has to be able to determine your location). As I do not want to deprive anyone from the potential health benefits of sleeping better, the app operates in Pro mode if you do not have the Play store installed (PayPal'ing me beer money is always an option).

The APK is attached to this post for those not using Google Play (only).

Under no circumstances are you allowed to (re-)distribute this APK
(v2.00: 32, v2.05: 180, v2.10: 164, v2.16: 288, v2.25: 118, v2.40: 555, v2.50: 546, v2.60: 39, v2.61: 132, v2.66: 27, v2.71: 563, v2.74: 388, v2.75: 1042)
Attached Files
File Type: apk CF.lumen-v3.00.apk - [Click for QR Code] (818.9 KB, 2300 views)
Last edited by Chainfire; 24th February 2015 at 12:59 PM.
The Following 52 Users Say Thank You to Chainfire For This Useful Post: [ View ]
9th April 2014, 10:12 PM |#3  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 60,499
 
Donate to Me
More
Changelogs
2015.02.24 - v3.00 - RELEASE NOTES
- (C) 2015
- Added KCAL driver (see XDA thread for details)
- Added Rootless driver (see XDA thread for details)
- Added freeload option
- Backuptool script updated (requires un-/reinstall of driver to become active)

2014.12.22 - v2.75
- Change notification flags
- Fix driver detection issue which could lead to bootloops on devices with symlinked busybox
- Work-around one case of bootloops, detect that case, and warn about it

2014.12.02 - v2.74
- Fix remote control issue

2014.11.19 - v2.72
- Fix issue with in-app billing

2014.11.14 - v2.71
- Hide notification from (secure) lockscreens on L
- Check free space before installing driver

2014.11.06 - v2.70
- Tasker integration (Pro only)

2014.11.05 - v2.66 - RELEASE NOTES
- Android 5.0 fixes
- 64-bit fixes
- Performance improvement

2014.10.22 - 2.61
- Fix UI bug where settings wouldn't open sometimes

2014.10.22 - 2.60 - RELEASE NOTES
- Fixed a name issue with the recovery installer
- Automatically restart service when app is updated
- Expanded theme options, including material (basic)
- SELinux policy patches for LPX13D
- Experimental support for arm64, x86-64, mips64

2014.07.02 - 2.51
- Fix: ignore light sensor triggered sleep if forced awake during sleep hours

2014.07.01 - 2.50
- Installer fixes for latest AOSP
- Installer fixes for Android "L" Preview
- Added wake button to notification during sleep mode, which goes to sundown mode and is the default tap response - in contrast to disable, which disables all filters and is the default tap response while not sleeping
- Fixed issue where starting CF.lumen would not start the driver/service when not using Pro, and nothing would happen regarding screen colors, no matter which buttons you push

2014.04.16 - 2.40 - RELEASE NOTES
- Added brightness control to filters (actionbar option)
- Added option to wake from sleep mode when an alarm goes off
- Added option to install via custom recovery
- Added backuptool support (survive custom ROM nightlies) - un/re-install driver to activate if coming from an older version
- Fixed setting sleep filter to disabled using day filter at night instead of sundown filter
- Fixed filters occasionally sticking while modifying settings

2014.04.14 - 2.25 - RELEASE NOTES
- Various UI tweaks
- Added gradual filter fading, configurable for sunrise, sunset, sleep and sensor events
- Added notification icon options (keep notification but hide icon)
- Added light sensor based wake from sleep option
- Added driver update needed notification
- Added option to switch between light, dark, and device themes
- Added quick toggle menu items to main activity
- Improved (Pro) notification behavior - en/disable now default tap option when active
- Fixed kelvin and R/G/B choices not being saved between filter selections
- Fixed "Upgrade to Pro" from notification sometimes not working
- Fixed text wrapping on light calibration dialog

2014.04.11 - 2.15
- Fixed driver installation problem when using Superuser instead of SuperSU

2014.04.11 - 2.10
- Fixed crash on driver (un)install

2014.04.10 - v2.05
- Fixed a number of force closes

2014.04.10 - v2.00
- Initial public release
Last edited by Chainfire; 24th February 2015 at 01:27 PM.
The Following 25 Users Say Thank You to Chainfire For This Useful Post: [ View ]
10th April 2014, 05:28 PM |#4  
Senior Member
Thanks Meter: 262
 
More
Is there any practical difference between this and Lux?

Sent from my Nexus 5 using XDA Premium 4 mobile app
10th April 2014, 05:50 PM |#5  
Senior Member
Thanks Meter: 68
 
More
Quote:
Originally Posted by rlaw

Is there any practical difference between this and Lux?

Sent from my Nexus 5 using XDA Premium 4 mobile app

See walkthrough video on YouTube, and you will get the answer.

Sent from my Nexus 4 using Tapatalk
The Following User Says Thank You to leninke For This Useful Post: [ View ]
10th April 2014, 06:01 PM |#6  
Senior Member
Thanks Meter: 73
 
More
Is it possible that you could add Tasker compatibility? If not, are there public intents available to control cf.lumen through Tasker intents? Thanks for updating this great app.
The Following User Says Thank You to jackattack For This Useful Post: [ View ]
10th April 2014, 07:55 PM |#7  
erikieperikie's Avatar
Senior Member
Flag Enschede
Thanks Meter: 33
 
Donate to Me
More
EDIT: The latest update(s) fixed my problems. Thanks CF! Will buy if I like the app after a few days of use.

BUG:
I would love to include a logcat, but I simply don't have the time today or tomorrow. If needed, I'll post one this weekend.

When the app runs for the first time: grant su access, then I see the "please install cf.lumen driver". I click install, device reboots after a few secs, after reboot I wait for some time before opening the app again. When I open it, it asks me the same thing: install the driver. Wasn't the driver installed, or doesn't it detect the driver?

PHONE: Nexus 4, ROM: Paranoid Android 4.2 BETA 4 (that's Android 4.4.2 if you don't know), KERNEL: franco.Kernel #204.

On my first try I had Nexus Display Control (also by Franco) installed. My guess was the apps aren't compatible. After uninstalling both apps, reboot, installed cf.lumen again, install driver, reboot: same problem. So for now no cf.lumen for me. Just eye strain.

I hope this helps you find the bug or incompatibility I have!
Last edited by erikieperikie; 12th April 2014 at 01:12 PM. Reason: bugs fixed
11th April 2014, 12:28 AM |#8  
kodirovshchik's Avatar
Senior Member
Flag Dneprodzerzinsk
Thanks Meter: 69
 
More
Thumbs up 4.0+
Excellent, and we need it for Android 4.0+
The Following 2 Users Say Thank You to kodirovshchik For This Useful Post: [ View ]
11th April 2014, 12:37 AM |#9  
Senior Member
Flag Rochester, NY
Thanks Meter: 104
 
More
No love for 4.1 - 4.3 makes me a sad panda
The Following User Says Thank You to SirBindy For This Useful Post: [ View ]
11th April 2014, 12:41 AM |#10  
Senior Member
Thanks Meter: 1,226
 
More
Quote:
Originally Posted by kodirovshchik

Excellent, and we need it for Android 4.0+

+1. Although I favour the cool-factor and performance of custom ROMs, it's always nice to be able to get a similar experience on stock ROM (which is ICS for me), considering that there are no stable custom ROMs on my device at the moment. I'm actually in the midst of custom ROM development for my device, though I work on CM10.2. (There are others who work on KitKat). It would be much appreciated if the @Chainfire could add support for lower Android versions.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes