yashsingh1/xdaforums huggingface dataset:
[General Questions and Answers] oldman1881:
just upgrade to vista business X64 SP1, it seems that it is not working with HD2, it shows autoplay when I connect it to my note book.

any advise from your guys?
[General Questions and Answers] syqe:
Have you downloaded the latest version of Windows Mobile Device Center?

On your phone have you checked the USB to PC Connection settings? Is it set to Active Sync?
[General Questions and Answers] crobs808:
I have noticed that on Vista X64, when I sync, I have to make sure Activesync is NOT running on my device already when I plug it in. I go the task manager on my phone, and kill ALL applications, THEN plug it in. It takes longer than ActiveSync on XP did, but it eventually connects. Takes about 15-30 seconds for me in Vista X64 Ultimate, whereas on XP (other computer) it is instant, 3-5 seconds. Stupid Vista.
[XPERIA X1 General] TITOFER:
hi, im from san salvador, central america, i have my xperia but is in english, i need to fla**** at spanish

already read how to flash it

but i dont know what room to use....

can you help me please...!!!

ando congratulation for this fourum!!! and sorry for my bad baaaaaad english

regards
[XPERIA X1 General] darthmarko:
Hello, try visiting HTC Mania or HTCSpain, you'll find plenty of Spanish Roms there..

Good Luck
[G1 Android Development] bkmo:
Here is a simple tutorial to get compcache ramswap running on the new Cyanogen 3.6.7 rom. Thanks to Cyanogen we now have a functioning swap that is fast and will not cause SSD wear.

Please make sure you have adb installed and functioning before you continue, as this tutorial will utilize adb to push the required files to the phone. Also your sd card should have a 500megish ext(2,3,4) partition as the second partition for this to work.

Download the userinit.sh.txt file attached here then:

Rename it to userinit.sh

create a directory c:\userinit

copy userinit.sh to c:\userinit

open CMD prompt

adb push c:\userinit\userinit.sh /system/sd

adb shell chmod 755 /system/sd/userinit.sh (not sure if needed being safe)

adb shell reboot

( This completes the compcache setup )

++++++++++++++++++++++++++++++++++++++++++++

To see if it is working enter: cat /proc/ramzswap in the terminal console app on the phone. You should have a XX% GoodCompress listed if it is working properly.

Hope this helps a bit. Please correct me if I made mistakes.

edit: re-uploaded the script with swappiness set to 60. You can re-push the new one the same way.

edit: removed media info from post and userinit.sh to simplify things.

edit: the following may help for those unable to get adb working. Make sure you place userinit.sh on the root of your sd (fat32 partition)

in terminal emulator:

su

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

cp /sdcard/userinit.sh /system/sd

chmod 755 /system/sd/userinit.sh
[G1 Android Development] jay22are:
thanks...very helpful tuttorial
[G1 Android Development] P_Dub_S:
Just did the audio push and it moved all 3 folders
[G1 Android Development] bkmo:
It is no longer needed. Compcache should work better, but time will tell I guess.
[G1 Android Development] DOHCtor:
I'll just leave my linux swap partition there for now then.

I notice when I run #free it shows total swap size around 24mb. With the linux swap, I get 32mb.
[G1 Android Development] bkmo:
so you are saying on your sd card you now have:

/system/sd/media with subfolders of ringtones, alarms, notifications, ui ?
[G1 Android Development] endolin:
thanks for the tutorial

thanks for the tutorial. one questions remains. how do we disable the sd-swap?
[G1 Android Development] drpfenderson:
Thank you so much for this. Seems to be working perfectly on 3.6.7.1. Cheers!
[G1 Android Development] bkmo:
Good, it is working fine then. I believe that the 24mb is pre-compiled by Cyanogen and is not user configurable right now.
[G1 Android Development] bkmo:
if you used the attached userinit.sh then it is not enabled. The partition is now unused. You now will not be wearing down your sd with swap.
[G1 Android Development] DOHCtor:
I just looked into your userinit.sh file. There's a line in there that seems to remove the media files from the phone memory. Why would you do that?
[G1 Android Development] bkmo:
I didn't write the initial script so I can only speculate that it is clearing the directory that the os is looking in before linking it to the sd. I really have not pondered on it. It has been working fine on my phone ever since I implemented it though.
[G1 Android Development] P_Dub_S:
I just checked and no they didn't get created but the cmd prompt showed all the files being pushed?
[G1 Android Development] dwang:
In cyans images, the media dir is empty. Its being deleted so it can then be symlinked to the one in the sd dir.
[G1 Android Development] bkmo:
Hmm can't debug it now, but will try to get adb running on a windowz box tomorrow. Just don't remove the media files from the fat32 partition until it is proven the files are copied to the sd properly. goodnight all
[G1 Android Development] DOHCtor:
I know, but doesn't the phone auto search for it in those folders? I use ringdroid and it creates a fold hierarchy just like that already. Is it really neccessary to add the symlinks?
[G1 Android Development] dwang:
Yes but all those music files show up in the music app which is annoying.

