[MOD][KERNEL] Touchkey backlight dimmer BY Ezekeel - Nexus S Android Development

Hi all, since Ezekeel cant post thread in Nexus S Development Section due to forum restriction, I help him to post.
After he was eligible, then I will delete this thread and request moderator to move that thread here
Here's the link to the thread in General.
[MOD][KERNEL] Touchkey backlight dimmer
Click to expand...
Click to collapse

What is this?
Do you mean this is used for turning the light low(darken) the capasitive button(back,menu, search,home) button?
And also, if I flash cron mod, will it override my 1.3.6 netarchy kernel?

What is this?
Do you mean this is used for turning the light low(darken) the capasitive button(back,menu, search,home) button?
And also, if I flashed cron mod, will it override my 1.3.6 netarchy kernel?

Interesting, I'd love to turn them off completely giving the phone a sleeker look

Related

[APP][OC/UV/Governor][GPU OC][GB][21 June]Control Freak 0.5beta (NEW!!)

Control Freak, the OC/UV app for Gingerbread!
PLEASE READ THE FULL POST! !!
NEW RULE! Read the ENTIRE op, plus the last few pages BEFORE posting a question!! I don't mind sharing information and helping people, but answering the same question on every page is getting old!!
Control Freak is a re-write of xan's Voltage Control app, designed to work with Gingerbread based kernels. It has (most of) the features of my Voltage Control EX.
Beware!! This app is still in development! Any issues are being worked on, but it may not run perfectly!! Also, I, nor anyone who has helped to make this app or the kernels/roms it works with are responsible for any damages caused by use of this app or any kernels/roms supported by this app!!
Features:
Designed for use with JVx based Gingerbread kernels
Works with cm7 kernels that support OC/UV
Specifically designed around features present in existz's Talon kernel
Allows enable/disable specific states
Allows undervoltage control on a state-by-state basis
Allows limiting clock to a specific speed
Allows changing of governors
Allows control of Cpu Threshold settings - see note2 bellow.
States enabled info is found by opening each UV control.
TIS info is now shown on the main screen
TIS info for Deep Sleep
TIS percentages
Logs all major start up values as they are polled from the sysfs.
Logs all settings to be applied when Apply is selected
Logs all settings to be saved when Save As Boot is selected
Controls GPU Clock settings on compatible kernels!!
GPU O/C Capable Kernels for Captivate:
Talon 0.3.1 by eXistZ -Released to public
Le Kernel du Jour by TheEscapist - CM7, may be only available on private test versions, talk to TheEscapist for more info
Glitch Kernel by glitch - CM7, may be only available on test versions, talk to glitch for more info
Note: On Gingerbread, the conservative governor is NOT recommended! Interactive/ondemand/smartass governors are supported, and interactive is the preferred governor! Talon does not have smartass implemented yet, so smartass will not show up in the Governor dropdown on Talon.
Additional Note: As of Talon 0.2.1, interactive governor is NOT included anymore! Existz removed it in favor of the ondemand governor.
Note2: Cpu Threshold control is NOT supported on most Gingerbread kernels, since Cpu Threshold is used by conservative governor. I just added the Cpu Threshold settings, so that I can make this backwards compatible with FroYo kernels/roms.
NOTE 3:If you are experiencing issues with settings not sticking on reboot, go to the Market, download the busybox installer by stericson, and install busybox 1.17.1. Some roms, including Perception II, have a version of busybox 1.18.4 that does not have run-parts compiled into it. Without run-parts, nothing in /etc/init.d gets loaded at boot. The version of 1.17.1 included in stericson's busybox installer DOES have run-parts, so it will work.
Change log -
Control Freak 0.5b:
- Added GPU Overclocking controls! Please note that your kernel must support GPU Overclocking for this feature to work! Also note that this version has NOT been tested on kernels without GPU Overclocking, so if anyone has a kernel that does not have GPU Overclocking, test this out and let me know how it goes!!
- Fixed the states enabled command to remove the extra 0 at the end that was being added due to Deep Sleep info
Control Freak 0.4.2b:
- Fixed fc issue on kernels with higher number of states available
- Changed the icon, the new icon was designed by b_randon14
Control Freak 0.4.1b:
- Fixed save function, now the proper max frequency is written to S_volt_scheduler
- Added logging to save function
- Added logging to apply function
- Log is now cleared when it is exported, so the log starts from scratch after each export
Control Freak 0.4b:
- Added Deep Sleep TIS info.
- Added TIS percentages.
- Added logging
- NOTE: Logging DOES NOT use logcat, so there is no need to enable logcat to generate logs, or to view/export the logs.
Control Freak 0.3.5b:
- Fixed the Max Frequency issue where any changes to the Max Frequency dropdown were not being saved. Now it writes the proper value to the proper place.
- Fixed another issue with Max Frequency dropdown. If you applied a Max Frequency LESS THAN the highest state enabled, on closing and restarting CF, it would show the highest enabled state as the max frequency, regardless of current setting. Now, if you set limit to 1000MHz, it will show 1000MHz at launch, no matter how many states above that freq that are enabled.
- Fixed the SI unit prefix for frequency. Forgot that 'm' is for "milli" and 'M' is for "Mega." And I was even arrogant enough to tell someone that I was right!!! Anyway, it is fixed now. And a HUGE thank you to aalh for pointing out my mistake!
Control Freak 0.3b:
- Fixed the TIS info issue. Now each state shows it's own TIS, instead of the
the TIS for the first state.
- Moved the TIS info to the main screen, so that it is visible all the time.
Control Freak 0.2b:
- States info issue resolved
- Unsupported kernel issue resolved (Same underlying cause as the states info issue)
Control Freak 0.1b:
- Initial Release
Known Issues -
- Sometimes, gpu read out will disappear for some states at random. If you open the uv/gpu controls, it will show the read out again. Closing the controls may cause that state's readout to stay and cause other states to loose their displays at random. May have to do with a glitch in the code to hide gpu controls for non-gpu compatible kernels.
- Sometimes it will not pull states_enabled_table info. This causes the CPU Limit dropdown to be empty. As an interim solution, until I can track down why this is happening, either exit Control Freak and launch it again, or simply enable each state, and they will be added back to the dropdown.
- Occasionally will report an unsupported kernel. If you are sure your kernel IS supported, simply restart.
Sources available at https://github.com/shane87/ControlFreak
Report any issues by posting IN THIS THREAD or sending me a PM. But please, read through the thread, and check the known issues section of this post before posting an issue. If your issue is listed, quote the original issue report, and add details about your system and set up. "Me too!" comments are not helpful and will be ignored.
Issues may also be reported by sending an email to [email protected] If you use this method to report bugs/issues, please export the log from Control Freak and attach it to the email. To export Control Freak's log, launch Control Freak, press Menu > Export log. The log will be exported to /sdcard/cf.log. Please attach this file to any emails addressed to me using the above link.
NOTE: I removed CF 0.3b due to the number of bugs in that software. Granted, all of them were fairly minor bugs, and primarily affected the UI, other than the Max CPU Limit issue. But with that issue, on top of the inability to enable/disable a state since you couldnt see the checkboxes, ther wasnt a whole lot you could do with 0.3b. Anyway, 0.3.5b takes care of those problems.
I removed CF 0.4b due to the Save errors, 0.4.1b has the same functionality, and it works right!
A HUGE thank you and shoutout to b_randon14 for designing the new icon!
Keep up the good work!!
If anyone has a Samsung Intercept, or knows anyone with a Samsung Intercept, check out bROM over at sdx, a deodexed, rooted rom designed by my brother, b_randon14!
Anyone interested in contributing, drop me an email at [email protected], and I will get you added as a contributor on github!
Reserved +++
I know its still in development but with JVH out and existz already working on a JVH talon build (continuum rom has it for now), you might have to implement that too.
grkmaster said:
I know its still in development but with JVH out and existz already working on a JVH talon build (continuum rom has it for now), you might have to implement that too.
Click to expand...
Click to collapse
Yeah, I am aware of JVH, and I plan on adding JVH compatibility as soon as existz's begins to release JVH-based kernels. Actually, as long as the sysfs is still implemented the same way, there SHOULDN'T be any issues. Of course, I thought the same thing about going from FroYo to to Gingerbread, and it wasn't quite that easy. But compared to the full re-write, which has taken almost three weeks, going from JVB to JVH shouldn't be as bad.
Anyone interested in looking at the sources on github, I have committed fix that prevents the app from fc'ing at launch. As it turns out, calling the inflater function to inflate a view does NOT save that view unless you specifically tell it to! Seriously though, it was a simple issue of forgetting to add a word or two of code. It is amazing how one messed up variable, or even a missing period, can complete crash an app. Now, just to get the layout setup so that everything is visible and positioned correctly.
Hopefully, I will have a running release ready by the end of the day.
P.S. If you intend to DIVIDE by 1000, and you accidentally put SUBTRACT 1000, Java/Android won't tell you that you are an idiot. It will just cause the app to crash, lol.
Release
Control Freak is live!!
Please read the OP, especially the known issues section.
Using this app right now! Let's see how it goes! Im accutally excited cause I don't really like setcpu or voltage control
Sent from my GT-I9000 using XDA App
will this app also work with cm7 gb or just the i9000 ones
superj3211 said:
will this app also work with cm7 gb or just the i9000 ones
Click to expand...
Click to collapse
I do not know. I don't have cm7 installed, and have not tested it against cm7. If cm7 implements oc/uv in the sysfs like Talon does, it SHOULD work, but again, no guarantees.
Sent from my Samsung Captivate using XDA App.
ROM: Cognition v4.3
Kernel: Onix 2.0.4, Voodoo Sound v7, Voodoo Color, lagfix
Modem: I9000 tljl3
HW Build Number: 1101
Anyone interested in designing a new icon for Control Freak? I have zero graphics design abilities, and would seriously appreciate if someone could design a nice icon. I will give a bounty of $5 US to the best design!!!
Sent from my Samsung Captivate using XDA App.
ROM: Cognition v4.3
Kernel: Onix 2.0.4, Voodoo Sound v7, Voodoo Color, lagfix
Modem: I9000 tljl3
HW Build Number: 1101
Cool. Something new to play with.
sent from my cappy rocking gingerbread (CM7)
shane87 said:
Anyone interested in designing a new icon for Control Freak? I have zero graphics design abilities, and would seriously appreciate if someone could design a nice icon. I will give a bounty of $5 US to the best design!!!
Sent from my Samsung Captivate using XDA App.
ROM: Cognition v4.3
Kernel: Onix 2.0.4, Voodoo Sound v7, Voodoo Color, lagfix
Modem: I9000 tljl3
HW Build Number: 1101
Click to expand...
Click to collapse
If i had any design ability Id help out but just like you they suck lol ..
Hope someone helps out since there is plenty of great graphic designers aroud here
Control Freak does not seem to pull up the states table at all under TalonDEV 0.1.7-JVH-Test_11 for Continuum, but Voltage Control EX does it most of the time.
Sent from my GT-I9100 using XDA App
rajendra82 said:
Control Freak does not seem to pull up the states table at all under TalonDEV 0.1.7-JVH-Test_11 for Continuum, but Voltage Control EX does it most of the time.
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
Read the OP. Control Freak does not use the States tab. If you press on the state, like you are going to change uv settings, it will show the enable/disable checkbox and the tis info.
Sent from my Samsung Captivate using XDA App.
ROM: Cognition v4.3
Kernel: Onix 2.0.4, Voodoo Sound v7, Voodoo Color, lagfix
Modem: I9000 tljl3
HW Build Number: 1101
shane87 said:
Read the OP. Control Freak does not use the States tab. If you press on the state, like you are going to change uv settings, it will show the enable/disable checkbox and the tis info.
Sent from my Samsung Captivate using XDA App.
ROM: Cognition v4.3
Kernel: Onix 2.0.4, Voodoo Sound v7, Voodoo Color, lagfix
Modem: I9000 tljl3
HW Build Number: 1101
Click to expand...
Click to collapse
Sorry. I missed that at first.
shane87 said:
Read the OP. Control Freak does not use the States tab. If you press on the state, like you are going to change uv settings, it will show the enable/disable checkbox and the tis info.
Sent from my Samsung Captivate using XDA App.
ROM: Cognition v4.3
Kernel: Onix 2.0.4, Voodoo Sound v7, Voodoo Color, lagfix
Modem: I9000 tljl3
HW Build Number: 1101
Click to expand...
Click to collapse
I think its a great alternative way and possibly keep it that way. State tab shuoldnt be that big oa deal if we have a option like that to enable and disable a checkbox under the states
I like the states enable/disable being in there with the UV setting, but I miss being able to see tis all in one place without having to scroll. Maybe the tis could be put on the line where the mV. Is displayed? I don't much miss the tis % but I can see that's not included and it is slightly handy.
More importantly than appearance I've noticed that all states show the same time for tis. Using cpuspy I see the real results. Also I'm still having issues sometimes where opening the app no states are selected and the Max clock is empty until I check at least one state. I also sometimes have blanks for scheduler and governor.
The new voltage control lite does not seem to suffer these issues, however I have noticed an inconsistency across the board about being able to save boot settings (sometimes works,sometimes not). And yes my init.d folder is chmodded correctly.
Rom continuum 5.4.1
Kernel talon 0.1.7
iXNyNe said:
I like the states enable/disable being in there with the UV setting, but I miss being able to see tis all in one place without having to scroll. Maybe the tis could be put on the line where the mV. Is displayed? I don't much miss the tis % but I can see that's not included and it is slightly handy.
More importantly than appearance I've noticed that all states show the same time for tis. Using cpuspy I see the real results. Also I'm still having issues sometimes where opening the app no states are selected and the Max clock is empty until I check at least one state. I also sometimes have blanks for scheduler and governor.
The new voltage control lite does not seem to suffer these issues, however I have noticed an inconsistency across the board about being able to save boot settings (sometimes works,sometimes not). And yes my init.d folder is chmodded correctly.
Rom continuum 5.4.1
Kernel talon 0.1.7
Click to expand...
Click to collapse
Yeah, I am planning on adding tis info, plus an indicator for enabled/disabled status on the line with the uv, so you can see everything in one glance.
I knew that the states info still isn't getting pulled right sometimes. You said vc lite has that issue fixed? Do you know if vc lite has sources available, so I can see how it got fixed?
I didn't know that the tis was messed up. I'll take a look at it tomorrow and see if I can track it down.
And for future reference, please report issues by clicking the link in the op. I check this thread often, but I check my issue tracker on github more often, usually, lol.
Also, I am working on adding governor specific tweaks, that will be displayed in a sliding drawer like vcex's states tab.
And an enormous thanks to all who use this app and give me feedback!!
Sent from my Samsung Captivate using XDA App.
ROM: Cognition v4.3
Kernel: Onix 2.0.4, Voodoo Sound v7, Voodoo Color, lagfix
Modem: I9000 tljl3
HW Build Number: 1101
AHA
Here you are
subscribed
I will start playing with CF now
And I will think about an icon
(I did the one for Moneydance a few years back, a Linux personal Finance app))
Question
Interactive, just sits at 1.2, unlike whatever VCEX did which made it scale (or hop, depending on semantics)

