(Need Root)Enable Automatic Light Sensor on Xperia Ray

Search This thread

usefulidiot

Senior Member
Sep 16, 2012
183
14
I didn't replace the als_curve.ini file but modified the values in hw_config.sh Its working fine with my device. Thanks a ton. But I wonder what these values 3,2,2,0 are ?



Your phone does not have that .inf file now ?

hey..what values did you exactly change 3,2,2,0 to? I'm on 1,1,1,0 and doing see any automatic adjustment to brightness, unless i'm doing something wrong!
 

gu5t3r

Senior Member
May 30, 2012
1,610
1,516
hey..what values did you exactly change 3,2,2,0 to? I'm on 1,1,1,0 and doing see any automatic adjustment to brightness, unless i'm doing something wrong!

try 0,1,1,0 or 0,2,2,0...

check you als_curve.conf

change it's content to
Code:
# Setup AS3676 ALS curve / group, y0, y3, k1, k2, x1, x2 
1,7,121,16,14,0,50
1,13,129,15,15,4,50
1,20,129,14,14,4,50
1,27,179,21,19,4,50
1,34,231,28,24,4,50
1,41,251,35,25,4,50
1,48,255,42,23,4,50
1,55,255,51,20,4,50
1,62,255,55,18,4,50
1,80,255,55,15,4,50
1,100,255,51,13,4,50
1,128,255,45,10,4,50
1,160,255,33,8,4,50
1,194,255,21,5,4,50
1,228,255,6,3,4,50 
1,255,255,0,0,4,50
 

usefulidiot

Senior Member
Sep 16, 2012
183
14
try 0,1,1,0 or 0,2,2,0...

check you als_curve.conf

change it's content to
Code:
# Setup AS3676 ALS curve / group, y0, y3, k1, k2, x1, x2 
1,7,121,16,14,0,50
1,13,129,15,15,4,50
1,20,129,14,14,4,50
1,27,179,21,19,4,50
1,34,231,28,24,4,50
1,41,251,35,25,4,50
1,48,255,42,23,4,50
1,55,255,51,20,4,50
1,62,255,55,18,4,50
1,80,255,55,15,4,50
1,100,255,51,13,4,50
1,128,255,45,10,4,50
1,160,255,33,8,4,50
1,194,255,21,5,4,50
1,228,255,6,3,4,50 
1,255,255,0,0,4,50

Cheers! How exactly do you test if its working? Thanks again!
 

kocir

Senior Member
Jun 25, 2005
100
4
I have placed the two files from the first post to my system/etc as recommended. I restarted my device. The sensor it seems to be working when I go to Service Menu / Test of Ambient Sensor. But it does not work normally. I do not know how to activate.Automatic mode.
 

kocir

Senior Member
Jun 25, 2005
100
4
:( I extracted the two files from the new ZIP file and placed to SYSTEM/ETC no changes. ALS BRIGHTNESS app shows changes but still shows 000% of Brightnes. The test from System menu also shows value changes. It seems than AS is working, but it is not activated.
 

borg17a

Senior Member
Aug 18, 2010
265
27
I've found the way to enable ALS on Ray:
Using root explorer Change this value in hw_config.sh(inside system/etc):
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds/
echo 0,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 12900 > $dev/torch/max_current
To
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds/
echo 3,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 12900 > $dev/torch/max_current​

Optional:replace als_curve.ini with the one i provide(is from arc):for me is better.
UPDATE:I've deleted the "als_curve.inf" from phone and changed
echo 3,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
to
echo 1,1,1,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]

now backlight seem more"wide range".

UPDATE: New CWM version added(InstallazioneALS_Xperia_Ray.zip):flash via recovery.

UPDATE:In official ics 4.0.4 i found the best way is to delete als_curve.inf (after change echo 1,1,1,0 )

UPDATE 08/November: for a fast response (istantaneous dim change) flash (Fast Response)InstallazioneALS_Xperia_Ray.zip

DonationToUNICEF: http://www.supportunicef.org/site/c.dvKUI9OWInJ6H/b.7677883/k.2C8F/Donate_now.htm



I don't know how to install this MOD. I flashed the latest zip-file, but nothing changed :( Still no ALS. PLS improve the install-instructions!
 

kocir

Senior Member
Jun 25, 2005
100
4
Just checked file "hw_config.sh" from file "(Fast_Response)InstallazioneALS_Xperia_Ray.zip"

