FORUMS
Remove All Ads from XDA

[Magisk][Module] Xperia Z2 / Z3 / Z3c Torch Boost v1.1

1,245 posts
Thanks Meter: 3,453
 
By okij, Senior Member on 7th June 2017, 09:31 PM
Post Reply Email Thread
Here I present you my first Magisk module.

Description:

It boosts the torch on SONY Xperia Z2 / Z3 / Z3c devices by replacing system/etc/flashled_calc_parameters.cfg with a file that sets if_torch_vr = 500000 instead of just 25000, which is the default value by SONY.

By doing this, the flash LED is operated at 500 mA instead of just 25 mA.

In my experiences, 500 mA is a sweet spot which provides good brightness, but at the same time doesn't heat the LED too much. Still, I would advice you to not use the torch for more than about 5 minutes at a time. You use this module at your own risk. If you want to set a lower brightness, then you can edit system/etc/flashled_calc_parameters.cfg in the zip and change if_torch_vr to a value lower than 500000 before installing the module. Of course you can also use a higher value, but I wouldn't exceed 1000000 (this is also the value that SONY set in the line # Max current for Torch (uA) i_batt_max_torch of the flashled_calc_parameters.cfg file.)

Background:

The method I used was first described in a thread by @olokos which you can find here. For comparison: The extreme version you can download there (which is a flashable zip and not a Magisk module obviously) sets if_torch_vr to 1000000, which corresponds to 1000 mA or 1 A. As users reported, even at this setting the torch can be used for 5 minutes before temperature increases significantly, but I want to keep it safe by using just half of that value. If you want to know more about the user experience with different settings, I recommend you to read the above mentioned thread, as well as @antkalaitzakis96's thread, who uses the same method, which you can find here.

Compatibility:

This module should work on any SONY Xperia Z2 / Z3 / Z3c device running on Android 5.0 - 8.1.0, rooted with Magisk. I'm quite sure about this since I compared the flashled_calc_parameters.cfg files from Android 4.4 (SONY stock KitKat ROM) with Android 6.0.1 (SONY stock Marshmallow ROM) and also with Android 7.1.2 (LineageOS and Carbon Nougat ROMs) and the files were always completely identical! If you still want to check if the module will be compatible with your system before installing it, grab system/etc/flashled_calc_parameters.cfg from your system by using a root file explorer and then compare it with the flashled_calc_parameters.cfg file from the module zip file. The only difference between the two files should be the if_torch_vr line.

Enjoy!

Please leave some feedback if the module works for you.

Thanks:

Many thanks to @topjohnwu for the ingenious Magisk universal systemless interface and to @olokos for the initial torch boost mod.

Changelog:

v1.0 - Initial release
v1.1 - Updated to Magisk Module Template 1500
The Following 26 Users Say Thank You to okij For This Useful Post: [ View ] Gift okij Ad-Free
 
 
11th June 2017, 06:04 PM |#2  
DawoodSahi's Avatar
Senior Member
Flag Lahore
Thanks Meter: 60
 
More
Needed this. Thank you so much.
The Following 2 Users Say Thank You to DawoodSahi For This Useful Post: [ View ] Gift DawoodSahi Ad-Free
13th June 2017, 10:45 PM |#3  
some_shyguy's Avatar
Senior Member
Flag Love City, U.S.V.I.
Thanks Meter: 62
 
More
I love this module, I always wondered why my light was dinner than everyone else's. My light cuts through the darkness now!
The Following 3 Users Say Thank You to some_shyguy For This Useful Post: [ View ] Gift some_shyguy Ad-Free
10th July 2017, 03:39 PM |#4  
Member
Thanks Meter: 19
 
More
Hi okij, I've used your module a bit reduced. Good work! Now there is the stock camera and I believe that the flash light so not in the camera settings is considered?The images are over-exposed in the close range. Once the module has been deactivated. Perhaps the setting can be automated to take pictures?
10th July 2017, 07:12 PM |#5  
OP Senior Member
Flag Düsseldorf
Thanks Meter: 3,453
 
More
Quote:
Originally Posted by bussi2010

Now there is the stock camera and I believe that the flash light so not in the camera settings is considered?The images are over-exposed in the close range. Once the module has been deactivated. Perhaps the setting can be automated to take pictures?

The module only changes if_torch_vr (comment line: "# LED If setting for Torch or video recording (uA)"), so it just affects the brightness when using the torch or when using the flash LED as a lamp when doing a video recording (which is good, because you have a brighter video lamp).

On the other hand, flash brightness is controlled by max_if_flash (comment line: "# Flash LED_If max current (uA)") which is set to 1500000 by default and not altered by the module. Therefore the module doesn't change anything when taking pictures.
The Following User Says Thank You to okij For This Useful Post: [ View ] Gift okij Ad-Free
19th July 2017, 06:03 AM |#6  
Member
Thanks Meter: 26
 
More
Anybody having problems to install this module on Magisk 13.3? When I go to MODULES, select it and install, Magisk app freezes and I have to restart my phone. After that, I cannot open Magisk app anymore. I have to completely uinstall it and install again to be able to open the app again. On Magisk 12 it was working perfectly.
19th July 2017, 07:11 AM |#7  
OP Senior Member
Flag Düsseldorf
Thanks Meter: 3,453
 
More
@maecar: The Problem is not Magisk 13.3, but Magisk Manager 5.1.0. There are numerous reports on the last few pages of the Magisk Support thread about the freezing issue. Until @topjohnwu fixes it, reverting to Magisk Manager 5.0.6 helps.
The Following User Says Thank You to okij For This Useful Post: [ View ] Gift okij Ad-Free
19th July 2017, 09:42 AM |#8  
whalesplaho's Avatar
Senior Member
Flag Treasure Island
Thanks Meter: 2,624
 
More
Mind making modulesl universal for Xperias...
Thanks... I use Z5!
3rd August 2017, 11:59 PM |#9  
olokos's Avatar
Recognized Developer
Flag Warsaw
Thanks Meter: 2,479
 
Donate to Me
More
Thanks for proper credit mate, nice work
The Following User Says Thank You to olokos For This Useful Post: [ View ]
4th August 2017, 12:33 AM |#10  
OP Senior Member
Flag Düsseldorf
Thanks Meter: 3,453
 
More
Quote:
Originally Posted by olokos

Thanks for proper credit mate, nice work

I have to thank you and @AndroPlus for the initial MOD! I've been happily using it since about 2 years, but of course always had to re-apply it when updating a ROM. Now with Magisk, we can just "set and forget".
The Following User Says Thank You to okij For This Useful Post: [ View ] Gift okij Ad-Free
17th October 2017, 08:05 PM |#11  
Senior Member
Flag Głogów
Thanks Meter: 12
 
More
Is 500,000 secure?
Post Reply Subscribe to Thread

Tags
boost, magisk, module, torch, xperia

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes