maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [ANNOUNCE] Speed Patch + Battery Patch + Tweaks --> Everything Needed To Have A Perfect N900 (https://talk.maemo.org/showthread.php?t=73315)

karam 2011-05-21 19:28

[ANNOUNCE] Speed Patch + Battery Patch + Tweaks --> Everything Needed To Have A Perfect N900
 
HELLO Everybody
This Guide Has 5 Parts :
1: Speed Patch : To speed up N900
2: Battery Patch : To Have A long battery life
3: Battery Patch Non KP : For non kernel-power users
4: FAQS : Frequently asked questions about batterypatch
5: Tweaks : To make you enjoy N900


Part 1: Speed Patch


INFO

A lot of you must have heard about the 200 lines to speed up linux while blackhat announced 4 lines to do that and it is called miracle patch
anyway neither of the available tutorials on internel are working on N900

BUT For Fortunately i was able to apply it to Maemo 5 on N900!!!!!

You will notice a lot of improvements in hildon-desktop
and basically every thing will be improved

CURRENT VERSION : 4.0

What Does It Do
The CFS (completely fair scheduler) in our phone's kernel manages the allocation of resources (cpu/mem) between tasks.
It was designed to cope with server-class machines such as web servers and databases, giving all tasks equal access to resources.
This means if a server is really busy, then all tasks on the machine slow down equally.
Desktop/mobile class machines shouldn't work the same way as servers though.
They have a human user who expects the machine to respond and give feedback within a certain time.
If a machine is slow to respond, the user loses some sense of control over the machine.
This patch addresses the problem by taking note of what the user is doing right now, and using that information to accelerate the current task, and decelerate other tasks on the system.
The user won't notice the background stuff going slower, they will just see their app working fast. The patch does this by creating multiple classes of task
-------------------------------------------
/dev/cgroup/cpu/tasks
/dev/cgroup/cpu/desktop/tasks
/dev/cgroup/cpu/applications/tasks
/dev/cgroup/cpu/applications/standby/tasks
/dev/cgroup/cpu/applications/launcher/tasks
-------------------------------------------
If you look at the contents of these files, you'll see the process IDs of all the tasks in each class. CPU and memory are shared out to these classes using the files "cpu.shares", and "memory_limit_in_bytes".
When lots of tasks are demanding CPU/memory at once, the resources are handed out to tasks depending on their share.
This is why your phone feels nicer when you have this patch - the kernel automatically classifies tasks and devotes more of cpu/mem to the "application" and "desktop" class tasks, and much less to other classes like "standby".


Installing Speed Patch

Code:

sudo gainroot
apt-get install speedpatch

Then Reboot twice

Uninstalling Speed Patch
To remove the patch:

Code:

sudo gainroot
apt-get purge speedpatch

Then Reboot

------------------------------------------------------


Part2 : BATTERY PATCH

INFO

This Tweak Improves The Battery Life of Our N900
For Standby And Continues Time Of Usage

CURRENT VERSION IS: 8.2
Compatible with all KP versions

When device is locked : or system is inactive or the brightness is off (except when having a call)

1-) vfs_cache_pressure goes to 10 : it's proven that doing this saves a lot of battery on standby
2-) change to underclock profile : vdd1 vdd2 enabled, (but with KPv48=> only vdd1 enabled) powersave_bias=20
3-) renice 1 some processes
4-) improve the response when receiving a call by changing MINFREQ to 600 but it returns to 250 after answering the call .. so no OC while talking with N900
5-) pausing some processes that sucks battery in idle mode (TESTING)

When the device is unlocked or the brightness is on

1-) vfs_cache_pressure goes back to 100
2-) overclock profile is loaded : vdd1 vdd2 enabled, conservative mode and powersave_bias=20
3-) renice 0 the previous processes
4-) Continue of the paused processes (TESTING)

Extra Feature

Someone may say "i don't want my N900 to use underclock profile and pause some processes when i lock the screen because i'm downloading a large application to install it"

Solution is :
Open the keyboard, lock the screen and leave the keyboard opened
in that case batterypatch is temporary disabled
so locking the screen will activate it's features


Dependencies

dbus-scripts, kernel-power-flasher | kernel-power-bootimg, kernelpower-settings

Installing Battery Patch
Code:

sudo gainroot
apt-get install batterypatch


Uninstalling Battery Patch

