yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] number1pete:
Hey guys we have been doing a lot of work with the Palm Pre over at precentral.net forums. The Palm Pre has terrible battery life so we have been doing everything we can to fix that. I am responsible for most of the Ondemand cpu scaling testing. ClipCarl is responsible for most of the userspace scaling using a script. And VitViper is resposible for most of the SmartReflex voltage scaling that the TI OMAP is capable of. Not sure if your G1's can do smart reflex.

Anyway i suggested 11% up_threshold and sampling rate of 1 second becasue a lot of user were getting bugs from ondemand scaling. My parameters (obtaing from much testing) aleviate those bugs. This may or may not pertain to yall since your procesor and operating system are different slightly.

One of the biggest problems facing a lot of Palm Pre users is phone freezes while using ondemand scaling. That problem is on are a very phone by phone basis. The other problem is flickering durring camera app and video play. This is due to what i have dubbed the Palm Pre sampling bug. Basically the only way to fix it is to sample at 1 second or greater. Otherwise no matter what you set the up threshold the phone will arbitrarily swithc from high to low state several times a second.

Anyway my point is that you guys may not have a lot of these problems depending on your procesor and kernel of the linux OS your using. But the parameters i suggested are a must for Palm Pre users or else uber bugs.

Check out our work by searching cpu scaling in precentral.net forums.

Dont forget to cat your trans_tables to make sure you dont have the sampling bug with whatever parameters your using.
[G1 Android Development] yukkio:
Hi, Any change log for 0.1.3.6??

