[MOD] BackLightNotification v1.6 (eclair) - led notifications by touchkey backlight

Search This thread

neldar

Retired Recognized Developer
Jul 4, 2010
569
363
twitter.com
Hope you can fully fix the battery life issue :) ...

Is it the same issue I read in another thread that it currently isn't possible for SGS to go into full "Suspend" mode whilst backlights are enabled?

Great work! Much appreciated!

Yes, it is the same reason, the wakelock.


Why is this wakelock needed?
I think that the touchkey controller is powered/driven by GPIO (at least it is powered on by setting a gpio pin).
And this gpio is switched off (automatically by h/w) if the S5PC110 is entering sleep mode.
The wakelock prevents the cpu from entering sleep mode and this results in greater energy consumption -> shorter battery life.

My aim is to find a solution without a wakelock or if not possible to reduce energy consumption by modifying the pm driver.
If someone with more knowledge in this scope wants to help me, feel free to contact me. I could provide a S5PC110 user manual with comments/notes from me about my research.
 
Last edited:

neldar

Retired Recognized Developer
Jul 4, 2010
569
363
twitter.com
While writing the above post i got an sudden inspiration about where to look in the S5PC110 user manual.

And after studying the S5PC110 user manual once more i found a hind how i could enable the touchkey controller while the rest of the phone is in sleep mode. After studying "Simtec Electronics" source code again, i noticed the solution has been almost right under my nose. I only had to add four not very spectacular function calls and it was done - no wakelock anymore. :)

Battery life should be much better now.

I am still testing the changes that should take some hours. I am also testing how much battery life has improved.
After finishing that I will publish RC3.
 
Last edited:

KLoNe1

Senior Member
Jun 28, 2010
606
88
Brisbane
This is terrific; GREAT WORK! (especially after you have just found out how to fix the battery issue!)

Now we just need to find out how to slowly fade the backlight in and out smoothly :cool:
 

dzasta

Senior Member
Sep 11, 2009
77
7
Just a quick note: If you PWM (pulse width modulate) the LED instead of a hard "on" you will save battery, that is a fact. With a 50% duty cycle your looking at around half of the current as supposed to full on.

Just thought I'd mention this as you mention in the OP FAQ section that you think it will hurt battery life. I would definately be very intersted in this should it make its way to the Vibrant. Keep up the good work!
 

oswade

Senior Member
Jun 18, 2010
1,057
119
While writing the above post i got an sudden inspiration about where to look in the S5PC110 user manual.

And after studying the S5PC110 user manual once more i found a hind how i could enable the touchkey controller while the rest of the phone is in sleep mode. After studying "Simtec Electronics" source code again, i noticed the solution has been almost right under my nose. I only had to add four not very spectacular function calls and it was done - no wakelock anymore. :)

Damn, thats a huge find neldar! :D All praise ;)

I guess it is now feasible to add flashing/pulsing now? (assuming sleep mode can stay)
 
Last edited:

dalingrin

Inactive Recognized Developer
Nov 6, 2007
1,433
2,756
Any chance you will release the source or at least find a way to distribute this mod without being tethered to your kernel?
 

neldar

Retired Recognized Developer
Jul 4, 2010
569
363
twitter.com
Just a quick note: If you PWM (pulse width modulate) the LED instead of a hard "on" you will save battery, that is a fact. With a 50% duty cycle your looking at around half of the current as supposed to full on.

Just thought I'd mention this as you mention in the OP FAQ section that you think it will hurt battery life. I would definately be very intersted in this should it make its way to the Vibrant. Keep up the good work!

The touchkey leds are wired to the touchkey controller and modifying the controller firmware to support PWM is a lot of work. Not comparable to the effort of modifying the driver in the kernel.

And fading/flashing/pulsing/any other led feature has to be done by touchkey controller (in order to save battery life).

I dont have the time to modify the controller firmware. And that would take for sure a lot of time. No source available, only a guess what kind of processor the touchkey controller is (ARM...). Really a huge bunch of work for which i'm not getting paid and benefit of that is only small, in my opinion.


I will release RC3 in a few minutes, so you can give it a try.
 

neldar

Retired Recognized Developer
Jul 4, 2010
569
363
twitter.com
So RC3 is released:

v0.9.8 (release candidate 3):
  • removed: wakelock -> (hugely) improved battery life

Battery lasts around 82 hours (estimated), with backlight notification permanently powered on.
This should be last rc before v1.0, if not an serious issue is reported.
 
Last edited:

DvTonder

Recognized Developer
Apr 24, 2007
2,523
4,203
Toronto
Amazing utility.Works great on my bell vibrant. Thank you. Now I can finally say goodbye to my Nexus One.
 
Last edited:

xan