Code:

sudo gainroot
apt-get purge batterypatch

------------------------------------

Part3 : BATTERY PATCH Non kernel-power users

INFO

This version is for people who doesn't use kernel-power
This Tweak Improves The Battery Life of Our N900
ONLY ON STANDBY
UNLIKE THE Battery Patch Full version

CURRENT VERSION IS: 6.0

When device is locked : or system is inactive

1-) vfs_cache_pressure goes to 10 : it's proven that doing this saves a lot of battery on standby
2-) renice 1 some processes

When the device is unlocked or the brightness is on

1-) vfs_cache_pressure goes back to 100
2-) renice 0 to the previous processes
Dependencies

dbus-scripts

Installing Battery Patch Non kernel-power users
Code:

sudo gainroot
apt-get install batterypatch-non-kp


Uninstalling Battery Patch Non kernel-power users

Code:

sudo gainroot
apt-get purge batterypatch-non-kp

----------------------------------------------------------------------

There are also 2 extra packages in devel:
1-batterypatch for unstable devices : for those who have really unstable N900s (current version is : 3.0)
2-batterypatch testing : just like the normal batterypatch but includes new unstable tweaks (current version is : 7.1)



----------------------------------------------------------------------


CHECKING

1. To check if Speedpatch was installed Correctly:

Open an xterm window
if no errors appeared that means speedpatch is applied

or
Code:

cd /dev/cgroup/cpu/user/
ls

You Should see some files
-------------------
2.To check if Battery Patch was applied :

Code:

sudo gainroot
echo 1000 >> /proc/sys/vm/vfs_cache_pressure

Then lock the phone and unlock it
Then
Code:

cat /proc/sys/vm/vfs_cache_pressure
you should see 100
If so then the patch is applied

PART4 : FAQS

1-)
Q-) I cannot change max frequency with qcpu or any other gui cpu freq changer!!!!

A-) To change the max cpu frequency you need to edit the max freq at :
/opt/batterypatch/profiles/overclock-new #(if using kernel-power 49 or newer) with any text editor
or
/opt/batterypatch/profiles/overclock-old #(if using kernel-power 48 or older) with any text editor

ex : Leaf Pad
Code:

sudo gainroot
apt-get install leafpad
leafpad /opt/batterypatch/profiles/overclock-new

and then change the maxfreq to anything you want down than save and quit
IMPORTANT !!! IF YOU HAVE AN UNSTABLE N900
IT'S RECOMMENDED TO DISABLE VDD1 ... CHANGE IT TO 0
IF YOU WANT TO OVERCLOCK MORE THAN 805
AS BATTERYPATCH MAXFREQ IS 805

Then reboot to take effect
(YOU CAN TEMPORARLY CHANGE THE SPEED BY EDITING THE OVERCLOCK FILE IN /usr/share/kernel-power-settings
BUT IT WON'T BE SAVED UNTILL YOU EDIT THE ONE IN /opt/batterypatch/profiles

2-)
Q-) My N900 shows low battery and when i lock the phone and leave it idle ..the battery bar will rise up again

A-)N900 will recalculate the remaining battery charge according to the way using it
.. if you are using N900 in a heavy way then battery bar will show less than leaving N900 on idle mode

3-)
Q-) My N900 shows temperature UNKNOWN in qcpu !!
A-) This is a kernel problem .... rebooting will solve it

----------------------------------------------------------------------



PART5 : TWEAKS

1-) You may try hardware accelerator wich will make hildon-desktop smoother
BUT it is known to be unstable so if it caused any hildon-dekstop crashs or reboots simply disable it

To enable it :
use any text editor to edit /etc/powervr.d/hildon-desktop.ini and change WSEGL_UseHWSync=0 to WSEGL_UseHWSync=1
so :

Code:

sudo gainroot
leafpad /etc/powervr.d/hildon-desktop.ini

and change

Code:

WSEGL_UseHWSync=0
To

Code:

WSEGL_UseHWSync=1
Believe me hildon will be much smoother but as i said before if any reboots occurred then disable it by changing


Code:

WSEGL_UseHWSync=1
To

Code:

WSEGL_UseHWSync=0

IMPORTANT: if you was very unlucky with HWsync you may have to reflash Your N900
because it may cause a reboot loop
otherwise it is stable to use on 80% of N900s
------------------------------------------------------


