COMPCACHE for UD *2.5.0*!! [Instructions] Updated 12/16/10

Chipster

New Member
Joined
May 6, 2010
Messages
22
Reaction score
0
When you start compache with the start command form userinit20 - you don't get the benefit of selecting size or disable through UD Settings. The UD scripts appear to have been "borrowed" from a more general ROM structure. They don't - and cannot work as they reside on UD2.x.

Here's a fix that requires a number of edits - but preserves changes in size (or disable) through Settings. It fixes the two main scripts that don't work in UD2.x. I also posted this at UD..

Edit /system/bin/handle_compcache to read as follows:

Code:
#!/system/bin/sh
#
# Compcache handler
# Decides whether or not Compcache is enabled
#
# This gets the percent of ram set in Settings
PROP="$(getprop persist.service.compcache)"
 
if [ $PROP = 0 ]
then
  /system/bin/compcache stop
else
  CCSIZE=$(($((232000 * $PROP)) / 100))
  /system/bin/compcache start $CCSIZE
fi
 
exit 0
The 232000 figure is the rounded amount of D1 RAM in kb
Then edit /system/bin/compcache to read:
Code:
#!/system/bin/sh
#
# Compcache manager
# [EMAIL="[email protected]"][email protected][/EMAIL] (cyanogen)
#
 
DEV=/dev/block/ramzswap0
MODULE=ramzswap.ko
MODULES_DIR=/system/lib/modules
 
case "$1" in
   start)
      echo 3 > /proc/sys/vm/drop_caches
#     As of v25 - need to explicitly call busybox on next line
      busybox insmod $MODULES_DIR/$MODULE
      rzscontrol $DEV --disksize_kb=$2 --init
      swapon $DEV
   ;;
   stop)
      swapoff $DEV >/dev/null 2>&1
      rmmod $MODULE >/dev/null 2>&1
   ;;
   stats)
      rzscontrol $DEV --stats
   ;;
   *)
      echo "Usage: $0 {start <size>|stop|stats}"
      exit 1
 
esac
exit 0

Finally... edit /etc/init.d/20userinit
To the end of the file - add:
/system/bin/handle_compcache
You don't need "compcache start" - instead, compcache is called through "handle_compcache"