This method gets rid of that problem.

Its not strictly neccessary but I wrote it for that reason
[G1 Android Development] DOHCtor:
Actually, it doesn't if you put it in the media folder and within the media fold you have other sub folders (ringtone, notification etc.), which ringdroid already creates for you. Like I said, I don't understand the reason to do a symlink for them.
[G1 Android Development] bkmo:
Hey, I almost forgot that you wrote it initially. I shared it here because I think it is a much cleaner way of putting the audio on sd. I now dont have to see all this junk in my music library. Great job on the script BTW
[G1 Android Development] Zarboz:
i would like that cuuuuz my sheet aint workin
[G1 Android Development] Booker-T:
I just wonder will it work for Roger v3?

What's the different between Compcache and backup_swap?
[G1 Android Development] h.nocturna:
#!/system/bin/sh

insmod /system/sd/xvmalloc.ko;
insmod /system/sd/ramzswap.ko memlimit_kb=32000 backing_swap=/dev/block/mmcblk0p3;
mknod /dev/ramzswap0 b 253 0;
echo 20 > /proc/sys/vm/swappiness;
swapon /dev/ramzswap0;

exit;

Here you go. :D

Whether it will work is dependent on the kernel, not the ROM. If Roger v3 has the cyanogenized 2.6.29 kernel, then this will work, otherwise no.

You can't really compare compcache and backup_swap as they are two different things that aren't mutually exclusive.

compcache is the compressing of the data that goes into RAM to expand the RAM. Backup_swap is something that can be used in when the RAM does fill up. Basically, once the RAM fills up, the next stuff goes to the swap (as it does in regular linux-swap).
[G1 Android Development] Zarboz:
so how did you compile the modules then...