[MOD][KERNEL] Touchkey Backlight Dimmer (BLD)

**** OUTDATED !!!! SEE BELOW ****
Version 1.0
It bugged me that there was no way to switch off the touchkey backlights on the Nexus S, so I looked into it. Starting with the Netarchy kernel I made some modifications exposing two switches in /sys/.../backlightnotification/ to manually turn on/off the button backlights. However on my i9020 the button backlights get activated automatically once you use the touchkeys - I could not check the i9023 since I do not have one. This behaviour seems to be controlled by the touchkey firmware which only is available as a binary, so without some hex editing the binary there seems to be no way to change this. The next best thing would be to disable the touchkey backlights everytime they get activated, however since I am lazy instead I chose a quick and dirty approach of using a cron daemon to simply trigger the off-switch once every minute. This is good enough so the backlight does not bother me while watching movies, etc. and the extra battery drain is practically zero.
Downloads:
www.multiupload.com/CHFDDBV6BP Kernel for 2.3.3 Custom ROMs
www.multiupload.com/0RPO16QCN0 Kernel for 2.3.4 Custom ROMs
www.multiupload.com/823MR3UZVD Kernel for 2.3.4 Stock ROM (unlock and root required)
www.multiupload.com/WYBGK5N3H9 Cron Backlight Dimmer for all ROMs (root and busybox with crond* required)
www.multiupload.com/EXC6465ZRC Cron Backlight Dimmer for all ROMs including busybox 1.18.4 (root required)
* How to check if your busybox supports crond:
Either in terminal app or adb shell write 'busybox --list | grep crond'. If you get 'crond' as a response your version of busybox supports crond.
Changes to the source code:
www.pastie.org/2122063
**** ALSO OUTDATED !!!! SEE BELOW ****
Version 2.0
Based on the latest BLN version 9, I made some modifications to implement a backlight dimmer which does not need an external program (like cron) to trigger an off-switch.
To activate the dimmer, just echo the dim interval in ms (this is milliseconds; 1000ms = 1s) into /sys/class/misc/backlightnotification/in_kernel_dimmer. If you pass a value of 0, the dimmer will be deactivated.
Here are the modifications to the source code: http://www.pastie.org/2378721
**** UPDATE ****
Version 3.0
Another day, another backlight dimmer version.
The previous implementations had the drawback that the time when the touchkey backlights were switched off was entirely independent of the time the touchkeys were pressed (and thus reactivated) for the last time. Consequently, the time until the backlights were deactivated was essentially random and could vary from practically zero up to the defined interval value.
Some people commented on that and I agree that it would simply look much more elegant if the dimmer would behave more consistently. So I sifted through the source code and found a way to detect the a press of the touchkeys which both works for the i9020 and i9023. This made it possible to link the dimming of the touchkey backlights to a touchkey press and have the backlights switched off with a consistent delay.
Also, this time instead of being lazy and simply hacking the dimmer functionality into BLN, this implementation does not depend on BLN anymore and can be included in the kernel independently of BLN (with CONFIG_BLD=y). This should improve the maintainability in case BLN or this tweak gets updated.
In /sys/class/misc/backlightdimmer, pass 1 or 0 to 'enabled' to enable or disable the dimmer. Pass the delay in ms (this is milliseconds; 1000ms = 1s) to 'delay'. The default state is disabled and a delay of 5000 = 5s.
Changes to the source code:
http://www.pastie.org/2388552
http://www.pastie.org/2388562
http://www.pastie.org/2388614
BUGFIX
I got reports about the delay not properly working. Found a bug that might have caused this problem.
Bug fix: http://www.pastie.org/2392734
BUGFIX #2
Turns out the implementation of the Backlight Dimmer was potentially unstable. I have made some changes to avoid possible problems.
Bug fix: http://www.pastie.org/2403815
BUGFIX #3
BLD was not working properly for the i9023 since the backlights were not re-enabled on touch which has been fixed in this patch.
Bug fix: http://www.pastie.org/2419575
BUGFIX #4
Patch to avoid race conditions.
Bug fix: http://www.pastie.org/2441553
No further patches will be published here. I have set up a git repo for all my tweaks. Each mod has its own branch to keep the tweaks cleanly separated and one can simply pull the latest patches from the corresponding branch.
https://github.com/Ezekeel/GLaDOS-nexus-s/tree/bld
Get Jonathon Grigg's 'Spark Mod Manager' GUI for controlling BLD: http://forum.xda-developers.com/showthread.php?p=17291034
Thanks to Netarchy for his help.
I do not accept donations and since I reached my 50GB limit of free space on SpiderOak, thanks to all of you kind people who got an account using my referral link, I could not ask for more.
Instead if you really want to donate your hard earned money to someone who deserves and needs it, consider donating to the Free Software Foundation at fsf.org: These guys are at the frontline when it comes to keeping Linux free and fighting these greedy bastards who think they are entitled to collect royalties and other fees from Linux users due to some silly patents - and if Linux falls, Android will be next.
nice work man
now if only we could make em brighter too >.>
also here for everyone
www.multiupload.com/CHFDDBV6BP Kernel for 2.3.3 Custom ROMs
www.multiupload.com/0RPO16QCN0 Kernel for 2.3.4 Custom ROMs
www.multiupload.com/823MR3UZVD Kernel for 2.3.4 Stock ROM (unlock and root required)
www.multiupload.com/WYBGK5N3H9 Cron Backlight Dimmer for all ROMs (root and busybox 1.17 or higher required)
source changes
www.pastie.org/2122063
op if you want these removed just say the word, just figured id help others out with your work til you earn your wings round here
Haha exactly, mine are very dim as well.
any chance of a ns4g edition?
I use Adjbrightness to turn off the button lights on my Aria. Works wonders.
shabbypenguin said:
any chance of a ns4g edition?
Click to expand...
Click to collapse
The 2.3.4 kernels should work for ns4g. If you run into problems I will look into it again.
I also send Netarchy the changes to the kernel I made and asked him if he could integrate it into his kernel, so I do not have to compile my own version each update. If you feel that this tweak is useful, sending him a PM and telling him that you like this tweak might help (but please do not get on his nerves; he has more important stuff to do).
ah alright, cool thanks
Thanks!
And yes, these restrictions are retarded
Optic2 said:
I use Adjbrightness to turn off the button lights on my Aria. Works wonders.
Click to expand...
Click to collapse
Sadly that doesn't work since the Nexus S button lights are being *****es...
does this affect bln?
theallian said:
does this affect bln?
Click to expand...
Click to collapse
No. I am using both BLN and this tweak simultaneously.
Ezekeel , thank you for this tweak and taking the time to share it with us. This is one thing that has annoyed me about this phone!
I'm nto sure if you know but Netarchy's latest version is now 1.3.7!
Will you be keeping this thread updated?
bringonblink said:
I'm nto sure if you know but Netarchy's latest version is now 1.3.7!
Will you be keeping this thread updated?
Click to expand...
Click to collapse
I asked Netarchy if he could include the changes in his kernel but have not received an answer yet.
I am using the latest stable CM, so everytime a new stable CM version using a new kernel will be released I will compile a modified version of corresponding Netarchy kernel (with bfs) including these backlight tweaks for my personal use. So, I can upload these and put the links in here.
However, I am not planning on providing modified kernels for all versions of the Netarchy kernel and for all possible variations (cfs - bfs, custom - stock) anymore. I have published the changes I made to the source code and every kernel dev can easily intregrate these into his custom kernel. So if you want this feature available in your favourite kernel, contact the corresponding kernel dev and ask him nicely to integrate these backlight tweaks.
I too would like this option. I love how sleek the Nexus looks as a black slate. Is making just the changed files into a flashable zip possible? That way anyone on any kernel can use this?
Ezekeel said:
I asked Netarchy if he could include the changes in his kernel but have not received an answer yet.
I am using the latest stable CM, so everytime a new stable CM version using a new kernel will be released I will compile a modified version of corresponding Netarchy kernel (with bfs) including these backlight tweaks for my personal use. So, I can upload these and put the links in here.
However, I am not planning on providing modified kernels for all versions of the Netarchy kernel and for all possible variations (cfs - bfs, custom - stock) anymore. I have published the changes I made to the source code and every kernel dev can easily intregrate these into his custom kernel. So if you want this feature available in your favourite kernel, contact the corresponding kernel dev and ask him nicely to integrate these backlight tweaks.
Click to expand...
Click to collapse
Thanks for the reply, will do
Sent from my Nexus S
anaglich said:
I too would like this option. I love how sleek the Nexus looks as a black slate. Is making just the changed files into a flashable zip possible? That way anyone on any kernel can use this?
Click to expand...
Click to collapse
I do not see any way one can achieve the same without a custom kernel.
Alright, I wish I knew how to compile a kernel. I would love to see this option implemented in Netarchy's or Mathkids kernel. I have attempted to contact both in regards to this.
anaglich, I will definitely look into it. Sorry for the late response!
ezekeel: since i only looked at the cron .zip last night after nightshift, i didn't see crond and there is none on my phone. Do you have an arm version to slap on there?
Unless it's part of busybox 1.17, then i'm a victim of old ass cm7 busybox it;s 1.16 and does not have crond either.
Alright, there is also such a thing as "too new", exactly 1.17.1 and there is a crond.
now let's see about installing this. patch is long in.
EDIT: Thanks, seems to work just fine. Can't say it ever bothered me, but i don't watch movies on it either.
EDIT2: Thanks again, users like it. Really appreciate you offering this.
You are welcome. I am glad some of you kernel devs have already integrated this tweak into your kernels.
It was fun figuring out how to compile a kernel and how to package it properly, but once I knew it, it was quite repetitive and got old fast. So for me personally, I am glad that now I have a broader choice of kernels available without modifying it myself. Yeah I am lazy.
Now if I can get Netarchy to include it too, I would be settled for future updates.

