[22FEB2012] [FIXED!!!] Custom Auto brightness with flashing LED (Read First Post)

Search This thread

ogonzuhnina

Senior Member
May 2, 2010
66
35
Warsaw
First post updated!!! Anyone did the custom autobrightness level tests??

I did, and failed.
my suspicion is that the rom I am currently using might be not compatible. (Hyperdroid CM7 2.1).
I'll try to update (but I seam to be too lazy) to some more up to date CM7 and report back

looking forward for more customautobrightness tests
 

ayyu3m

Senior Member
Oct 19, 2007
1,765
276
System Error
Nice. Gonna test this out now...

EDIT: (Review based entirely with the current kernel i m using)

- Replaced exactly as instructed. Corrected permissions too and Rebooted.

- Notification doesnt work. No leds blink after message or miss calls. No led is lit when charger is connected as well.

- Custom brightness works.

- Auto brightness works only once when "auto-brightness" option is selected in "Display". There after doesnt work.

Thankx. Hope this fix gets improved. I m using marc1706's kernel 1.0.8 and the rom as in my signature.
 
Last edited:

Looki75

Senior Member
Apr 1, 2010
1,708
1,450
a few days ago, i was writing a lights library for the ideapad a1 and thought i could revisit the leo liblights.
So here it is, for everyone to test :)

the following stuff should work:
  • autobrightness
  • custom autobrightness values
  • blinking leds (e.g. For notifications) - green and amber
  • static leds (e.g. For charging) - green and amber
  • screen dimming
  • custom screen dim level

instructions:
  1. download the attached file
  2. unpack lights.htcleo.so
  3. delete any prior lights library (i.e. Lights.* in /system/lib/hw/)
  4. push lights.htcleo.so to /system/lib/hw/
  5. set the correct permissions (should be the same as on all other libs in that folder)
  6. reboot
  7. test, review, and make sure to report back here ;)

cheers

edit: My test setup was:
Rom: Cm7 nightlies (see sig)
kernel: Tytung

this is purely fantastic!!! Big big thanks!!!
 

timsss

Member
Jul 20, 2008
9
0
I have posted a request in HeirOS' kernel thread, meanwhile can those who use earlier versions (1.7.2 or so) confirm if they have working LED Notifications when you use a working auto-brightness configuration please?
 

ph03n!x

Senior Member
Dec 18, 2010
2,177
1,615
CWM Zip file

I've made a a clockworkmod flashable zip package with @Milaq's fix.

Installing:
  • Copy the zip file to your SD Card
  • Back up your current ROM in ClockWorkMod
  • Flash this file
  • Reboot
This package will insert the following files in /system/lib/hw:
  1. lights.htcleo.so
  2. lights.bravo.so
  3. lights.leo.so
  4. lights.qsd8k.so
All of them are the same file, renamed to match most (if not all ROMs). This is because the file that will be used by your ROM will depend on how your device is named in build.prop.

If you face any issues, just do an advanced restore and restore the /system partition, and get in touch with the chef who cooked your ROM.
 

Attachments

  • (ClockWorkMod)Light_Library_Fix_by_Milap.zip
    165.9 KB · Views: 535

ph03n!x

Senior Member
Dec 18, 2010
2,177
1,615
I did, and failed.
my suspicion is that the rom I am currently using might be not compatible. (Hyperdroid CM7 2.1).
I'll try to update (but I seam to be too lazy) to some more up to date CM7 and report back

looking forward for more customautobrightness tests
Nice. Gonna test this out now...

EDIT: (Review based entirely with the current kernel i m using)

- Replaced exactly as instructed. Corrected permissions too and Rebooted.

- Notification doesnt work. No leds blink after message or miss calls. No led is lit when charger is connected as well.

- Custom brightness works.

- Auto brightness works only once when "auto-brightness" option is selected in "Display". There after doesnt work.

Thankx. Hope this fix gets improved. I m using marc1706's kernel 1.0.8 and the rom as in my signature.
Check out the CWM Zip I have posted, it *might* work as I have covered htcleo, leo, bravo and qsd8k nomenclatures.
I have posted a request in HeirOS' kernel thread, meanwhile can those who use earlier versions (1.7.2 or so) confirm if they have working LED Notifications when you use a working auto-brightness configuration please?
Not sure if you are talking about my observation that HeirOS kernel 1.7.5 is working, but we are way past that - we have an actual fix!!
 

Mafioso