BR.
[G1 Android Development] Chahk:
I'm confused about the correct setting for sampling_rate on CM 3.9.7. Is it 200000 or 2000000?
[G1 Android Development] huanyu:
Its 2000000, sorry for the misleading.. will fix that in next release
[G1 Android Development] uwonsum:
Setting your up_threshold low makes the CPU become very aggressive (see post #215) and may fix your bug in that OS, but that is more than likely not the solution to the freezing problem with ondemand. Let me give you an example; when using ondemand with the android OS/HTC Dream, if the CPU frequency is set to any value less than 128000 (128MHz), once the power plug is removed, it freezes. I am sure I can tackle this by making the CPU overly aggressive, but what I'll be doing is exhausting the battery and defeating the purpose of ondemand. If your available frequencies are 600000, 550000, 500000, 250000, 125000, you will crash/freeze if you allow the system to clock down to 12.5MHz.

I noticed one of the suggestions browsing through the site is to set powersave_bias to 1. That has absolutely no effect (see post #46). The Palm Pre has a CPU clock of 500MHz (clocked down from 600MHz). ((1/1000)*500) = .5MHz. As for whether the G1 supports smartreflex/voltage scaling...it does. Most devices out there today do, otherwise there would be little to no benefit using frequency scaling. Pre is new and you guys are just now getting to play with it. I am sure you will find a combination setting that works...just a matter of time.
[G1 Android Development] Glyphix:
Still one more typo -- see below -- says to set the value to both 0 and 1....

To anyone interested -- if swap was your second parition you could just change all reference to

/dev/block/mmcblk0p3

change to

/dev/block/mmcblk0p2
[G1 Android Development] number1pete:
Yeah we just found out a few days ago how powersave_bias actually works but your right.

I was never scaling down to 12.5mhz but i was scaling to 125mhz or 125000khz which is one of the available frequency changes. The reason we have to get agressive with the up_threshold is becasue if you are at 125mhz with the graphics turned on then buggy things happen. It has to be 500mhz or higher to run properly when the phone is out of standby and the graphics are on (which consequently uses more than 11% cpu utilization). Before we did anything the phone was locked at 500mhz so now our code can have the cpu clock down to 125mhz in standby and save good battery. The only way currently to save battery while the phone is on is to use smart reflex but a lot of people get lock ups with it. using powersave_bias to get to 250mhz while the phone is on has been very unstable and causes graphics problems in youtube and other videos.

We are getting close to a good solution but a lot of work has ended since hearing that Palm will be including their own scaling and voltage regulating in the next update due in 30 days. But in the mean time my code is getting me by with very decent battery life.
[G1 Android Development] uwonsum:
My mistake regarding 12.5Mhz, I deducted a zero. I am thinking that it is voltage related issue. But setting the threshold so low defeats the purpose of using ondemand. Yes, you will get better battery life with your current setting rather than sitting at a higher frequency with higher voltage on idle. With up_threshold of 11, just breathing next to the phone will send the CPU to the max frequency:p. Bad Bad for battery. If you had a data sheet on the CPU and had a range or know which frequency corresponds to which voltage that would help your situation. As for the G1, I do not recommend using a up_threshold lower than 32 and that is pushing it. I believe up_threshold of 40 is sufficient. For faster response, you are better off tweaking the sampling rate. In your case, as it is, you have to use 1000000 otherwise you get negative side-effects. Unfortunately the source for that OS is closed. Hopefully the upcoming release resolves some of these issues.
[G1 Android Development] cal3thousand:
slightly off topic... but the thread currently says update 8/7 at 1:xx AM?

Is that chinese time? cuz its still Thursday here in the States
[G1 Android Development] Janis:
Trouble with Notepad++

Can anyone clue me in as to what the format issues might be for editing? Does it need to be Unicode, or is there something I'm missing? I've used WordPad successfully by changing the extension to .txt and then back again, but I don't want to hose things if that was a fluke. Is there another solution? Do I need to boot Ubuntu to be sure? There's also the decoding of the line breaks in notepad, I'd like to get around that if I can.

I'm running 1.3.1 now.

EDIT: Okay, I searched it, and apparently using Wordpad will work for this. It's the line breaks that Unix needs, and I need, that the Windows native notepad takes away, in this case. The file is small enough (large files tend to be problematic, apparently) and doesn't have any other dependencies/isn't being used by anything else. I'm making a pretty big assertion here, and I haven't tested it but once by accident, so if anyone feels the need to post an argument, feel free. The only way I've done it is to change the file extension to .txt and then change it back. I imagine different things happen if you set your default app for .sh files to wordpad. I don't plan on trying that.

Repeat: these files, userinit.sh and user.conf, are small enough, and run essentially in isolation only once to set things up. Other Unix text editing probably needs something more complex to handle the crossover from Windows (and line-break handling) to Unix.

I haven't looked into anything in the Android SDK. Feel free.
[G1 Android Development] Glyphix:
After less then 12 hours I managed to fill up 18MB (it was 60 some MB before compression.) Though -- it was running horribly at that point -- I am changing back to 8 to see how it works.

/ # sh /system/sd/userinit.sh -s
===CompCache status===
CompCache version 0.6+
Compcache enabled
CompCache: MemLimit 18432(system) 18432(user)
CompCache: BackingSwap /dev/block/mmcblk0p3(system) /dev/block/mmcblk0p3(user)
CompCache: cc_swappiness - 30(system) 30(user)
=== CompCache status ===
BackingSwap: /dev/block/mmcblk0p3
DiskSize: 610470 kB
MemLimit: 18432 kB
NumReads: 35047
NumWrites: 40623
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 956
GoodCompress: 100 %
NoCompress: 0 %
PagesStored: 16783
PagesUsed: 4704
OrigDataSize: 67132 kB
ComprDataSize: 18428 kB
MemUsedTotal: 18816 kB
BDevNumReads: 32042
BDevNumWrites: 22884

===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)
/ # free
total used free shared buffers
Mem: 97972 96204 1768 0 544
Swap: 610460 63748 546712
Total: 708432 159952 548480
/ #
[G1 Android Development] Pfeffernuss:
Is using CompCache also recommended on 32B-devices? I would think that the more (free) memory you have the better it will run, or I am not completely understanding what CC actually does, that's also possible.

Right now I have only enabled Linux swap and it's running pretty decently. Will enabling CC makes things even more smooth?
[G1 Android Development] Gimpeh:
Null. It would not hurt a 32A device but it would have the most effect on a 32B device. In a sense it virtually extends your ram therefore it would run better. The technical details are in the first post and every post thereafter.
[G1 Android Development] myshyak:
have tried it on JacxRom 1.3, 32B Magic

Have 3 partitions, fat32, ext3 and swap

made a settings as in example for swap...

The phone stops do not load statrs in endless cycle.

Attach the log as well as config....

What is the was to get it back???

How to remove added files?
[G1 Android Development] pinetreehater:
CompCache is back

After using this for about 3 days, I have come to the conclusion that Compcache isn't for the G1 (at least not mine, and in its current .6 configuration).

For quite awhile, I'd run nothing but the linux swap, and things were good. I have tried compcache before, but it always seemed laggy. I actually posted a video of two identical G1's, one with compcache and one without. The without was faster.

Now that the new .6 version has come out, I decided to give it a whirl and see if it improves (NOTE:COMPCACHE IS ALWAYS FAST AT FIRST...GIVE IT A WEEK). I am running .6 compcache with a backing swap.

To be honest, performance is horrible. The only way to get rid of the lag is to reboot. This is also exactly what I observed running previous versions of Compcache, and remains the impetus for my switch to Linux-swap only.

I submit that my observations are purely anecdotal, and rely heavily on my own subjective observation. No hard data has been collected.

However, Cyanogen himself stated the G1 wasn't built to take full benefit of Compcache, and I believe he is right. There are also a few people in the CM 3.9.7 thread that are complaining about lag...likely because of compcache.

I'm gonna stick it out with the compcache and backing swap, for a little longer. I mean, you can always reboot and get your snappiness back.

Again, your own observations of compcache may differ markedly from mine. Respect my opinion.
[G1 Android Development] thedeanius:
Did i miss something?

I am very new to this user.conf thing and had a question,

First of all i got it working, and here are the settings i am using form my user.conf (v1.3.7)

# General parameters
general{
apps2sd=0	# this is useless here, require a modified a2sd script
media2sd=1	# moves the medias to sd if /system/sd/media exists
}

#compcache related parameters
compcache{
compcache_en=1	# enable(1) or disable(0) compcache
cc_disksize=32	# Ram swap disksize - any number between 1 to 95 should work
cc_memlimit=16	# Limit the memory usage for backing swap (cc .5x known issue-defaults to 15% of total RAM)
cc_backingswap_en=1	# enable(1) or disable(0) backing swap
cc_backingswap=/dev/block/mmcblk0p3 # pointing to the backingswap partition device
cc_swappiness=32 # default 60
}

#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=0	# enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p3 # swap partition device
swappiness=30 # default 60
}