[MOD][KERNEL] Screen Dimmer

This tweak is no longer supported, use Touch Wake instead!
For notebook/netbook computers switching off the screen after a certain timeout is a simple yet effective way of saving battery life and such a feature is integrated into every OS. Android also has a screen timeout feature, however this suspend function also disables the touchscreen controls (and touchkey buttons) and you have to press the power button to re-enable the screen (plus, if you did not disable the lockscreen, you also have to unlock it again).
Since this is kinda annoying I tried to find an app which could disable the screen after a timeout and re-enable it on touch, however I could not find one. After some digging I found out that there is no way with the current Android API to disable the screen without simultaneously disabling the touchscreen controls.
So I took a look at the kernel source and after some trial and error it seems I have found a stable way to implement such a screen off feature.
To enable (disable) the screen dimmer pass 1 (0) to 'enabled' in /sys/class/misc/screendimmer. Pass the delay in ms (this is milliseconds; 1000ms = 1s) to 'delay'. The default state is disabled and a delay of 15000 = 15s.
Changes to the source (based on kernel with BLD 3; apply patches in exactly this order):
http://www.pastie.org/2408247
http://www.pastie.org/2408254
http://www.pastie.org/2408257
http://www.pastie.org/2408259
http://www.pastie.org/2408260
BUGFIX:
I already have the first bug fix for you. The kernel was not compiling anymore without the screen dimmer activated in the .config. Besides that nothing has changed, so if you already have a compiled kernel with the screen dimmer running this will not change anything.
Bug fix: http://www.pastie.org/2408688
BUGFIX #2:
Fixed the auto brightness not working anymore.
Bug fix: http://www.pastie.org/2418667
BUGFIX #3:
The user space access to the framebuffer is closed down before the screen is dimmed which makes sense and took care of one oddity I did notice. Also it should save some more battery.
Bug fix: http://www.pastie.org/2420744
BUG FIX #4:
Patch to avoid race conditions.
Bug fix: http://www.pastie.org/2441551
Get Jonathon Grigg's 'Spark Mod Manager' GUI for controlling Screen Dimmer: http://forum.xda-developers.com/showthread.php?p=17291034
I do not accept donations and since I reached my 50GB limit of free space on SpiderOak, thanks to all of you kind people who got an account using my referral link, I could not ask for more.
Instead if you really want to donate your hard earned money to someone who deserves and needs it, consider donating to the Free Software Foundation at fsf.org: These guys are at the frontline when it comes to keeping Linux free and fighting these greedy bastards who think they are entitled to collect royalties and other fees from Linux users due to some silly patents - and if Linux falls, Android will be next.
This tweak is no longer supported, use Touch Wake instead!
good...thanks!!
You are the GOD ...
Amazing... can't wait one of the kernel dev have this on their kernel. So I can easly flash it.
I already have the first bug fix for you. The kernel was not compiling anymore without the screen dimmer activated in the .config. Besides that nothing has changed, so if you already have a compiled kernel with the screen dimmer running this will not change anything.
Bug fix: http://www.pastie.org/2408688
Nice job, looks like a cool mod.
I'll release it under a experimental version of my kernel enabled by default to see how people like it.
One question, does the screen go off while I'm watching a video such as YouTube?
Sent from my Nexus S using XDA Premium App
Highly Appreciated.
reddv1 said:
Nice job, looks like a cool mod.
I'll release it under a experimental version of my kernel enabled by default to see how people like it.
One question, does the screen go off while I'm watching a video such as YouTube?
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
Yes, unfortunately the screen always gets dimmed even if the app has the FLAG_KEEP_SCREEN_ON set. I took a look at the kernel source and it seems this flag is not passed on to the kernel and handled only by the Android OS; so the kernel does not know whether currently an app is open which has this flag set. Maybe I can think of something, but most likely this is a limitation which I cannot remove.
This will be amazing.
I have always wanted a way to wake up the phone without reaching over to the power button. I remapped my power button to the soft search key just so I didn't have to reach over to push the power button but it obviously didn't work to wake the phone. This is something I've dreamed of, to just touch the screen or the touch keys and it would wake.
Couple questions:
1) Is it possible that only touching the 4 soft keys will wake the screen (instead of the screen)?
2) How does this affect battery? Is a wake lock held? Does the phone sleep correctly to go into power saving? I'm assuming if the screen is touchable that the phone isn't sleeping and as such, this will be a battery drainer.
Enhanced said:
This will be amazing.
I have always wanted a way to wake up the phone without reaching over to the power button. I remapped my power button to the soft search key just so I didn't have to reach over to push the power button but it obviously didn't work to wake the phone. This is something I've dreamed of, to just touch the screen or the touch keys and it would wake.
Couple questions:
1) Is it possible that only touching the 4 soft keys will wake the screen (instead of the screen)?
2) How does this affect battery? Is a wake lock held? Does the phone sleep correctly to go into power saving? I'm assuming if the screen is touchable that the phone isn't sleeping and as such, this will be a battery drainer.
Click to expand...
Click to collapse
1) Currently the screen is re-enabled both when touching the screen and the touchkeys. I think that makes the most sense. However, one could easily modify the code to limit this to the touchkeys.
2) The phone is not put to sleep, only the screen is disabled. So compared to the normal screen lock this will drain the battery much quicker. This tweak is not intended as a replacement for the stock screen lock, but as an addition. You can set the screen lock to a value like one or two minutes, so it will properly lock the phone for example if put it in your pocket, while having the screen dimmer set to a lower timeout like 15sec, so the screen will be disabled and some battery saved if you just pause for some time for example because you wait for a download to finish or talk to somebody. So, if you use it right, you should save some amount of battery.
I found a bug after running this mod for about a couple hours. The screen would not turn on after leaving the phone for about half an hour. The touchkeys would light up and the when I clicked the volume keys I could hear the volume settings changing.
Sent from my Nexus S using XDA Premium App
Ezekeel said:
1) Currently the screen is re-enabled both when touching the screen and the touchkeys. I think that makes the most sense. However, one could easily modify the code to limit this to the touchkeys.
2) The phone is not put to sleep, only the screen is disabled. So compared to the normal screen lock this will drain the battery much quicker. This tweak is not intended as a replacement for the stock screen lock, but as an addition. You can set the screen lock to a value like one or two minutes, so it will properly lock the phone for example if put it in your pocket, while having the screen dimmer set to a lower timeout like 15sec, so the screen will be disabled and some battery saved if you just pause for some time for example because you wait for a download to finish or talk to somebody. So, if you use it right, you should save some amount of battery.
Click to expand...
Click to collapse
This is exactly what I'm lookin for. i will set 1 minute for screen dimmer and 2 minute for screen lock.
Ezekeel said:
For notebook/netbook computers switching off the screen after a certain timeout is a simple yet effective way of saving battery life and such a feature is integrated into every OS. Android also has a screen timeout feature, however this suspend function also disables the touchscreen controls (and touchkey buttons) and you have to press the power button to re-enable the screen (plus, if you did not disable the lockscreen, you also have to unlock it again).
Since this is kinda annoying I tried to find an app which could disable the screen after a timeout and re-enable it on touch, however I could not find one. After some digging I found out that there is no way with the current Android API to disable the screen without simultaneously disabling the touchscreen controls.
So I took a look at the kernel source and after some trial and error it seems I have found a stable way to implement such a screen off feature.
To enable (disable) the screen dimmer pass 1 (0) to 'enabled' in /sys/class/misc/screendimmer. Pass the delay in ms (this is milliseconds; 1000ms = 1s) to 'delay'. The default state is disabled and a delay of 15000 = 15s.
Changes to the source (based on kernel with BLD 3; apply patches in exactly this order):
http://www.pastie.org/2408247
http://www.pastie.org/2408254
http://www.pastie.org/2408257
http://www.pastie.org/2408259
http://www.pastie.org/2408260
BUGFIX:
I already have the first bug fix for you. The kernel was not compiling anymore without the screen dimmer activated in the .config. Besides that nothing has changed, so if you already have a compiled kernel with the screen dimmer running this will not change anything.
Bug fix: http://www.pastie.org/2408688
wor
I have send Netarchy, reddv1 and mathkid a notice (could not reach morfic) about this update, so they aware of this change. As soon as the new version is implemented I will update the list below. Be patient.
Kernels including these modifications:
none yet
Click to expand...
Click to collapse
it works great in trinity with the cm7 nightlies.. thank you.
I don't understand the instruction. what I have to do?
reddv1 said:
I found a bug after running this mod for about a couple hours. The screen would not turn on after leaving the phone for about half an hour. The touchkeys would light up and the when I clicked the volume keys I could hear the volume settings changing.
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
Hmm. Yeah, that sounds like a bug. Did any error messages appear in the log? Could you reproduce the error?
simms22 said:
it works great in trinity with the cm7 nightlies.. thank you.
Click to expand...
Click to collapse
Great. If you run into any problems please let me know. I am glad we have such a thorough tester on board.
tonno16 said:
I don't understand the instruction. what I have to do?
Click to expand...
Click to collapse
Wait for the kernel devs to implement this tweak. Then follow their instructions to activate the dimmer; they probably will supply you with some init.d scripts for convenience.
simms22 said:
it works great in trinity with the cm7 nightlies.. thank you.
Click to expand...
Click to collapse
Can I have your kernel please.
Can't hardly wait till u released it for public. I will realy appreciate it.
If I could give a try for your kernel, would please send me by email at [email protected]
Many thx before.
rejanmanis said:
Can I have your kernel please.
Can't hardly wait till u released it for public. I will realy appreciate it.
If I could give a try for your kernel, would please send me by email at [email protected]
Many thx before.
Click to expand...
Click to collapse
Here lucid blue kernel with the screen dimmer: http://goo.gl/nBHir
The screen dimmer is enabled and set at 30 seconds. Post any issue you have here.
Sent from my Nexus S using XDA Premium App
rejanmanis said:
Can I have your kernel please.
Can't hardly wait till u released it for public. I will realy appreciate it.
If I could give a try for your kernel, would please send me by email at [email protected]
Many thx before.
Click to expand...
Click to collapse
it should be out soon, maybe today or tomorrow. you dont want the one im using, its really a raw test kernel.
Found another bug, the auto brightness doesn't work anymore.
Sent from my Nexus S using XDA Premium App
reddv1 said:
Found another bug, the auto brightness doesn't work anymore.
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
i can confirm it
reddv1 said:
Here lucid blue kernel with the screen dimmer: http://goo.gl/nBHir
The screen dimmer is enabled and set at 30 seconds. Post any issue you have here.
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
grate thx men. i love u
it should be out soon, maybe today or tomorrow. you dont want the one im using, its really a raw test kernel.
Click to expand...
Click to collapse
okay mr simms. i can wait.

