• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Question [Bounty) TPD App Throttling Disablement

Search This thread

Burt Squirtz

Senior Member
Feb 11, 2018
587
254
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)
View attachment 5364457


sources/com/android/server/wm/OnePlusPerfManager.java
(here he disabled OnePlusPerfManager)
View attachment 5364459


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")
View attachment 5364467



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 🥶
Do you see anything unusual that's not supposed to be in there?
 

phr0zen

Senior Member
May 24, 2009
480
95
OnePlus 7 Pro
This magisk module disable TPD and OpPerf, I hacked oneplus services, it make the phone run at full speed when needed. working fine with stock kernel and rom . if you want restore it, you can disable or removing this magisk module.
First of all THANK YOU for this!
Secondly, how is anyone getting anything higher than 79? If it helps, I'm using Bromite browser with the Bromite WebView.
 

LuK1337

Recognized Developer
Jan 18, 2013
8,483
16,955
Samsung Galaxy S III I9300
Moto G 2014
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.
 

Dashwood Foxe

Senior Member
Dec 23, 2014
157
54
Survives an OTA but not a reboot? Lol. This sounds like a PITA
Could just.. disable the module, reboot, then OTA?
Normally before every major OTA, it's common practice to disable all your module Incase a conflicting module throws you into a boot loop. Sides with the current track records of timely OTAs from OnePlus, We can all agree it's about as inconsistent as waiting for the next blue moon. I'm sure a few extra steps and 2 minutes of your time won't eat into your fragging session in PUBG/Fortnite or whatever people are into these days.
 

fdgfgd

Member
Nov 22, 2017
35
73
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.
Disabling TPD only solves part of the problem. If the OPPerf service is running and is able to retrieve configs from OPOnlineConfig then it'll throttle CPU core frequencies in certain apps such as Chrome.

Speedometer scores in Chrome:
Throttling: ~15-20
TPD disabled: ~70
TPD/OPPerf disabled: ~110 (Full 888 potential)
 

Mar-cel

Senior Member
Jun 18, 2013
1,448
329
Disabling TPD only solves part of the problem. If the OPPerf service is running and is able to retrieve configs from OPOnlineConfig then it'll throttle CPU core frequencies in certain apps such as Chrome.

Speedometer scores in Chrome:
Throttling: ~15-20
TPD disabled: ~70
TPD/OPPerf disabled: ~110 (Full 888 potential)
how do you disable OPPerf ?
 

Haunt3r

Senior Member
For those that use tasker I created a TPD off and a TPD on task, you can set them as widget shortcuts on your home screen or however you want to run them. Obviously requires root.

Edit:

Added the profile for on boot TPD off event.
 

Attachments

  • TPD_Off.tsk.xml
    1 KB · Views: 54
  • TPD_On.tsk.xml
    1 KB · Views: 60
  • TPD_Off_Boot.prf.xml
    1.3 KB · Views: 49
Last edited:

thirtythr33

Senior Member
Sep 3, 2011
337
139
New York
OnePlus 6T
OnePlus 9 Pro
For those that use tasker I created a TPD off and a TPD on task, you can set them as widget shortcuts on your home screen or however you want to run them. Obviously requires root, I also believe there's the ability to run tasks at launch but I couldn't be f'd to figure it out. All this does is automate the chmod process that LuK1337 outlined.
so to be clear, I can use this to disable the throttling or do I also need to disable opperf (via titanium backup)?
 

Haunt3r

Senior Member
we have to do this every time?
According to what LuK1337 said, yes a reboot will remove the chmod on the files, which is why I mentioned the autorun at boot for tasker. I don't have a need for it to be done at boot, so I can just switch it on when I want that extra little bit of speed, or turn it off for better battery life.
 
  • Like
Reactions: aNGERY

Haunt3r

Senior Member
For those that use tasker I created a TPD off and a TPD on task, you can set them as widget shortcuts on your home screen or however you want to run them. Obviously requires root, I also believe there's the ability to run tasks at launch but I couldn't be f'd to figure it out. All this does is automate the chmod process that LuK1337 outlined.
For those wanting the TDP disabled on boot, in tasker create a new profile for event>system>device boot and link the TDP off task that you imported.

Edit: I've attached a profile you can import if you don't want to set it up yourself. I think you need to make sure to import the tasks first though.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    How did you manage to achieve such numbers?
    I really didn't do anything, no module,no tweaks, nothing, except it is on a custom rom(evolution x)
    Even I was surprised to see such a cracked score.
  • 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"
    10
    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.