2-) And you may also want swappolube and it's proposed values
to install it

Code:

sudo gainroot
apt-get install swappolube

once installed launch it then press on PROPOSED button then APPLY then STORE

------------------------------------------------------


3-) And you may also want tracker-cfg and lowmemory mode (will make tracker use less CPU and Memory wich will improve the speed a bit)
install it :

Code:

sudo gainroot
apt-get install tracker-cfg

once installed launch it and choose lowmemorymode
Then save and exit

------------------------------------------------------


4-) And ApMeFo app wich organizes folders your menu(try to reduce the shortcuts by putting them in folders) this will improve transitions

to install:

Code:

sudo gainroot
apt-get install apmefo

------------------------------------------------------


5-) And installing CSSU with it's nice modified hildon-*
for installing it

http://wiki.maemo.org/Community_SSU

------------------------------------------------------

6-)Also kernel-power is recommended

to install it :

Code:

sudo gainroot
apt-get install kernel-power-flasher

----------------------------------------------------------------------

7-)A great app called "Task-Swapper"
which allows To Easily Switch Between Opened Windows Without Passing Through Dashboard (Ctrl+Right or Ctrl+Left)

to install it:
Code:

sudo gainroot
apt-get install task-swapper

------------------------------------------------------
IF YOU DID ALL THE INSTRUCTIONS CORRECTLY

You should have a really fast and smooth N900

BTW The Tweaks Are All optional But For the best result Apply Them All


Enjoy

------------------------------------------

sr00t 2011-05-21 19:35

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
I'll give it a try.

Pillum 2011-05-21 20:00

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
for the record: you need bash for this

Pillum 2011-05-21 20:04

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
it says
/home/user/.bashrc no such file or directory
/etc/rc.local no such file or directory

:(

karam 2011-05-21 20:07

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by Pillum (Post 1012198)
it says
/home/user/.bashrc no such file or directory
/etc/rc.local no such file or directory

:(

After you run the script?
do you have bash installed ?

And i'm not quite sure about that but maybe sudser and rootsh1.8 are needed

elie-7 2011-05-21 20:12

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
can we please have this patched up with swappolube ??????

karam 2011-05-21 20:14

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by elie-7 (Post 1012204)
can we please have this patched up with swappolube ??????

swappolube does a completely diffrent things

you can refer to
http://wiki.maemo.org/Swappolube
to understand what swappolube does ;)

karam 2011-05-21 20:24

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by tokag (Post 1012208)
attached is a version i have modified to work with ash rather than bash for those who don't have bash installed. same installation instruction apply. enjoy.

PS
sorry for the .zip file. i don't have a .tar archive creator handy.

Thanks it might be a handy but still bash is more recommened IMO

sjgadsby 2011-05-21 20:39

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Other threads related to this:

vi_ 2011-05-21 20:49

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by karam (Post 1012180)
HELLO Everybody
A lot of you must have heard about the 200 lines to speed up linux while blackhat announced 4 lines to do that
anyway neither of the available tutorials on internel are working on N900

BUT For Fortunately i was able to apply it to maemo 5 on N900!!!!!

You will notice a lot of improvements in hildon-desktop
ex: faster multitask , faster contacts scrolling , faster images scroling
and basically every thing will be improved
Now the script is not made by me
all what i did is modified it a bit to work on maemo 5
PS : it is recommended to use good transitions.ini although it is optional to use
Download the patch.tar.gz from attachment it contains the patch and the transitions
place it in MyDocs
Then enter CODE :

sudo gainroot

apt-get install bash
tar xzvf /home/user/MyDocs/patch.tar.gz
cp cgroup_patch /home/user/
chmod +rwx /home/user/cgroup_patch
/home/user/cgroup_patch
chmod +rwx /etc/rc.local
chmod +rwx /usr/local/sbin/cgroup_clean
/etc/rc.local

DONE

And For transitions file (OPTIONAL)
cp /home/user/MyDocs/transitions.ini /usr/share/hildon-desktop/ # if you are using stock themes

if not then replace /usr/share/hildon-desktop with the path of your theme in my case
cp /home/user/MyDocs/transitions.ini /usr/share/themes/Blue-sky/

DONE

NOTE: the transistions file has thp tweaks also parallax and zoom_on_press under [home] section

YOU may not feel changes until reboot
but probably you will feel before as it happened with me

Enjoy :)
Please give feedbacks

