yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] oneG:
sh results

At first i got this....

$ export PATH=/data/local/bin:$PATH
$ sh /system/sd/userinit.sh
swapoff: /dev/ramzswap0: Operation not permitted
rm: cannot remove '/dev/ramzswap0': Permission denied
rmmod: delete_module 'xvmalloc' failed (errno 1)
rmmod: delete_module 'ramzswap' failed (errno 1)
insmod: init_module '/system/modules/lib/modules/2.6.29.6-cm/compcache/xvmalloc.ko' failed (Operation not permitted)
insmod: init_module '/system/modules/lib/modules/2.6.29.6-cm/compcache/ramzswap.ko' failed (Operation not permitted)
/system/modules/lib/modules/2.6.29.6-cm/compcache/ramzswap.ko disksize_kb=32768 memlimit_kb=24576 backing_swap=/dev/block/mmcblk0p3
mknod: /dev/ramzswap0: File exists
sysctl: error setting key 'vm.swappiness': Permission denied
swapon: /dev/ramzswap0: Operation not permitted
/system/sd/userinit.sh: cannot create /proc/sys/vm/page-cluster: permission denied
/system/sd/userinit.sh: cannot create /proc/sys/vm/laptop_mode: permission denied
/system/sd/userinit.sh: cannot create /proc/sys/vm/dirty_expire_centisecs: permission denied
/system/sd/userinit.sh: cannot create /proc/sys/vm/dirty_writeback_centisecs: permission denied
/system/sd/userinit.sh: cannot create /proc/sys/vm/dirty_background_ratio: permission denied
/system/sd/userinit.sh: cannot create /proc/sys/vm/dirty_ratio: permission denied
/system/sd/userinit.sh: cannot create /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate: permission denied
/system/sd/userinit.sh: cannot create /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq: permission denied
/system/sd/userinit.sh: cannot create /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: permission denied
/system/sd/userinit.sh: cannot create /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias: permission denied
$

But then itried it again and this came up...

export PATH=/data/local/bin:$PATH
$ $ su
# sh /system/sd/userinit.sh
rmmod: delete_module 'xvmalloc' failed (errno 11)
insmod: init_module '/system/modules/lib/modules/2.6.29.6-cm/compcache/xvmalloc.ko' failed (File exists)
/system/modules/lib/modules/2.6.29.6-cm/compcache/ramzswap.ko disksize_kb=32768 memlimit_kb=24576 backing_swap=/dev/block/mmcblk0p3
vm.swappiness = 30
# sh /system/sd/userinit.sh -s
===CompCache status===
Compcache is enabled
CompCache: DiskSize 32768(system) 32768(user)
CompCache: MemLimit (system) 24576(user)
CompCache: cc_swappiness - 30(system) 30(user)
===VM status===
Set VM: page-cluster - 3(system) 3(user)
Set VM: laptop_mode - 0(system) 0(user)
Set VM: dirty_expire_centisecs - 3000(system) 3000(user)
Set VM: dirty_writeback_centisecs - 500(system) 500(user)
Set VM: dirty_background_ratio - 5(system) 5(user)
Set VM: dirty_ratio - 10(system) 10(user)
===CPU status===
Set CPU: scaling_min_freq - 245760(system) 245760(user)
Set CPU: scaling_max_freq - 528000(system) 528000(user)
Set CPU: sampling_rate - 2000000(system) 2000000(user)
Set CPU: powersave_bias - 0(system) 0(user)
#
[G1 Android Development] sha.goyjo:
Am I the only one who experiences constant freezes (not panics or crashes, just system-wide freezes) with min_scaling set at the lowest speed? It's really strange. Anybody have any advice on the topic?
[G1 Android Development] uwonsum:
Already addressed.
[G1 Android Development] uwonsum:
Yes, with the power_bias set or not, from idle it will normally jump to the highest frequency. If you set the power_bias, it will throttle down, but go back up if more power is needed and fluctuates depending on the value used. I have not noticed performance drop with any app even with games. I am using 200, but the best number I believe is between 150 and 250 for maximum power efficiency to highest performance.
[G1 Android Development] dwang:
How about posting your userinit.sh with all of the settings you talked about in your previous posts.

