View Single Post
Posts: 1,463 | Thanked: 1,916 times | Joined on Feb 2008 @ Edmonton, AB
#1
PR 1.2/1.3 STOCK KERNEL ONLY!!
Also works on n950, nitdroid and open kernel (with aegis fixed origin) too

WARNING: Killed 2 N9s so far
1300mhz+ is very dangerous over a long time.

First, install inception from here. You don't need opensh or aegisctl anymore.

Download these two files:

Kernel Modules 1.5.4 (changelog)

User Interface 1.2.7 (changelog)

Install in this order!
(change to the directory you saved the files)
/usr/sbin/incept opptimizer_1.5.4_armel.deb
/usr/sbin/incept opptimizer-ui_1.2.7_armel.deb

Load OppUI from the menu.


Usage

This is the status screen. It will refresh automatically when you change anything, start the app, minimize and restore the app, or you can hit the refresh button if you feel the need. All data is coming from the sysfs entry (/proc/opptimizer) created by the kernel module. When this screen refreshes, if it can't find the sysfs entries, it will run the kernel module loader, wait, and refresh again. If it still doesn't work, you will see some error message here instead.



This is the settings screen. Here you can adjust the voltage, frequency, and apply your changes by clicking the red button. Frequency and Voltage labels will turn red if you are adjusting them into unsafe ranges. If you disable "Custom voltage", the voltage will be reset to whatever the kernel module thinks the default is (see raw output on previous screen). If you disable "SmartReflex", the default voltages are all increased slightly, and you will experience degraded battery life. There should be no reason to disable this, but I give you the option in case I am wrong. "Test iterations" is the number of times to verify the settings by running a CPU intensive calculation (it's drawing a mandelbrot in /dev/null). 1000 will take about 5 seconds and 16000 will take about 15 minutes. Of course, you can set it to 0 to skip the testing. When the testing is done, it will show how many seconds it took right below this, so you can use it as a benchmark, if you want. The test runs in a separate thread at normal priority.


If you attempt to apply unsafe changes, you will get an additional confirmation screen. I find this useful for when I show this app to people that like to push buttons without understanding the consequences.


This is what you see while it's running the test. Keep in mind that if you click "Stop test", the settings are still applied, but not saved. The progress is very fast at first, and then slows down due to the testing algorithm. The phone is still usable during the test, but I don't suggest it because it is likely to reboot and corrupt whatever files are open. When it's done the test, it verifies the md5 of the output file against what it expects, so if the cpu is unstable it *might* be able to warn you before it crashes. Nobody reported this feature is working yet so I don't know...


Known Issues
  • Apply on Startup takes a minute or two
  • Bug somewhere causes phone to reset when downclocking (occasionally)
  • Undervolting is impossible at this time
  • Cpufreq stats table not updated
  • Very high voltages or frequencies are slow, probably the chip throttles itself when too hot
  • Default voltage is correctly detected but when custom voltage is disabled you actually get a slightly increased voltage.

I AM NOT RESPONSIBLE FOR ANYTHING. I MAKE NO GUARANTEE THAT THIS WILL NOT RUIN YOUR PHONE


Here is some documentation from the kernel to help understand the 'raw output':

from smartreflex-class1p5c.c
* omap_volt_data - Omap voltage specific data.
*
* @u_volt_nominal : The possible voltage value in uVolts
* @u_volt_dyn_nominal : The run time optimized nominal voltage for device.
* this dynamic nominal is the nominal voltage
* specialized for that device at that time.
* @u_volt_dyn_margin : margin to add on top of calib voltage for this opp
* @u_volt_calib : Calibrated voltage for this opp
* @sr_nvalue : Smartreflex N target value at voltage <voltage>
* @sr_errminlimit : Error min limit value for smartreflex. This value
* differs at differnet opp and thus is linked
* with voltage.
* @vp_errorgain : Error gain value for the voltage processor. This
* field also differs according to the voltage/opp.

from voltage.c
* voltscale_adaptive_body_bias - controls ABB ldo during voltage scaling
* @enable: enable/disable abb
*
* Adaptive Body-Bias is a technique in all OMAP silicon that uses the 45nm
* process. ABB can boost voltage in high OPPs for silicon with weak
* characteristics (forward Body-Bias) as well as lower voltage in low OPPs
* for silicon with strong characteristics (Reverse Body-Bias).
*
* Only Foward Body-Bias for operating at high OPPs is implemented below, per
* recommendations from silicon team.
* Reverse Body-Bias for saving power in active cases and sleep cases is not
* yet implemented.
* OMAP4 hardward also supports ABB ldo, but no recommendations have been made
* to implement it yet.


So, which one is the real voltage? u_volt_calib is the real one, but if it is blank, it will use u_volt_dyn_nominal instead. If that one is blank too, u_volt_nominal is used. u_volt_dyn_nominal is calculated and stored by the formula u_volt_calib + u_volt_dyn_margin. Every time you recalibrate smartreflex it starts from that value and goes down to where it detects problems. If you disable smartreflex the u_volt_calib is blank so it uses the dyn_nominal + 50k. If you use a custom voltage and the opptimizer module, it will set both the u_volt_calib and u_volt_dyn_nominal to the requested value, so it will run at the voltage you requested even if smartreflex is disabled. It also sets the dyn_margin to 0 and sr_errminlimit to a lower value to try and stop smartreflex from further adjusting the values. Then it requests smartreflex to recalibrate so if there is a problem it will happen now instead of 24 hours later. The value "omap_voltageprocessor_get_voltage" in the opptimizer raw output can be used to confirm what voltage it settled on as this is pulled directly from the voltage controller. If it doesn't match what you selected please let me know.

To disable/uninstall either hold the power button for 10 seconds or type:
opensh
/sbin/rmmod opptimizer

The kernel modules are NOT reloaded until you start the UI.

Donations
The total amount of time I've spent on this so far is around 120 hours, there is a lot of research, testing, packaging, and other stuff to do besides just writing the code. It's all free and open source, but if you have a few spare dollars you don't mind sharing with me, it is appreciated. You can use the following service to do this: PayPal
In return, I will send you any new versions to test (if you want) and I will pay special attention to any bug reports or feature requests you submit.

Credits
This project wouldn't be possible without the work of others that some parts are based upon. A special thanks goes to Tiago Sousa (for the concept), Skrilax_CZ (for Symsearch), @tekahuna (for the original OPPtimizer), itsnotabigtruck (for inception, writing the loader, and answering about 200 of my stupid questions). Please consider donating to itsnotabigtruck if you haven't already. He can use the incentive to keep our phone properly under our control. Thanks to wook (from symbian-freak.com) for the icon.

Source
Module source is here:
https://gitorious.org/opptimizer-n9/...9/trees/master

UI source is here:
https://gitorious.org/opptimizer-n9/opptimizer-complete

Last edited by Creamy Goodness; 2013-09-21 at 21:37.
 

The Following 124 Users Say Thank You to Creamy Goodness For This Useful Post:
-Tyler-, accountvip, afaq, ajalkane, Alfred, AlMehdi, AMD, anapospastos, AndyNokia232, anidel, Arsenalter, Artyom, automagic68, banong, behrooz, besttt, Bundyo, cckwes, celebrant, CepiPerez, ceroberts75, Ch.Saqib, chemical1der, daniscott, Dousan, Dragoss91, draxcp6, e-yes, eerde, eMiL, et3rnal, ezameht, F2thaK, Fallenzone, Faz, Flapzapninja, Garp, godofwar424, Hacker, HanzBlix, Helmuth, hotnikkelz, hrbani, HtheB, ibrakalifa, imaginaryenemy, Iryus, itsnotabigtruck, jaeezzy, jakiman, jalyst, jecargo22, jhwan, jklubi, jleholeho, Jordi, jule, Kallela, kanser, kebbana, keptn, kfahoo, knobtviker, known, koe, late88, macesn, MaddogG, Maemomd, Maj3stic, Makeclick, Manatus, mariusmssj, MAX9, MeeNu, MFaroTusino, mike_shenoda, Mikkosssss, mingfan, Ministeri, mooglez, MrBlueSky, mwrf, N9WB, nicodonte, Nosph3ratu, OVK, peterleinchen, Pl4ub, Prestige, qole, rcolistete, ruplee76, Salmi, santiagopim, shanttu, sifo, soleil, sony123, Soppa, Sourav.dubey, spectrax0x, stooobs, superjunior, thanyapat, thedead1440, thengkhai, TheRAJN9, tioubxancur, tissot, TMavica, torcida, trayhoper, ttt0600, turbovomit, wook_sf, Wowfunhappy, zapotek, Zelig, ZogG, _Routser