As originally coded - compcache is supposed to be started as a service through /etc/init.local.rc
And /init.rc (you can't edit this one so it "sticks") includes the "import" command to run init.local.rc - but this doesn't appear to work. So last resort is to include the command in /etc/init.d/20userinit
 
Last edited:

Canefan

Member
Joined
Dec 27, 2009
Messages
125
Reaction score
0
Quick question regarding compcache. My battery consumption has been terrible since installing 2.3. This is also the first time that I've tried to use compcache. I want to disable it and see if there is any impact on battery usage. Is disabling in UD settings all that I need to do? I ask this because when I reboot and enter "compcache stats" in terminal emulator, I get stats. Doesn't this mean that compcache is running despite it being disabled in UD settings?
 

Chipster

New Member
Joined
May 6, 2010
Messages
22
Reaction score
0
Unfortunately - BD "fix" for comcache effectively turns it on all the time. One reason for the long post before.

To simply turn it off.... 2 ways:

Open terminal emulator.
SU
compcache off

OR... to disable on boot:

Open Root Explorer" from the market. - to /etc/init.d/userinit20. Allow R/W - to edit this file. At the end - place a "#" at the beginning of the line with "compcache start" - this stops the compache commend from executing on startup. Also - you can change "start" to "stop".

I'm also seeing adverse battery life in 2.3.. Still trying to figure out if compcache is part of the solution.
 
Last edited:

woodchc

New Member
Joined
Aug 25, 2010
Messages
11
Reaction score
0
Can you only do this with slayher kernels or can you use chevy or p3 and get compcache
 

Chipster

New Member
Joined
May 6, 2010
Messages
22
Reaction score
0
Can you only do this with slayher kernels or can you use chevy or p3 and get compcache

Only kernels that have included the ramzswap.ko in their compile. And so far - I only know of Slayher's.

If in doubt - open the kernel's zip on your PC - look in /system/lib/modules for ramzswap.ko. If it's there - your good. If not....
 

Firewing

Member
Joined
Nov 27, 2010
Messages
337
Reaction score
0
Location
in northern cali, where the desert and the mountai
Ok I am way to new at this to do this w/o first asking for advice... when I dl the 2 files from the links in post 1 they are both the same size and both named the same thing, how do I tell which one to flash first? Also on the first dl there is a choice between 1.6 1200,1.6 1100 etc, what does that mean?
Thanks
Cara
 

chrisvis

New Member
Joined
Apr 24, 2010
Messages
2
Reaction score
0
Loaded 2.3 w/ the LFY 1200 & CC enabled. Chevys kernals were a bit snappier then LFY's is, but battery life with LFY is fantastic. End of a 16 hour day my phone has 40% battery! That's never happened before.. not even close.

I am seeing weird slowdowns/pauses at times that I never had w/ chevy and 2.2/2.1, but the battery life makes up for it.

Sent from my Droid using DroidForums App
 

GOBIAS Industries

New Member
Joined
Jan 15, 2010
Messages
20
Reaction score
0
Something I have noticed in this thread as well as the UD 2.1 instructions thread that *may* be the cause of some problems I've read...

Careful with the spelling... i see a lot of "compache" and not the correct "compcache"

Hope that solves at least one person's problems
 
OP
anuraj1

anuraj1

Active Member
Joined
Jan 8, 2010
Messages
1,140
Reaction score
0
Location
AZ
Something I have noticed in this thread as well as the UD 2.1 instructions thread that *may* be the cause of some problems I've read...

Careful with the spelling... i see a lot of "compache" and not the correct "compcache"

Hope that solves at least one person's problems

Your nickname is awesome. I miss Arrested Development.

And yes, it looks like at least a couple of people have run into problems because of misspellings. Thanks for the post.
 

chnkyeydflip

Member
Joined
Mar 11, 2010
Messages
122
Reaction score
0
I had horrible battery life on all slayer's kernels with compcache enabled... I tried using saphire's kernels and everything has been great even with compcache enable. You might want to try them out... I'm on the 1.2 7 slot one with CC enable and been getting battery life like UD 1.0 around 16 to 17 hrs with moderate texting and use. Only problem for me was initially enabling it from a clean wipe. I had to install a slayer kernel then use the .zip method then install the saphire kernel.
 

Firewing

Member
Joined
Nov 27, 2010
Messages
337
Reaction score
0
Location
in northern cali, where the desert and the mountai
This is the error I get in the terminal...I followed all the directions...

export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$su
# compcache start
insmod: init_module '/system/lib/modules/ramzswap.ko' failed (Exec format error)
Failed to open /dev/block/ramzswap0: No such file or directory
swapon: can't stat '/dev/block/ramzswap0': No such file or directory
#

Sent from my Droid using DroidForums App
 

kei6193

New Member
Joined
Jan 18, 2010
Messages
9
Reaction score
0
whenever i flash a slayher kernel. i just get constant bootloops...
 

Smokie

Member
Joined
Jan 2, 2010
Messages
297
Reaction score
0
Location
Nj
Just to update this, I installed the LFY 1100 a little while ago, and I did not have to install the fix update.zip to have compcache working. Running pretty smooth and quick too. Just have to watch temps and battery now.

I am not having very good performance with the LFY kernels. Extremely choppy and laggy, fluctuating heat, and quadrant scores that are 150 points lower than with Slayher's 1.6 kernels. I can confirm that I didn't need to flash the update.zip for compcache though. I am going to give it a couple of days to let the kernel "settle down" and see if it gets any better.

aren't the LFY kernels all Slayher kernels?? i didn't think there was a difference.
 

Chipster

New Member
Joined
May 6, 2010
Messages
22
Reaction score
0
I have the slayher kernals running but can't seem to get compcache to work...

Sent from my Droid using DroidForums App

Which Slayher? 1.6 have the proper files. But his latest - LFY flavors - don't contain the ramzswap file. You may have to try the 1.6 Slayher first.

Would also appear - if you installed 1.6 first - then changed to LFY - the ramzswap.ko will remain behind in /system/lib/modules - so compcache may keep working (or maybe it will bring LFY to a crawl - probably a reason Slayher left the ramzswap out of the LFY compile).

This *won't* work to enable P3 - or other - kernels to support compcache - as ramzswap must be specially compiled for each.
 
Last edited:
Top