Question [Bounty) TPD App Throttling Disablement

Search This thread

EtherealRemnant

Senior Member
Sep 15, 2007
3,599
1,079
37
Denver, CO
Has anyone by chance investigated this for ColorOS? It doesn't seem to have TPD but it's still only scoring 60-65 and toggling performance mode in settings kicks it up to 100-105. It's way more performance than OOS had stock when I tested it but it seems to affect Vivaldi, Opera, Opera GX, and Edge Beta too which means it's likely a system-wide setting somewhere.

I would honestly prefer to stick with COS because it gets faster updates and feels smoother than OOS despite the bloat it comes with but I have gone looking and I don't see TPD files when looking in a root file explorer nor do I see any apps that look like they could be related to OPPerf.
 

AndyC76

Senior Member
Nov 24, 2010
188
33
Fully stock c48, normal and then high performance mode.
91.76 vs 117, is that what's expected?
 

Attachments

  • Screenshot_2022-05-18-21-06-28-99_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
    Screenshot_2022-05-18-21-06-28-99_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
    187.1 KB · Views: 69
  • Screenshot_2022-05-18-21-08-07-84_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
    Screenshot_2022-05-18-21-08-07-84_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
    179.1 KB · Views: 68

AndyC76

Senior Member
Nov 24, 2010
188
33
That's full stock, not even a custom kernel or a custom browser? That's way higher than it should be if the TPD is at work so congrats if so.
Yup can confirm it's fully stock, no modifications at all. It's wild how much snappier/faster the phone is while playing the game "Hitman Sniper: TS" !

You can see the performance mode is activated by looking at the second screenshot, a speedometer dial appears next to the alarm clock.
 

EtherealRemnant

Senior Member
Sep 15, 2007
3,599
1,079
37
Denver, CO
Yup can confirm it's fully stock, no modifications at all. It's wild how much snappier/faster the phone is while playing the game "Hitman Sniper: TS" !

You can see the performance mode is activated by looking at the second screenshot, a speedometer dial appears next to the alarm clock.
I don't know how you have that at stock. I just flashed back to C.48 NA and it's definitely still throttling lol.

Screenshot_2022-05-19-14-54-18-70_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
 
Last edited:

EtherealRemnant

Senior Member
Sep 15, 2007
3,599
1,079
37
Denver, CO
for those that also want to disable OPPerf again.

Based on the findings of @xls654 (digging in the oneplus-services.jar) and the idea of @LuK1337 to disable access to the tpd files of the kernel module, I created a new magisk module, after I found a build.prop variable in the code to disable OPPerf.

The module chmods the system writeable files of the tpd kernel module:

Code:
chmod 000 /sys/module/tpd/parameters/tpd_cmds
chmod 000 /sys/module/tpd/parameters/tpd_dynamic
chmod 000 /sys/module/tpd/parameters/tpd_enable
chmod 000 /sys/module/tpd/parameters/tpd_id

and sets a build.prop variable to disable OPPerf:

Code:
persist.sys.opperf.enable=false

Be informed that this module doesn't modify any system files so its universal and working on upcoming OOS versions. If you disable or uninstall the module and reboot all is reverted.

If you don't want to use a magisk module you can also set and revert the build.prop variable via terminal, but it is only read once on boot, when the OPPerf service starts, so you need to reboot after setting or removing the variable.

disable OPPerf:

Code:
su -c "setprop persist.sys.opperf.enable false"

revert:

Code:
su -c "resetprop -p --delete persist.sys.opperf.enable"
Hmm... C.48 on my OP9 has way worse than stock performance with this module:

Screenshot_2022-05-19-15-26-03-13_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

Stock:

Screenshot_2022-05-19-14-54-18-70_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

EDIT: Seems that TPD has been removed. I pulled up adb shell to do this manually. The files don't exist. And now disabling OPPerf actually throttles the device hard. Yikes.
 
Last edited:

AndyC76

Senior Member
Nov 24, 2010
188
33
It seems that the phone needs to work out when to allocate more resources to an appt

Screen shots in order

The last 2 screenshot show the first run and then the second run ( immediately after the previous)
 

Attachments

  • Screenshot_2022-05-20-06-07-36-64_0ba066473b79d6e213a1f6f52505e2ee.jpg
    Screenshot_2022-05-20-06-07-36-64_0ba066473b79d6e213a1f6f52505e2ee.jpg
    249.4 KB · Views: 59
  • Screenshot_2022-05-20-06-07-47-31_0ba066473b79d6e213a1f6f52505e2ee.jpg
    Screenshot_2022-05-20-06-07-47-31_0ba066473b79d6e213a1f6f52505e2ee.jpg
    210.2 KB · Views: 57
  • Screenshot_2022-05-20-06-07-51-35_0ba066473b79d6e213a1f6f52505e2ee.jpg
    Screenshot_2022-05-20-06-07-51-35_0ba066473b79d6e213a1f6f52505e2ee.jpg
    273 KB · Views: 51
  • Screenshot_2022-05-20-06-12-22-94_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
    Screenshot_2022-05-20-06-12-22-94_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
    184.3 KB · Views: 52
  • Screenshot_2022-05-20-06-15-22-02_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
    Screenshot_2022-05-20-06-15-22-02_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
    179.7 KB · Views: 58

