Related
#include <cyanogen/std_disclaimer.h>
Ever wish your G1 had an activity light for the sd slot? Now it can!
The Linux kernel includes built-in support for triggers through sysfs (/sys/class/leds/*/trigger) which allow for such things to be set up. The only thing stopping us from using these is the fact that android triggers the lights manually, which then disables our trigger... What I've done is rename button-backlight to btn-backlight in the kernel, and added an init script to set it up automatically on boot. On G1 hardware, this results in the light under the call,home,back,end, and home buttons to flicker any time there's sd activity... I've applied the same patch for sapphire/myTouch and N1, although I have no way of testing these platforms, it shouldn't cause any problems.
This kernel:
-Is compiled against the latest cm-kernel code (as of May 21)
-Is available with and without bfs
-Turns your button panel into an SD indicator
-Includes an init script to set up the trigger at boot (runs before bootanimation!)
If you like my work, BUY CYANOGEN AND/OR KOUSH A BEER!
EDIT: look on page 5 for a update-sdled-v5.zip for the latest version... G1 (button backlights) and myTouch (jogball) support for sd activity without an init script, as well as a nand-disk option that can be set from a userinit.sh
EDIT: new v6 build on page 6.... rebased off the latest cm-kernel, which means oc support is now included....
whoops... I forgot to attach them... here's the files...
cool thanks a lot! will try that one now...
wow nice mod ! is it possible to change these led to the jogdial button underneath? i am using a mytouch - again,nice work...
Thanks! It should be easy enough to make that work... I just need to know what the jog dial is named under sysfs... I'll take a look at the code and see what I can find...
-------------------------------------
Sent from my HTC Dream
Meisterlampe2000: (or anyone else with a mytouch) could you please run the following command in terminal emulator or adb shell and post the output?
#ls /sys/class/leds
-------------------------------------
Sent from my HTC Dream
no problem!
it's called:
jogball-backlight
i can try it for you if u want!
Cool, so I found jogball-backlight declared in board-mahimahi-microp.c (strange, I expected to find it in board-sapphire...
I'll get it compiled and posted in a few minutes for ya
-------------------------------------
Sent from my HTC Dream
Awesome... Seems to slow down CSRom a bit though.
Is this overclockable?
i flashed on a mytouch with aosp 1.6 and overclock.update.zip - flashing this removed my OC.zip any ideas?
is it possible to check internal flash activity?
Overclocking is done at a kernel level, so in order to have both, I'd have to release an oc version... I've been considering running an oc kernel on my end anyway, so I will post a version with that once I've made the switch... as far as internal flash activity, I haven't discovered a way, but it should be possible... the only problem is that an led can only be set to one trigger, so if it is set up for internal flash, you don't get sd activity shown... I'll definitely be looking into it though
-------------------------------------
Sent from my HTC Dream
you should add it or at least try it, throw these two together and i think you might have something that'll be thrown into a lot of ROM's
myTouch jogball version
Ok, so here's a version that does the same thing, but with the myTouch jogball... THIS ONE WILL NOT WORK ON G1, as the init script sets up the jogball instead of the button backlight.. it is otherwise identical to the first one without bfs.
EDIT: wrong file edited... should work on the N1 trackball... if you wanna try the jogball on the myTouch, scroll down, I just posted another update
theMODEL22 said:
you should add it or at least try it, throw these two together and i think you might have something that'll be thrown into a lot of ROM's
Click to expand...
Click to collapse
Yeah, if I can find a kernel led trigger for the internal flash, I may be able to then create a trigger that will register with both triggers to provide a single activity light for both... I definitely like the idea
jummama said:
Ok, so here's a version that does the same thing, but with the myTouch jogball... THIS ONE WILL NOT WORK ON G1, as the init script sets up the jogball instead of the button backlight.. it is otherwise identical to the first one without bfs.
Click to expand...
Click to collapse
but as I said in the first post, I have no way of testing it... it shouldn't cause any problems... but as always NANDROID THAT ***** FIRST!
MH, the file location seemed to be strange...
It´s not working on Sapphire...
Here is what i get for /sys/class/leds
->blue,jogball-backlight,btn-backlight,lcd-backlight,green and red
I guess, all those mixed colors are done via RGB for the Status LED ?
...anyway, for the Jogball, it must be jogball-backlight somehow ?
Thanks for that first shot !
MH, the file location seemed to be strange...
It´s not working on Sapphire...
Here is what i get for /sys/class/leds
->blue,jogball-backlight,btn-backlight,lcd-backlight,green and red
I guess, all those mixed colors are done via RGB for the Status LED ?
...anyway, for the Jogball, it must be jogball-backlight somehow ?
Thanks for that first shot !
Click to expand...
Click to collapse
Hmm, looks like I need to do some more grepping... strangely, the only jogball-backlight I found was in a board-mahimahi file... so I guess this second release is actually just for any n1 users that want it on their jogball, lol
-------------------------------------
Sent from my HTC Dream
Hey!
Can you send only modified files for dream/trout ?
git, mail etc
pl_laszlo said:
Hey!
Can you send only modified files for dream/trout ?
git, mail etc
Click to expand...
Click to collapse
I attached a diff on the first post... the only thing I changed was the name declaration in board-trout.c...
the zip includes a /system/etc/init.d/02setledtrigger file that just echos the proper trigger into the newly renamed led
I came to the Charge after a brief stint with the Nexus S 4G. On that device, there was a Voodoo-based kernel available which allowed the user to make adjustments to the color settings of the display. AFAIK, these color modifications are not included in the Voodoo kernel for the charge. Does anyone know whether it is possible to incorporate these in a future kernel and/or whether there is any other method out there to tweak the display?
I looked at incorporating Voodoo Color, but the methods that are modified by the Voodoo Color changes do not exist in our display driver.
imnuts said:
I looked at incorporating Voodoo Color, but the methods that are modified by the Voodoo Color changes do not exist in our display driver.
Click to expand...
Click to collapse
Too bad. Thanks for the quick reply though, imnuts.
NOTE: I'm not responsible if anything happens to your phone. (as always)
=> Source
Framework & SystemUI fixes
This fix includes:
- App background color gradient - eg. in Settings,... (big thanks for this tutorial, aarun!)
- Fixed small/wrong icons across the system - mainly statusbar (again ), menu icons and in power menu
- really small percentage battery icon is a little bigger now
- fixed some lockscreen layouts and dimensions - lockscreens (mainly secure ones) should look better now.
=> Update.zip
[FIX][CM10 ONLY] Layout fixes (DISCONTINUED!)
Framework-related fixes
This fix includes:
- Proper (blue) overscroll effect color
- App background color gradient - eg. in Settings,... (big thanks for this tutorial, aarun!)
- Fixed small/wrong icons across the system - mainly statusbar (again ), menu icons and in power menu
=> Source (check README)
=> Update.zip
Changelog
27/4/2013 - Thread cleanup & CM10 fixes discontinued, started to work on CM10.1
13/6/2013 - Source code is now available at GitHub.
To do/fix/improve
Trebuchet.apk - dock and homescreen has bad spacing and align...
Do you think think that gradient shoukd be by default? It 's turned off by default.. or im wrong?
sad96 said:
Do you think think that gradient shoukd be by default? It 's turned off by default.. or im wrong?
Click to expand...
Click to collapse
It should be default. AOSP Nexus ROMs have it. Even if not, I will still try to add it, because without it it looks just weird for me...
EDIT: OK, anyway, gradient working
Do you know when the zip file is ready? I haven't really used adb much lately
Benjamin_L said:
Do you know when the zip file is ready? I haven't really used adb much lately
Click to expand...
Click to collapse
CWM says some errors, like I must use EDIFY type of updater-script and update-binary, but I have tried to do this but failed... anyway I'm now working on it as I also don't want to use adb for this and always set permissions manually
Update.zip added
Thanks for the fix - the orange overscrolling effect has been really bothering me (and the fact that you can't change it anymore (unlike CM7))
Just a question: What is the "fade to black effect"?
aletto said:
Thanks for the fix - the orange overscrolling effect has been really bothering me (and the fact that you can't change it anymore (unlike CM7))
Just a question: What is the "fade to black effect"?
Click to expand...
Click to collapse
On galaxy nexus when you are pulling down the notification tray, things behind it slowly fade to dark as you pull the tray. This should have been default.
Sent from my GT-I5800 using xda app-developers app
EDIT: AT THIS POINT ITS GALAXY NEXUS-specific feature which is not in CM yet... We have to wait till its merged or something...
Any idea of fixing Phone dial-er app?
Layout:
The erase key is on right side of input box,
Shouldn't the be in bottom right? sorry if I'm wrong, but i used to the bottom right.
Reason for the fix : When you choose a contact from smart dial, the first few numbers are hidden, only the last few digits are visible and make the user feels like it wasn't chosen. I'm using the international format like +YYXXXXXXXXXX ...
Search bug
Are you able to search a contact from call log tab or contact tab (not the people app)? I'm kind of missing it.
Anandababu153 said:
Any idea of fixing Phone dial-er app?
Layout:
The erase key is on right side of input box,
Shouldn't the be in bottom right? sorry if I'm wrong, but i used to the bottom right.
Reason for the fix : When you choose a contact from smart dial, the first few numbers are hidden, only the last few digits are visible and make the user feels like it wasn't chosen. I'm using the international format like +YYXXXXXXXXXX ...
Search bug
Are you able to search a contact from call log tab or contact tab (not the people app)? I'm kind of missing it.
Click to expand...
Click to collapse
I will have to look at it... and the erase key should be as it is now. Different position from ICS, its normal.
Hi,
Do I just flash the zip. file?
Sent from my SG 580 powered by CMX.
SamG3apollo said:
Hi,
Do I just flash the zip. file?
Sent from my SG 580 powered by CMX.
Click to expand...
Click to collapse
Yep ... Please Use CWM (Recovery Mode) to flash the zip.
Progress update
OK, I'm now stuck on bootloop after testing my another fix with icons (complete remake of them to JB ones) I'm working on solution how to pass that and after that, I'll update OP with another improvement
Another progress update + fix available
OK, fixed icons mainly in statusbar area, changed from GB ones, now looks a lot better with JB ones, also fixed bad icons in power menu.
FINALLY
Cool work , there is problem with very small and distorted fonts too with default launcher with ADW launcher it's fine but still.
vishal8492 said:
Cool work , there is problem with very small and distorted fonts too with default launcher with ADW launcher it's fine but still.
Click to expand...
Click to collapse
Thanks, is this issue present even in CM7/CM7 with holo launcher? Because I think it will be due to our phone's resolution/screen size... isn't it?
Sent from my GT-I5800 running CMX
Flashed the current update.zip ....
Appreciate the blue cursor in the input box
Ideas:
Is it possible to have blue active icons in the notification drawer? Let that be white at in-active state.
Also the dial-er app drop down arrow while getting more than one search result (Where is it??? CM bug?)
The missed call notification is now in black & white. Is it correct?
Anandababu153 said:
Flashed the current update.zip ....
Appreciate the blue cursor in the input box
Ideas:
Is it possible to have blue active icons in the notification drawer? Let that be white at in-active state.
Also the dial-er app drop down arrow while getting more than one search result (Where is it??? CM bug?)
The missed call notification is now in black & white
Click to expand...
Click to collapse
1st of all, I changed all icons as they should be. That means, back/white icons are in holo theme, official in Android 4.0.4+ now. The icons before with exp. build 1 were GB ones, because in android source repository are no JB icons for LDPI/MDPI yet - I guess that is placeholder for later... So I came with at least this solution because I don't think they will continue with LDPI (old) resolution support for icons, because they wasn't even in ICS...
And for the blue icons... I'm trying to make it as close as possible to official CMX/JB as possible, because for our resolution default layouts are just uggly.. No blue icons in CMX, so no icons that I will do Just official JB because for LDPI is yet undone. It will be good to have theese fixes merged to marcellusbe's port so it wont have this type of issues.
Night light is an open-source app which uses KCAL to adjust blue light intensity of the display colors, so that viewing the screen at dark becomes pleasant for the eyes, and help you fall asleep faster (this is what science have proven so...).
Features
Easy to use user interface. Settings are easier to find.
Uses KCAL to adjust screen RGB colors, hence its efficient and changes are seen everywhere on screen.
Supports older KCAL implementations as well as newer KCAL implementation for v4.4 kernels.
Simple color controls for normal users through color temperature control.
Manual KCAL controls for advanced users.
Automation routines lets you define routines where you specify Night Light settings which you wish to apply, and they will be automatically applied for you in specified times.
Intensity fading in/out is supported as part of automation routines.
Supports sunset/sunrise timings.
Set on boot delay.
Original KCAL settings of user is backed up and applied when night light is turned off. And it can be configured as well.
Support for user profiles, which are collections of settings that user can apply with one click.
And to fulfill your all kinds of automation needs, app is supported as a Tasker plugin. You can use it with Profiles.
Option to automatically disable Night Light in lock screen, and turn it back on after the device is unlocked.
Quick Setting tile for easy toggling on/off night light anywhere.
Launcher icon shortcut for toggling Night Light on/off and toggling intensities.
Dark and Light theme.
Advantages
No overlays.
Background service is only used for lock screen option. The entire automation (including the fading) is done using neat AlarmManager tricks (which not only is battery friendly, but memory friendly as well).
Requirements
Kernel supporting KCAL.
Root access.
Download
Source - https://github.com/corphish/NightLight
Wow. Thanks for this awesome app. This is my best daily night light app.
Thanks
sounds good
let me have a try brother......
corphish said:
Night light is an open-source app which uses KCAL to adjust blue light intensity of the display colors, so that viewing the screen at dark becomes pleasant for the eyes, and help you fall asleep faster (this is what science have proven so...).
Features
Easy one touch toggles, with a single slider to tweak blue light intensity.
Quick Setting tile for easy toggling on/off night light anywhere.
Automatic switching on/off night light at user specifed timings. (Limitation - Start time must be lesser in value than ending time, that is if you choose starting time at 2300 hrs and ending time at 0600 hrs (next day) it won't work for now).
Requirements
Kernel supporting KCAL.
Root access.
Download
Source - https://github.com/corphish/NightLight
Click to expand...
Click to collapse
The automatic switch doesn't seem to be reliable. Could you add intents so it can be toggled with Tasker? I already have a profile that triggers at sunset so that would be perfect.
Sent from my Nexus 5X using XDA Labs
Great app, thanks. Have been using CF.lumen until now, but that seems unsupported (and is closed source).
Please keep improving it. Would also like to donate a beer.
Can you explain whats this KCAL thing ??? ??
thanks for this app apreciate it i got ADD and Slightly Autism and i already have an issue sleeping my brain get supercharged and i can't get to sleep but this app helps [email protected]
Loving the app so far, however, I notice it won't trigger at the time I have set unless I manually open the app. I've removed it from Android's battery optimization so I don't think that can be it. Any ideas?
rickysidhu_ said:
Loving the app so far, however, I notice it won't trigger at the time I have set unless I manually open the app. I've removed it from Android's battery optimization so I don't think that can be it. Any ideas?
Click to expand...
Click to collapse
Same here. I forgot to report it. I use Tasker to launch it at sunset & sunrise along with switching between dark / light app themes.
Sent from my Nexus 6P using XDA Labs
yochananmarqos said:
Same here. I forgot to report it. I use Tasker to launch it at sunset & sunrise along with switching between dark / light apo themes.
Click to expand...
Click to collapse
I ended up doing this as well! Now the other thing I'm hoping gets implemented is a smooth transition to the orange hue.
zaibansari20 said:
Can you explain whats this KCAL thing ??? [emoji848][emoji848]
Click to expand...
Click to collapse
Kcal is a kernel tweak that lets you customize colors at lower (kernel) level, so there won't be any filter or layer on screen, but in most stock kernels it isn't available, so you have to find a custom kernel for your phone/rom that has it.
Thanks for the app, but I've used tasker with the command "echo 180 75 35> /sys/devices/platform/kcal_ctrl.0/kcal" for a long time (echo 256 256 256 > /sys/devices/platform/kcal_ctrl.0/kcal to get the color back.)
Obviously you can change the values to whatever you want.
But the app will be much more easy for many people
Envoyé de mon ONEPLUS A5000 en utilisant Tapatalk
J0kker said:
Kcal is a kernel tweak that lets you customize colors at lower (kernel) level, so there won't be any filter or layer on screen, but in most stock kernels it isn't available, so you have to find a custom kernel for your phone/rom that has it.
Click to expand...
Click to collapse
I'm using LineageOS with a custom kernel which allows mein to change RGB values from any kernel modification app...
Sent from my LG G2 using XDA Labs
zaibansari20 said:
I'm using LineageOS with a custom kernel which allows mein to change RGB values from any kernel modification app...
Click to expand...
Click to collapse
So it should work for you, you can try with a kernel manager like kernel adiutor but the app should work.
J0kker said:
Kcal is a kernel tweak that lets you customize colors at lower (kernel) level, so there won't be any filter or layer on screen, but in most stock kernels it isn't available, so you have to find a custom kernel for your phone/rom that has it.
Thanks for the app, but I've used tasker with the command "echo 180 75 35> /sys/devices/platform/kcal_ctrl.0/kcal" for a long time (echo 256 256 256 > /sys/devices/platform/kcal_ctrl.0/kcal to get the color back.)
Obviously you can change the values to whatever you want.
But the app will be much more easy for many people
Envoyé de mon ONEPLUS A5000 en utilisant Tapatalk
Click to expand...
Click to collapse
I tried the Tasker method and it works great. I had no idea that command existed and could be used in Tasker. Thank you for sharing! :good: :highfive:
rickysidhu_ said:
Loving the app so far, however, I notice it won't trigger at the time I have set unless I manually open the app. I've removed it from Android's battery optimization so I don't think that can be it. Any ideas?
Click to expand...
Click to collapse
Does it fail to trigger if a reboot had happened sometime before the time it should have triggered?
For example, if it was to trigger at 5pm, but a device reboot happened in, say, 3pm, then does it fail to trigger at 5pm?
Anyway, set on boot is broken (again), will need to fix it, but normal timers should work fine.
corphish said:
Does it fail to trigger if a reboot had happened sometime before the time it should have triggered?
For example, if it was to trigger at 5pm, but a device reboot happened in, say, 3pm, then does it fail to trigger at 5pm?
Anyway, set on boot is broken (again), will need to fix it, but normal timers should work fine.
Click to expand...
Click to collapse
Ahh, that might be it. I think it stops working after a reboot, so I'd be going back into the app to get it going again.
Very minor issue though, great app - thank you for your hard work!!:highfive:
corphish said:
Does it fail to trigger if a reboot had happened sometime before the time it should have triggered?
For example, if it was to trigger at 5pm, but a device reboot happened in, say, 3pm, then does it fail to trigger at 5pm?
Anyway, set on boot is broken (again), will need to fix it, but normal timers should work fine.
Click to expand...
Click to collapse
Launcher shortcut (toggle on/off) switch is also seems somewhat broken, it toggle on but fails to toggle off.
@jineshpatel30 @rickysidhu_
Here is an experimental version (in the attachment of this reply), with launcher shortcut toggle and set on boot fixed.
The reason why it is experimental :
- Now written in kotlin
- Uses some of the new stuff announced in I/O 18, like ktx and the new material design style
- Uses different font called 'Acme'. (Feel free to suggest fonts)
- I decided to ditch cards because normal layouts look better in this new style.
Source - https://github.com/corphish/NightLight/tree/p
corphish said:
@[email protected]_
Here is an experimental version (in the attachment of this reply), with launcher shortcut toggle and set on boot fixed.
The reason why it is experimental :
- Now written in kotlin
- Uses some of the new stuff announced in I/O 18, like ktx and the new material design style
- Uses different font called 'Acme'. (Feel free to suggest fonts)
- I decided to ditch cards because normal layouts look better in this new style.
Source - https://github.com/corphish/NightLight/tree/p
Click to expand...
Click to collapse
It kicked in automagically at sunset tonight which reminded me to come back and comment. That was unreliable previously.
What does the save button do at the bottom? I assume it saves something, but there's no toast message to acknowledge it's been pressed.
I don't like the font, myself. Since you're going for new and fancy code and styling, why not use ProductSans? I like the new font used in the Wear OS app, I think that's it.
Could you add the numerical values for the sliders for more accurate fine tuning? I like the way the new XDA Navigation Gestures app does it. It's in the latest beta posted in the thread and should be pushed to the Play Store soon.
Since CF.lumen is EOL now, this app is going to be a great alternative especially when it eventually breaks.
Thank you!
Sent from my Nexus 6P using XDA Labs
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
K-Lapse : A kernel level livedisplay module
Intro - What is K-Lapse?
Kernel-based Lapse ("K-Lapse") is a linear RGB scaling module that 'shifts' RGB based on time (of the day/selected by the user), or (since v2.0) brightness. This concept is inspired by LineageOS (formerly known as 'CyanogenMod') ROM's feature "Livedisplay" which also changes the display settings (RGB, hue, temperature, etc) based on time. This is very very similar to f.lux for desktop too.
Why did I decide to make this? (A short story)
I (personally) am a big fan of the Livedisplay feature found on LineageOS. I used it every single day, since Android Lollipop. Starting from Android Nougat, a native night mode solution was added to AOSP and it felt like Livedisplay was still way superior, thanks to its various options (you could say it spoiled me, sure). I also maintained a kernel (Venom kernel) for the device I was using at that time. It was all good until the OEM dropped support for the device at Android M, and XDA being XDA, was already working on N ROMs. The issue was, these ROMs weren't LineageOS or based on it, so Livedisplay was... gone. I decided I'll try to bring that feature to every other ROM. How would I do that? Of course! The kernel! It worked on every single ROM, it was the key! I started to work on it ASAP and here it is, up on GitHub, licensed under GPL (check klapse.c), open to everyone
How does it work?
Think of it like a fancy night mode, but not really. Klapse is dependent on an RGB interface (like Gamma on MTK and KCAL on SD chipsets). In mode 1, it fetches time from the kernel, converts it to local time, and selects and RGB set based on the time. The result is really smooth shifting of RGB over time. Mode 2 uses the current brightness level to scale RGB, with the concept behind it being that lower brightness usually implies a dark environment, so a slight color temperature shift should help with eye strain.
There's also an option for a "brightness factor" that can reduce your brightness down to 80% below the minimum brightness that your phone allows. The catch is, it doesn't actually reduce the brightness, but rather uses a clever trick to fade away the RGB of the screen by the same amount so it "appears" to be lower brightness.
How does it really work (dev)?
Klapse mode 1 (time-based scaling) uses a method void klapse_pulse(unsigned long data) that should ideally be called every minute. This is done using a kernel timer, that is asynchronous so it should be handled with care, which I did. The pulse function fetches the current time and makes calculations based on the current hour and the values of the tunables listed down below.
Klapse mode 2 (brightness-based scaling) uses a method void set_rgb_slider(<type> bl_lvl) where type is the data type of the brightness level used in your kernel source. (OnePlus 6 uses u32 data type for bl_lvl) set_rgb_slider needs to be called/injected inside a function that sets brightness for your device. (OnePlus 6 uses dsi_panel.c for that, check out the diff for that file in op6 branch)
What all stuff can it do?
Emulate night mode with the proper RGB settings
Smoothly scale from one set of RGB to another set of RGB in integral intervals over time.
Reduce perceived brightness using brightness_factor by reducing the amount of color on screen. Allows lower apparent brightness than system permits.
Scale RGB based on brightness of display (low brightness usually implies a dark environment, where yellowness is probably useful).
Automate the perceived brightness independent of whether klapse is enabled, using its own set of start and stop hours.
Theoretically more efficient, faster by residing inside the kernel instead of having to use the HWC HAL like android's night mode. This is unproven and probably has no practical significance.
(On older devices) Reduce stuttering or frame lags caused by native night mode.
An easier solution against overlay-based apps that run as service in userspace/Android and sometimes block apps asking for permissions.
Give you a Livedisplay alternative if it doesn't work in your ROM.
Impress your crush so you can get a date (Hey, don't forget to credit me if it works).
Alright, so this is a replacement for night mode?
NO! Kinda, but no. Lemme explain. One can say this is an alternative for LineageOS' Livedisplay, but inside a kernel. Night mode is a sub-function of both Livedisplay and KLapse. Most comparisons here were made with night mode because that's what an average user uses, and will relate to the most. There is absolutely no reason for your Android kernel to not have KLapse. Go ahead and add it or ask your kernel maintainer to. It's super-easy!
What can it NOT do (yet)?
Calculate scaling to the level of minutes, like "Start from 5:37pm till 7:19am". --TODO
Make coffee for you.
Fly you to the moon.
Get you a monthly subscription of free food, cereal and milk included.
I want more! Tell me what can I customize!
All these following tunables are found in their respective files in /sys/klapse/
Code:
1. enable_klapse : A switch to enable or disable klapse. Values : 0 = off, 1 = on (since v2.0, 2 = brightness-dependent mode)
2. klapse_start_hour : The hour at which klapse should start scaling the RGB values from daytime to target (see next points). Values : 0-23
3. klapse_stop_hour : The hour by which klapse should scale back the RGB values from target to daytime (see next points). Values : 0-23
4. daytime_r,g,b : The RGB set that must be used for all the time outside of start and stop hour range.
5. target_r,g,b : The RGB set that must be scaled towards for all the time inside of start and stop hour range.
6. klapse_scaling_rate : Controls how soon the RGB reaches from daytime to target inside of start and stop hour range. Once target is reached, it remains constant till fadeback_minutes (#13) before stop hour, where target RGB scales back to daytime RGB. (Pre-v4.2 value was a factor, now it is a minute value)
7. brightness_factor : From the name itself, this value has the ability to bend perception and make your display appear as if it is at a lesser brightness level than it actually is at. It works by reducing the RGB values by the same factor. Values : 2-10, (10 means accurate brightness, 5 means 50% of current brightness, you get it)
8. brightness_factor_auto : A switch that allows you to automatically set the brightness factor in a set time range. Value : 0 = off, 1 = on
9. brightness_factor_auto_start_hour : The hour at which brightness_factor should be applied. Works only if #8 is 1. Values : 0-23
10. brightness_factor_auto_stop_hour : The hour at which brightness_factor should be reverted to 10. Works only if #8 is 1. Values : 0-23
11. backlight_range : The brightness range within which klapse should scale from daytime to target_rgb. Works only if #1 is 2. Values : MIN_BRIGHTNESS-MAX_BRIGHTNESS
12. pulse_freq : The amount of milliseconds after which klapse_pulse is called. A more developer-targeted tunable. Only works when one or both of #1 and #8 are 1. Values : 1000-600000 (Represents 1sec to 10 minutes)
13. fadeback_minutes : The number of minutes before klapse_stop_hour when RGB should start going back to daytime_rgb. Only works when #1 is 1. Values : 0-minutes between #2 and #3
Impact on performance or battery...
Fortunately, as per practical testing there is absolutely no negative effect on performance or battery backup!
"I'm a kernel maintainer. How do I add it to my source?"
Note : I'm currently maintaining klapse for OnePlus6 (enchilada), using the snapshot branch.
The klapse.c file is pretty much generic, but depending on your device you may need to change some of the #define values
The klapse.h file should be edited in order to make the K_RED etc. defines point to the correct RGB interface variable. OnePlus 6 simply uses kcal_red, kcal_green and kcal_blue in sde. Some devices have a struct or pointers instead of a variable. Those devices must edit their kcal files to keep a copy of the address that klapse will access. An example of a source with struct-based kcal with klapse support is this: commit (thanks to @rupanshji for this commit)
The KCONFIG is pretty understandable too, but you may wanna remove the "DEPENDS" line for your device.
The Makefile is just one line, and so is enabling klapse in the defconfig.
Now you must change the file that provides the kcal/gamma (mtk) interface. Thanks to other developers, all I had to do on the OnePlus 6 was to remove the keyword "static" from the variable declaration.
Great work! Can I pay for your next meal?
I'm just a university CS student so sure, any amount is much appreciated! You can donate via PayPal here :
Donate
XDA:DevDB Information
K-Lapse, Kernel for all devices (see above for details)
Contributors
tanish2k09
Source Code: https://github.com/tanish2k09/KLapse-Livedisplay
Kernel Special Features: RGB shifting based on a context
Version Information
Status: Stable
Current Stable Version: 4.3
Stable Release Date: 2019-03-02
Created 2019-03-04
Last Updated 2019-03-19
TODO :
Add custom-minute support
Add full-smooth scaling algorithm that actually scales from node to node to make the shift smoother
Add a third "intelligent" mode that uses both time-based and brightness-based values to magically come up with an RGB set that's perfect for that environment
A grayscale feature, that maybe also would support a yellow tint over it, so it's like a grayscale night mode.
Telegram support?
Yeah yeah, I know. Telegram links are common now. In compliance with the xda rule of "Only one TG link per thread" that I saw on some other sub-forums, maybe a link would be fine but mods can remove it per will.
Here's the official klapse telegram group, with commit notifications too:
t.me/klapse or from within telegram you can just join klapse but with an @ in front of it (I didn't use it to prevent an unintended mention to some person)
Notes :
I'm open to any other contructive feedback or suggestions
Klapse doesn't conflict with night mode of Android. They both can work TOGETHER, the result would be an overlap of both their colors.
Credits :
I pretty much wrote all the code for k-lapse myself, but it would be useless without these awesome people who put it to use -
@pappschlumpf for getting k-lapse working for the first time on any snapdragon device, with Smurf kernel for OnePlus 6
@Eliminater74 for tips along the way, very helpful
@HolyAngel for a collab to add support to HolyDragon, and indirectly SkyDragon, and suggesting some tunable structuring
@rupanshji for the commit used for an example of a structured kcal implementation
@flar2 for debugging and adding k-lapse support to his app EX kernel manager, purchase the app here - EXKM
@franciscofranco for adding k-lapse support to his app Franco Kernel Manager, purchase the app here - FKM
Screenshots
Screenshots from EXKM v4.04, Mixplorer and FKM v4.0 have been attached.
Note that these screenshots were taken while v4.3 was the active version. May change in future.
It's pretty common now
@apophis9283 Seeing you're one of the mods here, would you please be kind enough to delete the other 3 clones of this thread that got created due to XDA request failure?
Also, in case this thread is in the wrong sub-forum, please feel free to move it to the correct one but notify me via PM or email. Many thanks
Been using this on Smurf kernel for awhile now. Absolutely love it. Great job.
Glad your work is posted on XDA now works good in sky dragon.
Great alternative to night mode that does way more than that if you're interested in other features.
It's lightweight and won't bloat your system at all.
Any proper kernel should include this as there are only benefits and no drawbacks. 8)
As a last addition/compliment/support: it's been very well maintained and as you can tell just from reading OP, the dev is friendly and will help you if you have issues with it.
On Smurf kernel on op6. I have the gray scale option on digital wellbeing in the night and after switching on this mod (light mode) it automatically turns off the gray scale. Is it a bug?
akiwiz said:
On Smurf kernel on op6. I have the gray scale option on digital wellbeing in the night and after switching on this mod (light mode) it automatically turns off the grayscale. Is it a bug?
Click to expand...
Click to collapse
It is not a bug, it's actually expected behaviour.
First of all, we both know that the screen can't be both grayscale AND have a yellow tint at the same time, because yellow isn't gray.
Only one of them can stay active. The fact that klapse works from the kernelspace makes klapse more powerful. As soon as klapse refreshes, which happens every 30 seconds by default, the grayscale RGB will be overridden.
It also depends on how digital wellbeing's grayscale option works. I'm assuming it uses the same HWC HAL that android uses, but I have not the slightest clue. In case I'm right, both klapse and grayscale will work together to give you a black-n-white + slight yellow tinted screen.
As an alternative, how about I add grayscale as a feature to klapse itself? I can't add it to klapse right away but I can mark it in my TODO post above. Sounds good? Maybe I can come up with a solution that overlaps the grayscale with the yellow tint to create a grayscale night mode?
I don't know about you but it seems like an amazing idea to me
tanish2k09 said:
It is not a bug, it's actually expected behaviour.
First of all, we both know that the screen can't be both grayscale AND have a yellow tint at the same time, because yellow isn't gray.
Only one of them can stay active. The fact that klapse works from the kernelspace makes klapse more powerful. As soon as klapse refreshes, which happens every 30 seconds by default, the grayscale RGB will be overridden.
It also depends on how digital wellbeing's grayscale option works. I'm assuming it uses the same HWC HAL that android uses, but I have not the slightest clue. In case I'm right, both klapse and grayscale will work together to give you a black-n-white + slight yellow tinted screen.
As an alternative, how about I add grayscale as a feature to klapse itself? I can't add it to klapse right away but I can mark it in my TODO post above. Sounds good? Maybe I can come up with a solution that overlaps the grayscale with the yellow tint to create a grayscale night mode?
I don't know about you but it seems like an amazing idea to me
Click to expand...
Click to collapse
Thank you for the explanation ? is there a way I can switch off klapse at night when grey scale from digital wellbeing kicks in? Also your alternative would be ideal if it's possible in future! Thanks again
akiwiz said:
Thank you for the explanation ? is there a way I can switch off klapse at night when grey scale from digital wellbeing kicks in? Also your alternative would be ideal if it's possible in future! Thanks again
Click to expand...
Click to collapse
A tester just told me that klapse's yellow tint worked on gray-scale too.
But to answer your question, the only possible solution is to either disable Klapse or keep the schedule of start and stop outside the range of grayscale's schedule.
Btw I totally recommend you to use Klapse at night because yellow tint in the dark is better than grayscale to look at
tanish2k09 said:
A tester just told me that klapse's yellow tint worked on gray-scale too.
But to answer your question, the only possible solution is to either disable Klapse or keep the schedule of start and stop outside the range of grayscale's schedule.
Btw I totally recommend you to use Klapse at night because yellow tint in the dark is better than grayscale to look at
Click to expand...
Click to collapse
So I need EXM to set a schedule start?
akiwiz said:
So I need EXM to set a schedule start?
Click to expand...
Click to collapse
EXKM is one way. You can create your own tunables in Franco kernel manager too like. Here's a couple screenshots of an example.
You can use those same paths in kernel adiutor too. I haven't talked to the dev for klapse support yet, maybe I should but next weekend probably.
You can also use a file manager to change those files. Remember that pretty much everything in /sys is rebuilt during each boot so all values reset. That's why an apply-on-boot method is used for fixing values.
Info for which file does what is in OP.
This doesn't seem to work for me. OnePlus 6 with xXx NoLimits and Smurf Kernel. Latest stable versions for all. I have changed settings with EXKM and rebooted multiple times. /sys/klapse files accurately reflect the settings in EXKM. Setting K-Lapse alternately to time and light have failed to demonstrate any color changes as would be expected from the settings. I turned off the phone's night mode so that I can see more purely what K-Lapse does.
Thoughts?
maigre said:
This doesn't seem to work for me. OnePlus 6 with xXx NoLimits and Smurf Kernel. Latest stable versions for all. I have changed settings with EXKM and rebooted multiple times. /sys/klapse files accurately reflect the settings in EXKM. Setting K-Lapse alternately to time and light have failed to demonstrate any color changes as would be expected from the settings. I turned off the phone's night mode so that I can see more purely what K-Lapse does.
Thoughts?
Click to expand...
Click to collapse
I'm guessing you're using the wrong display calibration mode.
On the OnePlus 6 stock ROM it only works with custom and adaptive display modes in settings.
tanish2k09 said:
I'm guessing you're using the wrong display calibration mode.
On the OnePlus 6 stock ROM it only works with custom and adaptive display modes in settings.
Click to expand...
Click to collapse
That was it exactly. Thanks!
I can't find any settings for K-lapse in the latest EX Kernel Manager. I went through every section of the app. No K-lapse settings.
majikfox said:
I can't find any settings for K-lapse in the latest EX Kernel Manager. I went through every section of the app. No K-lapse settings.
Click to expand...
Click to collapse
Tools > Color Control > K-Lapse Settings
maigre said:
Tools > Color Control > K-Lapse Settings
Click to expand...
Click to collapse
Nope. Not there.
majikfox said:
I can't find any settings for K-lapse in the latest EX Kernel Manager. I went through every section of the app. No K-lapse settings.
Click to expand...
Click to collapse
I don't own EX kernel manager yet but I was given a v4.04 build to test, and it was under Graphics > Klapse-settings
They'll obviously only show up if the kernel supports it.
Also, some users reported that the update isn't live for them yet, so you may have to wait. That's not in my control either and flar2 handles EXKM.