#virtual memory
sys_vm{
sys_vm_en=1	# enable(1) or disable(0) virtual memory configurations
page_cluster=3	# default 3, (0 since CM3.9.6+)
laptop_mode=0	# default 0
dirty_expire_centisecs=5000	# default 3000
dirty_writeback_centisecs=800	# default 500
dirty_background_ratio=10	# default 5
dirty_ratio=16	# default 10
}

#cpu clock
proc_cpu{
proc_cpu_en=1	# enable(1) or disable(0) user cpu configurations
# freqency options
# 19200
# 122880
# 128000
# 245760
# 384000
# 528000
scaling_min_freq=128000	# default 245760
scaling_max_freq=528000	# default 528000
sampling_rate=2000000	# default 2000000 depending on kernel version
powersave_bias=200	# default 0, (200 since CM3.9.6+ )
up_threshold=30	# default 40, percent cpu usage before going up a speed step
}

Here is the output i get from:

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

===CompCache status===
CompCache version 0.6+
Compcache enabled
CompCache: MemLimit 16384(system) 16384(user)
CompCache: BackingSwap /dev/block/mmcblk0p3(system) /dev/block/mmcblk0p3(user)
CompCache: cc_swappiness - 32(system) 32(user)
=== CompCache status ===
BackingSwap: /dev/block/mmcblk0p3
DiskSize: 32130 kB
MemLimit: 16384 kB
NumReads: 228
NumWrites: 1402
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 83
GoodCompress: 100 %
NoCompress: 0 %
PagesStored: 1003
PagesUsed: 216
OrigDataSize: 4012 kB
ComprDataSize: 850 kB
MemUsedTotal: 864 kB
BDevNumReads: 50
BDevNumWrites: 316

===VM status===
Set VM: page-cluster - 3(system) 3(user)
Set VM: laptop_mode - 0(system) 0(user)
Set VM: dirty_expire_centisecs - 5000(system) 5000(user)
Set VM: dirty_writeback_centisecs - 800(system) 800(user)
Set VM: dirty_background_ratio - 10(system) 10(user)
Set VM: dirty_ratio - 16(system) 16(user)
===CPU status===

As you can see the output stops after :

===CPU status===

and doesnt show any results for the settings determinded in the user.conf file

am i missing something in the user.conf?

btw, this displays correctly with an older version of user.conf that i got here yesterday
[G1 Android Development] pinetreehater:
I think in the meantime, I am going to try ONLY the compcache and backing swap.

