Question [Bounty) TPD App Throttling Disablement

Search This thread

Mar-cel

Senior Member
Jun 18, 2013
1,494
344
OnePlus 9 Pro
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.
I now get 83.3 with your profiles in Browserbench
 
  • Like
Reactions: Haunt3r

Trekster

Senior Member
Aug 5, 2008
74
12
That's about what I get as well, better than stock, but not better than when OP perf is disabled. I haven't noticed a huge hit to battery or anything with these profiles either, but I've only been using them today, so I'll know more as the week goes on.
I've been using the TDP disabled Omega kernel since it was out. Battery life is worsened but not a lot. And the phone charges so fast that it's worth the sacrifice. This means i can flash the newest kernel, run TDP disabled during the day and enable it for lower battery drain during the night.
 
  • Like
Reactions: Haunt3r

xxspark89xx

Senior Member
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.
@xls654 Dude, I installed your module and it fixed my connection problems - wifi (internet) would stop working after a period of time and I'd have to restart the phone in order to get it to work again.

Thank you!
 
Last edited:

xxspark89xx

Senior Member
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 🥶
Seems like (I'm guessing) the changes to WIFI fixed my wifi issue where my internet connection would stop even when I was still connected to my wifi. Reconnecting to my wifi wouldn't fix my issue or toggling airplane mode, only a restart would fix it. This was getting so annoying as I'd have to restart my phone multiple times a day. Now with the module installed, it works without an issue. So I think whatever was done inadvertently fixed my problem. 😅
 

Burt Squirtz

Senior Member
Feb 11, 2018
608
295
Google Pixel 6
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.
Oh man. Your module was amazing. Would you possibly reload a new one for the new 8.8 update by chance?

There's no need to remove the module bro. It works so damn well and it makes it very easy for so many users.
 

Burt Squirtz

Senior Member
Feb 11, 2018
608
295
Google Pixel 6
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.
A bit of a silly question, but how exactly do you add these profiles to tasker? It's asking me for a whole bunch of choices like application, event Etc.

Does anyone know the EXACT steps to add these profiles?
 

Burt Squirtz

Senior Member
Feb 11, 2018
608
295
Google Pixel 6
In tasker, long press on the Home icon, choose import project, and browse to the .tsk.xml file
Okay this worked to install tpd off on boot. But for some reason I can't figure out how to import tpd immediately off, or tpd on. I'm a smart guy and I can't believe tasker's is this freaking hard to figure out. Those files simply won't import as it says those files don't exist. (I even put them in the projects folder in Tasker.

What's the path these two specific XML files go to? It's not device boot anymore, is it?

It's giving me this BS message when I try and import it:
 

Attachments

  • Screenshot_20210719-134201.jpg
    Screenshot_20210719-134201.jpg
    193.4 KB · Views: 159

Haunt3r

Senior Member
Jul 16, 2012
247
76
Portland,Oregon
Google Pixel 8 Pro
Okay this worked to install tpd off on boot. But for some reason I can't figure out how to import tpd immediately off, or tpd on. I'm a smart guy and I can't believe tasker's is this freaking hard to figure out. Those files simply won't import as it says those files don't exist. (I even put them in the projects folder in Tasker.

What's the path these two specific XML files go to? It's not device boot anymore, is it?

It's giving me this BS message when I try and import it:
I believe you need to be on the tasks header to import the tasks.
 

Haunt3r

Senior Member
Jul 16, 2012
247
76
Portland,Oregon
Google Pixel 8 Pro
I still don't understand how to get on or off to work immediately with a shortcut. What exact steps do I need to do? I can't believe this requires an engineering degree to get to work.

Long press on your homescreen, add widget, add tasker task (may need to reopen tasker and close it), choose the tasks you're wanting to run when you place the widget.
 

Burt Squirtz

Senior Member
Feb 11, 2018
608
295
Google Pixel 6
Long press on your homescreen, add widget, add tasker task (may need to reopen tasker and close it), choose the tasks you're wanting to run when you place the widget.
This is excellent advice and you've been a lifesaver. Okay I got it working.

But now it keeps vibrating with it on even when I set the vibration to the absolute lowest setting. It won't stop vibrating even when I turn notifications off.
 

Haunt3r

Senior Member
Jul 16, 2012
247
76
Portland,Oregon
Google Pixel 8 Pro
This is excellent advice and you've been a lifesaver. Okay I got it working.

But now it keeps vibrating with it on even when I set the vibration to the absolute lowest setting. It won't stop vibrating even when I turn notifications off.
It should only vibrate once, to notify you that the task completed.. If you don't want it to vibrate at all go into the task and delete the vibrate line, this can be done by clicking on the task>long press on vibrate>then use the scissors icon to cut it out, then click the arrow in the upper left hand corner to return to the tasks window.
 
  • Like
Reactions: Samuel Holland
It should only vibrate once, to notify you that the task completed.. If you don't want it to vibrate at all go into the task and delete the vibrate line, this can be done by clicking on the task>long press on vibrate>then use the scissors icon to cut it out, then click the arrow in the upper left hand corner to return to the tasks window.
You can also make it a qs toggle
 
  • Like
Reactions: Samuel Holland

Walhalla

Senior Member
Jul 5, 2008
147
137
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"
 

Attachments

  • OnePlus-TPD-and-OPPerf-Disabler.zip
    2 KB · Views: 586
Last edited:

shremi

Senior Member
Aug 22, 2011
113
26
Well I just tried the module .... Definitely not a placebo the difference is there wondering how it will affect battery life
 

massaquah

Senior Member
Jan 10, 2008
104
5
Hannover
OnePlus 9
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"

Thank you for this module.
With this module activated and using Omega kernel (not the latest but the previous version), I get 87 points in Browserbench.
Am I missing something?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 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.
    16
    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.