Its not entirely clear what parameters you are setting and what values.
[G1 Android Development] sha.goyjo:
If it's "already addressed" it should be in the comment code of the .conf . Or perhaps notated in the OP? It's not that hard to write

# WARNING: SLOW SPEEDS MAY CAUSE ERRORS

or

# WARNING: THIS SPEED UNSTABLE

However, it's much easier to snap at someone else, so I understand.

Or you know, you could always help specifiy WHERE it was already addressed.
[G1 Android Development] Gimpeh:
What exactly is the Backing_swap? I'm familier with compcache and the linux_swap but the backing_swap is foriegn to me.
[G1 Android Development] uwonsum:
Normally I would have gave the link, but this thread has 50 comments. See post #8
[G1 Android Development] tutech:
CM 4.2.14.1 incompatibility

I noticed after updating to CM 4.2.14.1 that the userinit.sh v0.1.5.3 in the OP of this thread no longer works nicely.

Here's some output:

adb shell sh /system/sd/userinit.sh -s

unknown option -- 1BusyBox v1.15.3android (2010-01-29 01:54:08 EST) multi-call b

inary

Usage: tail [OPTIONS] [FILE]...

Print last 10 lines of each FILE to standard output.

With more than one FILE, precede each with a header giving the

file name. With no FILE, or when FILE is -, read standard input.

Options:

-n N[kbm] Print last N lines instead of last 10

-f Output data as the file grows

=== user.conf ===

*** general ***

apps2sd=1

media2sd=0

*** CompCache ***

compcache_en=1

cc_memlimit=24

cc_disksize=32

cc_backingswap_en=0

cc_backingswap=/dev/block/mmcblk0p3

swappiness=30

*** Swap File ***

swap_file_en=0

linux_swap_file_size=32

linux_swap_file=/system/sd/swap.file

*** Linux Swap ***

linux_swap_en=0

linux_swap_partition=/dev/block/mmcblk0p3

*** VM ***

sys_vm_en=0

page_cluster=0

laptop_mode=0

dirty_expire_centisecs=3000

dirty_writeback_centisecs=500

dirty_background_ratio=5

dirty_ratio=10

*** CPU ***

proc_cpu_en=0

scaling_min_freq=128000

scaling_max_freq=528000

sampling_rate=2000000

powersave_bias=200

up_threshold=40

=== CompCache status ===

CompCache version 0.6+

!!!ERROR Compcache disabled

unknown option -- 1BusyBox v1.15.3android (2010-01-29 01:54:08 EST) multi-call b

inary

Usage: tail [OPTIONS] [FILE]...

Print last 10 lines of each FILE to standard output.

With more than one FILE, precede each with a header giving the

file name. With no FILE, or when FILE is -, read standard input.

Options:

-n N[kbm] Print last N lines instead of last 10

-f Output data as the file grows

CompCache: DiskSize (system) 32768(user)

CompCache: cc_swappiness - 30(system) 30(user)

=== CompCache status output ===

stats: Not a typewriter