If I disable the settings for VM and Processor speed, will it revert back to the ROM's standard settings. Or will it continue to run at the settings I configured before I disabled the feature?
[G1 Android Development] huanyu:
From the log, it seems like you are still using 0.1.3.5 which has a small problem displaying the cpu status if the the user.conf file ends with "}". A simple fix is add a newline. I have fix this in 0.1.3.7, i believe.
[G1 Android Development] huanyu:
boot into recovery mode and do

adb shell mount /system/sd
adb shell rm /system/sd/userinit.sh

this should remove the userinit.sh file...
[G1 Android Development] huanyu:
it will run at rom's standard settings.
[G1 Android Development] Gimpeh:
Is there a way to modify the conf or the sh file within the phone itself with a app like Su File Manager & Terminal or another Document Editor app?
[G1 Android Development] pinetreehater:
Thanks Huanyu

I am still playing with different settings too:

I cannot seem to get my up_threshold to change to 10....I wanted to see what would happen. The lowest I can go is 16

=== 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)
[B]ERROR!!![/B] Set CPU: up_threshold - 40(system) 10(user)

When I did

cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
40
#

it still reported the value at 40 even though the script was supposed to change it to 10 (hence the above error).

However set 16 works

=== 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)
Set CPU: up_threshold - 16(system) 16(user)

cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
16
#

I guess 10 is too low and the system knows it LOL...
[G1 Android Development] ttabbal:
Any editor that preserves UNIX line endings should work fine. I use "vi" from the terminal. If you don't know VI, do a google for the keyboard commands before starting it up. It's not the most intuitive thing in the world, but it works.
[G1 Android Development] Gimpeh:
So there is no Word Editor app on the market place that could do this?
[G1 Android Development] Gimpeh:
I don't have access to a computer at the moment. This is why I am asking.
[G1 Android Development] uwonsum:
Gimpeh,

This is easy to do as the user said above. From terminal emulator,

su

vi /system/sd/user.conf

Well, I hope you know how to use vi...if you don't, spend 3 minutes reading some basic commands here.

good luck.
[G1 Android Development] rasturn:
yes

SUFBS

Mount system first!!

just long press on the file chmod 777 and then single click on it view, use sufbs to view the file, press menu; page editor, make changes, save, then chmod 755 reboot, i've done it serveral times. "777" lets you modify the file, the cong or the userinit.sh
[G1 Android Development] uwonsum:
I could be mistaken, but I thought by default this mod is already included. So you won't have to add it again.

To remove the files:

adb remount

adb shell rm /the/directory/where/I/pushed/the/file.extention

Or from terminal emulator (in your case, it would be the terminal in recovery mode)

su

mount -o remount,rw /dev/block/mtdblock3 /system

rm /the/directory/where/I/copied/the/file.extention
[G1 Android Development] myshyak:
2huanyu;uwonsum thanks.

Seems this to be much complicated for my level of knoweledges.

Hipe soon you would relize the gui unitility that would make the same ;-)
[G1 Android Development] Glyphix:
If you use wordpad (or other windows editor) to edit the files, all you need to do is dos2unix them in the terminal, and it will reformat just fine.

i.e.

dos2unix /system/sd/user.conf

so for instance to modify the terminal instruction from the first post to include this, you would....

su
mount -o remount,rw /dev/block/mtdblock3 /system
cp /sdcard/userinit.sh /system/sd
cp /sdcard/user.conf /system/sd
dos2unix /system/sd/user.conf
dos2unix /system/sd/userinit.sh
chmod 755 /system/sd/user.conf
chmod 755 /system/sd/userinit.sh
reboot
[G1 Android Development] Gimpeh:
Much better and easier than using VI on a ION. Thanks much!
[G1 Android Development] dan0zone:
The SUFBS way is great ,,well for the G1 , been using this for a while ..
[G1 Android Development] mianosm:
This is a great addition to the tool box in terms of the media2sd, cc management, linux_swap, cpu adjustments, and others. : )

Thanks for the hard work and dilligent updates. ; )
[G1 Android Development] xarejayx:
best setup user.conf

Hello everyone, I'm still learning about compcache,

Im running cynogens latest experimental rom, my sdcard is setup for ext2/fat/swap, whats the best options for user.conf? do i use swap_backing? do i enable linux swap? I'm unsure what to do for this kinda setup
[G1 Android Development] pinetreehater:
How to I break the symlink

I want to move my ringtones (and alarms,notifications,ui) to the /system/media/audio directory. I have done it until I am blue in the face. Even restored the permissions and everything.