LAST NOTE:
IF you didn't think the patch worked or did anything don't worry it will not affect anything

EDIT!!:

JUST to make sure no problems occure open a terminal window and type
(as user)

bash

(as root)

bash

then exit

This looks cool, however can you please explain in detail what you have done to make this maemo5 compliant?

Pillum 2011-05-21 21:17

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by karam (Post 1012202)
After you run the script?
do you have bash installed ?

And i'm not quite sure about that but maybe sudser and rootsh1.8 are needed

got them all installed :/

karam 2011-05-21 21:21

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by Pillum (Post 1012232)
got them all installed :/

there should be no problems then
Ahh yes you might need to rerun the patch that happened once with me
and /etc/rc.local problem should vanish

karam 2011-05-21 21:21

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
YEP the main idea was from there

karam 2011-05-21 21:25

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by vi_ (Post 1012224)
This looks cool, however can you please explain in detail what you have done to make this maemo5 compliant?

ok the other guides on the internet are for ubuntu and some other linus OSs but they all give the same result so the script i made is gathering all the guides on the internet in one script so i can make sure at least one of them works on maemo 5 as it is a based linux OS it self
AND IT REALY WORKED!!!

msa 2011-05-21 21:30

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
does this actually work? anyone mind doing a video to demonstrate the results?

karam 2011-05-21 21:38

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by msa (Post 1012238)
does this actually work? anyone mind doing a video to demonstrate the results?

ok simply can some one try it and say to us it worked
if no one then i will have to make a video but it will still not enough casue you need to see before and after the patch is applied
and in my case i have already applied the patch

geekgirl74 2011-05-21 22:02

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
didn't work here...
there are no files or directories created in /dev/cgroup after a reboot; also /etc/rc.local is empty. I think you need to chsh to bash (or bash4, depends on the installed version), but you can't do that for user, only for root. So no, it doesn't work.

karam 2011-05-21 22:04

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by geekgirl74 (Post 1012245)
didn't work here...
there are no files or directories created in /dev/cgroup after a reboot; also /etc/rc.local is empty. I think you need to chsh to bash (or bash4, depends on the installed version), but you can't do that for user, only for root. So no, it doesn't work.

That is an issu i'm solving now looks like the patch is applied for a single boot hold on give me 5minutes

karam 2011-05-21 22:16

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Edited the first post people a new line added
cp speedpatch /etc/event.d/

so the cgroup folder is created every reboot :)

ENJOY

mehulrajput 2011-05-21 22:31

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by karam (Post 1012254)
Edited the first post people a new line added
cp speedpatch /etc/event.d/

so the cgroup folder is created every reboot :)

ENJOY

not able to untar. says invalid tar magic.

karam 2011-05-21 22:41

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by mehulrajput (Post 1012260)
not able to untar. says invalid tar magic.

tar xzvf patch.tar.gz

if didn't work then the problem is in your tar

just retested it :)

angrycore 2011-05-21 23:01

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Correct me if I am wrong. First, as I understand, it should work only if you have bash as your default shell. So you need to set it as such shell to make the solution work. Second, what effect are you talking about? It should assign cgroups according to the shell session the process was started. There could be effect if you start something heavy in a new shell session comparing to the situation when there is no such assignment, but not in the regular case. Third, it is actual mostly for multi-core systems, but our n900 has only one CPU.

Guys, if you feel an effect after applying this, are you sure it is not a placebo?

dchky 2011-05-22 05:58

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by angrycore (Post 1012286)
Guys, if you feel an effect after applying this, are you sure it is not a placebo?

It will be placebo for exactly the reasons you say - if the aim is to speed up interactivity for the things people generally do on the N900 using their fingers, this script will make no measurable difference.

karam 2011-05-22 06:18

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
first i don't realy understand what does this patch do (that is why it is called miracle patch)

second i wouldn't post a new thread if it wasn't working

ok here i 'm tellng you what exactly happened with me

i was surfing the internet like a normanl person then the webpages i'm viewing get to more +10
in that point N900 gets laggy while multitasking (very laggy)

at the sane time i tried the patch without a reboot
suddenly the multitask lags are gone!!!!!!!!!!! so
the patch has done it's job

well after that i tried scroling at contacts app (as i use it a lot)
and i have felt at least 2x faster scroll