AndyC76

Senior Member
Nov 24, 2010
188
33
Would you consider running 2 in a row? Meaning run it once, then immediately run it again
 

EtherealRemnant

Senior Member
Sep 15, 2007
3,599
1,079
37
Denver, CO
I'm losing my mind with this piece of crap device. I went back to 11.2.10.10 and the module doesn't work completely either. I get around 60 with the module. Around 40 without it. At least my Geekbench single core score is not 800 anymore but ugh.

I get ~80 in Vivaldi and ~60 in Chrome, DuckDuckGo, and Opera GX, even with arter97's kernel.

Screenshot_20220605-010129.jpg
Screenshot_20220605-010641.jpg
Screenshot_20220605-005912.jpg
 
  • Sad
Reactions: AndyC76

EtherealRemnant

Senior Member
Sep 15, 2007
3,599
1,079
37
Denver, CO
That's called thermal throttling, not specific app throttle. And you can't disable thermal throttling, it's built in the hardware to protect it from basically frying itself. The hardware throttle is usually set up to 95 Celsius degrees.
Throttling happens way sooner than that on mobile SoCs to protect the other components in the device. You can generally see it starting to happen around 50-55C and then it crashes hard between 60-70C.

That said though, you are correct that the app throttle is different. It also only shows itself on certain apps in OOS11 and typically benchmark apps weren’t subjected to it so it’s unlikely that this app was affected either way.
 

samwhiteUK

Senior Member
Jul 1, 2012
166
63
Cambridge
OnePlus 9 Pro
I used to know a fair bit about this but over the last year I totally forgot about it. I'm wondering if anyone can help me out. I'm on the latest OOS 11 and the latest Arter97 kernel. In Firefox, I'm getting a score of 62 on Speedometer 2.0. I've done the chmod to the /sys/module/tpd/parameter/tpd* files, and I've used the adb command to disable opconfig. What am I doing wrong?
 

ekin_strops

Senior Member
Apr 29, 2016
1,138
427
Munich
OnePlus 9 Pro
Throttling happens way sooner than that on mobile SoCs to protect the other components in the device. You can generally see it starting to happen around 50-55C and then it crashes hard between 60-70C.

That said though, you are correct that the app throttle is different. It also only shows itself on certain apps in OOS11 and typically benchmark apps weren’t subjected to it so it’s unlikely that this app was affected either way.

It solely depends on what kind of throttling is the phone relying on. If it's software throttling (OS) then it throttles earlier, but if it's hardware-based throttling by Qualcomm then it's 95 Celsius. And SD888 for example is hitting 95 celsius a LOT of times (the X1 CPU core), so, no, it's not being throttled at 60-70 already but later. Regarding the other components, the only important component which doesn't like the heat is the battery. And OOS has battery based thermal throttling, which means, regardless at what temperatures is the SOC at, if the battery reaches about 45 Celsius, it will hard throttle both the CPU and GPU.

P.S. operating temperature of the SD888 are up to 95 celsius, and it's completely safe if the phone is hitting above 90 Celsius on the CPU or GPU. (Qualcomm data).
 

EtherealRemnant

Senior Member
Sep 15, 2007
3,599
1,079
37
Denver, CO
I used to know a fair bit about this but over the last year I totally forgot about it. I'm wondering if anyone can help me out. I'm on the latest OOS 11 and the latest Arter97 kernel. In Firefox, I'm getting a score of 62 on Speedometer 2.0. I've done the chmod to the /sys/module/tpd/parameter/tpd* files, and I've used the adb command to disable opconfig. What am I doing wrong?
Stock kernel + the posted Magisk module on 11.2.10.10.

Screenshot_20220609-094721.jpg
It solely depends on what kind of throttling is the phone relying on. If it's software throttling (OS) then it throttles earlier, but if it's hardware-based throttling by Qualcomm then it's 95 Celsius. And SD888 for example is hitting 95 celsius a LOT of times (the X1 CPU core), so, no, it's not being throttled at 60-70 already but later. Regarding the other components, the only important component which doesn't like the heat is the battery. And OOS has battery based thermal throttling, which means, regardless at what temperatures is the SOC at, if the battery reaches about 45 Celsius, it will hard throttle both the CPU and GPU.

P.S. operating temperature of the SD888 are up to 95 celsius, and it's completely safe if the phone is hitting above 90 Celsius on the CPU or GPU. (Qualcomm data).
I cannot find anywhere that Qualcomm discloses maximum temperatures beyond saying the operating temperature is -150C to 150C but I can't see any manufacturer letting a phone get that hot. All that heat has to go somewhere and that phone would be way to hot to handle... Literally. I know my phone isn't hitting anywhere near 95C before it starts to throttle hard. In fact I tested it yesterday and noted a huge drop at 77C and the battery was at 43C. This isn't really the appropriate thread to continue to argue that point though.
 