Retired Recognized Developer
May 21, 2006
1,407
455
Crack-ow
Yesss it works! Went back from voodoo to get this. Will test moar :)
Thank You!

It seems that buttons are sensitive to touch even with wakelock disabled.... Maybe there is a way to simulate button touched event to leave only one LED on? (right one for call, left for message?)
 
Last edited:

gusoldier

Senior Member
Oct 16, 2008
244
49
Just tried it. When you have email/missed call/sms/whatever and you turn your screen on and then when it goes back off, the leds turn on again.....
Most of the time I don't even check emails or sms right away (but I do want to know I have received something, thats why I installed this app)...

So it would be better to make the leds go off after you turn your screen on, so when you're aware of the notifications there is no need for them to be on.
 

xan

Retired Recognized Developer
May 21, 2006
1,407
455
Crack-ow
Well notification is notification. Dismiss them and problem gone!

For me its actually a good feature.
 

neldar

Retired Recognized Developer
Jul 4, 2010
569
363
twitter.com
Amazing utility.Works great on my bell vibrant. Thank you. Now I can finally say goodbye to my Nexus One.
Hmm, didn't know i that it is already working with other phones as i9000.
The kernel is not meant for other phones as i9000.

Yesss it works! Went back from voodoo to get this. Will test moar :)
Thank You!

It seems that buttons are sensitive to touch even with wakelock disabled.... Maybe there is a way to simulate button touched event to leave only one LED on? (right one for call, left for message?)
The touchkey controller behaves like in normal operation, but it cannot interact with the other parts of the phone in sleep mode.

Just tried it. When you have email/missed call/sms/whatever and you turn your screen on and then when it goes back off, the leds turn on again.....
Most of the time I don't even check emails or sms right away (but I do want to know I have received something, thats why I installed this app)...

So it would be better to make the leds go off after you turn your screen on, so when you're aware of the notifications there is no need for them to be on.
To disable notifications led you should open the notification screen or open the application that has enable the notification.
Btw, that is standard android behavior.
 
Last edited:

Anubiszx

Senior Member
Dec 20, 2009
63
9
Madrid
Congratulations!! This app is amazing, I'll put it in every Galaxy S I touch.

Thanks for all the work and effort!
 

kingcory

Member
Aug 6, 2010
24
1
Absolutely amazed at what you dudes can do.