thera are different vaules, than recommended !!! Why?

file echo 0,7,7,0 > $dev/lcd-backlight/als/params

What is correcte? 3,2,2,0 or 1,1,1,0 or 0,7,7,0 ?
Is the second file "als_curve.conf" also correct?
 

arcatarc

Senior Member
Just checked file "hw_config.sh" from file "(Fast_Response)InstallazioneALS_Xperia_Ray.zip"

thera are different vaules, than recommended !!! Why?

file echo 0,7,7,0 > $dev/lcd-backlight/als/params

What is correcte? 3,2,2,0 or 1,1,1,0 or 0,7,7,0 ?
Is the second file "als_curve.conf" also correct?

The values influenced the speed how the brightness raise and decrease,so the right values depend on personal preference,0,1,1,0 is slow,0,7,7,0 is istantaneous..
I suggest you to try different conbination until you find your prefered
 

kocir

Senior Member
Jun 25, 2005
100
4
Unfortunately no effect, still not working.
Should be problem with kernel? But test of ALS in Service Menu shows changing of values.
 

arcatarc

Senior Member
Unfortunately no effect, still not working.
Should be problem with kernel? But test of ALS in Service Menu shows changing of values.
To test it do in this way:
1)set brightness to 25-40%
2)put the phone under a bright lamp (or sunrise)
3)now with a finger close the light sensor in the top right corner of the phone
you should see change in screen dim..
 

kocir

Senior Member
Jun 25, 2005
100
4
YES, I went outsoude from building. There is very strong sun and it works. Only I am not sure how sensitive it is and what range it will do (0%-100%?).
 

Top Liked Posts

  • There are no posts matching your filters.
  • 61
    I've found the way to enable ALS on Ray:
    Using root explorer Change this value in hw_config.sh(inside system/etc):
    # LMU AS3676 Configuration
    dev=/sys/devices/i2c-0/0-0040/leds/
    echo 0,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
    echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
    echo 12900 > $dev/torch/max_current
    To
    # LMU AS3676 Configuration
    dev=/sys/devices/i2c-0/0-0040/leds/
    echo 3,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
    echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
    echo 12900 > $dev/torch/max_current​

    Optional:replace als_curve.ini with the one i provide(is from arc):for me is better.
    UPDATE:I've deleted the "als_curve.inf" from phone and changed
    echo 3,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
    to
    echo 1,1,1,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]

    now backlight seem more"wide range".

    UPDATE: New CWM version added(InstallazioneALS_Xperia_Ray.zip):flash via recovery.

    UPDATE:In official ics 4.0.4 i found the best way is to delete als_curve.inf (after change echo 1,1,1,0 )

    UPDATE 08/November: for a fast response (istantaneous dim change) flash (Fast Response)InstallazioneALS_Xperia_Ray.zip

    If you like my work make a donation(51% will be donate to UNICEF):
    EVERY DAY CHILDREN DIE NEEDLESSY!!!
    https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q94WGHC4F2DH2
    10
    ALS

    try my app
    not very clean, not fast, not nice, not general
    but can be usefull on some eric phones
    tested on xperia pro, neo - android 2.3
    3
    Hi arcatarc. I'm on JJ 3.2 rom. I searched this thread and you told, that in JJ's rom is ALS enabled by default. When i open hw_config.sh(inside system/etc) it shows, that:
    # LMU AS3676 Configuration
    dev=/sys/devices/i2c-0/0-0040/leds/
    echo 0,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]

    Also i think its not enabled (it was the same on JJ 3.1). Or JJ enabled it by another way?

    echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
    line is enabling als

    echo 0,0,0,0 ... means that als is most wide range, lowest up response, lowest down response, and has no offset...
    first 3 values you can change from 0-7, the last one I don't know
    1
    yeah, I saw it "working"... with a step or two at most. I am really disappointed by how SE implemented this. Even the brightness manual slider seams to have 15-16 steps, i.e. it's not smooth. I had a HTC Hero and auto-brightness/slider were flawless.
    1
    Should i do update from sd card or
    wipe dalvik cache,factory reset,wipe cache and then install from sd card???:confused::confused::confused:

    ---------- Post added at 10:56 AM ---------- Previous post was at 10:53 AM ----------

    Should i do update from sd card or
    wipe dalvik cache,factory reset,wipe cache and then install from sd card???

    Only flash zip from cwm...