Senior Member
Nov 13, 2007
1,068
123
Pune
I just flashed the new libs, however I feel the new libs are causing to lit up the screen way too bright for the light for my taste :(

Can anybody post a tut or a link, what all the custom brightness parameters consist of ? In cm7 settings, adjusting auto blacklight levels seems a very technical task and I can't make out what means what :eek:

Its much easier in Sense ROMS (I've tried NRGZ's), you can set auto brightness and then there are 3 option to further fine tune it depending on your preference if you like brightly lit screen or not so bright (guess it adjusts threshold levels in background). I hope somebody can make it simple for cm7 roms also :D

Also it used to work fine before this libs also :confused:
 

ph03n!x

Senior Member
Dec 18, 2010
2,177
1,615
I just flashed the new libs, however I feel the new libs are causing to lit up the screen way too bright for the light for my taste :(

Can anybody post a tut or a link, what all the custom brightness parameters consist of ? In cm7 settings, adjusting auto blacklight levels seems a very technical task and I can't make out what means what :eek:

Its much easier in Sense ROMS (I've tried NRGZ's), you can set auto brightness and then there are 3 option to further fine tune it depending on your preference if you like brightly lit screen or not so bright (guess it adjusts threshold levels in background). I hope somebody can make it simple for cm7 roms also :D

Also it used to work fine before this libs also :confused:
Try this link from Dorimanx's ROM Thread... - http://xdaforums.com/showpost.php?p=15609473&postcount=3
 
  • Like
Reactions: Mafioso

Ultraboss

Senior Member
Jul 22, 2008
72
12
Tours
Just tested your libs on my Sensation ROM, not working at all.

Is it a way to get a custom "power management" widget like in CM7 roms for Sense roms ??
 

ph03n!x

Senior Member
Dec 18, 2010
2,177
1,615
Alright, just tested @Milaq's light library in my CM7 nightly dated 17th Feb (Dorimanx Kernel v4.7), with a few tweaks on Dorimanx's suggested custom light levels. IT WORKS BEAUTIFULLY!!!!!!!!

Just tested your libs on my Sensation ROM, not working at all.

Is it a way to get a custom "power management" widget like in CM7 roms for Sense roms ??
I really am not sure how light levels are controlled in Sense-based ROMs. Hope a Dev or a Chef can help?
 

marzinho

Senior Member
Mar 17, 2010
184
18
TyphooN CyanogenMod 7 Nightly v3.7.6[2.3.7][A2SD][tytung r14]

- notification LED blinking OK
- charging LED solid/amber-to-green change OK
- autobrightness OK
- custom CyanogenMod autobrightness levels and settings OK
 
  • Like
Reactions: ph03n!x

ph03n!x

Senior Member
Dec 18, 2010
2,177
1,615

SnoopHTC

Senior Member
Jun 14, 2009
262
53
Xiaomi Redmi Note 5 Pro
Xiaomi Mi 9
Hello Ph03n!x, Yes I can and I will do ;), just a question before flash your zip : no perm command in your updater-script for the libs, it's normal? :) Thanks

EDIT : FULL WORKING !!!!!!!!!!!!! THANKS A LOT IS GREATEST !!!! (I just make a fix perm in cvwr to be sure after flash your zip and before reboot ;))
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    liblights with autobrightness, custom b/l levels, blinking notifications

    a few days ago, i was writing a lights library for the ideapad a1 and thought i could revisit the leo liblights.
    so here it is, for everyone to test :)

    the following stuff should work:
    • autobrightness
    • custom autobrightness values
    • blinking leds (e.g. for notifications) - green and amber
    • static leds (e.g. for charging) - green and amber
    • screen dimming
    • custom screen dim level

    instructions:
    1. download the attached file
    2. unpack lights.htcleo.so
    3. delete any prior lights library (i.e. lights.* in /system/lib/hw/)
    4. push lights.htcleo.so to /system/lib/hw/
    5. set the correct permissions (should be the same as on all other libs in that folder)
    6. reboot
    7. test, review, and make sure to report back here ;)

    cheers

    EDIT: my test setup was:
    rom: CM7 nightlies (see sig)
    kernel: tytung
    28
    We have a fix


    I have made a ClockWorkMod flashable version of the fix in this post. This should cover almost all ROMs, irrespective of how the device is named in build.prop (leo, htcleo, bravo, qsd8k).

    Original Post:
    UPDATE: Thanks to Looki75, we have a workaround using Tasker to have custom auto-brightness levels with the flashing LED libraries here. Please go through his post and give your feedback!

    I am rewriting the whole post, based on what I realized/ learnt today :)

    We currently two lights libraries for to our phone:
    • lights.htcleo.so - this file has working auto-brightness and flashing LED notifications - but custom auto-brightness settings do not work (more on this a bit later)
    • lights.qsd8k.s0 - this file has working auto-brightness and custom auto-brightness levels, but LED notifications do not flash

    Custom auto-brightness settings

    What is it?
    • This is a setting/ feature in CM7 ROMs, not sure if MIUI has it or not (Users, please confirm if you have custom auto-brightness settings in non-CM7 based ROMs)
    • In a pitch dark room, the screen's brightness chosen by auto-brightness setting may be higher than required. With custom auto-brightness, the level of brightness the phone uses for a specific amount of light can be configured - the biggest benefit being higher battery life. Please read this post by @Dorimanx for custom auto-brightness levels.
    How do I know if I have it or not?
    You do not have the lights library that is compatible with custom auto-brightness levels if:
    1. Your LED Notifications work (Except HeirOS kernels)
    2. If you have something similar to this in your logcat:
      20:50:43.090 Error lights 180 ***: value=90 (Mode=1)
      20:50:43.090 Error lights 180 ***: value=91 (Mode=1)
      20:50:43.090 Error lights 180 ***: value=92 (Mode=1)
      20:50:43.090 Error lights 180 ***: value=94 (Mode=1)
    On the other hand, you have it if
    1. Your LED does not flash
    2. Your screen will dim for several seconds (5~10seconds) before timing out
    3. You do not see the errors I had quoted above in your logcat
    So what is the point of this thread?
    I had tried several Kernel combinations (and libaudio.so, but that does not matter in this issue) while trying to figure out the No Sound/ BT Voice Command/ libaudio.so issues, and found out that even if I have lights.qsd8k.so, which enables custom auto-brightness levels, LED Notifications flash with HeirOS 1.7.5 Kernel - they flash in amber and green alternatively. This gave me a hope that
    • This is something to do with the kernel (I used Tytung's initrd.gz, so it is not from there...)
    • This could be fixed easily with all our kernels, because HeirOS has already done it!
    So What Next?
    Anyone using any of the HeirOS kernels see what library you have (/system/lib/hw), and please use the lights.qsd8k.so if it is not there, deleting lights.htcleo.so while at it (it is available in the Mirrors used by @Dorimanx), and confirm if you concur with my observations - please mention the kernel version and the name of the lights library in your feedback.

    Once we have that confirmed, we can request HeirOS to let us know the secret ingredient :) (or someone intelligent enough to look through the source codes can find it and post the diff/ findings).

    This is not a critical/ experience-affecting issue, but rather something that is now "broken" and can be fixed without much ado!! I am sorry for not being clear earlier, a little bit of Rum cleared things up for me :D

    Lets now restart this discussion!!!
    10
    CWM Zip file

    I've made a a clockworkmod flashable zip package with @Milaq's fix.

    Installing:
    • Copy the zip file to your SD Card
    • Back up your current ROM in ClockWorkMod
    • Flash this file
    • Reboot
    This package will insert the following files in /system/lib/hw:
    1. lights.htcleo.so
    2. lights.bravo.so
    3. lights.leo.so
    4. lights.qsd8k.so
    All of them are the same file, renamed to match most (if not all ROMs). This is because the file that will be used by your ROM will depend on how your device is named in build.prop.

    If you face any issues, just do an advanced restore and restore the /system partition, and get in touch with the chef who cooked your ROM.
    4
    Tasker Profile to enable custom auto-brightness!!!

    I programmed a very simple Tasker profile which acts as the CM7 custom auto-brightness feature.

    Thanks to this profile, I could keep the original lights lib to have blinking LED notifications, + the Tasker profile enables me to have the custom auto-brightness.

    So I have both blinking LED and custom auto-brightness!

    Ok, the tasker profile is less user-friendly (in terms of interface) than the CM7 feature. But it works and the easy part is that: if you use already the CM7 feature, the thresholds (sensor) and values (brightness) are the same:
    Sensor thresholds: 0-10240
    Brightness scale: 0-255

    I am sharing here this profile, which contains my own values for Sensor-Brightness. You can easily import it in your Tasker and adapt the values if necessary.

    Of course you need to have "custom brightness" unchecked in Android parameters AND CM7 settings!

    If other members are willing to test it, I will be happy to get feedback (better programming, battery use, etc...)!

    Thanks,
    Looki
    3
    I'm using CM7 Nightly released by Arif Ali. The version I use is dated 3rd March.

    lol, thats the rom i am contributing to and the new liblights was originally coded for :p

    we build the liblights from source there and the overlay configs are specifically tuned for it in mind. so you dont need to overwrite or flash any lights library.

    thanks for the feedback, ill have a look into that issue :)
    btw: what kernel are you using?