[Sony Xperia 1 IV] Doom Slayer:
If you want stable 120hz with a better battery life and lower heat during normal usage with forced endurance mode for camera (longer 4k120FPS recording) and game enhancer's performance profile, look no further!

Of course at your own risk, I do not take any responsibility for broken devices, burned hands, radiation sickness or any other catastrophic events. DO NOT INSTALL THIS ON ANY OTHER DEVICES, APART FROM 1 IV or 5 IV!!!

IT'S FOR ANDROID 13 ONLY.

In case you are ignoring my advice, keep in mind that:

IF DEVICE KEEPS RECORDING WITHOUT WARNING IT MEANS YOUR THERMAL ENGINE IS BROKEN

Description:

During your normal usage (not gaming or camera) phone will heat less due to the lower CPU frequencies and screen wont forcefully switch to 60hz even if for some reason phone will reach the higher temperature.

Frequencies are following: 1574Mhz (Little)+1651Mhz (Big)+2054Mhz(Prime)+545Mhz(GPU)

If you add your game/app to the game enhancer and select "performance profile" it will throttle way less aggressively. Max temperature is changed from 56C to 61C, screen refresh rate will only drop if the display's temperature sensor will reach 45C.

In "balanced" profile the temperature limit is set to 58C, frequencies are limited to 1574Mhz (Little)+1651Mhz (Big)+2054Mhz(Prime)+545Mhz(GPU).

"Battery mode preferred" is set to 57C with the following limits: 1267Mhz+1325Mhz+1728Mhz+492Mhz.

View attachment 5922571

Camera related profiles are set to 63C.

Video recording profile is set to endurance mode (66C temp limit) with a little bit of throttling to cool device down.

During recording device will show warning, but won't stop recording or disable camera functionality. However if the camera module itself will reach the limit temperature (untouched by me for safety reasons), the recording will stop. Additionally modem might be temporary switched off to cool device down.

View attachment 5911055

Is this safe?

As safe as using endurance mode, given that you will use it reasonably. I doubt anyone really needs to record 30 minutes 4k120fps videos often and balanced profile is enough for most games, unless you play with emulators and want to squeeze more juice out of your CPU.

May not be as safe for you, if you have sensitive skin. :D

I strongly recommend using stick/stand when recording high quality videos for a longer periods of time.

External cooler is also advisable for long gaming sessions with performance profile.

View attachment 5911057

Instructions:

You need root and magisk.

Install this module

GitHub - HuskyDG/magic_overlayfs: Make system partition become read-write (it is also possible without Magisk)

Make system partition become read-write (it is also possible without Magisk) - HuskyDG/magic_overlayfs

github.com

Latest version is not working properly, so I attached the one that works.

After rebooting go to oem/etc with any root file manager, enable R/W and replace the thermal-engine.conf and change.cfg for newer versions.

Make sure to set the same permissions and backup original files.

In the end you may want to go to /data/adb/modules/magisk_overlayfs and modify mode.sh to lock partition again (mode 2), this is done to avoid some apps detecting traces of modified system with Momo app.

Additionally I recommend undervolting GPU.

Thanks to @ragu24 for pointing at the right direction. :)

To do so:

Install konabess and select your GPU (should be in the middle).

Backup old image.

Then go to import/export.

Export your config (backup).

Import config txt that I shared.

Save GPU freq table.

And then repack and flash image.

After rebooting check the frequency table if the UV applied correctly.

Have fun!

If for any reasons you want return to stock, you can simply disable overlayFS module and restore your config in konabess.

Changelog

0.1 initial release:

Kill switch disabled

Applied Xperia Stream profile to Game Performance and camera

0.2 version:

Slightly raised screen temperature limit (it was lower in gaming mode)

Modified general camera profile (non stock app?)

0.3 version:

Disabled screen fps drop for other game profiles (unless screen itself is hot)

Returned kill switch (previous version will not stop unless other sensors show high temp)

Raised temperature till 64C for camera and game performance profile

0.4 version:

Less aggressive throttling for best performance (Game performance and camera profiles)

Raised temp to 66C for video recording and game performance profiles (endurance mode)

For other camera related profiles I limited temp to 63C

Switched modem to endurance mode on a game performance profile, however during long video recording modem may be temporary disabled to reduce device temperature

1.0 version:

Introducing modified "battery life preferred" and "balanced" profiles for Game Enhancer (Also thermal limit in custom settings should do the trick)

"Battery life preferred" temp limit: 57C, Max frequencies: 1267Mhz(Little)+1325Mhz (Big)+1728 (Prime)+492Mhz (GPU)

"Balanced" temp limit: 59.5C, Max frequencies: 1574Mhz+1651Mhz+2054Mhz+545Mhz

1.1 version:

Reworked game enhancer profiles to have dynamic frequency adjustment instead of aggressive throttling

Restricted limit for performance profile to 61C

Restricted limit for balanced profile to 58C

Disabled modem endurance mode for performance profile, since device doesn't heat that much anymore (back to stock change.cfg)

Made sure that underclocking kicks in instantly on balanced and battery safe profiles

Minor bug fixes

1.2 version:

Introducing modified "default" profile to reduce heat during normal usage and prolong battery life

Same logic applies to voice calling profile with a bit more aggressive temperature control

Device is underclocked to 1574Mhz(Little)+1325Mhz (Big)+1651Mhz (Prime)+421Mhz (GPU)

1.3 version:

Applied custom "balanced" game enhancer profile as a system default for best overall performance, stability and thermals

Max frequencies on apps other than camera and inside game enhancer are: 1574Mhz (Little)+1651Mhz (Big)+2054Mhz(Prime)+545Mhz(GPU)