maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N9 / N950 (https://talk.maemo.org/forumdisplay.php?f=51)
-   -   overclocking kernel modules + UI for PR1.3 [ko v1.5.4] [ui v1.2.7] (https://talk.maemo.org/showthread.php?t=83357)

Creamy Goodness 2012-03-31 08:14

overclocking kernel modules + UI for PR1.3 [ko v1.5.4] [ui v1.2.7]
 
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
http://www.appcheck.net/storage/OPP-UI1.png
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.


http://www.appcheck.net/storage/OPP-UI2.png
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.

http://www.appcheck.net/storage/OPP-UI4.png
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.

http://www.appcheck.net/storage/OPP-UI3.png
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

ibrakalifa 2012-03-31 08:22

Re: overclocking kernel modules for PR1.2
 
omg next part is cssu for n9 please, :D

thx so much

Creamy Goodness 2012-03-31 08:24

Re: overclocking kernel modules for PR1.2
 
next part is voltage control i hope...

rainisto 2012-03-31 08:59

Re: overclocking kernel modules for PR1.2
 
and you are aware that your attachements symsearch.ko is 0 bytes size?


But apart from that if you compile it yourself from sources it does seem work (although a bit different approach that I had).

Log:
[ 606.995483] symsearch: found kallsyms_lookup_name on 0xb008e490.
[ 621.736511] opptimizer.ko - The OPP Management API
[ 621.736541] https://gitorious.org/opptimizer-n9/opptimizer-n9 for source
[ 621.736572] This module uses SYMSEARCH by Skrilax_CZ
[ 621.736572] Made possible by Jeffrey Kawika Patricio and Tiago Sousa
[ 621.736602] 0.1-alpha3
[ 621.736633] Created by Lance Colton <lance.colton@gmail.com>

RM696-07-1_PR_001:/# cat /proc/opptimizer
opp rate: 1100000000
freq table [0]: 1100000
policy->max: 1100000
cpuinfo.max_freq: 1100000
user_policy.max: 1100000
0.1-alpha3
RM696-07-1_PR_001:/# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
1100000

jakiman 2012-03-31 10:14

Re: overclocking kernel modules for PR1.2
 
Amazing. Awesome work Creamy Goodness!!

Just curious, what have you tried up to stable? 1.2, 1.3GHz?
Also, is there a way to confirm what frequency you are really running at?
I guess we can use conky?

thedead1440 2012-03-31 12:37

Re: overclocking kernel modules for PR1.2
 
^ did you enter into opensh after devel-su. i did that and the error didnt appear again.

itsnotabigtruck 2012-03-31 14:39

Re: overclocking kernel modules for PR1.2
 
Quote:

Originally Posted by F2thaK (Post 1186452)
Just tried as root, same error? WTF

Not root - you need to run opensh like it says in the OP. If that fails, do accli -I from opensh and paste the output (edit out your IMEI!).

m4r0v3r 2012-03-31 14:41

Re: overclocking kernel modules for PR1.2
 
ill do this when phone gets too slow, but atm it's fast enough, nice work though

Creamy Goodness 2012-03-31 15:55

Re: overclocking kernel modules for PR1.2
 
oops I am not sure how the 2nd module was 0 bytes but fixed it now

Creamy Goodness 2012-03-31 16:12

Re: overclocking kernel modules for PR1.2
 
Quote:

Originally Posted by m4r0v3r (Post 1186494)
ill do this when phone gets too slow, but atm it's fast enough, nice work though

I don't blame you, but things will be more interesting if we can undervolt the phone. Increased battery life is always good :)


Quote:

Originally Posted by jakiman (Post 1186405)
Amazing. Awesome work Creamy Goodness!!

Just curious, what have you tried up to stable? 1.2, 1.3GHz?
Also, is there a way to confirm what frequency you are really running at?
I guess we can use conky?

I think mine rebooted when I tried 1.2Ghz, but who knows, maybe I put too many zeroes or something. It's not surprising though, after a big frequency bump you need more voltage too...

I suggest conky to verify the changes ;)
http://www.appcheck.net/storage/20120331102349.png

thedead1440 2012-03-31 16:56

Re: overclocking kernel modules for PR1.2
 
could you upload the files back in the first post.

Creamy Goodness 2012-03-31 19:58

Re: overclocking kernel modules for PR1.2
 
yeah i dunno where the attachment went... I added another link at the end of the post

pipould 2012-03-31 21:23

Re: overclocking kernel modules for PR1.2
 
Quote:

Originally Posted by Creamy Goodness (Post 1186523)
I don't blame you, but things will be more interesting if we can undervolt the phone. Increased battery life is always good :)




I think mine rebooted when I tried 1.2Ghz, but who knows, maybe I put too many zeroes or something. It's not surprising though, after a big frequency bump you need more voltage too...

I suggest conky to verify the changes ;)
http://www.appcheck.net/storage/20120331102349.png