so do you think my n900 is special to accept this patch?
i don't think so

Anyway i was expecting a lot of guys to say it is not working
well i don"t care i just loved it and shared it
and now i realy have a super N900

Dark_Angel85 2011-05-22 06:54

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
i've applied it and we'll see how it goes.... thanks for the tip and effort. will provide feedback after a while.. seeing how playing games and watching streaming videos go...

how to check if the patch is successfully applied?

eefo 2011-05-22 07:31

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
working smooth and awesome ;)

karam 2011-05-22 07:57

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by Dark_Angel85 (Post 1012415)
i've applied it and we'll see how it goes.... thanks for the tip and effort. will provide feedback after a while.. seeing how playing games and watching streaming videos go...

how to check if the patch is successfully applied?

you need to

cd /dev/cgroup/cpu
ls

you should see some files and directories :)

EDIT : but you may need a reboot to check

Dark_Angel85 2011-05-22 08:27

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by karam (Post 1012441)
you need to

cd /dev/cgroup/cpu
ls

you should see some files and directories :)

EDIT : but you may need a reboot to check

i tried typing
cd /dev/cgroup/cpu
ls

but nothing happens... it does go up to the /dev/cgroup/cpu directory but typing ls does nothing... i did reboot after applying the patch

karam 2011-05-22 08:43

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by Dark_Angel85 (Post 1012452)
i tried typing
cd /dev/cgroup/cpu
ls

but nothing happens... it does go up to the /dev/cgroup/cpu directory but typing ls does nothing... i did reboot after applying the patch

hold on
take a look at this:

http://i51.tinypic.com/ke8a5u.png

karam 2011-05-22 08:48

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Note that these files are created and deleted while running or closing apps
so i was lucky getting them in a screen shot as i was running a lot of apps

anyway as long as the directory cgroup is created that means the patch has been successfuly applied

eefo 2011-05-22 08:55

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
hey karam dont mind but an off topic question.
first let me know if you have used transitioncontrol ?

karam 2011-05-22 08:58

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by eefo (Post 1012464)
hey karam dont mind but an off topic question.
first let me know if you have used transitioncontrol ?

well i don't use it but i use the transitions of theme-customizer (old stable)

and i have put them in the 1# post
you can try them they are the best

Dark_Angel85 2011-05-22 09:06

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
well, hopefully it's not placebo but i did try opening many browser windows... launched all my bookmarked sites... about 7-8 of them... with 3 accounts online using the default IM application (this is normally the killer in all thing lagging)... but the multitasking seems to be pretty smooth so far... which is good cause normally after opening 4+ browser windows it'll start to slow down... so we'll see how consistently this happens...

then i'll have MORE BROWSING POWER!! imagine having seamless 8++(right now btw) windows open all the time... what a sight

karam 2011-05-22 09:18

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Very glad i helped :)

eefo 2011-05-22 09:25

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by karam (Post 1012466)
well i don't use it but i use the transitions of theme-customizer (old stable)

and i have put them in the 1# post
you can try them they are the best

o no no , actually wanted some information about it .
like the things in it .
anyways thanks for this script :)

karam 2011-05-22 09:31

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
Quote:

Originally Posted by eefo (Post 1012485)
o no no , actually wanted some information about it .
like the things in it .
anyways thanks for this script :)

no problem enjoy

mveplus 2011-05-22 09:48

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
For the people that want to now more about the way this script works look here how cgroups work.

This is in general what this script does.
I do not plead for detailed post. ;)

karam 2011-05-22 09:56

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
thabks That is usefull i will post in the first post

lidow 2011-05-22 10:32

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
@karam,

after executing the cgroup_clean script, rc.local remains empty. I have bash installed anyway I tried both version ash and bash.
Also if rc.local does not exists the script do not create it.

I looked in you script and understand that infact this should be present in rc.local, so I add it manually.

mkdir -p /dev/cgroup/cpu
mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
mkdir -m 0777 /dev/cgroup/cpu/user
echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent

lidow 2011-05-22 10:37

Re: [ANNOUNCE] SUPER SCRIPT TO Speed UP N900
 
After applying what Karam provided here, looks like my device indeed speedup. Feels quicker and smoother.

Thanks karam.


All times are GMT. The time now is 06:31.

vBulletin® Version 3.8.8