ekin_strops

Senior Member
Apr 29, 2016
1,138
427
Munich
OnePlus 9 Pro
Stock kernel + the posted Magisk module on 11.2.10.10.

View attachment 5634019

I cannot find anywhere that Qualcomm discloses maximum temperatures beyond saying the operating temperature is -150C to 150C but I can't see any manufacturer letting a phone get that hot. All that heat has to go somewhere and that phone would be way to hot to handle... Literally. I know my phone isn't hitting anywhere near 95C before it starts to throttle hard. In fact I tested it yesterday and noted a huge drop at 77C and the battery was at 43C. This isn't really the appropriate thread to continue to argue that point though.

SD888 hits 95 on daily basis under stress tools. Seems like you're not completely aware of what Hardware thermal throttling is compared to software-based thermal throttling (OS).

Also, the OnePlus 9 Pro:

Here, measured temps while playing Genshin (CPU).

Tell me now that it throttles that soon at that it doesn't hit the 95 or more.

4.5W average power consumption. Average temp. 78 Celsius degrees.
 

Attachments

  • photo_2022-05-04_16-07-15.jpg
    photo_2022-05-04_16-07-15.jpg
    71.3 KB · Views: 19

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    SD888 hits 95 on daily basis under stress tools. Seems like you're not completely aware of what Hardware thermal throttling is compared to software-based thermal throttling (OS).

    Also, the OnePlus 9 Pro:

    Here, measured temps while playing Genshin (CPU).

    Tell me now that it throttles that soon at that it doesn't hit the 95 or more.

    4.5W average power consumption. Average temp. 78 Celsius degrees.
    Again, this isn't the thread for this discussion.
  • 18
    The magisk module removed, see post #26 @LuK1337 , the command "chmod 000 /sys/module/tpd/parameters/tpd_*" is better way,Thanks @LuK1337. That module is only for my personal testing.
    15
    for those that also want to disable OPPerf again.

    Based on the findings of @xls654 (digging in the oneplus-services.jar) and the idea of @LuK1337 to disable access to the tpd files of the kernel module, I created a new magisk module, after I found a build.prop variable in the code to disable OPPerf.

    The module chmods the system writeable files of the tpd kernel module:

    Code:
    chmod 000 /sys/module/tpd/parameters/tpd_cmds
    chmod 000 /sys/module/tpd/parameters/tpd_dynamic
    chmod 000 /sys/module/tpd/parameters/tpd_enable
    chmod 000 /sys/module/tpd/parameters/tpd_id

    and sets a build.prop variable to disable OPPerf:

    Code:
    persist.sys.opperf.enable=false

    Be informed that this module doesn't modify any system files so its universal and working on upcoming OOS versions. If you disable or uninstall the module and reboot all is reverted.

    If you don't want to use a magisk module you can also set and revert the build.prop variable via terminal, but it is only read once on boot, when the OPPerf service starts, so you need to reboot after setting or removing the variable.

    disable OPPerf:

    Code:
    su -c "setprop persist.sys.opperf.enable false"

    revert:

    Code:
    su -c "resetprop -p --delete persist.sys.opperf.enable"
    11
    As the OP does not respond, I decided to investigate myself what changes were made in the oneplus-services.jar file.

    I unpacked the original oneplus-services.jar framework from my phone, decompiled classes.dex which was inside and compared all changes made in @xls654 module.

    The changes are in three files inside classes.dex (original files on left side, "hacked on right side):


    sources/com/android/server/wifi/tsu.java
    (wtn enables something called "OpWifiLowLatency", but I don't know what is WifiManager.WifiLock and why he disabled it, to be honest I don't understand just this one change, I don't know what WiFi has to do with TPD and overall app throttling)
    Code_eidIYu8z5t.png



    sources/com/android/server/wm/OnePlusPerfManager.java
    (here he disabled OnePlusPerfManager)
    Code_XNTzVwKOzp.png



    sources/com/android/server/hmo.java
    (I'm quite sure boolean H enables TPD, so OP disabled it by replacing whole function with "return false")
    Code_VOKkhWRTF4.png




    I hope someone will find this information useful. I wanted to see how OP turned off the throttling app out of curiosity, and since he doesn't write back in this thread, I thought that I would save everyone's time by showing what I found.

    I hope the author of the module will not be angry that I showed it 🥶
    9
    I'll Personally donate $50 to anyone that comes up with a easy solution to disable the app throttling. I'm well aware that some Developers can exclude the TPD commit, but it seems like devs aren't too keen on doing that.

    I also realize that OnePlus should have added a toggle within the OS for us to turn that on or off. Samsung does this they have a feature called 'enhanced processing', that lets the phone run at full potential.
    5
    No, it's just what I showed in the post, some things have been disabled, but nothing was added that was not originally there, the module is safe.
    Not sure why would one bother patching services jar when you can just do "chmod 000 /sys/module/tpd/parameters/tpd_*"...
    At least that'd survive OTA updates.