What's the software you're using in your screenshot ? :) Thx :)

Creamy Goodness 2012-03-31 21:25

Re: overclocking kernel modules for PR1.2
 
you can get it here: http://talk.maemo.org/showthread.php?p=1178764

soleil 2012-04-01 00:09

Re: overclocking kernel modules for PR1.2
 
And how do you go back to the stock kernel ?

soleil 2012-04-01 00:49

Re: overclocking kernel modules for PR1.2
 
Quote:

Originally Posted by itsnotabigtruck (Post 1186492)
Not root - you need to run opensh like it says in the OP. If that fails, do accli -I from opensh and paste the output (edit out your IMEI!).

I got it . I forgot to incept opensh package
I got the same error here is my accli - I output :
Quote:

/home/user # /usr/sbin/aegisctl -s
aegisctl: Operation not permitted (do you have the right credentials?)
/home/user # accli -I
Current mode: normal
IMEI: ***********************
Credentials:
UID::root
GID::video
CAP::chown
CAP::dac_read_search
CAP::fowner
CAP::fsetid
CAP::kill
CAP::linux_immutable
CAP::net_bind_service
CAP::net_broadcast
CAP::net_admin
CAP::net_raw
CAP::ipc_lock
CAP::ipc_owner
CAP::sys_chroot
CAP::sys_ptrace
CAP::sys_pacct
CAP::sys_boot
CAP::sys_nice
CAP::sys_resource
CAP::sys_time
CAP::sys_tty_config
CAP::lease
CAP::audit_write
CAP::audit_control
CAP::setfcap
GRP::root
GRP::dialout
GRP::video
GRP::pulse-access
GRP::users
GRP::metadata-users
GRP::calendar
tracker::tracker-extract-access
tracker::tracker-miner-fs-access
libaccounts-noa::accesssvt
package-manager::packagemanager_limited
package-manager::packagemanager_private
icd2::icd2-plugin
Cellular
TrackerReadAccess
TrackerWriteAccess
Location
FacebookSocial
AID::.opensh.
opensh::opensh

Creamy Goodness 2012-04-01 01:03

Re: overclocking kernel modules for PR1.2
 
Quote:

Originally Posted by soleil (Post 1186626)
And how do you go back to the stock kernel ?

hold power for 10 seconds

soleil 2012-04-01 01:52

Re: overclocking kernel modules for PR1.2
 
Quote:

Originally Posted by Creamy Goodness (Post 1186633)
hold power for 10 seconds

Ok then :)

I successfully overclock my phone to 1.1Ghz . I noticed that the exact command was :
/sbin/insmod /lib/modules/2.6.32.48-dfl61-20115101/symsearch.ko
/sbin/insmod /lib/modules/2.6.32.48-dfl61-20115101/opptimizer.ko

not this :
/sbin/insmod/ /lib/modules/2.6.32.48-dfl61-20115101/symsearch.ko
/sbin/insmod/ /lib/modules/2.6.32.48-dfl61-20115101/opptimizer.ko

soleil 2012-04-01 02:16

Re: overclocking kernel modules for PR1.2
 
Screenshot :) :
http://farm8.staticflickr.com/7254/6...4e2205c2_z.jpg

Creamy Goodness 2012-04-01 02:26

Re: overclocking kernel modules for PR1.2
 