jw
[G1 Android Development] h.nocturna:
The modules are pre-compiled for the cyangenized 2.6.29 kernel. I was using jacHEROski1.4C that uses that kernel, so I just pushed xvmalloc.ko and the ramzswap.ko to /system/sd/ and just pushed userinit.sh to the same place and presto, compcache up and running.
[G1 Android Development] Booker-T:
Thanks, I think the ROM I am using is not compatible as it is too old:(

I will try it soon
[G1 Android Development] Zarboz:
so....where can i find these xvmalloc.ko and ramzswap.ko at?

i am hunting and even tried compiling but only can use busy box on the phone so no go with that

i was hunting in a 1.2c version will dl 1.4c and hunt more
[G1 Android Development] h.nocturna:
Took me a while to find as well, I had to go to the code.google page to find it. Just extract and place on /system/sd (if you use my userinit.sh) or the other directory depending on which sh file you use.
[G1 Android Development] Zarboz:
im on jac hero 2.7.2 just flashed the boot.img from jacheroski 1.4c the a2sd.sh and the wlan.ko and put the .ko files on /system/sd and chmod'd the userinit.sh

willl let yall know if it wors
[G1 Android Development] BombaMyte:
This will be interesting... *gets another Pepsi & waits*
[G1 Android Development] Zarboz:
dang wifi tether being slow

* is still waiting for 1.4c to dl *

so basically heres what i did if anyone cares

Running jachero 2.7.2 whatever the newest version is

flashed cyanogens boot img.. (flash_image boot /sdcard/cyanogensboot.img)

pushed wlan.ko from that build to /system/lib/modules

pushed a2sd.sh from that build to /system/bin/

chmod'd a2sd.sh from terminal

downloaded the .ko's thx so much h.nocturna and pushed to /system/sd

pushed userinit.sh /system/sd

chmod userinit.sh

ill have to give solid answers after i flash newest boot img

sooo for some reason i cant get userinit.sh to run on boot.....buuuut

after typing all those commands from the userinit.sh script into terminal it comes up as working i know these dont persist on reboot though ...how can i resolve that?
[G1 Android Development] BombaMyte:
*sips Pepsi*

Sorry, had to do it.
[G1 Android Development] h.nocturna:
easy. It doesn't *have* to be named userinit.sh, you can just add the code to the end of a2sd.sh and it should have the same effect.
[G1 Android Development] Zarboz:
so for some reason whenever i edit the .sh files and save them it wont load from the phone ....
[G1 Android Development] innerspace:
agreed

I've had nothing but positive results thus far with this userinit file. Phone seems much more stable and quick, compcache is reporting significantly lower usage which makes me wonder... backing_swap should be activated AFTER compcache is full... right? I was never seeing high enough comcache usage before to make a backing_swap activation necessary, so does this imply the swap partition is actually running alongside compcache? I don't think I've wrapped my head around this yet.
[G1 Android Development] h.nocturna:
... no comment... sorry

have you tried chmodding it again after you edited? Shouldn't be necessary, but just a shot in the dark.
[G1 Android Development] merps:
dumb question - permissions on the files you edit, are they right?
[G1 Android Development] Zarboz:
i dont do windows at all so i dont know how to change that im on my roommates computer

buuuuut i got it runnin :D

runnin jac hero 2.7.2

flashed kernel from 1.4c jacheroski

pushed wlan.ko from 1.4c

pushed a2sd.sh(added the commands from userinit.sh to this as well) from 1.4c

pushed /system/modules from 1.4c (unionfs support)

and its good to go
[G1 Android Development] merps:
afaik - this is a roll over so once, and if, compcache fills (15% of memory I believe) it then activates the backing_swap(?)

you can always put the handset under load then 'cat /proc/swaps' to check - haven't tested yet myself...
[G1 Android Development] h.nocturna:
That sounds like fun. Just out of curiosity, how did you fix your userinit.sh conundrum?

If JACHero doesn't add compcache to their next build. I'll be tempted to do this... Actually, I might just do it just to get multi-touch back... When you say flash the kernel, did you just flash the boot.img?

Other than that, I think I might be able to do this... hmmmm... *sly smile*

Work in 15min... I can do it...
[G1 Android Development] martinx817x:
i have tried running this and it keeps telling me:

this is what put in using the terminal

$su (terminal only)

#cp /sdcard/userinit.sh /system/sd/

#chmod 775 /system/sd/userinit.sh

#sh /system/sd/userinit.sh

:not found

:not found

:not found

mknod: /dev/ramzswap0: file exists

please tell me what I'm doing wrong, I can get compache to work but not backswap
[G1 Android Development] mycnam:
bkmo, can you update the attached file to 20 swappiness and 24576kb of cache? thanks!
[G1 Android Development] nurre:
For those using backing_swap, there's a good chance it'll also push uncompressable bits directly to swap, and keep only the compressable stuff in there. Which might be why your seeing different statistics.
[G1 Android Development] h.nocturna:
Alright, so I tried modding the JACHero2.7.3 ROM to include support for compcache (above). And well, the performance wasn't greatly enhanced compared to jacHEROski1.4C with compcache. The fact that I lost multi-touch made me switch back. Also... for some reason, the weather app could not update my current location. It would work for everything else, just not my current location... weird...
[G1 Android Development] overpower:
For those who care, in the Q&A forum I went ahead and took a shot at answering the differences between compcache backing swap and linux backing swap. I also did a mini-howto on the commands to enable them.

It is here.

I don't have a swap partition to play with, so I guessed a bit. PM me if I need to correct anything.

@bkmo

If you want to link it in the first post go for it.
[G1 Android Development] pistol4413:
file still.on fat32

I followed the steps and everything went through perfectly, but I still notice the userinit.sh file on my fat32. Should it be there or should it be on my ext3? I'm on cyanogen 3.6.8
[G1 Android Development] jasherai:
my version of userinit.sh

Hi all,

figured I'd share my copy of the userinit.sh which I hacked together to be able to switch between swap methods.

This version

- ensures compcache modules are available before enabling them (slightly futureproof).

- requires you to enable each type of swap as wanted

- will gracefully disable swap and remove modules on stop (and restart)

- support for compcache backing_swap

- can be executed at runtime and boot.

Todo:

- allow config files to specify swappiness and vfs_cache_pressure

- allow better getopts for settings

- remove any other requirement to edit the script to set options.

I hope this is useful for someone! :cool:

jasherai

/ # /system/sd/userinit.sh help

Usage:
/system/sd/userinit.sh [help|status|stop]

help - prints this message
stop - disable swap and remove modules
status - output of :
cat /proc/swaps (shows swap partitions enabled)
cat /proc/ramzswap (compcache stats if enabled)
mfree (or free if mfree is not installed)

This userinit.sh script will enable compcache or swap partition (default) as configured
Having run this script, you now have a /system/sd/userinit.d/etc/ folder to configure your swap settings
To enable compcache run the following command
$ touch /system/sd/userinit.d/etc/use_compcache
To enable compcache with backing swap run the following commands
$ touch /system/sd/userinit.d/etc/use_compcache
$ touch /system/sd/userinit.d/etc/use_compcache_backing
To enable swap partition run the following commands
$ touch /system/sd/userinit.d/etc/use_swap

Obviously you remove the above files to disable each type of swap

INFO:
defaults:
- swap_partition swappiness: 60
- swap_partition vfs_cache_pressure: 10
- compcache_partition swappiness: 15
- compcache_partition disksize: 24Mb
- default swap_partition : /dev/block/mmcblk0p3 (the third partition)

/ #
[G1 Android Development] MotherMayI:
it wont let me use the sh file here cuz its just a text file and i have to type "userinit.sh.txt" is that right?
[G1 Android Development] dixxa:
no...

you download the little file

for example your desktop

adb push userinit.sh.txt /system/sd/userinit.sh

adb shell chmod 755 /system/sd/userinit.sh

/system/sd/userinit.sh status should work.

then

touch /system/sd/userinit.d/etc/use_compcache

touch /system/sd/userinit.d/etc/use_compcache_backing

# /system/sd/userinit.sh stop

Disabling swap /dev/ramzswap0 -

done

# /system/sd/userinit.sh start

Enabling compcache modules WITH backing swap - done

Set swappiness [15] setting and enabling compcache swap partition [/dev/ramzswap0] with backing_swap [/dev/block/mmcblk0p3]

vm.swappiness = 15

/system/sd/userinit.sh status to check if it's ok

# /system/sd/userinit.sh status

Filename Type Size Used Priority

/dev/ramzswap0 partition 24572 3332 -1

DiskSize: 24576 kB

NumReads: 422

NumWrites: 842

FailedReads: 0

FailedWrites: 0

InvalidIO: 0

PagesDiscard: 0

ZeroPages: 67

GoodCompress: 68 %

NoCompress: 3 %

PagesStored: 775

PagesUsed: 279

OrigDataSize: 3100 kB

ComprDataSize: 1073 kB

MemUsedTotal: 1116 kB

total used free shared buffers

Mem: 97876 82892 14984 0 3540

Swap: 24572 3332 21240

Total: 122448 86224 36224

and you're good
[G1 Android Development] martinx817x:
how can i tell if this is working or not?
[G1 Android Development] psrtx:
Re: how can i tell if this is working or not?

See " dixxa" post above yours on how to check the status (from terminal run "/system/sd/userinit.sh status")
[G1 Android Development] Zarboz:
#flash_image boot /sdcard/boot.img <--- cyanogens boot.img

didnt get the userinit.sh fixed but the insmod commands stick on reboot so thats cool but someone mentioned its my permissions when saving the .sh files arent correct so they dont stay like that when i push them to the phone or the phone isnt reading the permissions
[G1 Android Development] overpower:
@jasherai

Excellent script. I still think the proper syntax for a backing_swap is memlimit_kb instead of disksize_kb, but based on the current build where we can't tell if the backing_swap is in use or not via /proc/ramzswap, I don't think it matters if the effect seems to work. When we get .6.x then maybe the parameter choice will have a different effect.
[G1 Android Development] jasherai:
@overpower Thanks for the heads up! I'll have a bit off a dig and see if I can get it right in time for the newer modules :)

I'm glad you have found it useful. :)

jasherai
[G1 Android Development] Zarboz:
Can i use your script in my jacheromod?
[G1 Android Development] jasherai:
sharing?! shocker! :O

Go for it! let me know if you make any improvements, and I'll pm you any changes from my side too :)

Good work on the mod btw!:D
[G1 Android Development] martinx817x:
thanks tried it and when i enter free or /system/sd/userinit.sh status I can see my swap being used. But I how do I see if compache is working or not, like the good compression etc? I tried entering: cat /proc/ramzswap but it just says no such file or directory.
[G1 Android Development] Zarboz:
OK

the only thing im worried about is that after a day or so it seems the swap is full and i need a way to dump the cache once its filled or something...or reset swap every 6 hours
[G1 Android Development] BombaMyte:
Agreed. The compcache along with my linux-swap (started automatically on reboot) have filled considerably since doing this mod.

EDIT: Here's the stats just before I rebooted a few mins ago...

# free
free
total used free shared buffers
Mem: 97908 96192 1716 0 76
Swap: 94672 47920 46752
Total: 192580 144112 48468
# cat /proc/ramzswap
cat /proc/ramzswap
DiskSize: 32000 kB
NumReads: 61231
NumWrites: 28660
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 351
GoodCompress: 74 %
NoCompress: 5 %
PagesStored: 7648
PagesUsed: 2800
OrigDataSize: 30592 kB
ComprDataSize: 10712 kB
MemUsedTotal: 11200 kB

And after...

# free
free
total used free shared buffers
Mem: 97908 96624 1284 0 212
Swap: 94672 10064 84608
Total: 192580 106688 85892
# cat /proc/ramzswap
cat /proc/ramzswap
DiskSize: 32000 kB
NumReads: 1019
NumWrites: 2634
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 289
GoodCompress: 76 %
NoCompress: 5 %
PagesStored: 2345
PagesUsed: 722
OrigDataSize: 9380 kB
ComprDataSize: 2847 kB
MemUsedTotal: 2888 kB
[G1 Android Development] jasherai:
hmmm.. well rerunning my script first disables and then reenables swap...

in essence flushing swap/compcache.. would this be good enough?

if you could put it in a cron (not sure if there is such a thing in android! :O ) then it could do the trick. :cool:
[G1 Android Development] jasherai:
Hey martinx817x,

It appears you haven't enabled compcache as yet.

Can you confirm by checking for the following file?

/system/sd/userinit.d/etc/use_compcache

if you don't run

# touch /system/sd/userinit.d/etc/use_compcache

This enables compcache with this script. (please run

# /system/sd/userinit.sh help

for more info)

If you run the userinit.sh again, it should now enable compcache.

system/sd/userinit.sh status

should now show data for the swap line ( using the default compcache size, you should see 24mb (24572) in the swap line.

hth,

jasherai
[G1 Android Development] cigar3tte:
How is this affected after a wipe or flashing an updated ROM?
[G1 Android Development] jasherai:
Hi pistol4413,

on cynanogens roms, the userinit.sh script is called from /system/sd/userinit.sh

Using my script manually will continue to work until the next reboot, but the settings won't apply on reboot as the file won't be in the expected place. So copy it into the above path to let it work on reboots.

To do this you can:

(adb method with an ext partition)

$ adb push userinit.sh /system/sd/userinit.sh

(adb method without an ext partion)

$ adb remount

$ adb push userinit.sh /system/sd/userinit.sh

(terminal method)

$ su

# cp /sdcard/userinit.sh /system/sd/userinit.sh

# exit

$ exit

hth

jasherai
[G1 Android Development] jasherai:
@cigar3tte

if you have an ext partition, then the userinit.sh script (whichever one you are using) will stay in place.

If you have not partitioned your sd card, then /system/sd/ is overwritten on flashing, and is most likely missing anything you have stored there... (can anyone double confirm this?)

(compcache does not require a partition on your sdcard)

I hope this makes sense.

jasherai
[G1 Android Development] overpower:
Although the script does flush it and can be used to flush out the swap, in most cases a swap file should fill up as processes use memory. It's normal.

Of course if it gets sluggish go ahead and flush the swap, and this should cause a lot of processes to die thus returning you back to a near reboot state.

The problem with the sluggishness is that android is not designed to have a swapfile at all and doesn't protect core processes from being swapped out to slower swap space and also kills random processes based on internal memory space only (ignoring that there is plenty of virtual memory). As soon as both those issues are solved, we should be able to avoid flushing to fix responsiveness.
[G1 Android Development] jasherai:
This is a good point, however I believe the kernel is intelligent enough to handle the removal of swap cleanly. I haven't had any application force close when "flushing" swap, but then I haven't tested specifically for this case.

Can anyone report on their experiences?

Interesting point here too... a touch above my experience level with android. Can anyone else shed some light where this might be configured?
[G1 Android Development] ulyssesclark:
im receiving an error.( /sdcard/userinit.sh :no such file or directory)
[G1 Android Development] simplyTravis:
I am having a problem with my ram running low while using compache and google voice. Is there anyway to make it free up more ram? Also, if I can't fix it, how would I disable compache?

It made my phone run awesome until I loaded up a root theme and google voice. I would like to keep both but if running naked will end up fixing this I will do that.

I've tried searching around but I'm pretty ignorant on how to get that aspect fixed. I use dxtop's ram widget to view the available memory and when it dips under 20 mb it goes sloooooow.

I'm running cyanogen 3.6.8.1 (latest version), using Android Plus theme, apps2sd, on an ext2/3 with 500+MB partition.
[G1 Android Development] martinx817x:
thanks again. I tried to enable it and then checked the status. it gives me the same results as when i type in free. in the swap line i always see around 32mb so i dont know what i am doing wrong. I might just use compache by itself.