Problem is, that directory is symlinked to the /system/sd/media directory. It WAS initially enabled in the user.conf file. But I have since disabled it. Problem is, the symlink is still there.

# cd system
cd system
# ls
ls
app etc lib modules xbin
bin fonts lost+found sd
build.prop framework media usr
# ls -l
ls -l
drwxr-xr-x 1 0 0 2048 Aug 1 2008 app
drwxr-xr-x 1 0 2000 2048 Aug 1 2008 bin
-rw-r--r-- 1 0 0 2243 Aug 1 2008 build.prop
drwxr-xr-x 1 0 0 2048 Aug 1 2008 etc
drwxr-xr-x 1 0 0 2048 Aug 1 2008 fonts
drwxr-xr-x 1 0 0 2048 Aug 1 2008 framework
drwxr-xr-x 1 0 0 2048 Aug 1 2008 lib
drwxr-xr-x 1 0 0 2048 Aug 5 02:27 lost+found
[B]lrwxrwxrwx 1 0 0 16 Aug 7 19:24 media -> /system/sd/medi[/B]
a
drwxr-xr-x 3 1000 1000 26 Aug 4 21:48 modules
drwxrwx--x 9 1000 1000 1024 Aug 7 20:34 sd
drwxr-xr-x 1 0 0 2048 Aug 1 2008 usr

I am tired of the ringtone delay when I get a call. I have been told (and it is all over the boards)that moving your media back to internal memory should fix this problem.

Can someone direct me as to how to undo this symlink?

Will
[G1 Android Development] pinetreehater:
Well I guess you could just delete it...that works nice.

However, media still won't show up...I give up.
[G1 Android Development] sha.goyjo:
DON'T GIVE UP

I have been using smaller .ogg files for my ringtones, and it works better and faster. I honestly think the high bitrates that are in the folders are a problem. Try replacing your ringtones with these

http://www.lighthousesolutions.info/AudioResources.zip

its a HUGE audio package, all of them small .ogg files.

It should make your delay go away, it helped me.
[G1 Android Development] dwang:
I would agree w this observation. I thought the lagging had been fixed w .6, but it still starts lagging after a day or two.
[G1 Android Development] jay22are:
i am running CM 3.9.7 with compcache and backing_swap...i am loving the smoothness of the compcahe..
[G1 Android Development] dwang:
For those that are having trouble editing in windows, download notepad++. It has a unix mode. Do a Google to find it.
[G1 Android Development] slackmagic:
Now that CPU scaling is part of the script(s), does one still need to run/use SetCPU?

and thanks again to those that have put lots of hours of testing into this. Compcache + backing swap works great on my phone (I don't mind rebooting every now and then)
[G1 Android Development] Gimpeh:
I can't wait till the Swappiness issue is fixed. I don't care for it to remain at the system default of 10.
[G1 Android Development] pinetreehater:
My swappiness is what I set it at 30. The only issue I was aware of is that you must set all your swappiness levels to the same valuel (compcache,linux,backing)

If you notice my sig,

I have my swappiness set at 30...(although the compcache/backing swap combo only allows you to set it once...when I used compcache and linux swap, i had two swappiness values, but they had to be the same).
[G1 Android Development] pershoot:
hi all.

i have a 64mb linux-swap partition. if i want to run with compcache and the backing swap (of 64mb), would it be best to leave 32mb for compcache cc_disksize?
[G1 Android Development] ElChouch:
I get this error on compcache 0.6 when running the test

=== user.conf ===

*** general ***

apps2sd=0

media2sd=1

*** CompCache ***

compcache_en=1

cc_memlimit=16

cc_disksize=32

cc_backingswap_en=0

cc_backingswap=/dev/block/mmcblk0p3

swappiness=30

*** 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=32

=== CompCache status ===

CompCache version 0.6+

!!!ERROR Compcache disabled

CompCache: DiskSize (system) 32768(user)

!!! Unable to set compcache cc_swappiness to user specific "30"

Current system value is "60"

=== CompCache status output ===

Failed to open /dev/block/ramzswap0: No such file or directory

Can someone help please ? :)
[G1 Android Development] huanyu:
looks like you run the script with root

su
sh /system/sd/userinit.sh
sh /system/sd/userinit.sh -s
[G1 Android Development] huanyu:
I believe i have fixed that issue in the latest release. Try update the script and let me know if the problem still exists.