Auto brightness tuning

Hi all! My Note is running 2.3.6 LC stock software with root.
I heard that there is an option in Kj mode, which helps to tune auto-brightness levels. I would like to ask you, is it possible to implement such thing into my ROM? For me the default auto-brightness tune is too bright for me and I want to tune it. Actua)y I want it to work, but on te lowest levels range. What filesI should edit for this?
Many thanks in advance!
NightWildChild said:
Hi all! My Note is running 2.3.6 LC stock software with root.
I heard that there is an option in Kj mode, which helps to tune auto-brightness levels. I would like to ask you, is it possible to implement such thing into my ROM? For me the default auto-brightness tune is too bright for me and I want to tune it. Actua)y I want it to work, but on te lowest levels range. What filesI should edit for this?
Many thanks in advance!
Click to expand...
Click to collapse
why not use the unofficial JKay mod's mod for LC1 by _giggino_ (check last week's posts in the original thread)?
Yes.
http://forum.xda-developers.com/showthread.php?t=1235212
Another option is to use a program like Screen Filter, as this lowers the brightness on the AMOLED screen universally
Wow, thanks a lot! I'll try it now

[Q] Features Missing in pengus77's CM10-20130514

Flashed this CM10 based ROM yesterday. Found that 2 key features that were baked into system in previous release are missing from this release.
First is Overclocking/underclocking of CPU through Settings->Performance. Now this options is missing altogether from the list.
Though this drawback can be mitigated by using Trickster Mod or similar app.
And second one is the option to "customize auto-brightness settings". There are some apps in the store that promise similar utility, but they never worked for me. This option wasn't needed if auto-brightness levels were not as super low as they are in this release.
Anyone noticed this?
Diljinder said:
Flashed this CM10 based ROM yesterday. Found that 2 key features that were baked into system in previous release are missing from this release.
First is Overclocking/underclocking of CPU through Settings->Performance. Now this options is missing altogether from the list.
Though this drawback can be mitigated by using Trickster Mod or similar app.
And second one is the option to "customize auto-brightness settings". There are some apps in the store that promise similar utility, but they never worked for me. This option wasn't needed if auto-brightness levels were not as super low as they are in this release.
Anyone noticed this?
Click to expand...
Click to collapse
1) I removed the CPU Settings because they're limited and don't work with this device as they should (Tegra needs a different kind of love).
2) I removed the auto brightness settings because they rely on the light sensor exposed to the rom... which we don't have. All the auto brightness is handled in the kernel (on ICS as on CM) so every operation in that menu is basically a no-op.
For 1, use CPU Adjuster or Trickster Mod from the market and you get a load more options that are guaranteed to work.
And for 2, check my kernel thread. You can mod the auto-brightness settings via sysfs, or wait a bit until wfd adds that feature to Kowalski Manager
Hope this clarifies why those two things are gone
pengus77 said:
1) I removed the CPU Settings because they're limited and don't work with this device as they should (Tegra needs a different kind of love).
2) I removed the auto brightness settings because they rely on the light sensor exposed to the rom... which we don't have. All the auto brightness is handled in the kernel (on ICS as on CM) so every operation in that menu is basically a no-op.
For 1, use CPU Adjuster or Trickster Mod from the market and you get a load more options that are guaranteed to work.
And for 2, check my kernel thread. You can mod the auto-brightness settings via sysfs, or wait a bit until wfd adds that feature to Kowalski Manager
Hope this clarifies why those two things are gone
Click to expand...
Click to collapse
Thanks for clarification. I appreciate it.

Categories

Resources