[Galaxy S III Original Android Development] curiousrom:
Performance profiles - Deleting a System File? power.smdk4x12.so

***

Battery saver and performance > Performance profiles

Edit: What a coincidence as a couple of days ago I was looking at https://github.com/LineageOS/android_device_samsung_i9300/blob/cm-14.1/power/power.h to try to find out what the different > Settings > Battery > Battery saver and performance > Performance profiles > Power save, Balanced and Performance do exactly when modifying the LineageOS 14.1 for S3 i9300 stock kernel's settings and was preparing a post about it.

Note: those LineageOS Performance profile options settings probably do not work with custom kernels.

For example from that file (pegasusq is the default CPU governor) > governor_settings > - Performance vs. + Balanced made with DiffMerge, if there is only 1 line it's because that setting is identical in both profiles.

Best viewed in a browser as the XDA app does not show the colors. Edit: {PROFILE_POWER_SAVE} added:

-[PROFILE_PERFORMANCE]

+[PROFILE_BALANCED]

{PROFILE_POWER_SAVE}

.hotplug_freq_1_1 = 500000, {800000} <<< this setting is identical for both Performance & Balanced profiles but is set to 800000 in Power save.

- .hotplug_freq_2_0 = 200000,

+ .hotplug_freq_2_0 = 500000, {700000}

- .hotplug_freq_2_1 = 500000,

+ .hotplug_freq_2_1 = 700000, {1000000}

- .hotplug_freq_3_0 = 200000,

+ .hotplug_freq_3_0 = 700000, {900000}

- .hotplug_freq_3_1 = 700000,

+ .hotplug_freq_3_1 = 900000, {1200000}

- .hotplug_freq_4_0 = 200000,

+ .hotplug_freq_4_0 = 900000, {1100000}

.hotplug_rq_1_1 = 150, {200}

- .hotplug_rq_2_0 = 100,

+ .hotplug_rq_2_0 = 150, {200}

- .hotplug_rq_2_1 = 200,

+ .hotplug_rq_2_1 = 250, {300}

- .hotplug_rq_3_0 = 150,

+ .hotplug_rq_3_0 = 250, {300}

- .hotplug_rq_3_1 = 250,

+ .hotplug_rq_3_1 = 350, {400}

- .hotplug_rq_4_0 = 200,

+ .hotplug_rq_4_0 = 350, {400}

.min_freq = -1,

.max_freq = -1, {1000000}

- .up_threshold = 80,

+ .up_threshold = 90, {95}

- .down_differential = 5,

+ .down_differential = 3, {2}

.min_cpu_lock = 0,

.max_cpu_lock = 0, {3}

- .cpu_down_rate = 20,

+ .cpu_down_rate = 10, {5}

.sampling_rate = 200000,

- .io_is_busy = 1,

+ .io_is_busy = 0, {0}

- .boost_freq = 900000,

+ .boost_freq = 700000, {0} boosting power hints are ignored for PROFILE_POWER_SAVE

- .boost_mincpus = 2,

+ .boost_mincpus = 0, {0}

- .interaction_boost_time = 90 * (MS_TO_NS),

+ .interaction_boost_time = 60 * (MS_TO_NS), {0}

- .launch_boost_time = 3000 * (MS_TO_NS)

+ .launch_boost_time = 2000 * (MS_TO_NS) {0}

Note: If you have root enabled you can tweak the Lineage stock kernel settings using some of this data & also change the governor and other stuff by using one these free kernel mangers: like Kernel Adiutor, Kernel Monitor, Kernel Tool, Kernel Tuner, etc.

But before you do make sure to have a recent full TWRP backup in case you mess up something & as a rule of thumb if you don't know what a setting does: research it or leave it alone! :eek:

BTW Automatic optimization as seen in the Battery saver and performance panel screenshot attachment is not working in LineageOS 14.1 and was removed in LOS 15.1. Maybe that fake setting will also be removed in 14.1 in a future update.

Meanwhile it's better to keep it disabled to avoid useless processes & errors.

From this post by jrizzoli, Lineage Team Member:

***

Deleting a System File? power.smdk4x12.so

Edit: "...delete power.smdk4x12.so" - Maybe it would be better to say rename power.smdk4x12.so to power.smdk4x12.so.bak to disable it and the tweak can be easily undone by renaming it again & removing .bak.

Edit 2: [MENTION=5257316]bejunk[/MENTION] After renaming /system/lib/hw/power.smdk4x12.so to power.smdk4x12.so.bak & rebooting the > Settings > Battery > Battery saver and performance > Performance profile options are completely gone as shown in the screenshot!

That is because in the android_device_samsung_i9300/power/Android.mk file you can see:

...LOCAL_CFLAGS += -DUSE_PEGASUSQ_BOOSTING

LOCAL_MODULE := power.$(TARGET_BOOTLOADER_BOARD_NAME)…

Which is related to the Performance profiles described above.

***

Could you support that system file power.smdk4x12.so deletion suggestion with some quote or reference please?

If LineageOS 14.1 for i9300 "uses only AOSP implementation of power HAL (power.default.so)" as you say then why deleting a file that it's not using will change anything in performance?

Or because power.default.so is in the same /system/lib/hw/folder as power.smdk4x12.so are you saying that LineageOS i9300 will now be forced to use it because power.smdk4x12.so was deleted?

It's important because the S3 i9300's board is in the smdk4x12 family and I can see here https://github.com/LineageOS/android_device_samsung_i9300 in the Power folder > android_device_samsung_i9300/power/power.c "power_module HAL_MODULE_INFO_SYM... .name = "smdk4x12 Power HAL". :confused:

Check this: https://review.lineageos.org/q/project:LineageOS%2Fandroid_kernel_samsung_smdk4412 and also this: https://review.lineageos.org/q/project:LineageOS%2Fandroid_device_samsung_i9300

"..battery life seems also improved" - Without some stats or logs or BetterBatteryStats dump that's hard to prove.

Placebo is a sneaky thing. ;)

***