[: 20100201192453: out of range

[: 20100201192454: out of range

[: 20100201192455: out of range

[: 20100201192457: out of range

[: 20100201192458: out of range

[: 20100201192459: out of range

[: 20100201192500: out of range

[: 20100201192500: out of range

[: 20100201192501: out of range

[: 20100201192502: out of range

[: 20100201192502: out of range

[: 20100201192508: out of range

[: 20100201192509: out of range

[: 20100201192511: out of range

[: 20100201192512: out of range

[: 20100201192514: out of range

[: 20100201192515: out of range

[: 20100201192517: out of range

[: 20100201192523: out of range

[: 20100201192526: out of range

[: 20100201192529: out of range

--- dexopt-wrapper /data/app/com.shazam.android.odex

--- BEGIN '/data/app/com.shazam.android.apk' (bootstrap=0) ---

--- waiting for verify+opt, pid=5862

--- would reduce privs here

--- END '/data/app/com.shazam.android.apk' (success) ---

I realize that the busybox binary included in this CM build is most likely the only culprit causing this but I have not had an opportunity to delve into this fairly complex shell script to debug/fix.

Has anyone else worked on getting this to work as well as it always has in prior CM builds?
[G1 Android Development] tnpapadakos:
it looks like the only incompatibility was with the compcache section...i dont use compcache, so i should probably be ok, right?
[G1 Android Development] overpower:
Yah, I think you'll be fine even if you did use compcache.

As for what happened, in this version of CM there are two issues.

tail has a more stringent syntax. The script uses "tail -1" which is invalid. The correct syntax is "tail -n1". This can be fixed easily.

"rzscontrol /dev/block/ramzswap0 -s" no longer works. Instead it throws the "stats: Not a typewriter" error. A quick google search shows that's a hard to track down error and I suspect it has to do with the compile environment.

CompCache should continue to function, you just can't pull stats out of it which throws a bunch of stuff off in the script.

As for

[: 20100201192453: out of range
[: 20100201192454: out of range
[: 20100201192455: out of range
[: 20100201192457: out of range
[: 20100201192458: out of range

errors. I haven't tracked it down myself so maybe someone else can figure out why.
[G1 Android Development] BoomBoomPOW:
Hope someone updates the script to be compatible with CM's latest. I, for one prefer a cc/backing swap setup. But if you state that cc will still be able to function correctly, then it's good.
[G1 Android Development] stellarman:
Updates for CM5?

What changes are needed to keep this compatible with the new CM5. I hope someone can make the changes and verify the new locations in which these files need to be placed.
[G1 Android Development] tnpapadakos:
as far as i can tell, placing the userinit.sh in the /sd-ext folder, that's it
[G1 Android Development] sup3rst4r:
i can push the files using adb, but when i try and chmod i get:

"chmod: /system/sd/userinit.sh: Not a directory"

and when testing i get:

"sh: can't open '/system/sd/userinit.sh'"

Any ideas guys? I'm running CM6 on a GSM Desire with appstosd and i'm trying to get media2sd working...
[G1 Android Development] uwonsum:
backing_swap is a complement to compcache--it uses a physical swap partition managed by compcache.
[G1 Android Development] dwang:
Why don't y create your own seperate thread so that u can update the op whenever u modify your scripts.
[G1 Android Development] uwonsum:
It is not necessary. huanyu's script gets the job done. If additional optimization is discovered, he adds them without complaining.
[G1 Android Development] pychobj2001:
I couldn't read the user.conf file cause notepad didn't format it right..so i didn't even know i wasn't using backing swap..ha..i am now tho..and turned off the cpu scalling i bought setcpu for that stuff...so i can do it all on the fly....love this mod tho!!! keep up the good work...hope it gets better and better, there isn't much more we can do w/ this mod but i believe some body will always find some way to optimize the code..always is....that's what i love about open source, and joe smo can come along and say "i've got an idea" and it is embraced by the comunity and not reject..
[G1 Android Development] Gimpeh:
Ah I see. I assume then that the backing_swap would also be contained on the internal ram rather than the SD card. Is there any benefit to use this along with compcache and swapper?
[G1 Android Development] dwang:
no, backing_swap is using the swap partition on the sdcard. When the compcache swap is filled up, compcache will use the swap partition (backing_swap) as an overflow swap.
[G1 Android Development] Gimpeh:
So its basically the Linux Swap?
[G1 Android Development] sha.goyjo:
what dwang replied is not TECHNICALLY correct. Any linux-swap partition can be called out by backing_swap for VM usage, but to repartition the internal flash is a lot of work and far more risky. So we use the linux-swap partition on the SD card instead. It's easier and less dangerous, and doesn't eat up precious internal memory space.

Also, the next version of compcache will be able to support backing swap files instead of just linux-swap partitions, so you'll be able to have the linux-swap on your internal flash much more easily, if you would so choose. Or you could keep it on your sd. The options would be much more open, and would allow for a greater degree of user customization. Which is what we're all about :)
[G1 Android Development] Gimpeh:
Nice, Can't wait for this next version. Thanks for clearing that up for me.
[G1 Android Development] namsir:
did anyone attempt to put this on the cyanogen 3.9.5 yet?
[G1 Android Development] ShatBag1105:
3.9.5 and running smoothly. :)

There shouldnt be any prob with any new builds unless the kernel changes or "our infallible creator" disables userinit like in 3.9.3, correct?
[G1 Android Development] elzee:
Ditto and a good tutorial .. was very easy to comprehend and execute.

Thanks! :thumbsup:
[G1 Android Development] Lakers3408:
Im getting an error, I guessing SetCPU app is causing that error

ERROR!!! Set CPU: scaling_min_freq - 384000(system) 245760(user)

Set CPU: scaling_max_freq - 528000(system) 528000(user)

I have SetCPU at 528/384

If I change it to 528/245

The error disappears
[G1 Android Development] miketaylor00:
I get the same error using the overclock widget. When the 3rd party app over writes the setting you will see an error. Either change the file and don't use the other app or don't worry about the error.
[G1 Android Development] akatragedy:
havin trouble

i keep gettin this screen after i install and reboot i had it runnin but i wiped my ext3 now i cant get it workin again plz help:o
[G1 Android Development] huanyu:
download the script again... It looks like a incorrect file format. Likely caused by editing the script/configuration file using notepad. Use Notepad++ instead and make sure its save as unix format
[G1 Android Development] justanothercrowd:
just wanted to stop in and say thanks for the script. Worked it into my xHERO and xROM :) It works wonderfully on both ROMS
[G1 Android Development] sacredsoul:
3.9.6 is up and compcache scripts doesnt work anymore...
[G1 Android Development] yukkio:
I put this into my userinit.sh:

#!/system/bin/sh

modprobe ramzswap
rzscontrol /dev/block/ramzswap0 --backing_swap=/dev/block/mmcblk0p3 --init
swapon /dev/block/ramzswap0

exit;

Hope it works.

BR.

Edit:

BackingSwap: /dev/block/mmcblk0p3
DiskSize: 32130 kB
MemLimit: 14632 kB
NumReads: 111
NumWrites: 984
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 59
GoodCompress: 100 %
NoCompress: 0 %
PagesStored: 647
PagesUsed: 142
OrigDataSize: 2588 kB
ComprDataSize: 549 kB
MemUsedTotal: 568 kB
BDevNumReads: 7
BDevNumWrites: 278
[G1 Android Development] acidwashg1:
compcache on cyanogen 3.9.6

http://compcache.googlecode.com/hg/s...zscontrol.html

^ compcache manpage

this is sample code for a 24mb compcache setup with a backing swap. according to manpage: compcache will use up to 24mb. once memory compression exceeds memlimit amount, the backing swap is used.

modprobe ramzswap
rzscontrol /dev/ramzswap0 --backing_swap=/dev/block/mmcblk0p3 --memlimit_kb=24000 --init
swapon /dev/block/ramzswap0
[G1 Android Development] uwonsum:
The post above yours has the correct settings.
[G1 Android Development] sacredsoul:
Can you upload your userinit? I cant seem to get it working.
[G1 Android Development] yukkio:
Here's.

BR.
[G1 Android Development] sacredsoul:
Thanks man! and the old user.conf is fine? This is with backswapping correct? Any settings I need to change in user.conf? Thanks!
[G1 Android Development] uwonsum:
That script on post #83 does not utilize the user.conf file--it only enables compcache with backing_swap. In the main time, I edited the script by huanyu that still gives you all the other features available in the user.conf file. This is just the userinit.sh file. Use your old user.conf or just download the one from post #1.

Hopefully, if huanyu has time, he will upgrade the script to detect which version of comcache (module: .5 or .6) you have and set the parameter accordingly.

The script I have attached only works with Cyanogen's build 3.9.6+
[G1 Android Development] yukkio:
I think Cyanogen said powersave_bias=200 is the best value for 3.9.6.

BR.
[G1 Android Development] uwonsum:
powersave_bias is not the only option in the userinit script. Besides, you may want to test different numbers...
[G1 Android Development] sacredsoul:
Thanks. What's the command to check if it's working as it should? I tried

adb shell sh /system/sd/userinit.sh -s

and it says not found.
[G1 Android Development] uwonsum:
I just re uploaded the file. use the instruction from post #1
[G1 Android Development] yukkio:
Here's my trans_table:

From : To
: 19200 122880 128000 245760 384000 528000
19200: 0 0 0 0 0 0
122880: 0 0 0 0 0 0
128000: 0 0 0 0 0 0
245760: 0 0 0 0 0 45
384000: 0 0 0 45 0 130
528000: 0 0 0 1 175 0

Is it ok?

BR.
[G1 Android Development] sacredsoul:
I cant get comcache to get enabled. I tried comcache+backing swap. This is the output...

Yes, its set to 0.6 in the user.conf.
[G1 Android Development] Canesfan22:
I get the same thing and im using cyan .6
[G1 Android Development] huanyu:
I forgot to modify the status checking for compcache 0.6

Can you run this for me

rzscontrol /dev/block/ramzswap0 -s

So i know if the compcache has set up properly or not
[G1 Android Development] Canesfan22:
I ran it; get this:

Failed to open /dev/block/ramzswap0: No such file or directory
[G1 Android Development] sacredsoul:
I did

In terminal and I got
[G1 Android Development] huanyu:
hum... i think i may found the problem, give me 20mins to fix it
[G1 Android Development] sacredsoul:
Thanks man! Appreciate it.
[G1 Android Development] huanyu:
uploaded, please give it a try and let me if there is any error
[G1 Android Development] Canesfan22:
I still get Failed to open /dev/block/ramzswap0: No such device or address
[G1 Android Development] ERamseth:
seems to work for me.
[G1 Android Development] sacredsoul:
Working for me...
[G1 Android Development] huanyu:
can you tell me whats your compcache version or rom version?

can also you do

sh /system/sd/userinit.sh
sh /system/sd/userinit.sh -s

and tells me the outputs?
[G1 Android Development] Canesfan22:
insmod: can't insert '/system/modules/lib/modules/2.6.29.6-cm/compcache/xvmalloc.ko': File exists

insmod: can't insert '/system/modules/lib/modules/2.6.29.6-cm/compcache/ramzswap.ko': unknown symbol in module or invalid parameter

/system/xbin/bb/insmod /system/modules/lib/modules/2.6.29.6-cm/compcache/ramzswap.ko disksize_kb=32768

mknod: /dev/block/ramzswap0: File exists

vm.swappiness = 30

swapon: /dev/block/ramzswap0: No such device or address

===CompCache status===

/proc/ramzswap: No such file or directory

Compcache is disabled

/proc/ramzswap: No such file or directory

CompCache: DiskSize (system) 32768(user)

/proc/ramzswap: No such file or directory

CompCache: MemLimit (system) 24576(user)

CompCache: cc_swappiness - 30(system) 30(user)

=== CompCache status ===

/proc/ramzswap: No such file or directory

===VM status===

Set VM: page-cluster - 3(system) 3(user)

Set VM: laptop_mode - 0(system) 0(user)

Set VM: dirty_expire_centisecs - 3000(system) 3000(user)

Set VM: dirty_writeback_centisecs - 500(system) 500(user)

Set VM: dirty_background_ratio - 5(system) 5(user)

Set VM: dirty_ratio - 10(system) 10(user)

===CPU status===

Set CPU: scaling_min_freq - 245760(system) 245760(user)

Set CPU: scaling_max_freq - 528000(system) 528000(user)

Set CPU: sampling_rate - 2000000(system) 2000000(user)

Set CPU: powersave_bias - 200(system) 200(user)

#

I am running CMs latest ROM .6
[G1 Android Development] huanyu:
By default, the user.conf assume you are using compcache v .5 where CM 3.9.6 using compcache v .6. So you need to change the cc_version=0.5 to cc_version0.6 in your user.conf
[G1 Android Development] Canesfan22:
I changed that rebooted the phone but still the same thing :(
[G1 Android Development] huanyu:
sorry its cc_version=0.6 not cc_version0.6
[G1 Android Development] Canesfan22:
yep I just deleted the 5 and changed it to a 6. still the same errors :confused:
[G1 Android Development] huanyu:
which version of the script are you using? You need version 0.1.3+ to get compcache 0.6 to work. I think you may still using v0.1.2 ( which won't work at all)
[G1 Android Development] Canesfan22:
I am using 0.1.3.1
[G1 Android Development] huanyu:
but the output does not match v0.1.3.1 or v0.1.3
[G1 Android Development] Canesfan22:
Interesting.. I'm going to try something then and post back.

>>EDIT<<

Alright, I just deleted all of the comcache scripts and repushed 0.1.3.1 and it seems to be working now! thanks much for your time!
[G1 Android Development] eViL D::
I am getting this returned.
[G1 Android Development] sha.goyjo:
Ok, here's an interesting one. Running 1.3.1 on CM 3.9.6 , If it output -s from userinit.sh it says that compcache is disabled. But all of my other factors (cpu speed changes, vm setup alterations, etc etc) are working. "cat" says that /proc/ramzswap doesn't exist, which means that the insmod is failing (I think)

The killer is that if I su and run the script from the command line, everything works, including compcache .6.

And yes, I've got the settings set properly
[G1 Android Development] sha.goyjo:
do you think maybe it's an issue with rzscontrol not being sane during boot?
[G1 Android Development] uwonsum:
Auto detect Compcache Version

Give all the credit to huanyu since this is his script which I just modified; all that was done was changed a couple lines

This script should automatically detect whether you are using version .5 or .6 compcache--you dont have to set it in the user.conf file.

All the other options are still there. Use the instruction on post #1

If you can add it to the main page, am sure it may help some folks...Thanks!
[G1 Android Development] sha.goyjo:
Do you know if this will help the problem of it not running for some people at boot time?
[G1 Android Development] uwonsum:
You didnt even test it before asking that question...how am I supposed to answer?
[G1 Android Development] ERamseth:
I have the same lack of /proc/ramzswap but lsmod tells me the module is loaded and /proc/swaps tells me it is using /dev/block/ramzswap0... also dmesg says that ramzswap is being used.

is there some reason /proc/ramzswap wouldn't be created?
[G1 Android Development] uwonsum:
Use the one on post # 115 until he updates the code.
[G1 Android Development] sha.goyjo:
Uwonsum, I'm aware that you don't like me, but please keep your personal issues out of testing situations..

Yes, of course I tested it first. It doesn't appear to help with the problem that myself and a couple of earlier posters noted.
[G1 Android Development] ERamseth:
I get the same effect. all signs point to compcache and ramzswap working well except for the lack of a /proc/ramzswap

here is the output from my dmesg... it might provide some clues:

$ dmesg | grep ramzswap
<4>[ 19.571655] ramzswap: Unknown symbol xv_destroy_pool
<4>[ 19.582214] ramzswap: Unknown symbol xv_get_total_size_bytes
<4>[ 19.591796] ramzswap: Unknown symbol xv_create_pool
<4>[ 19.599487] ramzswap: Unknown symbol xv_malloc
<4>[ 19.606018] ramzswap: Unknown symbol xv_free
<4>[ 19.611907] ramzswap: Unknown symbol xv_get_object_size
<6>[ 19.653411] ramzswap: NUM_DEVICES not specified. Using default: 1
<6>[ 19.660034] ramzswap: Creating 1 devices ...
<6>[ 19.689605] ramzswap: Backing swap set to /dev/block/mmcblk0p3
<6>[ 19.696105] ramzswap: Memory limit set to 8192 KB
<6>[ 19.701080] ramzswap: Using backing swap device: /dev/block/mmcblk0p3
<6>[ 19.708251] ramzswap: Memory limit set to 8192 kB
<6>[ 19.731262] Adding 31172k swap on /dev/block/ramzswap0. Priority:-1 extents:1 across:31172k SSD
$
[G1 Android Development] uwonsum:
There is no /proc/ramzswap with compcache .6. Even your own output tells you that.
[G1 Android Development] sha.goyjo:
Thanks ERamseth...that's useful.
[G1 Android Development] sha.goyjo:
So then, if you were to full flesh out and explain what you are saying, would it be that the cat /proc/ramzswap failure is not an error? And that userinit.sh is working at boot for myself and others?

I still output that compcache is not enabled with

sh /system/sd/userinit.sh -s

Can you clarify any of these problems?
[G1 Android Development] uwonsum:
Post #115 which has the new files was posted at 07:54 PM

You post # 116 was post at 07:56 PM .

So now you could not have possibly tested it even if you were on speed.

Read the instruction on post # 1 on how to install it. stop being lazy and getting angry over nothing.