(Need Root)Enable Automatic Light Sensor on Xperia Ray - Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A

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

where to find hw_config.sh in my system folder?
i found it, but...how to test?

memazy said:
where to find hw_config.sh in my system folder?
i found it, but...how to test?
Click to expand...
Click to collapse
You'll see the screen became more brigth when the ambient light rise,and viceversa..

memazy said:
where to find hw_config.sh in my system folder?
i found it, but...how to test?
Click to expand...
Click to collapse
Both of the files, hw_config.sh and als_curve.conf, are in /system/etc.
Sent from my ST18i using Tapatalk

arcatarc said:
I've found the way to enable ALS on Ray.​
Click to expand...
Click to collapse
works! thanks.
Auto-bright stay more sensitive than before.
note: if you replace original als_curve.conf don't forget to set right permissions! rw-r-r. See it at original file before replacing.​

Not working for me. Changed it to 3,2,2,0, rebooted and yet no avail.
Edit: !! One can check that light sensor is working fine through service menu (call *#*#7378423#*#*) -> Service tests -> Ambient light sensor. It shows the sensor output and one can play covering the sensor to see as value changes. So, the Ray has a working sensor after all, but it is not used?

zstoichev said:
So, the Ray has a working sensor after all, but it is not used?
Click to expand...
Click to collapse
sensor works. auto-brightness works. but slightly. you can take a torch and to light on a sensor, having covered the screen with a hand. screen will change brightness.

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.

It works. Good job~

good job thanks!!!

great !!! working perfect !

Q: how to enable ?
OK, sensor now working ( tested in service menu )
Unfortunately, I do not see the possibility of its use - especially for automatic brightness adjustment desktop. There is no option to set AUTOMATIC BRIGHTNESS. I tried a few widgets and even though I always set AUTO, never worked ...
How do in practice this now-functional sensor to use?
THX

radek.kaplan said:
OK, sensor now working ( tested in service menu )
Unfortunately, I do not see the possibility of its use - especially for automatic brightness adjustment desktop. There is no option to set AUTOMATIC BRIGHTNESS. I tried a few widgets and even though I always set AUTO, never worked ...
How do in practice this now-functional sensor to use?
THX
Click to expand...
Click to collapse
Hi, to work well you must edit the file. sh, and replace with:http://forum.xda-developers.com/attachment.php?attachmentid=805848&d=1323082156 , then, in the state switch, option 2 is what gives the brightness automatically, try putting a lamp and then covering the sensor with your finger and see as changing the brightness automatically, for me it worked great, greetings.
sorry bad English, I use google translator ñ_ñ

Can You do this for Mini Pro? In Mini Pro is another hw_config.sh and i dont know how to do it, my sensor doesnt work :/
http://dl.dropbox.com/u/12061271/hw_config.sh

efx_d3 said:
Hi, to work well you must edit the file. sh, and replace with:http://forum.xda-developers.com/attachment.php?attachmentid=805848&d=1323082156 , then, in the state switch, option 2 is what gives the brightness automatically, try putting a lamp and then covering the sensor with your finger and see as changing the brightness automatically, for me it worked great, greetings.
sorry bad English, I use google translator ñ_ñ
Click to expand...
Click to collapse
I don't understand what you mean with this?

Bazonga said:
I don't understand what you mean with this?
Click to expand...
Click to collapse
1.-arcatarc follow steps.
2.- edit file, 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[/LEFT]
IMPORTANT :Optional:replace als_curve.ini with the one i provide(is from arc):for me is better. (with this works best for me also)
link download : http://forum.xda-developers.com/attachment.php?attachmentid=805848&d=1323082156
Both of the files, hw_config.sh and als_curve.conf, are in /system/etc.
to try:
1 .- Use light switch widget.
2 .- Second tap the widget ( i use extended control) is auto brightness.
3 .- Try a flashlight and see how it works the brightness automatically.
I hope it is clear to you, greetings.
I may not understand because I do not speak English, my language is Spanish and use a translator,
xda took months just by using the google translator
sorry for bad writing in English

Thanks, but I just don't understand which widget i have to use? What do you mean with "option 2"? I only have the brightness on/off switch and the state switch with airplane mode, gps, bluetooth etc but no brightness??

THis thread make my Xray so good, thanks for your great post

You're english is fine.
---------- Post added at 11:41 PM ---------- Previous post was at 11:38 PM ----------
Bazonga said:
Thanks, but I just don't understand which widget i have to use? What do you mean with "option 2"? I only have the brightness on/off switch and the state switch with airplane mode, gps, bluetooth etc but no brightness??
Click to expand...
Click to collapse
I suppose he means, that you can check the functionality by using a freeware widget like Backlight! Launcher: Set the display brightness to "A" (auto) and the sensor would adapt the brightness of your screen depending on your environment.
I checked the sensor in the service menu and it's running, but I didn't see a change when I use a flashlight or my hand.
Does it belong to a special widget?
I have choosen the Backlight on/off widget and changed it to off and on again and I used the named brightness widget.

I don't see any changes in automatic brightness with this trick and additional widget, even though the ALS did worked from device test. Help?
EDIT: It works now! just having a wrong angle before when checking. as long as the Brightness is not set at the lowest then it would work. Thanks!
sent from my little red phone using XDA App

Related

Set the lowest LCD backlight

By default the LCD backlight can be set to "30 to 255". But if you use your Streak in dark, you may want to get a bit lower.
With this you get the lowest backlight possible (it won't turn off on "0"). You may replace "0" with higher number (0 to 29).
"Night mode"
Code:
echo "0" > /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
chmod 444 /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
"Back to normal"
Code:
echo "30" > /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
chmod 644 /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
What you can do now
You can use app "GScript" to create your own "shortcuts" and put them on your screen. Unfortunately you will have to disable "Automatic brightness" manually to make it work (no code for that yet).
Future development
I guess it has to be possible to modify the backlight range from the default 30-255 to 0-255 and adjust the light sensor too.
I will try dig deep. If anyone knows more, please share.
This is awesome. At night, I like to use Amazon Kindle to read a book but it's still too bright. I may have to play around with this. An APK would be even better.
almostinsane said:
An APK would be even better.
Click to expand...
Click to collapse
Give me a few minutes and i'll knock one up
Here you go. It's not the best looking app in the world but it gets the job done!
Thanks moneytoo!
I'll post this in the app section too.
There could be a possibility to tweak lowest light setting in BACKLIGHT_CONTROL in EMList app. To view EMList app, type *#*#307#*#* and look in app drawer. To unview EMList in your apps, type an*#*#308#*#*
Sent from my Dell Streak using XDA App
almostinsane said:
At night, I like to use Amazon Kindle to read a book but it's still too bright.
Click to expand...
Click to collapse
Completly agree, this is very cool. I will try it out tonight, thanks.
try searching for 'Dimmer' on the market. turns from whatever brightness you're at to 10.
Easy and free!
samstables said:
try searching for 'Dimmer' on the market. turns from whatever brightness you're at to 10.
Easy and free!
Click to expand...
Click to collapse
That's good to know. It only won't let you set 0-9 while the workaround with "chmod" works.
Thanks for this moneytoo
And thanks for the tip toward 'GScript' i have been looking for something like this for ages - this is great
Thanks guys! on my second day on the streak and loving it. The community support makes me love it even more!
Cheers.
Sent from my Dell Streak using XDA App
Thanks moneytoo...this works perfect.
How about turning it completely off?
I'm in the wrong thread because I'm running an Atrix, but perhaps in your adventure you've come across the relevant area to control off/on for the backlight on the Streak. On my old PocketPC I could stretch out the battery life significantly by doing this, and since it was just an LCD screen you could still view it enough to read ebooks just with ambient light.
Thanks in advance and apologies if this is considered hijacking.
Does not work on my stock 351...
If it's rooted, just use superdim or adjbrightness. Both could be found on market for free.
Sent from my Dell Streak using Tapatalk
Didn't know about superdim, it works great. Thank you.
You can also just make the change using root explorer (if you are rooted), and the change takes place right away.
You just have to remember to change the permissions to 444 (read only to everyone) or the values change back with you lock the screen.
More interesting is that with read only to everyone only autobrightness can up the brightness.
I usually use Screen Filter app, available on Market
but I want to try this app
*downloading....
moneytoo said:
By default the LCD backlight can be set to "30 to 255". But if you use your Streak in dark, you may want to get a bit lower.
With this you get the lowest backlight possible (it won't turn off on "0"). You may replace "0" with higher number (0 to 29).
"Night mode"
Code:
echo "0" > /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
chmod 444 /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
"Back to normal"
Code:
echo "30" > /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
chmod 644 /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
What you can do now
You can use app "GScript" to create your own "shortcuts" and put them on your screen. Unfortunately you will have to disable "Automatic brightness" manually to make it work (no code for that yet).
Future development
I guess it has to be possible to modify the backlight range from the default 30-255 to 0-255 and adjust the light sensor too.
I will try dig deep. If anyone knows more, please share.
Click to expand...
Click to collapse
Hiya buddy, you forgot to set the led buttons brightness as well:
Code:
echo "50" > /sys/devices/i2c-0/0-002c/leds/button-backlight/brightness
watch_mania said:
Hiya buddy, you forgot to set the led buttons brightness as well:
Code:
echo "50" > /sys/devices/i2c-0/0-002c/leds/button-backlight/brightness
Click to expand...
Click to collapse
Oh forget about it. Won't work as expected..
I use adjbrightness, does the same job!

Streak Screen Dimmer - Night Mode!

Firstly, many thanks to 'moneytoo' who posted how to change the values, i simply cobbled together a very poor looking app, regardless, i hope some people find this useful
This is taken from moneytoo's thread, which can be found here - http://forum.xda-developers.com/showthread.php?t=764148
YOU WILL NEED ROOT ACCESS. NOT TESTED ON 1.6, WORKS ON 2.1
moneytoo said:
By default the LCD backlight can be set to "30 to 255". But if you use your Streak in dark, you may want to get a bit lower.
With this you get the lowest backlight possible (it won't turn off on "0"). You may replace "0" with higher number (0 to 29).
"Night mode"
Code:
echo "0" > /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
chmod 444 /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
"Back to normal"
Code:
echo "30" > /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
chmod 644 /sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/brightness
Click to expand...
Click to collapse
In the app you have 3 buttons: Night Mode, Normal, and Max Brightness. I don't really think it needs any more explaining
Enjoy! All credit goes to moneytoo (cheers pal!)
Awesome, thanks for posting. Will try it out in the evening and report back.
Thanks for putting this together, my only issue is that the dimming doesn't stick when you put the streak to sleep and wake it again.
Awesome app! Very practical tool for the streak.
Sent from my Dell Streak using Tapatalk
There's an app on the market now called AdjBrightness that does this and works after sleep/waking up as well.
Troute said:
There's an app on the market now called AdjBrightness that does this and works after sleep/waking up as well.
Click to expand...
Click to collapse
yup works well that one.
ability to turn off button backlights is cool (be nice if you could turn them back on again) without resetting the streak..

Turning off auto brightness...

Anyone come accross how to do this yet?
Brightness is set to maximum but dims when in low light.
Thanks.
As of the moment no way to set the auto brightness to off. Maybe some software update oughta to do it, or some genius gets pissed off and develop one.
I also noticed that when you force off the capacitive button lights (useful when dark) via software, the keyboard light will not turn on also (not useful when dark).
The x10 mini has locked auto-brightness too and it can be disabled this way:
http://forum.xda-developers.com/showthread.php?t=1036544&highlight=brightness
Maybe it works on the mini/active as well?
Hyper_Sonic said:
Edit /etc/hw_config.sh using RootExplorer
1. change the line: i2c_pwm_als with i2c_pwm
2. set permissions to rwxr--r-- (744) if they are changed! VERY IMPORTANT!
3. reboot and enjoy the missing sensor
Click to expand...
Click to collapse
Nice find schmolch. Will try and update this thread.
jtdc said:
I also noticed that when you force off the capacitive button lights (useful when dark) via software, the keyboard light will not turn on also (not useful when dark).
Click to expand...
Click to collapse
how and where do you do this? is this a setting somewhere? (cant find it)
or do you use 3rd party software? (if so, whats it called?)
^ Its an app on the market called "Screen Filter". I use that to further dim the screen (at nights), thereby save battery as well. And its free, as in really free, no ads at all unlike many "free" but has ad pushing. You can turn off the capacitive button lights when you prefer to setup a widget for it.
jtdc said:
Nice find schmolch. Will try and update this thread.
Click to expand...
Click to collapse
Looks like the format has changed in this file.
But this one looks interesting:
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
I guess it can be tested "live" by doing:
echo 0 > /sys/devices/i2c-0/0-0040/leds/lcd-backlight/als/enable
I'm on a non-rooted build so I can't test myself :-(
jtdc said:
^ Its an app on the market called "Screen Filter". I use that to further dim the screen (at nights), thereby save battery as well. And its free, as in really free, no ads at all unlike many "free" but has ad pushing. You can turn off the capacitive button lights when you prefer to setup a widget for it.
Click to expand...
Click to collapse
thanks a bunch!
edit: exactly what i was looking for actually!
jtdc said:
^ Its an app on the market called "Screen Filter". I use that to further dim the screen (at nights), thereby save battery as well. And its free, as in really free, no ads at all unlike many "free" but has ad pushing. You can turn off the capacitive button lights when you prefer to setup a widget for it.
Click to expand...
Click to collapse
I found another app, which may actually be better, as it turns off the backlight of the capacitive buttons, but leaves the keyboard backlight active when opened!
it's called "Keyboard backlight controller".
funny enough, this is supposed to disable keyboard backlight, but on the Xperia Mini Pro it disables only the backlights of the soft-keys!
edit: forgot to mention, this app needs root, so may not be for everyone.
Whoa nice find, I'll try that when I can
Sent from my GT-P1000 using Tapatalk
Anyone also notice the screen flickers when dimmed?
Karlos G said:
Anyone also notice the screen flickers when dimmed?
Click to expand...
Click to collapse
yes, this is caused by the auto brightness, which can't be turned off in the user interface.
I've played around with hw_config.sh file, trying to get it disabled, but to no avail.
Anyone else more luck?
I've found an application that works, it's called "Disable Auto Brightness".
It was made for another Xperia type phone, but also works on the mini pro (and I assume mini as well).
It works, but its somewhat unhandy: it'll disable the auto brightness sensor, but only after unlocking. so while using the stock lock screen, it works almost perfectly, but when using something like widgetlocker, it'll only work if you leave the system keyguard enabled (under advanced settings) which I don't really like too much.
so for anyone having these flicker issues, this is a fairly good solution.
but I'd like to have the sensor completely turned off.
soooo, anyone any luck with that?
Heimiko said:
yes, this is caused by the auto brightness, which can't be turned off in the user interface.
I've played around with hw_config.sh file, trying to get it disabled, but to no avail.
Anyone else more luck?
I've found an application that works, it's called "Disable Auto Brightness".
It was made for another Xperia type phone, but also works on the mini pro (and I assume mini as well).
It works, but its somewhat unhandy: it'll disable the auto brightness sensor, but only after unlocking. so while using the stock lock screen, it works almost perfectly, but when using something like widgetlocker, it'll only work if you leave the system keyguard enabled (under advanced settings) which I don't really like too much.
so for anyone having these flicker issues, this is a fairly good solution.
but I'd like to have the sensor completely turned off.
soooo, anyone any luck with that?
Click to expand...
Click to collapse
I guess that means the echo 0 to lcd-backlight/als/enable thing I posted a few days ago didn't work?
Smiley76 said:
I guess that means the echo 0 to lcd-backlight/als/enable thing I posted a few days ago didn't work?
Click to expand...
Click to collapse
correct. including another few different settings I tried.
they do have effect on the brightness of the LEDs though, but sadly no turning off the auto brightness of the screen.
Smiley76 said:
Looks like the format has changed in this file.
But this one looks interesting:
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
I guess it can be tested "live" by doing:
echo 0 > /sys/devices/i2c-0/0-0040/leds/lcd-backlight/als/enable
I'm on a non-rooted build so I can't test myself :-(
Click to expand...
Click to collapse
This works on my SK17i (Xperia mini pro). See here for more info.
Hey thnx!! It proved to be help full for me!!

[Q] Backlight settings for CM7

Has anyone played with the backlight settings for the Atrix on CM7 pre4 yet? I'm looking to set the brightness down some as it seems too bright to me, but I'm looking for a starting point if someone has one.
Thanks.
i personally use auto brightness, it works great for me... BUT, you might be interested in this thread here, since it allows you to modify the brightness beyond factory settings (maybe even beyond CM7 settings!)
http://forum.xda-developers.com/showthread.php?t=1245332
Alcapone263 said:
i personally use auto brightness, it works great for me... BUT, you might be interested in this thread here, since it allows you to modify the brightness beyond factory settings (maybe even beyond CM7 settings!)
http://forum.xda-developers.com/showthread.php?t=1245332
Click to expand...
Click to collapse
Yea I'm using the auto brightness as well but you can set the levels for the auto brightness to be custom. I'm finding the auto brightness to be too bright in most cases so I want to turn it down.
Alcapone263 said:
i personally use auto brightness, it works great for me... BUT, you might be interested in this thread here, since it allows you to modify the brightness beyond factory settings (maybe even beyond CM7 settings!)
http://forum.xda-developers.com/showthread.php?t=1245332
Click to expand...
Click to collapse
Keying off the link above, I wrote this "noob" script to toggle LCD backlight level from my home screen with a Script Manager widget. It's basically one touch to toggle and another to exit.
#!/bin/sh
# Toggle LCD backlight setting
cd /sys/bus/i2c/drivers/lm3532/0-0038/leds/lcd-backlight
#First show brightness level
echo Brightness= `more brightness 2>&1`
if [ -f /usr/local/sbin/lowlight.txt ]
then
LEVEL=`cat /usr/local/sbin/lowlight.txt`
else
echo 17 1F > /usr/local/sbin/lowlight.txt
fi
if [ "$LEVEL" = "17 00" ]
then
echo "Setting backlight high..."
echo 17 1F > registers
grep CTRL_A_FS_CURR_REG registers 2>&1
echo 17 1F > /usr/local/sbin/lowlight.txt
elif [ "$LEVEL" = "17 1F" ]
then
echo "Setting backlight low..."
echo 17 00 > registers
grep CTRL_A_FS_CURR_REG registers 2>&1
echo 17 00 > /usr/local/sbin/lowlight.txt
fi

Question Flashlight Brightness Mod?

So apparently the 1 III suffers from the same issues as its Sony Predecessors... The Flashlight is very bright when you use it as camera flash, but when you turn on the flashlight, its artifically throttled to idk, prevent overheating?
So for the older Xperias there were ways to modify flashlight configs and librarys. However, I havent found a way to edit the current parameter for the flashlight on the 1 III. For the 5 II the GodlyTorch App seemed to work, according to a report in https://forum.xda-developers.com/t/...ness-fix-torch-light-not-photo-flash.4203293/, but that doesnt want to work on my 1 III (I have Root)
Now the question: Can someone find the parameters to increase Flashlight LED Current via Magisk Module, XPosed/LSPosed Module or manual edit? I'd be even willing to donate to a kind developer who builds a usable flashlight mod for the 1 III.
Thanks in advance.
When flashlight is on and your device is rooted, you can change the value of
Code:
/sys/class/leds/led:torch_0/brightness
/sys/class/leds/led:torch_3/brightness
(There are two flash LEDs)
The max value you can set is given by the max_brightness file in the same directory.
I didn't find a way (yet) to apply this by default, you have to have the flashlight running in order to change its brightness that way.
However, I do warn you that I am not responsible in any way if using your LED at full power causes damage to your device.
MK73DS said:
When flashlight is on and your device is rooted, you can change the value of
Code:
/sys/class/leds/led:torch_0/brightness
/sys/class/leds/led:torch_3/brightness
(There are two flash LEDs)
The max value you can set is given by the max_brightness file in the same directory.
I didn't find a way (yet) to apply this by default, you have to have the flashlight running in order to change its brightness that way.
However, I do warn you that I am not responsible in any way if using your LED at full power causes damage to your device.
Click to expand...
Click to collapse
Thanks for this info, working fine for me!
I played a bit around with this and tested the brightness values with 150; working fine in terms of short term heat development.
Edit 2: After a few days I start to notice a very slight discoloration of the diffusor with a value of 150. Its not affecting anything and barely visible, but I'd recommend to go lower than 150, because I suspect the LED may get too warm for the diffusor. I changed the guide to use 30 for now (which equals double the brightness compared to stock), please test your values for yourself, its probably better to not exaggerate it.
Make sure you type in the values right! Too high values and the LED Diffusor may melt, or the LED might die. Do this modification at your own risk, no matter at which brightness you target! I am not responsible for side effects resulting from the mod.
With Terminal Shortcut Pro and assigned Root Priviliges I made myself a Home Screen Icon that will boost the values for me in the current "Torch session" once the LED is turned on before. Other terminal emulator apps will work too.
In the Shortcut I set Run with Root and used the following command
Code:
echo 30 >> /sys/class/leds/led:torch_0/brightness && echo 30 >> /sys/class/leds/led:torch_3/brightness
Basically just a command that writes the 30 brightness value to the 2 files.
If someone can find a terminal command that turns on the flash in the first place, we could combine the commands to potentially make a simple but working replacement quick settings for the torch.
Edit: Thanks to the XDA Community and a Tool I was able to recreate the Torch experience with a Quick setting
You need https://play.google.com/store/apps/details?id=com.quinny898.app.customquicksettings
You have to buy the premium in app purchase for 1,29€ to unlock Root Command Running. Then you configure your quick setting (choose the Advanced -> Root Command under Preset) and paste the following script (credits to https://forum.xda-developers.com/t/increasing-torch-power-with-root.3637773/post-73098701, modified by me for 1 III)
Code:
#!/system/bin/sh
toggle=$(cat /sys/class/leds/led:switch_0/brightness)
if [ "$toggle" = "0" ];then
echo 30 > /sys/class/leds/led:torch_0/brightness
echo 30 > /sys/class/leds/led:torch_3/brightness
echo 1 > /sys/class/leds/led:switch_0/brightness
echo "on"
else
echo 0 > /sys/class/leds/led:torch_0/brightness
echo 0 > /sys/class/leds/led:torch_3/brightness
echo 0 > /sys/class/leds/led:switch_0/brightness
echo "off"
fi
Once again, make sure you type in the values right! Too high values and the LED Diffusor may melt, or the LED might die. Do this modification at your own risk, no matter at which brightness you target! I am not responsible side effects resulting from the mod.
Then you get rename the toggle, give it a nice Torch Icon and set the color to grey. It will function like the normal quick setting: Tap once, it turns on, Tap again, turns off. Even works locked.
Good luck and best regards.
If you want to use the Google Assistant Button as a torch toggle and also have Quick Settings Toggle (sadly its always toggled on) i found an app that can do both.
You need:
LSposed/Xposed
Root Shell access (adb shell)
Xposed Edge pro
Busybox for Android NDK (Magisk Module)
XperiaGAButtonRemap (Magisk Module)
Open a cmd or powershell
execute adb shell
execute su
accept root permissions on your phone
execute vi /bin/torch
press the key i
paste the script:
einhuman197 said:
Code:
#!/system/bin/sh
toggle=$(cat /sys/class/leds/led:switch_0/brightness)
if [ "$toggle" = "0" ];then
echo 150 > /sys/class/leds/led:torch_0/brightness
echo 150 > /sys/class/leds/led:torch_3/brightness
echo 1 > /sys/class/leds/led:switch_0/brightness
echo "on"
else
echo 0 > /sys/class/leds/led:torch_0/brightness
echo 0 > /sys/class/leds/led:torch_3/brightness
echo 0 > /sys/class/leds/led:switch_0/brightness
echo "off"
fi
Click to expand...
Click to collapse
press ESC
type :wq and press ENTER
execute chmod +x /bin/torch
Now you can execute /bin/torch as root and it will toggle the torch with higher brightness values.
In Xposed Edge enable "Keys" toggle and open it. Tap on "+ Add" at the bottom, press the Google Assistant Button, it should be recognized as "KEYCODE_PROG_BLUE", then set the action of either click/double click/long press (whatever you prefer as the torch toggle) to execute a Shell command, enter /bin/torch in the input field and enable the "Root access" toggle.
If you want, you can also set other custom things to the Google Assistant button for the other 2 states.
For the quicksettings menu tap on "Quick settings tiles" in the main menu of Xposed Edge and enable the first tile and open the settings for that tile. Set the action, again, to a shell command, input /bin/torch and enable Root Access. You can set the label to "Torch" and choose the Torch icon found in "Built-in icons". As i already said, the toggle will always be turned on for some reason. It just executes a shell command after all.
Good luck
Amazing, thank you everyone.
However, please let me insist that this may damage your phone if you put values too high... trust me. I accidentally put a brightness of 350 instead of 150 while trying the script in a terminal, and a few seconds were enough for the plastic underneath the glass to melt... Thankfully, it is still transparent so I can still use my flashlight, but no doubt it could have done a lot more damage if I let it run for longer. So please, use this with a lot of care (and double check what you write).
That's why in lots of countries, rooting voids your (hardware) warranty, you can do physical damage to your device so again, please be careful. Thankfully, this plastic bit and even the LED underneath are easily replaceable (the plastic bit is separated from the rear glass and the LED is on a separate ribbon cable). However, there don't seem to be a lot of OEM replacement parts for this phone yet.
Seems like a lot of work for little return and added threat of damage to an expensive phone. I agree that the brightness is dimmer than other phones I have had...but I did a test in a completely dark room and it actually is bright enough to find "whatever" you may be looking for. So I can live with it. Maybe Sony will do something to improve it a little?
jaseman said:
Seems like a lot of work for little return and added threat of damage to an expensive phone. I agree that the brightness is dimmer than other phones I have had...but I did a test in a completely dark room and it actually is bright enough to find "whatever" you may be looking for. So I can live with it. Maybe Sony will do something to improve it a little?
Click to expand...
Click to collapse
Sony could definitely improve it. But it seems like they had a history for compareably dim Flashlights.
I edited my explanation post to adapt lower brightness, because 150 as value starts to slightly discolor my diffusor, so I suspect we should run it lower.
MK73DS said:
太棒了,谢谢大家。
但是,请让我坚持,如果您将值设置为高,这可能会损坏您的。......我相信在终端中尝试手机时,我不小心将恢复设置为 350 而不是 150 ,几秒钟就可以让玻璃下面的恢复正常……幸好还是可以的,所以我可以使用我的手电筒,但有疑问,如果我能运行更长时间,它会请小心使用它(并仔细检查你写的内容)。
这就是为什么在国家/地区,root 导致您的许多(硬件)故障,您可能会再次对您的设备造成物理损坏,请小心。值得庆幸的是,塑料钻头甚至下面的 LED 都可以轻松更换(塑料钻头与后玻璃分离,LED 还位于单独的带状电缆上)。
Click to expand...
Click to collapse
darken5404 said:
Click to expand...
Click to collapse
You can't say I didn't warn you!
Indeed flashlight in mark 3 and older xperias is very bad.
I compared it to an iPhone and it's like day and night. Many aspects xperia brand is suffering like front camera, flashlight, no 21:9 pics, missing 4k 60fps recording in main app with stabilization, poor screen brightness, insufficient battery capacity, no any cooling system (especially at this price there should be vapor chamber or any other advanced cooling and not throttling cpu as a solution...), Not to mention regular software apps like Album, email and others :/
MK73DS said:
You can't say I didn't warn you!
Click to expand...
Click to collapse
I got it fixed through sony aftermarket and has ip68,fixed the screen for me by the way
On android 12 after rebooting the function stops working.
So I got to the area of the phone you guys specified, but as of today, the default values are WAY different that what yall found. Let me take a few screen shots
Here is the systems default peramitors. Any idea why they are so different?
Edit- Okay, so extra piece to the puzzle. When torch is off, the brightness file is 0, but when it is on the file is set to 15.
editing the file while the torch is on does nothing.
Edit 2 - Just wanted to note that for those who just want a demonstration of the changes possible, the fallowing app will do just that
Release v1.4.6 · BRoy98/GodlyTorch
Merge pull request #2 from TheDorkKnightRises/patch Fix LED file path for OnePlus One (bacon), proper device names for OP Merge pull request #3 from TheDorkKnightRises/patch Fix default double-...
github.com
this app needs root. Run it as a HTC 10 and it works just fine. However, I would like to recommend NOT going over the half way point. its VERY bright and will probably kill your LED if you do. You have manual control over the brightness. You can add it as a shortcut in the drop down menu of your phone. simply use the standard torch button, and then click the godly torch button to activate whatever preset you gave it.
Edit 3 - setting the brightness in Godly Torch to 50% Intensity sets the brightness to 135. Given that we know damage starts to happen at 150, I set the brightness in Godly to 15% (under the "toggle Intensity" shown in the screen shot), which brings the brightness to a value of 45. Its easily double as bright. I would not recommend going past this point.
I would say by using godly torch as a HTC 10 worked...mind you I double checked the brightness by just hitting the quick toggle and then messing with godly torch. The lower setting is matching just turning on the quick toggle the higher setting is what I'm comfortable with, but idk how long I'm comfortable running it at that brightness.
BlazingKahn35 said:
On android 12 after rebooting the function stops working.
Click to expand...
Click to collapse
For those on stock who use the assistant button :
If it stops working after reboot, copy the binary file to somewhere safe on your sd card, then using XPosed edge just add a long press gesture to your assistant button that recopys the file from your sd card, then sets the permissions again (make sure to check run as root)
cp /sdcard/torch /bin/ | chmod +x /bin/torch

Categories

Resources