Cool. Btw it looks like smartreflex is enabled by default and I don't think it would work properly when we change the clocks like this because we have version 1p5 which is software and not hardware based. You might want to try disabling it if you're going to try for > 1.1Ghz. I'm trying to figure out a way to reset it properly meanwhile...

opensh and then cat 0 > /sys/power/sr_vdd1_autocomp to disable it

Prestige 2012-04-01 02:30

Re: overclocking kernel modules for PR1.2
 
Has anyone noticed any performance boost??
Thats the point of overclocking..
I hope there's soon a comprehensive guide on how to overclock N9..
Keep up the good work..!!!!!

soleil 2012-04-01 02:31

Re: overclocking kernel modules for PR1.2
 
I did not try for > 1.1 Ghz . I will wait for your guide to disable smartreflex first :)

Creamy Goodness 2012-04-01 02:34

Re: overclocking kernel modules for PR1.2
 
Well we need a benchmark or something, I'm sure there is some web based one we can play with. I'll leave that to you guys as I'm having enough of a headache trying to learn this stuff.

soleil 2012-04-01 03:17

Re: overclocking kernel modules for PR1.2
 
I just did some test with Browsermark and Sunspider Javascript 0.9.1 The overclocking N9 has a better score but the different is minimal

Creamy Goodness 2012-04-01 03:29

Re: overclocking kernel modules for PR1.2
 
yeah sorry I'm dumb -- you need root to disable smartreflex, 1200 works (for me) if I do it.
I did get a reboot last time I tried to switch back to 1ghz, there could be some problems with my module. I know when it initializes it binds to certain addresses but I don't know if those are valid forever or not.
My best score in sunspider was 3277.9ms @ 1.1ghz.

soleil 2012-04-01 03:38

Re: overclocking kernel modules for PR1.2
 
Coud you please give a how to disable smartreflex ? :)
My score in sunspider is 3218.9ms @ 1.1ghz
http://farm8.staticflickr.com/7107/7...5992c663_z.jpg

With the normal clock the score is 3581ms @1.0Ghz

http://farm8.staticflickr.com/7082/7...d6aae8fc_z.jpg

Minimal different when doing Browsermark :
1.0Ghz :
http://farm8.staticflickr.com/7239/7...476198dd_z.jpg

1.1Ghz :
http://farm8.staticflickr.com/7270/7...7175e0fe_z.jpg

Creamy Goodness 2012-04-01 03:40

Re: overclocking kernel modules for PR1.2
 
Yeah I better put it in the first post...
opensh and then echo 0 > /sys/power/sr_vdd1_autocomp

HanzBlix 2012-04-01 03:53

Re: overclocking kernel modules for PR1.2
 
There might be a few tools that we can use from the developer mode devtools. Swap logger in performance looks like a go to me, it doesn't have to be used with the instrumentation dashboard via QtSDK but it gives a nice readout, I'm yet to actually try it out though.
http://harmattan-dev.nokia.com/docs/...waplogger.html

I'm sure we could use something from the power analysis devtools aswell for power consumption to test undervolt etc, I'll read up on those ones later.

jakiman 2012-04-01 06:43

Re: overclocking kernel modules for PR1.2
 
Smart reflex definitely caused problems with getting good overclocking results on the N900. e.g. WIth it enabled, it was stable to around 850-900MHz for many but when turned off, it could go to 1.1GHz stable.

pipould 2012-04-01 09:32

Re: overclocking kernel modules for PR1.2
 
Problem is to define "when the phone is stable"...

Could go up to 1.2 without the smart ref command but how could it be possible to know if the phone is stable.. Tried Grand turismo on psx emulator, nothing more...

rainisto 2012-04-01 10:14

Re: overclocking kernel modules for PR1.2
 
if you don't change vddmax to allow higher voltages, you will never get stable 1.2Ghz. With default voltages you pretty much can't go over 1.1GHz without losing stability of system.

Ministeri 2012-04-01 10:45

Re: overclocking kernel modules for PR1.2
 
So far the modules have been working great at 1150 mhz with Smart Reflex on. Haven't tried any higher yet.

Can't wait to get the voltage control. :)