Thanks so much for your time and your amazing work.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Questions & Answers:

    How do i enable led notification for ...?
    • sms: notification by default
    • touchwiz email: notification by default
    • gmail: notification by default
    • Google talk: notification by default
    • calendar: download "Calendar notifier" app from market (alternative)
    • call: my BLN control - Pro from market
    • any other apps not shipped with stock-samsung firmware:
      ask the author of the app for notification led support

    What lagfixes are supported?

    How much does this modification affect battery life?
    With backlight notification permanently powered on, the battery lasts around 82 hours (around 3,5 days, 1,22% per hour). This means, that activated backlights will increase battery usage by about 0,18% per hour. If there is no backlight notification ongoing, battery life is normal (around 96 hours, 1,04% per hour). Tested with flight mode enabled.
    How do you test the battery consumption? This is a common and reliable method.

    Can you get this mod working with Android 2.2 (froyo)?
    BacklightNotification for Froyo is now available.

    Could you add a fade feature?
    That is not possible, hardware is limited (by controller firmware) to simple on/off.

    Could you add a flashing/blinking light/pulse feature/option?
    That is available in the froyo kernel combined with the bln control pro.

    I got the message "Cannot open update.zip (bad)". What does this message mean?
    That means the file got corrupted, you should delete the update.zip in /sdcard/ and download the zip-file again, copy it again to /sdcard/ and rename it to "update.zip".


    Source:
    kernel: linux-2.6.29 updated | license: GPLv2
    normal bln ramdisk | license: unknown (proprietary?) | author: samsung
    voodoo lagfix ramdisk | license: GPLv3 | author: supercurio (Francois SIMOND)
    BacklightNotification patches v1.6 for eclair | license: GPLv2 | author: neldar (Michael Richter) | comment: compatible to all Galaxy S phones, no porting needed (just enable KEYPAD_CYPRESS_TOUCH and disable KEYPAD_MELFAS_TOUCH in config)
    Liblights for BacklightNotification | license: Apache-2.0 | comment: have a look at the NOTICE file


    Chancelog:

    v1.6 (stable)
    • new sysfs interface (/sys/class/misc/backlightnotification/) - recommend update
    • updated kernel source

    v1.1:
    • added: option to disable/enable bln (without uninstall)

    v1.0 (stable, based on rc3)

    v0.9.8 (release candidate 3):
    • removed: wakelock -> (hugely) improved battery life

    v0.9.6 (release candidate 2):
    • improved battery life
    • fixed: wakelock remains enabled after notification is disabled


    v0.9.5 (release candidate 1):
    • reduced size of initramfs
    • some lowmemorykiller tweaks
    • updated proprietary kernel modules
    • solution for calendar & call notification: "Missed Call for Android 2.x" app

    v0.9.1 beta:
    • improved compatibility with lagfixes
      (see Q&A "What lagfixes are supported?")


    v0.9 beta:
    • initial release (first public beta)
    1
    This modification is ONLY for firmwares with Android 2.1 (eclair)!
    if you are searching for a froyo (android 2.2) version: BLN for froyo

    What is BackLightNotification?
    The BackLightNotification mod converts the touchkey backlights into a notification led.

    What is modified?
    The BackLightNotification mod replaces the kernel by a modified kernel and it also replaces the lights.default.so in /system/lib/hw/.
    In detail:
    This kernel includes my backlight notification patch and additionally ext4 and tun modules. (For lagfix and vpn support.) The lights.default.so in /system/lib/hw/ enables android led notification via backlights. This mod does not include any modified app. To enable led/backlight notification for an app/function see the Q&A "How do i enable notification for ...?"

    What Galaxy S phones are supported?
    This kernel is only for i9000 and i9000m (Bell Vibrant).
    If you want BLN for any other Galaxy S phone, then please ask someone who creates custom-kernels for that phone, whether she/he would like to include BLN. The patches are compatible to all already released Galaxy S phones.

    Does this mod drain the battery?
    No, that issue has been fixed in v1.0. Some blogs are still reporting that, but that is an old news that applies to an early beta version.
    Measurements showed, that an ongoing BLN increases battery consumption by 0,18% per hour. The average battery consumption without BLN is 1,04% per hour, so an ongoing BLN results in an overall battery consumption of 1,22% per hour. And by the way: ongoing NoLed results in an overall battery consumption of more than 9,5% per hour. Please see the Q&A "How much does this modification affect battery life?".

    How reliable will I be notified with this mod?
    With this mod you will get 100% reliable notifications via touchkey backlights.

    Why could you state, that this mod is 100% reliable?
    The BLN mod activates already available APIs in android. If an application initiates a led notification, it will call the notification manager and that will call liblights (lights.default.so), which enables/disables the backlights by calling the (modified) touchkey kernel driver.

    For more questions and answers have a look at the Q&A in the second post.


    If you have A2SD or mimocan lagfix installed, remove/disable it before installing BacklightNotification.

    Instructions for installation/update:

    New method: SGS kernel flasher app:
    If your phone is already rooted you can try the SGS kernel flasher app.
    Just download&install the app and select any .tar or update.zip that you want to flash from this thread.
    If your phone is not rooted and/or you dont want to root the phone, you can use the odin/heimdall method.

    Update.zip-method:
    1. Download "i9000_BacklightNotification_v1.6.zip" (md5: 606aa95a2b43be900928cd7a32eb5a7e)
    2. copy the zip-file to /sdcard/
    3. rename the zip-file to "update.zip"
    4. power off the phone
    5. boot into recovery mode (by pressing "Vol Up" + "home key" + "power key" together,
      when bootlogo appears, release the keys)
    6. apply update.zip (Vol Up/Down to select and Home key to apply -
      you will see strange characters and a flickering screen, that is normal)
    7. wait for reboot
    8. install apps, if needed, see the Q&A "How do i enable backlight notification for ...?"
    If you want to have more control over BacklightNotification:
    BLN control app - blinking, call notification, scheduler and more to come


    BackLightNotification with Voodoo lagfix(-only) beta4/v3.0:
    i9000_BacklightNotification_v1.6_with_voodoo_lagfix_beta4.zip (md5: dde016adb2c18182a1bff25bdc6a0048)
    Support for voodoo lagfix:
    Discuss about Project Voodoo / lagfix, color or http://project-voodoo.org/


    Removal:
    Download "i9000_android_2.1_remove_backlight_notification.zip" (md5: 9a9baa80b18e24eac19c02e7cb3a153a)
    (if you have the voodoo package, use the package from project-voodoo)
    and continue with step 2. of the instructions above.


    Todo for v2 (sorted by priority):
    1. app to enable/disable bln function (without uninstalling) done
    2. add an option to disable/enable bln (without uninstall) added with v1.1
    Twitter:
    http://twitter.com/neldar_dev

    Credits:
    supercurio (for voodoo lagfix, his kernel-update.zip-template and the ct-ng config)
    1
    No, you should wait for a release of voodoo project with bln integrated.



    Should be compatible, but you should apply first the 3-button fix.
    Bln replaces only the kernel and one file in /system.
    I've already applied 3-button fix!
    I'm going to apply your patch! thanks!