Thank you Creamy Goodness!

Sunspider: 3097 ms

EDIT: 1250 mhz (SR off) starts stuttering but doesn't reboot. 1200 mhz (SR off) seems to work ok so far.

HanzBlix 2012-04-01 13:00

Re: overclocking kernel modules for PR1.2
 
Yeah tricky thing with overclocking, especially at this stage, all could seem well then 3 days down the road you could be faced with random reboots.
But still, It's early days yet, good things take time.

Creamy Goodness 2012-04-02 04:05

Re: overclocking kernel modules for PR1.2
 
Quote:

Originally Posted by jakiman (Post 1186710)
Smart reflex definitely caused problems with getting good overclocking results on the N900. e.g. WIth it enabled, it was stable to around 850-900MHz for many but when turned off, it could go to 1.1GHz stable.

Did people adjust the voltage up enough? I never did try that hard I think. This is 45nm cpu so I hope it can go 1.3 at least. Should I try on my n9 or n950? :\

My default voltage is either 1225000 or 1375000 and it's further lowered to 1175000 by smartreflex. Maybe. I didn't design this thing so it's hard to understand. Quick, someone read this and summarize.

Btw I uploaded a new version to read this additional voltage and smartreflex info, you can't change it yet though.

mariusmssj 2012-04-02 07:14

Re: overclocking kernel modules for PR1.2
 
Creamy Goodness thanks for this, really can't wait to overclock my N9

pipould 2012-04-02 08:18

Re: overclocking kernel modules for PR1.2
 
Is there a strong impact on autonomy when disabling smart reflex ?

pipould 2012-04-02 09:13

Re: overclocking kernel modules for PR1.2
 
I tried to create a script to change change automaticaly the freq, seems to work so far but do you have any idea how we could run devel-su, opensh into that script ?

Quite unsecure but well, so far so good.

bnwg 2012-04-02 09:59

Re: overclocking kernel modules for PR1.2
 
Quote:

Originally Posted by Creamy Goodness (Post 1187065)
Did people adjust the voltage up enough? I never did try that hard I think. This is 45nm cpu so I hope it can go 1.3 at least. Should I try on my n9 or n950? :\

My default voltage is either 1225000 or 1375000 and it's further lowered to 1175000 by smartreflex. Maybe. I didn't design this thing so it's hard to understand. Quick, someone read this and summarize.

Btw I uploaded a new version to read this additional voltage and smartreflex info, you can't change it yet though.

Really thank for compiling the overclock modules for N9. It's such a big step (at least for me) to make my N9 superior.

As you might have already read thru the information below which is taken out from the 3430 datasheet. It has some suggested "stable" vsel for different freq. Of course it may vary device from device but FYI my 2 years old milestone is stable using vsel 59 (stable means no bootloop which reboot itself infinitely).

I tried to find something like that for 3630 from its datasheet but no luck for that. But I hope this can give some educational guess for the safe yet stable vsel for our N9.

By the way, the voltage use for milestone (ie. vsel 60) is kinda different from N9 (ie. 1225000 or 1375000). Don't know how to relate them.


max_vsel
Frequency Stable (>=) Possibly unstable Probably unstable (<=)
550 56
800 58 56 .. 54 52
1000 60 58 .. 56 54
1100 64 62 .. 60 58
1200* 76 74 .. 70 68
1330* 84
*: Always unstable in some CPUs! Will damage CPU on prolonged use. According to OMAP3430 datasheet, max_vsel up to 66 should be acceptable. Above 80 will certainly severly damage the CPU on long-term scale. The most appropriate and stable settings seem to be either 800 MHz or 1000 MHz at max_vsel of 56 to 60.

Sniper_swe 2012-04-02 10:15

Re: overclocking kernel modules for PR1.2
 
I have seen the samsung galaxy s which uses the cortex a8 processor run stable at 1.4ghz. Some users even got it to 1.6ghz but i dunno how stable that was:P

F2thaK 2012-04-02 11:23

Re: overclocking kernel modules for PR1.2
 
I wish I could just get this to work...


All times are GMT. The time now is 05:28.

vBulletin® Version 3.8.8