Related
a few months ago i read where a forum member had an adb command to set the internal cpu to 604 before he could flash certain roms.
His phone would freeze up at any overclock speeds over 604, so he figured out a way to adb some commands to set the clock speed lower or at 604.
appreciate any help. tried the search function and it seems to be missing some posts/threads?
Well,
You can set the max scaling frequency in an already running kernel thusly:
Code:
echo "604800" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Note the emphasis on "already running", though.
The thing is, instability as a result of overclocking is a hardware problem - and the kernel is just as susceptible to crashing because of hardware problems as any other software on the phone is. So, there's a bit of a chicken-and-egg problem - how would you turn down the max scaling frequency if the kernel has already crashed before it executes your request?
The answer depends on how the dev for the "ROM" set the defaults. If the defaults are "compiled in", you are screwed. OTOH, if the dev set the min/max scaling speeds in a similar fashion as above (using "write" commands in the init.rc and init.desirec.rc scripts to push values into the already-running kernel), then you have an option which is a little complicated:
unpack the boot image from the ROM, modify those boot scripts (look for places where writes to "scaling_max_freq" and "scaling_min_freq" occur) for a new (lowered) maximum frequency, and then repack the boot image and install that instead of the boot image that came with the ROM.
There is a very small chance that a phone at a certain clock speed is right on the "hairy edge", where it can run a small number of seconds, or until it warms up a bit, before it eventually crashes as a result of a hardware timing fault. If the ROM in question does something like an "import /system/etc/init.local.rc", then you could use a "write" statement in there to turn down the scaling_max_freq. This would allow you to "patch" the dev's ROM behavior (in /system) without going to the trouble of unpacking and repacking boot images - writing changes to /system/etc/init.local.rc could be done in an Amon_RA session (say for instance right after you flashed the dev ROM).
I'm skeptical that such "ragged edge" behavior is commonplace, though - if your phone is going to crash as a result of overclocking, it will usually happen almost instantly when the kernel boots - and you are back to the chicken-and-egg problem.
bftb0
q AND a v1.45 -The noob questions answered/how-to guide!
I've created this thread in the interest that “noobs” will find it and hopefully find the answers to their most often asked questions and perhaps to dispel myths that seem to crop up from time to time. My goal is to reduce the number repeated thread posts and concentrate these Q&A questions in quick and easy format.
In the event your answer isn't in here somewhere and you need to start a thread, please include your current ROM, Radio (by RUU number of origination), and kernel if you've flashed one that didn't come in the ROM. Summing it up in your sig makes it easy for people to see in any of your posts. (See my sig at the bottom of this post for an example.)
NOTICES:On the evening of 8/31/11 a bug was found to be causing force closes of the camera and Gtalk. The issue has to do with the camera and a solution has been discovered. This LINK contains "camera.zip" and can be flashed via CWM to resolve this issue.
Credit: mpwt51 on the Android Central Forums and Snow02 on the BAMF Forums
The ClockworkMod issues have been resolved in newer releases so I've removed the link.
Index:
1: Rooting your device.
2: What ROM is best for you?
3: Flashing a ROM
4: What radio will work with your ROM?
5: Flashing a radio
6: Flashing an RUU
7: Flashing a kernel
8: Facts about your battery and charging.
9: Titanium Backup-your friend and enemy.
10: Setting S-on/unrooting
11: Troubleshooting!
Useful references
Second Post: OC'ing and leak news
1: Rooting your device.
Rooting your device is not something that should be attempted because your buddy did it and you want to be cool like him. Every rooting guide or tool SHOULD state clearly that you're going to void your warranty and may also destroy your device in the process (a.k.a, “brick” it). Rooting an Android device is to attain superuser permissions to perform various administration level functions which have been deliberately locked out by the manufacturer to prevent you from stealing carrier services, removing software, and damaging the device. I would like to emphasize “damaging the device”.
If you're not rooted already, and you're aiming to, you're life has become easier. We used to do it though ADB, but jcase is endorsing Revolution, so I must deffer to him. For those interested in the "old fashioned" way, you may still find it HERE.
The old ADB method will still work on all firmwares for the Thunderbolt, but different exploit files are needed. Revolutionary is currently the preferred method and will work on all known Thunderbolt firmwares. And by ALL, I mean from the first engineering leak to the latest 2.11.605.3 Gingerbread OTA. This will remain the case for all future leaks, and if this changes, I shall note it accordingly here and indicate what new rooting method will work.
Please direct questions pertaining to the Revolution method to the thread in the development section. I've never used this method, so I'm not a good source of advice.
To stock root users:
I highly advise NOT staying with the stock ROM after rooting. That is a VERY old RUU. Verizon is pushing updates automatically which WILL render your phone fairly useless until you remove the update files. To avoid this, use a custom ROM. Ideally, you SHOULD move to RUU 1.70 ASAP as it resolves many connectivity, power usage. and functionality issues.
If for some strange reason antique firmware lights your fire and you're device has auto-updated to OTA 1.70 and entered something of a boot loop, THIS LINK has fixes for you.
2: What ROM is best for you?
You will never get more answers for any question than this question. What ROM is best for you is HIGHLY subjective and largely hinges on what you expect from your device. I'm going to ask, on behalf of all XDA members, that you DO NOT start a thread like "What ROM is best for me?" filled with requirements, presumptuously expecting an influx of polite and informative answers. Instead, please DO investigate things for yourself. Here's some helpful info to get you started down that path:
Sense ROMs: Sense ROMs are built from RUUs, either officially released or leaked. An RUU is the complete update file for a handset; including the bootloader, radio, and ROM. Currently, all Gingerbread Sense ROMs are based on leaked RUUs. Each RUU has a version number, for example 2.10.605.0. The higher the number, the newer it is. Newer is generally better. Devs will usually include the base RUU version number in their OP. I like to think of custom ROMs developed on a common base as a family of sorts. They're going to generally have some similarities. They can have major differences as well. Some things about them won't ever change though.
Sense ROMs come in many flavors; 2.1, 2.1/3.0 hybrid, 3.0. It's really hard to tell what you like until you play with some and get to know them.
AOPS ROMs: AOSP ROMs are not built from leaked or released RUUs. They are built upon code obtained through the Android Open Source Project and are custom built for the devices. HTC, and manufactures in general, don't support AOSP being developed for their device. As a result, AOSP devs basically have to figure it out for themselves which makes the ROMs much more experimental. These ROMs typically come out in 1 or more versions, usually identified by date of release if it's a final release version, or an RC (release candidate) version if it's still in beta testing. Think of the version number and RC/beta number like the RUU number of a Sense ROM. For instance, CM7.0.3 may have several release versions that are only very slightly different. Then you may have several CM7.1.0 Beta or RC candidates that may less stable, but being offered for real world use and user feed back. That's basically the picture for the dInc currently, not the Tbolt, so don't quote me. CM releases are generally going to all look and feel the same and carry the same group of features. OMFGB is going to be making a name for itself with different features and characteristics. You won't know which you like until you try them.
3: Flashing a ROM
There are 2 ways to flash a ROM, however I'm only going to explain one of them because the second method is not prefered by any dev I'm aware of. The method I'm describing is through ClockworkMod Recovery.
There will be instances where you will not need to wipe anything to update your ROM. Examples would be ROMs called “nightlies” and ROMs that are an evolution, such as CM7. Some ROMs will have a command in the updater script to wipe and/or format directories or partitions, so unless unpacking the ROM and editing the updater script sounds like fun, accept the fact it WILL wipe your device. BE SURE TO READ THE OP BEFORE FLASHING so you know whether it will wipe your device or not, whether you must manually wipe it, or if flashing over your current ROM is acceptable. IF wiping isn't desired or required, skip step 3.
Step 1: Download the ROM of your choice.
Step 2: Reboot into recovery. If this is your first ROM flash, remove the battery and re-insert it, then hold Vol-down while powering the device on. Do not release Vol-down until you see the white HTC screen. When the bootloader comes up, select “recovery”.
Step 3: Wipe user data/factory restore. This will be an option on the main menu of ClockworkMod Recovery (CWM). Confirm the wipe. It's also wise to also format /system. This can be found under "mounts and storage". Select /system and confirm the format.
Step 4: Wipe the dalvik cache. This is done by selecting “Advanced”, then “wipe dalvik cache”. Again, confirm this action to complete it.
Step 5: Flashing your ROM. On the main menu you will be selecting “install zip from sdcard”, then “choose zip on /sdcard”. You'll then see a directory tree of your SD card. Assuming you haven't moved your downloaded ROM, you'll find it in “download”. Select the ROM's zip file, confirm the flash, then sit back and wait. First boots on a new ROM are slow so be patient. The more you do this, the more comfortable you'll get with the whole process.
4: What radio will work with your ROM?
That's a pretty short answer... with some twists. If you're using ANY gingerbread Sense ROM, ANY "MR2" radio will work for you. If you're using Froyo, the answer gets a bit murky. If you're using AOSP, it gets even murkier. Allow me to explain....
Some Froyo builds based on older "MR1" bases have been ported to use newer "MR2" radios. Examples would be Eaton ROM, and BAMF 1.8.6. Some still use "MR1" radios, but they're slowly going extinct. Certain AOSP ROMs come in 2 versions, one for "MR1" radios, one for "MR2" radios. The bottom line is you MUST read the OP. Gingerbread Sense ROMs are the no-brainer. ALWAYS use "MR2" radios.
A note about "MR" designations: "MR(fill in the blank)" really doesn't mean jack. They are numbers made up on the fly to make things easy to describe. A much better way to describe the radio version would be by the RUU it came from using the first 3 numbers of the RUU, such as "2.10" for the 2.10.605.1 RUU radio. I WISH this was the standard method of designation, but it's not.
The following is the most complete list of Tbolt radios I'm aware of. RADIOS
This link is the CDMA and LTE radio packaged together: Adrynalyne's list
These are described THE RIGHT WAY, by the RUU of origination. Adrynalyn's list takes it one step further and describes "MR" version and release details. You will notice that there are actually 2 radios for each RUU number. This is because the radios have been parsed into individual CDMA and LTE radios. The common reference to "the radio" usually refers to the pair of radios from an RUU, so, in order to flash the "MR2" radio, you'd need to flash both the CDMA radio and the LTE radio. The advantage of this is you can mix and match radios depend on what works best for you, your area, and your device. For those not interested in the mix-n-match game, Adrynalyn's list packages the pair nice and neat for simple flashing.
That still leaves us with this whole "MR1/MR2/MRwhatever" quagmire of "what's it mean???" Short answer: MR1 radios are everything from RUU 1.68.605.3 and older, MR2 radios are anything from RUU 1.70.605.0 and newer.
5: Flashing a radio.
Flashing a radio is done much differently than a ROM or a kernel. Instead of using CWM, you'll be doing this through the bootloader. The Tbolt bootloader only recognizes files named PG05IMG. Accordingly, any radio you flash will need to be named PG05IMG.zip. The radio you need will almost always be indicated on the thread for the ROM you're using. If you flash the ROM without the proper radio, you will NOT have any wireless functionality at all. DO NOT PANIC. Flashing back to a compatible ROM will restore functionality, as will updating the radio to the proper version.
Edit: If you're using the radios from the listing provided above, you'll need to do this operation TWICE, once with the CDMA, once with the LTE radio, to have a complete version of a radio. Adrynalyn's radios are complete pairs.
From here you have 2 options. 1) Follow the guide provided in the radio listing, or 2) follow this guide. Option 1 is done through ADB. Option 2 is done solely on the device.
1: Download the required radio(s).
2: Renaming it PG05IMG.zip and placing it on the root of your SD card.
3: CHECK THE MD5 SUM.*
4: Reboot into the bootloader
5: Select “bootloader”
6: The bootloader will automatically search for the update, then it will ask you if you wish to update. Vol-up approves the update, Vol-down declines it. You want to Vol-up to update it.
7: It will unpack and update the radios (or radio, if you're using the singles from the listing), then tell you to push “power” to reboot.
8: After rebooting, remember to remove or rename the radio so that if you need to hard boot into recovery, the bootloader won't find that file and attempt to update it instead of allowing you to move on to CWR.
*Flashing a bad radio can brick your device so it's important to check that MD5. I recommend only using radios from sources that provide MD5 sums for you to verify against. You can use an app from the market to check it, or you may do it through terminal emulator, assuming you have busybox. (Virtually all custom ROMs do, but stock/rooted ROMs don't.) The usual location of busybox is /system/xbin or /system/bin. Sometimes it's found at /local/data. Assuming it's at /system/xbin, your command will look like “/system/xbin/busybox md5sum /sdcard/pg05img.zip”. After a moment, the MD5 for the file will appear and you can compare it to the posted MD5. Assuming they match, happy flashing! If they don't match, delete the file and re-download.
Note about radio file management: It can be a major inconvenience to leave a pg05img.zip file on the root of your SDcard if you need to boot into recovery.... like, it won't be happening. This is what I, and many others, do to manage multiple radio files on our devices.
Rename them instead of deleting them. For instance, you just flashed the 2.10 CDMA radio, so now you've got this pg05img.zip file on your SDcard root. I would rename it something like "2.10_cdma_pg05img.zip" through a file browser as soon as the phone booted back up. Your hboot will ONLY look for files named "pg05img", not simply files with that in the name. What you'll eventually end up with is a quick and easy to understand listing of all your radios, pre-MD5 checked, ready to rename and flash at the drop of a hat. Renaming a file does NOT change it's MD5.
6: Flashing an RUU.
I put this right after flashing a radio because the process is exactly the same. So is the need to check the MD5. An RUU will replace your radio, bootloader, and ROM so don't flash an RUU unless you know exactly what you're doing. In general, you should never need to do this unless you want to return to a completely stock device with S-Off. RUU's are UNMODIFIED firmware that ROMs are built on.
7: Flashing a kernel
Flashing a kernel is done exactly the same as flashing a ROM. In short, you're flashing a new boot image; either provided or created on the fly. The kernel is the guts of Android that interfaces software with hardware and can bring many advantages or disadvantages to the table, depending upon the software and hardware in question. Kernels for HTC devices come in 3 basic flavors: AOSP, Gingerbread with Sense, and Froyo with Sense. These are pretty obvious characteristics of a ROM and determining the kernel you need should be easy. That information can be found on your phone and on the ROM OP. Not all kernels are presently represented on XDA and at this time I will not be providing links to other sources. Let Google be your friend!
8: Facts about your battery
Your HTC contains a variation of lithium-ion technology known as a lithium polymer battery. These are relatively long life batteries which are very resistant to “memory” effects and fluctuations in output voltage. They are the closest thing to ideal that technology provides at this point in time. There's much speculation and rumor floating about these interwebs concerning how they function and how they should be treated. Many of them are imaginative and WRONG. So, here's the real dirt.
First, the BAD things to do with a Li-on battery:
*Keeping it fully charged all the time or storing it longer than a week or so fully charged.
*Shorting it out.
*Storing it for extended periods in a completely discharged state.
*Getting it wet.
*Attempting to overcharge the battery.
*Attempting to overdischarge the battery
Here's why: These batteries can explode gloriously if contaminated with water. Shorting them out generates temperatures that can damage them and cause them to explode. Overcharging can do the same thing as shorting them out. Overdischarging them can permanently alter the components of the cells and render them garbage in very short order.
Next, the GOOD things to do with a Li-on battery:
*Charge the battery and use it.
*Keep it dry, just like the rest of the phone
*If you use multiple batteries, rotate through them so no particular battery is left stored fully charged for an extended period.
*Recharge completely dead batteries as soon as possible as this state my be the most destructive way to keep a battery in. Better yet, if you use multiple batteries, switch them out before it's completely dead.
*Allow the phone or charger to charge the battery as it's designed to. Don't use modified kernels that attempt to trickle charge it. Don't waste your time “bump charging” it.
*Avoid consistently running your battery flat dead.
*If storing your battery for extended periods, run it down to approximately 35% before storing. This is the IDEAL storage charge state.
Here's the why: Li-on batteries have do not exhibit “charging memory” like old Ni-Cad batteries did. The use in running full charge in discharge cycles occasionally is strictly for the benefit of the phone's battery stats. Charging a the battery excites lithium compounds which in turn retain electrons in the shells of the lithium atom. This is due to lithium's volatility and is why it will react violently to moisture and can melt your skin off. Left fully discharged, those compounds are keen to create bonds that fill the void of left by the electrons that powered your device. Left fully charged, the compounds that retain the electrons that power your device can break down under the electron load. Eventually, both of these conditions take place and what's what ultimately ends your battery's useful life, but that degradation can be avoided with proper use. A charge of roughly 35% for long term storage is the optimum to avoid either of those conditions, and a cell in that state can be stored for years without appreciable degradation.
The three most power-hungry devices in your Tbolt are the screen, LTE radio, and CDMA radio, generally in that order. Memory use, as some might suggest, is NOT a significant drain on your battery, and therefore should be used as fully as possible to reduce the use of your forth largest consumer of power, the CPU. Task killers are a waste of time, space, and resources on your phone and have no legitimate use. They are the life support system for poorly designed apps that should have been aborted before birth. Practice software eugenics; keep only the best and most useful apps, delete the apps that abuse your system resources and connectivity. (Your phone doesn't really make convincing fart sounds anyways...)
9: Titanuim Backup-your friend and enemy
Perhaps you've wondered how you might backup all your odds and ends between ROM flashes? Well, the app you're looking for is called Titanium Backup. It comes in two flavors; free and premium. Free is all you really need. What this app will let you do is make full backups of your user app and data, and system apps and data. Sounds pretty groovy, huh? Now you can pick up on your Angry Birds right where you left off, ROM after ROM (Don't lie... we all play it, but don't always admit it.) Hold it right there...
This app is probably more advanced than your average joe needs it to be, and that can get you into trouble. And it's not perfect either.
Generally, all user apps and data can be restored across OS's and platforms. When I moved from my dInc to my Tbolt, it was a breeze. Just had to shuffle a couple files from one SDcard to another and you're back in business. Where people run into issues with Titanium Backup is when they attempt to do a FULL restore. That includes system apps and data that are rarely the same and often not compatible from one ROM build to the next. If you're lucky you only end up with dead apps. If you're not lucky, you get to reflash your ROM and start from scratch. So, here's a few pointers to help avoid complications with Titanium Backup...
*Only use a batch restore operation on USER apps and data. NOT system data.
*Many say NEVER restore app or system data, however, they are wrong. Some system data is restorable, but I suggest manually going down the list and restoring rather than attempting a batch operation restore. The following is system data I KNOW to be stable..
-[User dict] and [user dict htc]. There are 2 keyboard/dictionary system data files that will snap back your dictionary as well as your keyboard settings.
-Bluetooth pairings. This USUALLY works, but not always.
-WiFi hotspots. This will help avoid having to re-enter secured hotspot keys and trusted hotspots to automatically log onto.
-Internet/bookmarks. This will snap your bookmarks back.
-Wallpaper/settings Gingerbread. This SHOULD work... I've never had problems with it.
*It's it's REAL important, make 2 backups of it. Titanium Backup is nice, but it lacks any kind of QoS and does junk out a backup from time to time.
*Backup your SDcard elsewhere from time to time. It's not exactly unheard of in these days of ultra-low voltage and clock settings to corrupt an SDcard. If that's the only place you're data exists, that will be the LAST place your data existed.
Generally, if it's in Red, don't mess with it. If it's white, it SHOULD work, but there's no promise. Some versions of Wireless Tether, for instance, don't restore well from one ROM to another. Green items are system settings and are mostly good to go, but some make assumptions concerning the ROM that might not be true, such as the nature of the framework. Restore with caution. There are many help threads in Q&A regarding Titanium Backup. Please search those before posting. The problems with Ti-Backup have been few and fully explored and explained.
10: Setting S-on/Unrooting
Since there are 2 methods for setting S-Off/rooting your device, there are 2 methods to set S-On and unrooting.
If you used Revolution, follow THIS link.
If you used the jcase ADB method, follow THIS link.
11: Troubleshooting!
As was pointed out to me, there are problems that crop up that seem unexplained to the noob, and even some senior members, so I've decided to add SECTION 10: Troubleshooting!.
1: "EEK! GADS!!! I flashed my first ROM and I have NO SERVICE!!!" Step one: remember the Hitchhiker's Guide to the Galaxy and "Don't panic". Your problem lies with the fact your stock radio doesn't work with your new ROM. Your fix will be to go up to Section 4, follow one of the links provided, then follow instructions provided in Section 5.
2: "My phone keeps trying to update every time I boot into the bootloader!!! This HAS TO be VERY BAD!!!" No... it's actually good because it means your phone is doing exactly what it's supposed to do. Computers have this uncanny will to do EXACTLY what they're told... And what you've told it, unwittingly, is that there's a new update for it. In other words, you've probably left a file on the root of your SDcard called "pg05img.zip". If you're phone still works, just go into your file explorer of choice and delete it or rename the file to ANYTHING except pg05img.zip. If your phone has gone kattywhampus (yes, that is MY technical term), then you'll be forced to remove the file be installing your SDcard in another device or SDcard adapter and deleting it using another device or computer.
3: "My phone boots, but there's NOTHING but a background and it doesn't respond to any hard or soft buttons! Did you just flash a kernel??? If so, what kind? Kernels come in 4 basic stripes and types; Froyo and Gingerbread, Sense and AOSP. Your fixes at this point are A) restore from your last nandroid backup, or B) find the correctly corresponding kernel type for your ROM and flash that just as you would any other kernel. Make sure to wipe dalvik when you do.
4: "I've flashed like 4 ROMs in a row and I'm still having Force Closes on the system process/reboots! Is it bricked?" No, my friend, you're phone is just fine. There's most likely just garbage left in /system which is usually not formatted in a "factory restore/wipe user data". The assumption is that the new ROM will completely overwrite /system, but that isn't always the case. Easy fix: do a manual /system format, then reflash the ROM. You may have heard some myth about wipe 3 times... I call it a myth because it IS a myth. Your phone and SDcard use NAND memory, not magnetic media like a platter or cassette tape. For an excellent explanation why multiple wipes is a waste of your time and useless, read THIS.
5: "help i'm a noob rooted with revoltion clockwork none apps need root won't work help!" This is NOT a question. It's not even a sentence. PLEASE form sentences and questions with words, not mindless run-ons that require the assistance of the Psychic Friends Network to decode. We want to help, so please do the following:
*Use complete sentences and terms. (You did NOT root with Revoltionary, it doesn't do that. It turns S-Off."
*Don't DEMAND answers or demand credentials of the answer giver.
*Provide basic info: ROM, radio, kernel, other software or hardware at play.
Doing this will get you answers much faster.
6: "Hells bells, Margret! I didn't know I shouldn't take an OTA while rooted!" Don't worry, you're not the first and won't be the last. The following are a few sets of instructions that will fix you right up.
Method 1: (thanks to sonicbuffalo for posting this method)
1) Once you are in ClockWorkMod Recovery, scroll down to "Wipe cache partition".
2) Select "Wipe cache partition" using the home key or power button.
3) Now, scroll down to "Yes - wipe cache".
4) Press the home key or power button to perform the wipe.
5) When done, restart your phone.
6) Your ThunderBolt will boot into the Android operating system and will say that the UPDATE FAILED.
7) Choose Cancel to stop the update.
8) Restart your phone one last time and you'll see that the "Powering Off" loop is gone.
Method 2: This will delete your data
1) Once you are in ClockworkMod Recovery, select "wipe data/factory reset" using volume keys.
2) Press home key or power button to select.
3) Answer Yes, by scrolling with vol keys and home or power key to select.
4) When phone reboots, the powering off loop should be gone.
Method 3: This only works if you have a Nandroid Backup from prior to accepting the update.
1) Once in clockwork select "backup and restore" using vol keys.
2) Select using the home key or power button
3) From next menu select "restore"
4) Choose your backup from list and select.
5) Answer yes to restore backup
6) When phone reboots the "powering off" loop is gone.
Method 4: This is a last ditch effort if all other methods fail.
1) Download the Leaked Rooted Update from HERE.
2) Following instructions in THIS post load the rooted leak.
3) When your phone reboots, the powering off loop should be gone and you should be running the latest software and still rooted.
Useful references:
The Official Thunderbolt ROM & kernel Listing v3.0
The Thunderbolt Root User's Dictionary v1.0.1
You're battery may be lying to you...
If by some miracle my mindless, ill-constructed ramblings have helped you, slap that thanks button! Feel free to PM me with any questions or for clarity on anything covered here.
Credits and thanks:
Gu1dry: for his itemized radio thread.
Adrynalyne: for his HIGHLY organized and descriptive radio thread
MattBeyers: for his Root User's Dictionary
DemoManMLS: for Official Thunderbolt ROMs and Kernels listing (retired)
MyComputerDoctor: for continuing to maintain the R&K listing in the stead of DemoManMLS
Byrong: for his spiffy battery info thread.
jcase: for his ADB rooting guide.
OC'ing (update 10/22/11)
For the slightly more advanced noob I present.....
Intro to overclocking!
What is overclocking?
Overclocking is making your CPU/system work at faster clock rates than it was designed/rated for.
How do I overclock?
Glad ya asked! But before I go into the how, I'd like to point out the dangers and why it's beneficial.
Dangers:
The risks involved in OC'ing are probably greater than rooting your device. The worst thing you can do is fry your phone. You might also render your ROM/kernel useless junk on your device that you might need to wipe and restore/reflash. You can also corrupt your SDcard. In the long term, it's possible to reduce your device's lifespan because of the extra heat, which, if high enough, can chemically alter the silicon the transistor gates are made of, thus destroying them. Higher voltages can also induce electron tunneling, a quantum mechanical effect where electrons "tunnel" through the silicon from one circuit trace to another. This can be highly damaging.
Benefits:
The benefits of OC'ing are a significantly faster device. I conjunction with an appropriate governor, you can actually save power while improving performance.
Now, the "how-to":
There are several valuable apps I recommend to add to your OC'ing arsenal. The most popular is SetCPU, which can be obtained for free by XDA members at THIS thread. Instructions for it's use are included in the app as well as the thread. This is a good app to start with for messing around with settings. It will also allow you to select governors and enter governor parameters.
Incredicontrol is another useful tool you'll be interested in. It allows you to alter voltage settings for each clock step.
CPUspy is a very nice little app that provide you with time-in-state readings for every clock step. This will become useful if you're adjusting your governor. It will make evaluating your adjustments fast and easy.
Finally, ScriptFusion by TwistedUmbrella is an excellent long term solution to implementing clock and voltage tweaks. It's a good idea to get that and use it once you know what settings will work.
I can't really give you a step 1, step 2, step 3 guide to this. It's just impossible because every device is different. Instead, I'll try to lay out some method, theory, and reason.
The theory is to push your CPU to run as close to it's limitations as possible before it becomes unstable. Due to the nature of SoC's (system on chip), there are several major components to consider. The core, which executes applications, as well as the GPU, are the most robust components. The least robust are memory, such as caches, and are the first to suffer the effects of overclocking. Be SURE to do a nandroid backup before tweaking settings!!!
The method I tend to use is to first feel out what the CPU is capable of handling at some conservative voltages. Generally, kernel devs set their voltages conservatively because they don't feel like dealing with the heat that comes from some nutjob frying their toy. SetCPU is a good tool for this because you can adjust settings and not have them implemented at boot so if you do crash your device, it will reboot back to stock clock limits. Most devices will be stable at 1.5 GHz at around 1325mv because the S2 Snapdragon is fabbed at the same 45nm scale as the MSM8660 dual-core S3 that powers the EVO 3D at 1.5GHz. If your device isn't stable at this speed, it's quite likely that your CPU isn't a good candidate for OC'ing and only modest increases should be expected.
So, at this point you should use SetCPU to push your clock frequency up until you're either happy with it or it becomes unstable. Don't be afraid of it becoming unstable, it's probably going to happen eventually. All it means is you've found your CPU's limits at that voltage. Your phone will reboot to stock, assuming you did NOT check "apply at boot", and you're back at square one. No harm, no foul.
At this point I recommend installing Incredicontrol or getting comfy with your terminal emulator or ADB shell. Through Incredicontrol, terminal, or ADB, take a look at your voltage table. Incredicontrol provides a nice GUI and is self-explanatory. To view your voltages through ADB shell or terminal, enter the following command:
cat /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
Memorize, screen capture, or write these settings down for reference. We KNOW these voltages to be stable up to a point and serve as a good baseline. Most kernels have a maximum voltage they will allow. Modern Ziggy kernels are 1400mv.
For sake of explanation, we'll say your device goes unstable at 1.49GHz at 1250mv on the stock voltage table. At this point, push the voltage up by 25mv for that frequency to 1275. Then, try your 1.49GHz setting again. You can either run a benchmark stress test, use the stress test in SetCPU, or use the device as normal to verify if the new voltage setting is stable. Hopefully it is. If so, increasing the voltages above that frequency by 25mv may make them stable as well. It doesn't sound like a lot, but 25mv does make a difference. Eventually, you'll find a point where too much voltage makes the device unstable, and too little is unstable as well. That's about the point where you're risking damage to your device and I suggest backing down the frequency by about 100MHz and calling that your safe maximum.
Now, for the other end of the frequency specturm...
You have a maximum AND a minimum. Most often, the frequency and voltages for the minimum are set for stability, not power saving. Some kernels will run as low as 22MHz. Some functions, such as playing media with the screen off, will not function well at such slow speeds. Usually 122MHz will perform well. After finding the lowest frequency that works for you, try to adjust the voltages down as low as possible. Since your phone spends most of it's time down around these frequencies, modest, but real power savings can be realized.
We've found the safe settings! Now what???
Well, you can do things the easy way and just set SetCPU and Incredicontrol to enforce your settings on boot, but now you've got 2 apps that are constantly running and taking up resources, especially SetCPU. There is a better way. That's where ScriptFusion comes into play. ScriptFusion is basically a script that creates a script in the /system/etc/init.d directory where boot executed scripts reside. This method doesn't use any system resources beyond those already used to establish these settings. ScriptFusion is easy to use, but it's settings execute at boot, therefore, any mistakes cannot be easy fixed if they make the system unstable. That's why I suggest using it as a method of implementing final changes, not feeling out where your points of stability are.
Still another way is to write your own script. Simple Linux commands in a properly formatted text file get the job done. Many resources can be found to show you how to write these kinds of scripts. It's also possible to copy a script already on your device, modify it, and push it back to the device using the "adb push" command.
Using a script:
The following is the actual script I use with the setup described in my signature. It began with a speedtweak.sh script that I pulled and edited over time to suite my desires.
Code:
#!/system/bin/sh
# Mode: extreme
#built for Imoseyon TEST kernels and branches. contact [email protected] with questions.
sysfile="/sys/devices/system/cpu/cpu0/cpufreq/vdd_levels"
echo "184320 750" > $sysfile
echo "245760 825" > $sysfile
echo "368640 900" > $sysfile
echo "768000 1000" > $sysfile
echo "1024000 1100" > $sysfile
echo "1222400 1125" > $sysfile
echo "1408000 1175" > $sysfile
echo "1593600 1375" > $sysfile
echo "1766400 1375" > $sysfile
echo 184320 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1593600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 60 > /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load
echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/smartass/min_cpu_load
echo 184320 > /sys/devices/system/cpu/cpu0/cpufreq/smartass/awake_ideal_freq
echo 184320 > /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_ideal_freq
echo 1593600 > /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_wakeup_freq
#echo 610000 > /sys/devices/system/cpu/cpu0/cpufreq/smartass/up_min_freq
echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/smartass/ramp_up_step
echo 250000 > /sys/devices/system/cpu/cpu0/cpufreq/smartass/ramp_down_step
echo 6 > sys/devices/system/cpu/cpu0/cpufreq/smartass/sample_rate_jiffies
echo 50 > /proc/sys/vm/swappiness
echo cfq > /sys/block/mmcblk0/queue/scheduler
echo 40 > /proc/sys/vm/vfs_cache_pressure
echo "100,200,352,640,2570,5120" > /sys/module/lowmemorykiller/parameters/minfree
echo "0,1,2,11,12,13" > /sys/module/lowmemorykiller/parameters/adj
echo 30 > /proc/sys/vm/dirty_ratio
echo 35 > /proc/sys/vm/dirty_background_ratio
echo 5000 > /proc/sys/vm/dirty_expire_centisecs
echo 1 > /proc/sys/vm/oom_kill_allocating_task
echo 0 > /proc/sys/vm/oom_dump_tasks
echo 1 > /proc/sys/kernel/sched_compat_yield
echo 250 > /sys/block/mmcblk0/queue/iosched/read_expire
echo 1200 > /sys/block/mmcblk0/queue/iosched/write_expire
echo 1024 > /sys/block/mmcblk0/queue/read_ahead_kb
#echo "100,200,20000,20000,20000,25000" > /sys/module/lowmemorykiller/parameters/minfree
Everything all the way down to [echo "1408000 1175" > $sysfile] as well as the freq_min and freq_max is generated by the script. Imoseyon's speedtweak.sh doesn't have a quick setting for running at 1.6GHz, so the settings for 1600000KHz were added by me. The parameters with "smartass" in them are there to modify the behavior of the governor. The echo lines going to /proc/sys/vm/* modify RAM and virtual memory use. The lines echoing commands to /sys/* modify memory use and other behaviors. The lines beginning with "#" are ignored.
You've got 2 options, write the script from scratch using an appropriate editor, or modify one already on the device. Why invent the wheel if you don't have to? Let's modify! Here's one method to do it:
1) Connect your Tbolt to your computer with debugging checked and in "charge only" mode.
2) Navigate to your ADB directory in a command prompt window as usual, then enter "adb pull /system/etc/init.d/01vdd_levels", without the quotes.
3) You'll notice a new file in your ADB directory called.... 01vdd_levels! Lets open it with a suitable editor. I use Vim because it's made for Linux and this purpose. Easier ways exist.
4) From here you can make the edits you want to. Change a voltage, set your min or max freq, or adjust one of the many parameters of the governor you've chosen. A list of parameters for the active governor can be found using the following command: "ls /sys/devices/system/cpu/cpu0/cpufreq/(name of governor)" This doesn't work on non-active governors. "echo" commands set a parameter, followed by the parameter value, followed by the parameter location.
5) Once you've edited or created the parameters you want to run in the script, save it.
6) Go back to ADB. Enter "adb remount" to make /system writable. Enter "adb push 01vdd_levels /system/etc/init.d" to push the new file. It will automatically copy over the old file.
7) Now we have to set it's permissions. Enter "adb shell". That will take you to the command shell. Then enter "chmod 777 /system/etc/init.d/01vdd_levels". This permission level is higher than what it needs to be, but it will get the job done.
8) Reboot by exiting out of adb shell. Enter "exit" in the shell until you're back at the DOS prompt. Then enter "adb reboot". Your device will reboot a moment later and all your script setting SHOULD be in place if you've done it right. You can check to see if that's the case using the "cat" command. An example would be:
cat /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load
The result of that command should reflect the value you've entered in the script.
Another way of editing an already existent script: Our friend, Script Editor!
* You might need to modify file permissions to edit a stock file. In terminal: chmod 777 /system/etc/init.d/name_of_file
1: Go to the market and install Script Editor.
2: Navigate to /system/etc/init.d/01vdd_levels and select it.
3: You'll get a window with all kinds of spiffy options. We want to edit. If you have a text editor or a file manager with and editor, it will ask you to select one.
4: Edit your script. Double check your values. Then save it.
5: At the file menu you saw before, select "Run". You'll get a terminal screen as the script runs. Once it's finished, exit out with the button at the top left. You're all done!
The reason for editing the script the way I've done, by adding in parameters for the governor, is to better manage how the governor performs. Some simply cut the balls of their device by setting clock settings low to save power. No need for that if your chosen governor is behaving the way you want. I find the settings I have for smartass keep spikes up to full clock speed to a minimum and saves even more power than just castrating the device because it's CHOOSING to run at slower freqs, not artificially limited to them. Therefore, under more modest loads, it's going to use more modest settings, not the max possible, even if it's a low max. Properly tweaked, you're device may rarely exceed factory clock speeds, but if need be, summoning 1.6GHz is possible. Obviously this method is more efficient than castrating your device.
If you're prone to using different governors, or you like to change you freq_min or freq_max settings, you may add additional data to the script with no ill effects. For instance, if I change to the interactiveX governor, I can simply add in more lines to alter that governor without removing the lines for the smartass. The parameters for the smartass simply won't be implemented because the path becomes invalid.
This is the leanest method of implementing kernel settings, and the most powerful. This script by no means is the limit to what you can do. What a script is able to do depends on the kernel features you're applying it to. It's possible with some kernels to alternate between governors based on conditions of the device. For me, this script gets the job done and that's all I care about.
A valuable note on scripts: There's an app called Script Manager that does an excellent job helping to manage, edit, and create scripts. With this app, it's possible to edit a script, save it, and execute it. It will also allow you to execute scripts on boot that aren't in /system/etc/init.d. If you're attempting to edit a script in the /system directory and it warns you that it's read-only, back out of the file edit functions, hit "menu", then "more", then "advanced options", and select "mount /system as RW" If scripts are your thing, this is a very handy app to have.
"Geeze Loonatik! What's all that crap mean???"
Good question. There's a lot of numbers in there that don't seem to have an obvious value. It took me a while to look if up and get decent answers, and I still haven't figured it all about, but let me share what I know.
/lowmemorykiller values: These values are pages. There are 6 of them that dictate the minimum number of pages (4kb in size) allowed free before processes are killed in that catagory. More on this can be read HERE. Additional info can be found HERE.
/proc values: These values dictate virtual memory and RAM use and behavior. There's actually a lot of them, but most aren't going to do much, and some don't even apply to Android devices, but are there because it's Linux. THIS link does a very good job documenting them.
/smartass/sample_rate_jiffies: A "jiffy" is a time value based upon a number of clock cycles. The number of clock cycles is fixed, but not always the same for every implementation.
/sys/block/mmcblk0/queue: These parameters are pretty straight forward. Time is measured in milliseconds and size in kb. Before you look at these and say "Hell! I'll just set it to read a MB at a time ahead and IO reads and writes to expire in 150ms", consider the fact that will become the top priority of your device. It's entirely possible to create lag by setting IO operations to such high performance that will be pretty much all your phone wants to do. My settings are actually pretty extreme, but they work for how I generally use the phone.
I'll try to explain more as I have the time and learn more.
Credit: Androcheck, Pikachu01, Linuxinsight.com
I hope someone finds this useful. If anyone has any input or suggestions, feel free to toss them out there.
Very useful. Keep this updated please.
Stickied.
You may want to mention in OP that if using TitaniumBackup between roms that users shouldn't restore system apps or data (red in TiBu). While it may RARELY be compatible, it causes more problems than it is worth. It appears users don't understand that wiping data/cache and then restoring all your data back with TiBu is counter productive.
White=good
Green=generally ok but still easily causes problems in some circumstances
Red=NO
While this is not specific to Tbolt at all...It may still be useful at least to help with understanding.
Another scenario that happens TOO often (and usually gets a new thread started each time it's asked)...
User's leaving the PG05IMG.zip file on their sdcard, ROM bootloops from something they did, and the user subsequently freaking out because they have no idea how to get their phone to work again.
I know you made sure to mention removing the file in step 5 of Flashing a Radio but others may not flash according to your steps and/or flash something else other than a radio that didn't mention removing the file afterwards.
Absolute_Zero said:
Another scenario that happens TOO often (and usually gets a new thread started each time it's asked)...
User's leaving the PG05IMG.zip file on their sdcard, ROM bootloops from something they did, and the user subsequently freaking out because they have no idea how to get their phone to work again.
I know you made sure to mention removing the file in step 5 of Flashing a Radio but others may not flash according to your steps and/or flash something else other than a radio that didn't mention removing the file afterwards.
Click to expand...
Click to collapse
I hear ya.... I'm trying to figure out how I want to restructure some of the thread so information like that isn't repeated numerous times and isn't buried in a how-to.
market forse closes..
hey guys, i rooted my thunderbolt and now the app market is always randomly popping up and saying it needs to force close.... if i clear cache and data, uninstall updates its works for a minute and can get into it, but as soon as i switch to another app it wont let me back in, and then its starts randomly popping up again.... heres the vid i followed to root, if it helps..... http://www.youtube.com/watch?v=yQYoeFrJ1Jk&feature=related thanks!
RUU Question
First post! Somewhat of a noob here, but an enthusiast none the less. The leaked RUU posted yesterday is in .exe format, so should I zip it up and rename it? or just rename it to PG05IMG.zip? Don't want to brick this bad boy. Thanks in advance.
jc-cshmny said:
First post! Somewhat of a noob here, but an enthusiast none the less. The leaked RUU posted yesterday is in .exe format, so should I zip it up and rename it? or just rename it to PG05IMG.zip? Don't want to brick this bad boy. Thanks in advance.
Click to expand...
Click to collapse
hmmm.... Not sure. Let me look into that.
edit: It's already been done for you. Here you go! LINK
Thanks. Gonna give it a go now.
I have a couple questions and just a little background.
1) I was an Evo user until 3 days ago when my phone got stolen. So, it was cheaper for me to cancel my sprint contract and get a new phone vs. buying another evo outright (buying off ebay wasn't really an option because I didn't trust the ESN would truly be clean). Ended up going to verizon and hopped on my fam's plan, which got grandfathered in on the unlimited data.
2) Thunderbolt seems a bit different from the evo (rooting is so much easier on the evo). Anyways - the root thread says something about NOT to use the root method below (which seems to be the typical older, adb, etc way to do it). Which one is the way to go?
3) What's with all the talk of bricking the device? Is this something that happens on the Tb from trying to root it.....flash roms....etc? Very few if any actually truly bricked their evo. Bootloops and whatever - but that's just needing to change something usually
4) Voiding the warranty - not really - can't you just unroot?
MedSchool26 said:
I have a couple questions and just a little background.
1) I was an Evo user until 3 days ago when my phone got stolen. So, it was cheaper for me to cancel my sprint contract and get a new phone vs. buying another evo outright (buying off ebay wasn't really an option because I didn't trust the ESN would truly be clean). Ended up going to verizon and hopped on my fam's plan, which got grandfathered in on the unlimited data.
2) Thunderbolt seems a bit different from the evo (rooting is so much easier on the evo). Anyways - the root thread says something about NOT to use the root method below (which seems to be the typical older, adb, etc way to do it). Which one is the way to go?
3) What's with all the talk of bricking the device? Is this something that happens on the Tb from trying to root it.....flash roms....etc? Very few if any actually truly bricked their evo. Bootloops and whatever - but that's just needing to change something usually
4) Voiding the warranty - not really - can't you just unroot?
Click to expand...
Click to collapse
ok... let me go point by point.
1) Groovy on the unlimited data. I'd die without it!
2) jcase is THE man on this subject. If he says go Revolution/AphaRevX, that's how it should be done. If he didn't have full confidence in it, he wouldn't endorse it.
3) All that jazz about bricking devices has largely faded. The problem isn't so much with rooting, radios, roms, or bootloader, but rather suspect parts that were used in certain older Tbolts. If your Tbolt is remotely modern, it should be just fine.
4) Yes, you can unroot. The dev forum has a guide or two on how to go about doing that. But, if you ask me, and my rooted Tbolt just got bricked or smashed or abducted by greys.... I'm going the way of insurance, and I'm telling them the greys took it. But that's just me.
hey i have the CyanogenMod 7. Im having trouble with it! I just put the rom on there and dl gapps. Now im trying to work the radio because it wont let me log into my gmail account. Can you please tell me what radio i need for the cyan 7 rom please!! i would appreciated all the help and will give you a thanks for your meter!~
patelhj1 said:
hey i have the CyanogenMod 7. Im having trouble with it! I just put the rom on there and dl gapps. Now im trying to work the radio because it wont let me log into my gmail account. Can you please tell me what radio i need for the cyan 7 rom please!! i would appreciated all the help and will give you a thanks for your meter!~
Click to expand...
Click to collapse
The radio you need will depend on which version of CM7 you flashed.
The OP in the CM7 thread always indicates which radio to use for which build. They are mentioned as MR1 or MR2/MR2.5.
Starting with RC1.4 (iirc) it requires MR2/MR2.5.
For CM7RC1.4-present: MR2, MR2.5, OTA MR2, 2.01.605.0 leak, 2.07.605.0 leak, 2.10.605.1 leak, 2.11.605.0 leak, and some others in there somewhere (some prefer OTA MR2 and some prefer the newer GB leaks but which one will work the best for you is subjective).
Individual LTE and CDMA Radios: http://forum.xda-developers.com/showthread.php?t=1048128
OTA MR2: http://forum.xda-developers.com/showthread.php?t=1160346
Others: http://goo.gl/S8EKK
For more, do some looking in the dev sections here or @ rootzwiki. They're easy to find.
okay so i think i am understanding it better.. just to let u know what installed was from
RC1.6.1 FOR MR2/MR2.5 RADIOS Uploaded 8/15 1:20AM
md5sum 240a9eb48a5faad38003d328d10d5237
and Goo-inside Gapps
So what radio do i use? and where can i dl it? im sorry for these annoying amateur questions but we all need to start somwhere.. and i am doing a lot of research as well! just easier if i can get direct answer
patelhj1 said:
okay so i think i am understanding it better.. just to let u know what installed was from
RC1.6.1 FOR MR2/MR2.5 RADIOS Uploaded 8/15 1:20AM
md5sum 240a9eb48a5faad38003d328d10d5237
and Goo-inside Gapps
So what radio do i use? and where can i dl it? im sorry for these annoying amateur questions but we all need to start somwhere.. and i am doing a lot of research as well! just easier if i can get direct answer
Click to expand...
Click to collapse
See where it says rc 1.6.1 then mr2/2.5 it is telling you that you can use one of those radios just search forums and you will easily find them
Sent from my VS910 4G using xda premium
Beamer9408 said:
See where it says rc 1.6.1 then mr2/2.5 it is telling you that you can use one of those radios just search forums and you will easily find them
Sent from my VS910 4G using xda premium
Click to expand...
Click to collapse
Yep... MR2 Radios is what it's calling for. I have links to two good radio listings in my OP in Section 4. I'd suggest the Adynalyne thread. One file to flash for both radios.
You might want to cover about the VZW OTA update (options to stop it) since it looks like there are questions about it daily.
Absolute_Zero said:
You might want to cover about the VZW OTA update (options to stop it) since it looks like there are questions about it daily.
Click to expand...
Click to collapse
Yeah.... I think you're right. I'll have to look into it.
noob here- i have tried to plug my phone in my comp. its asking for the ADB drive to see my phone..... i have tried multiple downloads of diff suppose to be sites for the ADB wondering if you would have one for the HTC Thunderbolt
GEEWIZ 3.4 SCH-I500 JZO54K JELLY BEAN 4.1.2 ROM/KERNEL
RETIRED -- GEEWIZ 3.4 WAS THE FINAL RELEASE OF GEEWIZ BASED ON ANDROID 4.1
OTHER AVAILABLE GEEWIZ VERSIONS:
GeeWiz 4 - AOSP Jelly Bean 4.2: http://forum.xda-developers.com/showthread.php?t=2088224
GeeWiz 3.4 is a ROM for the Samsung Fascinate, based on AOSP Jelly Bean 4.1. Like it's predecessors of the same name, GeeWiz doesn't aim to provide a lot of bells and whistles or incorporate all of the latest and greatest tweaks and enhancements developed by the community; the aim is to provide a basic, stable, functional device.
GeeWiz 3.4 uses a modified version of the GeeWiz 2.8 Gingerbread (Linux 2.6) kernel with a number of very specific tweaks/hacks in order to continue to support the proprietary Samsung RFS file system and other features I wanted to carry over. As a result, this ROM may not be used in conjunction with any other Kernel, and this Kernel cannot be used in conjunction with any other ROM. Please consider it a "matched set", and they will always be updated/distributed together. XDA community developed enhancements to the ROM or Kernel are encouraged, and will be given prominent feature status in this post.
Your device needs to be set up as stock or stock-like (e.g. GeeWiz 2.8) before installing this ROM/Kernel. If you are currently running with an MTD-based platform, the device must be reverted back to the original OEM volume format. Please refer to the forum/thread were you acquired your current ROM for guidance on how to revert the device as necessary.
Installing this ROM/Kernel or any other provided component(s) will void your device's warranty, and I cannot be held responsible for any damages of any kind (including data loss) that are incurred either directly or indirectly by these packages and components. What you do to your device is ultimately your problem!
FEATURES
Android Jelly Bean AOSP build JZO54K (android-4.1.2_r1)
Google Apps version JZO54K from the Galaxy Nexus
All devices (GPS, compass, orientation, camera, flash) are functional
Wifi (WPA/WPA2) and Bluetooth Tethering support
Supports OEM DBDATA volume to keep performance reasonable
Supports both RFS and EXT4 formatting on all volumes
OEM USB modes (CD-ROM/Kies/MTP) replaced with standard Android Mass Storage
Advanced Battery Settings: Maximum Charge, Automatic Recharge Point
Advanced CPU Settings: Maximum/Minimum Clock Speed, Governor Selection
Advanced In-Call Volume Boost Selection
Backlight Notifications built into system, controlled by the OS
Supercurio Voodoo Sound 10
Fascinate Dock audio simulates a true USB audio device for seamless output path switching
Custom Dock options - Enable BLN, Stay Awake, Enable audio output
CREDITS
While it would be impossible to remember/cite every possible reference that was used during development, I would like to specifically thank the following teams/individuals for making their work public so that others could learn from it and in more cases than not, shamelessly "borrow" it:
jt1134 - A primary source of knowledge for all things Samsung Fascinate
sgtkwol - Maintains a Linux 2.6 kernel for the Epic that provided a vast amount of reference material for the kernel updates
pawitp - Fixed my video driver changes to eliminate a 'microlag' issue (thank you!)
Entropy512- Customizations to allow WPA/WPA2 Wifi Tethering to work on the Galaxy S
teamhacksung - Maintains a large repository for all Galaxy S devices, I can't count how many code compares I did against their material
Cyanogenmod - The fact that this ROM can make a call at all is thanks to this team. So much of this effort is based on theirs!
rxwookie - A long-time supporter of all things GeeWiz and always takes the time to help other folks out here. I think he probably knows more about GeeWiz than I do!
ACTIVATION AND PROVISIONING
While I have no reason to believe that activation/provisioning wouldn't work properly on this ROM, it is a difficult thing to test on CDMA networks. Until it's been established that activation/provisioning is indeed working properly, I suggest you do not use anything like the ODIN "EFS Clear" option that may affect it. If the phone was properly provisioned before installing this ROM, it should maintain that provisioning. I have successfully activated a Fascinate on this ROM, but have not tested the process enough to be fully confident with it.
KNOWN ISSUES
USB Mass Storage / ADB may not work after device has been docked
After docking and removing the device from a Samsung Fascinate dock, USB Mass Storage and/or ADB may stop working. When this occurs, the only way to restore USB connectivity is to power off the device and power it back on. Rebooting is not sufficient and will not alleviate the problem.
FIRST-TIME INSTALLATION RECOMMENDATION
This ROM performs significantly better when the device uses the EXT4 file system. Unfortunately, using ODIN will always format the device with the RFS file system. Unlike previous versions of GeeWiz, the new "Full Wipe" ODIN package has been modified such that it will format the data volumes (DATA, DBDATA, CACHE) with the EXT4 file system on the first boot. This is now the recommended installation method for first-time installation.
If the "Full Wipe" ODIN package is not used, please note that your data must be wiped manually if coming from another ROM to avoid problems, and I strongly recommend converting, at minimum, the data volumes of the device (DATA, DBDATA, CACHE) to the EXT4 file system.
UPGRADING FROM GEEWIZ 3.2/3.3
GeeWiz 3.2.x/3.3.x Versions can be upgraded directly to GeeWiz 3.4 without a need to wipe the device data or revert the file system back to RFS. The EDIFY update-zip below is compatible with most, if not all, recoveries and will work regardless of if the device is formatted with RFS or EXT4.
Your Dalvik-cache will be automatically wiped, so the first reboot will take a long time
Due to problems with some Google services after a kernel change, the Google Services Framework package will have its data cleared during installation. You will be prompted to accept Google's location services again
DOWNLOADS
EDIFY Update-Zip (ClockworkMod / GeeWiz Recovery) Compatible Downloads
GeeWiz 3.4 ROM/Kernel (EDIFY Update-Zip)
http://www.mediafire.com/file/ascgikdaqdg3ai5/geewiz-3.4-syskernel-01122013.zip
MD5: 6b2e280f9d51492febec43b8b9fa3bd4
GeeWiz 2.8 Recovery (EDIFY Update-Zip)
http://www.mediafire.com/file/5fxee76vrxv28eq/geewiz-2.8-recovery-04162012.zip
MD5: 9869d3138279d99f1237a442f7573cad
ODIN Compatible Downloads
GeeWiz 3.4 ROM/Kernel/Modem/Recovery/Data Wipe Full Update (ODIN)
This will delete all user data from your device, replace your RECOVERY with GeeWiz Recovery as well as replace your modem with the EH03 revision. Your data volumes will be formatted with EXT4 on the first boot
http://www.mediafire.com/file/2266vgo7uma5xmk/geewiz-3.4-fullwipe-01122013.tar.md5
MD5: 0d6c2cf955d0024c925c2d10ce046e1d
GeeWiz 3.4 ROM/Kernel (ODIN)
http://www.mediafire.com/file/jzfwybqu6ns70ay/geewiz-3.4-syskernel-01122013.tar.md5
MD5: 46e17141a8f8a8ae48001c3e4653e088
GeeWiz 2.8 Recovery (ODIN)
http://www.mediafire.com/file/h5gov2c1r8836tj/geewiz-2.8-recovery-04162012.tar.md5
MD5: b70d4063dffaa9cd89629f307d3beae5
SOURCE CODEThe entire baseline for GeeWiz is available on github: https://www.github.com/djp952.
Device repo: android-platform-device-samsung-atlas3g (branch android-4.1.2_r1)
Kernel repo: android-kernel-atlas (branch android-4.1.2_r1)
Please see post #2 of this thread for an overview of how to build the GeeWiz ROM/Kernel from source as well as how to package your modifications. I would be happy to include any XDA community developed modifications or enhancements to the baseline as featured packages, add-ons or patches for GeeWiz!
Disclaimer: djp952 reserves the right to mercilessly kang your changes and assimilate them when you fix things that he was unable to. djp952 will also give you *major* props and full credit for the fix, so it's not that bad, right?
HOW TO BUILD THE GEEWIZ 3 ROM AND KERNEL
A common request I've gotten is how to build either the GeeWiz ROM or kernel from source. I think GeeWiz 3 is a little less intimidating as a first step for getting into AOSP builds since it doesn't stray too far from the Android baseline, and the kernel is based on Samsung's stock model for the device rather than the enhanced MTD model. Whatever the reason, I'm happy to try and describe how I build these components and generate the packages that I post for the community. Sometimes it's normal, sometimes it's a bit wonky, but as long as I don't miss anything important it should be a workable process for anyone that would like to get into building custom Android builds.
I think GeeWiz 3 would be a great learning tool, it works as-is but leaves enough room for additional customizations and enhancements that it may be a better place to start than jumping into something like Cyanogenmod or AOKP as your first project. It's up to date at the moment with the latest Android code as well, so that's a definite bonus as opposed to working with something like Gingerbread where tricks you learn may not apply to the next project you take on.
BUILD ENVIRONMENT
I use Ubuntu 12.04 Desktop x64 for my Android build environment, and even though Google states that this environment is "Experimental", I've not run into any issues with it. To get started, simply follow the directions Google has provided here:
http://source.android.com/source/initializing.html
If you are running on Windows x64, I can also recommend using a Virtual Machine as your build environment. I like Oracle VirtualBox the best, but the stock Fascinate code by Samsung has major USB problems with it, you won't be able to use ADB or Heimdall. For Fascinate-specific development I recommend VMWare Player since it can work with the stock USB. Note that you need an x64 OS and a CPU with Virtualization Support to host an x64 guest OS regardless of the software you choose. The best performance and compatibility will come from installing Linux natively on your system.
DOWNLOAD GEEWIZ SOURCE TREE
Once your environment is set up, you of course need some source code. I've opted to use Google's repo tool and AOSP manifests to control the source tree, so the first thing you need is the Google repo tool. Follow the first section of this document, entitled "Installing Repo":
http://source.android.com/source/downloading.html
I have two separate "builds", or in Android terms Manifests out there. One is called DEFAULT and includes just changes to AOSP necessary to support the Fascinate. The other is called CUSTOMBUILD and adds the light OS customizations I have done. Since I never use DEFAULT and I'm not sure t even builds at the moment, we're going to use CUSTOMBUILD, or as it's called here at XDA "GeeWiz".
Open a terminal window to your home directory (~/)
mkdir android
mkdir android/platform
cd android/platform
repo init -u https://github.com/djp952/android -m custombuild.xml -b android-4.1.2_r1
What we just did was initialize the repository for AOSP, but haven't downloaded anything yet. The -u argument to repo tells it where to find the manifest XML files. In this case, my github "android" repo. The -m tells it what manifest to use. The -b tells it what branch to pull. This is important because like most folks, I have multiple branches out there. I have been indicating at the very end of the first post what the current active branch is, android-4.1.2_r1 right now.
At this point, I suggest going into the ~/android/platform/.repo/manifests directory and having a look at the manifest file. (.repo is a hidden folder). Open up custombuild.xml in GEDIT and you can see that I've taken the AOSP manifest and simply replaced portions of it to point into my own github repos for things I've changed. I'll try to include details on how I manage this below so you could do something similar if you want to.
The most time-consuming part of building Android is downloading the code. Can't go much farther without it, so get yourself a cup of coffee and a good book ...
In the terminal, at the ~/android/platform directory
repo sync
The SYNC command uses the manifest to go get all the code. Most of it is going to come from Google, but all the bits I've altered will come from my github instead. It's going to take a very long time to download.
BUILD GEEWIZ ROM
Once downloaded, we have to choose what device to build for. GeeWiz has two target devices, "atlas" and "atlas3g" (Technically, there are three as I use the same build for "toro" - VZW Galaxy Nexus). Atlas is the Wifi-only target known here as "GeeWiz Media". Atlas3G adds to that changes required to include voice/data support (mostly courtesy of Cyanogenmod!). Let's assume if you're reading this, you're interested in Atlas3G.
In the terminal, at the ~/android/platform directory
source build/envsetup.sh
lunch
The "Lunch Menu" (haha Google) will present you with a list of device builds to choose from. You can select by number, or you can type in anything not on the menu. As of this writing, the build we want is #8, full_atlas3g-userdebug. userdebug generates a generally release-quality build, but doesn't odex (pre-optimize) the APKs and has some additional debugging support you wouldn't ordinarily find. You could also type in full_atlas3g-eng for an "Engineering" build or full_atlas3g-user for a "Release" build. I think you'll prefer userdebug most of the time.
Select 8 - full_atlas3g-userdebug
make -j4 rompackage
This will kick off the build. It will take a long time the first time through. The rompackage argument is something I added to AOSP to support the Fascinate. This will build the EDIFY update-zip that I upload for everyone and use to generate the ODIN packages (more on that later). On typical Android devices, you would use otapackage (update-zip install) or updatepackage (fastboot install) instead. Fascinate is a special needs child, so it gets a special needs build process.
Once it's done, provided I didn't forget anything important here, you'll have a full ROM/Kernel package ready to be flashed via Clockworkmod or GeeWiz Recovery in the ~/android/platform/out/target/product/atlas3g folder. It will be named along the lines of full_atlas3g-rom-YYYYMMDD.HHMMSS.zip. Making a package for ODIN involves more steps, but I'll get to that. First I have to tell you how to build a modified Kernel ...
BUILDING THE GEEWIZ KERNEL
The Atlas and Atlas3G repos have a pre-compiled kernel in them that is packaged with the ROM build. This section will describe how to build and include customized versions of that kernel. First step is, of course, to get the source code. Both ROMs share a kernel but due to differences in the ramdisk (initramfs), they are built independently.
In a Terminal, at the ~/android directory
git clone https://github.com/djp952/android-kernel-atlas.git
cd android-kernel-atlas
git branch android-4.1.2_r1 remotes/origin/android-4.1.2_r1
git checkout android-4.1.2_r1
Now the build environment needs to be set up. I use the compiler provided with AOSP to build the kernel as this is how Google does it. If you are using a different compiler, or have put your AOSP tree into a different location, you may have to modify these commands slightly.
In a Terminal, at the ~/android/android-kernel-atlas directory
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=~/android/platform/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
NOTE: From this point forward, don't close that Terminal, otherwise you will have to execute the environment export commands again.
The kernel is built in three steps. This is necessary because the Fascinate doesn't conform to Android's models and we have to include the ramdisk (initramfs) in the kernel image. The first step is to select which device you are building the kernel for, which in this case will be "atlas3g_defconfig". (The other configuration for GeeWiz Media is called "atlas_defconfig").
make atlas3g_defconfig
This initializes the kernel build for Atlas3G. Since we need to build the ramdisk as part of the kernel, the next step is to generate any loadable kernel module (.ko) files that need to be part of that ramdisk
make modules
The way I have the kernel set up, it will pull the necessary files for the ramdisk by looking at the device "initramfs.list" file, in the AOSP tree. The file that describes the atlas3g ramdisk, for example, is in ~/android/platform/device/samsung/atlas3g. If you examine this file you can see that it lists where all the files should come from, relative to the kernel source root directory. This explains why I went through how to build the AOSP tree before the kernel, the kernel depends on the AOSP build. Provided everything is in the right place, it's time to build the kernel
make
This executes the main kernel build. Should any ramdisk files be missing, it will error out early on and let you know what the problem is. Assuming everything goes well, your kernel will be in the ~/android/android-kernel-atlas/arch/arm/boot directory. It's named zImage and it's the combined kernel/ramdisk required for the Fascinate.
This zImage file can now be flashed directly to the device with Heimdall, packaged up for ODIN, etc. However in order to make it part of your AOSP build and corresponding EDIFY update-zip, we have to copy it into the AOSP tree and rebuild the ROM. It's a bit tedious, and other folks have different and more streamlined ways of accomplishing this, but this method has worked for me.
cp ~/android/android-kernel-atlas/arch/arm/boot/zImage ~/android/platform/device/samsung/atlas3g/kernel
cd ~/android/platform
source build/envsetup.sh
lunch full_atlas3g-userdebug
make installclean
make -j4 rompackage
This set of commands will clean out and rebuild your ROM package with the updated kernel.
CREATING ODIN PACKAGES
While not the most popular way for people to install your ROM, no guide would be complete without describing how to generate the ODIN-based installation packages. I like to provide a "Full Wipe" ODIN package that will take care of resetting the device while flashing the new ROM/Kernel, it's an easy way for people that are comfortable with ODIN to just completely replace the contents of their phone with your stuff. For this section, I'm going to assume that you are using GeeWiz Recovery, version 2.8 or later. Other recoveries will work, but as you may expect I'm most familiar with the one I made and I know for certain it has all the necessary features in place.
The ODIN factoryfs.rfs file must be generated by formatting the SYSTEM volume with RFS and then installing your ROM:
Copy your generated EDIFY update-zip to the SDCARD
Reboot into GeeWiz Recovery
Wipe the device data by selecting Wipe Device Data and then Wipe all User Data (Factory Reset)
Press the HOME key to return to the main menu
Format the SYSTEM volume with RFS by selecting Manage Volumes / Format Volumes / Format SYSTEM / Format SYSTEM [rfs]
Press the HOME key to return to the main menu
Select Install Update Package, and choose your EDIFY update-zip to install
After the installation is complete, reboot the phone by selecting Exit from the main menu. Not rebooting the device after the flash will result in a bad ODIN file more often than not. Trust me on this one.
After the device has fully booted, reboot it back into GeeWiz Recovery. The next step will be to generate a backup of the RFS-formatted SYSTEM volume to ultimately use with ODIN. GeeWiz Recovery can create these by choosing to execute a "raw dump" of the volume:
Select Manage Volumes / Backup Volumes / Backup SYSTEM / Backup SYSTEM [raw dump]
GeeWiz Recovery tries to keep volumes unmounted after it's done working, so the SDCARD must be mounted before the contents can be accessed with ADB:
Press the HOME key to return to the main menu
Select Manage Volumes / Mount Volumes / Mount SDCARD
GeeWiz Recovery will store the backup as /sdcard/backup/volume/SYSTEM-YYYYMMDD.img.gz, so as an example, I might pull it to my home folder with this command:
adb pull /sdcard/backup/volume/SYSTEM-20121022.img.gz ~/
The .gz file will contain a compressed copy of the backup, just open it up, extract the file, and then rename it to factoryfs.rfs. This is the SYSTEM volume for ODIN. There are also a number of other files you can include in your ODIN package to perform various other flash or wipe operations (I'll tell you where to get them, too)
boot.bin - Will replace the primary bootloader. VERY DANGEROUS to include, I strongly recommend against including it.
cache.rfs - Will wipe the CACHE volume; necessary if you want the device to boot into recovery automatically and run a command
dbdata.rfs - Will wipe the DBDATA volume
factoryfs.rfs - Will replace the SYSTEM volume
modem.bin - Will replace the CDMA modem
movinand.bin - Will wipe the DATA, PREINSTALL and FOTA volumes
param.lfs - Will replace the parameter block. Semi-dangerous to include, but required to ensure an initial boot into recovery mode
recovery.bin - Will replace the RECOVERY kernel and ramdisk
Sbl.bin - Will replace the secondary bootloader. VERY DANGEROUS to include, I strongly recommend against including it.
zImage - Will replace the BOOT kernel and ramdisk
To generate an ODIN-compatible tarball, gather the files you want to include and execute the following commands from a Terminal. Replace tarfilename.tar with the name you want to give the tarball, and replace file file file file with the names of the files from the table above you want to include:
tar --format=ustar -cf tarfilename.tar file file file file
md5sum -t tarfilename.tar >> tarfilename.tar
mv tarfilename.tar tarfilename.tar.md5
NOTE: If you rename the .TAR file, it will invalidate the MD5 checksum and you will have to md5sum it again.
OK, where to get the files. You can access a "full stock" ODIN package for the Fascinate, like the EH03 version that is available here on XDA to get copies of all the stock versions of these files. Or, you can use the ones from my ODIN "Full Wipe" package if you'd like as well. My ODIN tarball has a gimmick that you may find useful. If you include my copies of cache.rfs, param.lfs and recovery.bin, the device will initially reboot into recovery and automatically format the CACHE, DATA and DBDATA volumes with the EXT4 file system. It's a relatively simple trick, but an effective one to help improve the performance of your ROM. I also like to provide a "syskernel" tarball that includes only factoryfs.rfs and zImage. The benefit of this is that it will not wipe out any of your user's data. The downside is that the user may be responsible for going into Recovery on their own and executing any steps your EDIFY update-zip would have typically taken care of, like clearing the Dalvik-cache.
==================
For now, that pretty much sums it up! I can expand on this, or perhaps more appropriately compress it (I am a tad verbose!) based on feedback and how useful this little guide ends up being for everyone. Let me know -- PM me or post here in this thread, I'll see it either way!
reserved post
reserved 3
Downloading now. Will reply with the results soon
Just have one question though. I am on a voodoo kernel ie kgb with geewiz 2.9 rom. And I will be using the edify update method to flash the 3.2 rom. Do I need to convert the file system to ext? Or can I just flash it over the existing setup.
Thanks in advance
edit...I flashed the JB rom on the above setup. The phone is stuck at the big X logo. Doesnt seem to go beyond that. So i went back to stock froyo. Then flashed GW 2.8.1. Booted properly. Everything working fine. Next i flashed geewiz recovery & converted files to ext4. rebooted. works fine too. Flashed JB rom. Phone still stuck at the X logo.
Kindly help...
Sent from my SCH-I500 using xda app-developers app
swapnilss said:
Downloading now. Will reply with the results soon
Just have one question though. I am on a voodoo kernel ie kgb with geewiz 2.9 rom. And I will be using the edify update method to flash the 3.2 rom. Do I need to convert the file system to ext? Or can I just flash it over the existing setup.
Thanks in advance
edit...I flashed the JB rom on the above setup. The phone is stuck at the big X logo. Doesnt seem to go beyond that. So i went back to stock froyo. Then flashed GW 2.8.1. Booted properly. Everything working fine. Next i flashed geewiz recovery & converted files to ext4. rebooted. works fine too. Flashed JB rom. Phone still stuck at the X logo.
Kindly help...
Sent from my SCH-I500 using xda app-developers app
Click to expand...
Click to collapse
Let me follow those exact steps and see what happens. Mandatory silly question: did you wipe data after installing the JB rom?
Just to clarify to make sure I do the same thing, you went back to stock Froyo (ED05), not stock Gingerbread (EH03)?
It will sit at the X logo for quite some time after flashing the ROM, since it has to dalvik all the apps. "Quite some time" in this case means like 3-5 minutes though. It does take much longer than Gingerbread to do this, but it's not some craziness like half an hour.
:crying:
edit: If I can't duplicate this, I can post a kernel update where debugging is ON by default so we could use ADB to see what it's hanging up on, but I will totally understand if you don't want to go through all that effort. Been there!
Odined back to stock. Loaded full wipe 3.2 and everything is golden. MMS, WiFi etc works great.
Did have to restart before WiFi would start. ROM is a little laggy at first but once it settles performance is on par with other JB Roms:thumbup:
Thanks Mr.GeeWiz: looks great for a "beta"
Edit: speakerphone works great also, sweet^o^
Sent from my SCH-I500 using xda app-developers app
I still think in overall the ROM is laggy.
WiFi requires restart each time you switch it off.
Whatsapp is not working after SMS code verification.
Thanks DJP952
i decided to give this a try. everything works great. wifi did not require a reboot for me. camera, mms, wifi all work great. a little sluggish getting started, but pretty stable nonetheless. great work DJ. thanks
djp952 said:
Let me follow those exact steps and see what happens. Mandatory silly question: did you wipe data after installing the JB rom?
Just to clarify to make sure I do the same thing, you went back to stock Froyo (ED05), not stock Gingerbread (EH03)?
It will sit at the X logo for quite some time after flashing the ROM, since it has to dalvik all the apps. "Quite some time" in this case means like 3-5 minutes though. It does take much longer than Gingerbread to do this, but it's not some craziness like half an hour.
:crying:
edit: If I can't duplicate this, I can post a kernel update where debugging is ON by default so we could use ADB to see what it's hanging up on, but I will totally understand if you don't want to go through all that effort. Been there!
Click to expand...
Click to collapse
Hi djp,
I forgot to mention that I have bought the handset from Reliance (mobile service provider in India ). And that puts a limitation on me as I am not able to wipe the data dalvik and cache whenever I flash my phone to a new rom. If I do the data wipe I lose my 1x/3g Connectivity and I cannot restore it (tried various options like data fix files, apn restore etc etc) unless I flash the stock rom from Reliance (EK10 Froyo. No official gb rom for India yet ). Hence whenever I flash roms I do not wipe data. But in spite of that I have never faced any problems. Infact now the number of user apps is close to 100 and I can still flash any touchwiz rom (geewiz 2.8, 2.9, tsm resurrection and 2.2 etc without any problems. I am in no way promoting my method of not wiping but I have no other choice.
With the given restrictions that I have, please advise me how and what I can do to successfully flash JB rom. Currently there are no user apps in my device so clearing dalvik should not be a problem.
Sent from my SCH-I500 using xda app-developers app
swapnilss said:
Hi djp,
I forgot to mention that I have bought the handset from Reliance (mobile service provider in India ). And that puts a limitation on me as I am not able to wipe the data dalvik and cache whenever I flash my phone to a new rom. If I do the data wipe I lose my 1x/3g Connectivity and I cannot restore it (tried various options like data fix files, apn restore etc etc) unless I flash the stock rom from Reliance (EK10 Froyo. No official gb rom for India yet ). Hence whenever I flash roms I do not wipe data. But in spite of that I have never faced any problems. Infact now the number of user apps is close to 100 and I can still flash any touchwiz rom (geewiz 2.8, 2.9, tsm resurrection and 2.2 etc without any problems. I am in no way promoting my method of not wiping but I have no other choice.
With the given restrictions that I have, please advise me how and what I can do to successfully flash JB rom. Currently there are no user apps in my device so clearing dalvik should not be a problem.
Sent from my SCH-I500 using xda app-developers app
Click to expand...
Click to collapse
Ah, I see your point. When you had problems with activation, were you wiping data using Recovery or using the "Factory Reset" option in the OS? The latter, at least the Samsung version of it, will indeed nuke your activation. However, using Recovery to do it *shouldn't* affect anything. The activation stuff is stored in some secret location that recovery doesn't affect. I honestly have no idea where it's even stored, I used to think it was on the "EFS" volume, but as it turns out it's not!
I've never spent any real time trying to figure out a more surgical way to wipe data other than nuking the DATA and DBDATA partitions completely. Unfortunately, I don't really have the necessary knowledge to be able to do it any other way. While I'm relatively confident that wiping data through Recovery won't hurt, of course I cannot be 100% certain of that.
I apologize that I don't know enough about the non-Verizon models to be more confident in a recommendation for you. From what I know of the SCH-I500 CDMA, wiping outside of the Samsung OS, changing the modem version, or using the evil "EFS Clear" option in ODIN has never affected activation for me.
Sorry sir. Without a wipe, this one's not going to work. Just too far removed from the stock ROMs.
I can duplicate the Wifi issue and am looking into it. For me, it just took a REALLY long time for it to turn on, like 10 minutes. I think I know what I've done that might cause this and hope to fix it Getting the logs now.
edit: I think I see what the problem is, not sure why it hasn't been an issue with the "Media" version. I have to dynamically load and unload the Wifi driver to prevent bad things from happening, this isn't the usual way it's done. The OS is set up to start the Wifi "supplicant" automatically, when it probably shouldn't be. The supplicant can't load if the wifi driver isn't up yet. Sometimes it works, sometimes it doesn't, and when it doesn't Wifi will be hosed until the OS sorts it out. I have two solutions to try, the first is to see how Android behaves if I don't allow the supplicant to be started as part of the "main" service class, the second is to figure out that aforementioned bad thing and do it more properly. I'll get it. Sorry for the bug
Thanks for trying this guys! I never expected it to be as good as the "big" ROMs, and I wish I could do something about it being so ungodly slow for a while. It seems to pick up and work properly after all the apps have been updated and it's had a chance to do all the Google backups and whatnot that it wants to do.
One problem I saw yesterday for the first time that you might need to watch out for ... The battery TANKED in a matter of 2 hours for some reason. It looks like Google Search went off the reservation. I've also seen "GPS Status and Toolbox" destroy the battery if you don't close it all the way (long-press HOME, then swipe it away).
Oh, one cool feature we have now ... "Take Bug Report". Check in Settings/Developer options to see it. What this does is collect all kinds of logs and information about the phone and make an e-mail out of it. The default sends it to your GMail account. It's about 3MB, but it will be nice to have something everybody can use to gather logs for problem resolution rather than asking folks to hack around in ADB. So, if you run into weirdness, you can click that button, wait a while and watch scary "shell has been granted superuser permissions" pop up a lot, and you'll ultimately end up in GMail with something you can send you me or post parts of here! Great that Google added that in an accessible way finally!!
For the folks having trouble with turning Wifi on and off, I have an experimental/test patch for you. This patch will replace the GeeWiz 3.2 kernel with an updated version that changes the ramdisk/initramfs such that the wifi services are not started until Android requests them to be started. It may affect Wifi and Bluetooth Tethering, but my testing of the change here for both showed no ill-effects:
GeeWiz 3.2.1 Wifi Patch [Experimental] [EDIFY update-zip]
REMOVED: Please use official patch in the DOWNLOADS section of the main post
NOTE: You will be asked to re-opt-into the Google Location service on the first boot, this is normal. I clear the "Google Services Framework" app on any kernel change now to avoid the well known Jelly Bean issues with losing connection to Google Services when you alter the kernel. This may have been fixed with JZO54K, but why risk it when all you have to do is click "Agree"
You may have to reboot once more after installing this to clear up the Wifi on/off problems so that the Android settings are synchronized with the changes. If after a second reboot this does not solve your problem, please let me know!
Rollback: This change can be rolled back by installing the EDIFY update-zip for GeeWiz 3.2 again on top of it without wiping data. I can also package/provide a more specific rollback that only undoes the changes if necessary.
Please let me know if this solves your Wifi issues or not, so that I can either post it as a primary patch for GeeWiz 3.2 (and GW Media 3.2) or take another crack at solving it Thanks!!!
djp952 said:
Ah, I see your point. When you had problems with activation, were you wiping data using Recovery or using the "Factory Reset" option in the OS? The latter, at least the Samsung version of it, will indeed nuke your activation. However, using Recovery to do it *shouldn't* affect anything. The activation stuff is stored in some secret location that recovery doesn't affect. I honestly have no idea where it's even stored, I used to think it was on the "EFS" volume, but as it turns out it's not!
I've never spent any real time trying to figure out a more surgical way to wipe data other than nuking the DATA and DBDATA partitions completely. Unfortunately, I don't really have the necessary knowledge to be able to do it any other way. While I'm relatively confident that wiping data through Recovery won't hurt, of course I cannot be 100% certain of that.
I apologize that I don't know enough about the non-Verizon models to be more confident in a recommendation for you. From what I know of the SCH-I500 CDMA, wiping outside of the Samsung OS, changing the modem version, or using the evil "EFS Clear" option in ODIN has never affected activation for me.
Sorry sir. Without a wipe, this one's not going to work. Just too far removed from the stock ROMs.
Click to expand...
Click to collapse
Hi!
Wiped data dalvik and cache & now I am on JellyBean. Thanks djp952. :good::good::good:
This Rom looks great and apart from the Wifi issue ( havent got time to update my phone with the patch for wifi issue as yet) which takes some time to start or sometimes just rebooted my phone altogether, everything seems to work fine. Had a problem verifying Whatsapp but used their "Verify by Call" method and now its working fine too. Battery life seems good to me as of now. Liked the inbuilt BLN.
Sadly, as i mentioned before, i lost my 1x/3g connectivity (nothing to do with this Rom) and thats Ok for a day or two till i try & figure out something to enable it again. By the way, i have always done the wipe through recovery only. Never used the factory reset option in settings menu. And that means the 1x/3g settings get wiped out the moment I wipe Data (note: wiping dalvik & cache does not affect it).
Anyways , looking forward for more developments on this rom from you.
edit... The stock gallery does not seem to show all the files available in that folder. I have 1400 plus pics in that DCIM folder and the stock gallery shows 1000 or sometimes 500 only.
QuickPic
swapnilss said:
The stock gallery does not seem to show all the files available in that folder. I have 1400 plus pics in that DCIM folder and the stock gallery shows 1000 or sometimes 500 only.
Click to expand...
Click to collapse
We are a little off topic, but... I too have had nothing but problems with the stock Gallery application... not loading at all, not showing pictures, generally being grumpy (okay, so I get that way too sometimes), etc.
Try Quickpic (http://market.android.com/details?id=com.alensw.PicFolder) , it's a free app that is a gallery replacement (ad-free too!). Just make it the default and you should be set. If, for some reason, you don't like it... Just uninstall and revert back.
As for the Jellybean ROM... too sweet! I love having an original Galaxy S with JB running on it! I get questioned all the time what phone I have, because it's running the latest Android build and doesn't look like any out there right now.
Sent from my SCH-I500 using xda app-developers app
I'll load up some huge amount of photos and have a look at Gallery. I could switch from using the Google Nexus version to the AOSP, if it shows any improvements. One bonus we could get there is that I enabled widescreen photos in the AOSP branch Didn't include it for various reasons, one I recall was that it would crash if you tried the "face detect" option.
I'll have a look -- maybe it can be fixed! I also have to download this "Whatsapp" that people are using ... never heard of it What does it do?
Thanks as always for the feedback guys! Glad it's going pretty well thus far
FYI for any aspiring developers, I've started making a "HOW TO" guide for building GeeWiz from scratch in Post #2:
http://forum.xda-developers.com/showpost.php?p=33011164&postcount=2
I've gotten as far as how to make the AOSP ROM and compile the kernel. At minimum, I need to add how to make the ODIN files as well, but maybe later. Depending on level of interest, I can go into as much as anyone wants there, short of how to make actual code changes (but I could try to help offline). I think describing how to get from source to the flashable files is a good first step, I'll see how it goes from there
DJ, you should link this on the home page of GeeWiz 2.9, so more folks can get this. Also, I think you should name it JellyWiz...
Can I ask what this is ?
AndroidGee209 said:
Can I ask what this is ?
Click to expand...
Click to collapse
JellyBean for the Fascinate, with GeeWiz recovery and kernel
---------- Post added at 03:53 PM ---------- Previous post was at 03:51 PM ----------
where can i find the compass?
I'm trying to encrypt the storage on my HTC One, but when I kick off the encryption task it just sits at the Android "gear-droid" (what I call the funny Android encryption logo, the one with the gear) until I manually restart the device. Encryption never takes place.
Running logcat on the device shows the infamous error:
"Orig filesystem overlaps crypto footer region. Cannot encrypt in place."
Searches on CM's issue tracker shows this open issue which discusses the problem at length, basically for this type of device the problem is almost certainly a misconfiguration of the fstab files. Essentially, they're set to use the last 16kb of the data partition to store the key in, but the partition isn't setup to reserve this space.
(XDA won't let me post the link, so go to CM's JIRA and look for bug CYAN-87)
A change was pushed to the Evita branch to fix this, but I haven't found a similar push occurring on the HTC One branch.
(XDA won't let me post the link, so go to CM's review board and look for change 48090)
I've been trying to run some of the commands referred to in the JIRA thread from recovery, but the file system presented to ADB there looks a lot different than the one at run-time, and it can't find any of the tools needed to do the job (vdc, make FS, etc).
Two questions:
1) Can this be fixed after ROM install? I'd rather not have to rebuild the ROM to fix this minor issue (reformatting is fine though)
2) Where are all the file system tools during recovery? I don't quite get why the recovery file system is so different than the normal run-time one, let alone where all the tools disappeared to
And if someone with the proper accounts / permissions could remind CM and the various device maintainers about the broken encryption support that would be swell. It seems like a lot of devices have mis-configurations preventing encryption from functioning, which is dangerous given how much access these devices have today (and how prevalent cell phone losses / thefts are).
Brickbug Aftermath: Speeding up the Galaxy S2 i9100, S2 AT&T i777, S2 Epic 4G Touch d710 and Note n7000
UPDATE: KERNELS CAN TRIM FAT PARTITIONS
contrary to what has been said in this thread and elsewhere, the S2 TRIM kernels could always trim FAT partitions. the problem is that the FAT file system implementation does not support batch trimming (ie: fstrim), but the fact that the DISCARD mount option has always been supported on FAT has eluded us all. the mainline commit that introduced the option is here, and the corresponding code in CM's repo is here.
this means that it would probably be a good idea to add DISCARD to the default mount options of the internal sdcard in CM. deleting files from internal storage would probably become slower, but the expectation would be that overall performance should increase. the performance issues related to queue flushing that plague non-queued TRIM commands should not be a big problem in this case, since the sdcard is used mostly for media (few big files without multitasking access).
UPDATE: VICTORY !!!
2016-03-02: after two years of tests and discussions, folklore, FUD and evidence, @Lysergic Acid finally took the plunge and merged! TRIM is now part of the official CM 12.1 and CM 13.0 kernels, and this project can at last be retired, yoohoo!!! CM 13 users now enjoy TRIM out of the box, but users of CM 12.1 builds older than Match 2016 as well as CM 11.0 users continue to require a separate TRIM kernel.
this thread is dedicated to Entropy and the brave users who risked their devices to run the very first TRIM tests.
IMPORTANT NOTE FOR USERS
i am tried of lazy users sending private messages to me instead of reading the thread. i am especially tired of users asking over and over on PMs whether TRIM is safe. if you read the threads you would know: TRIM is completely safe on every supported device, stop asking! and please, never PM technical questions to anyone on XDA unless you already know the guy.
DOWNLOAD FROM -> HERE
IMPORTANT NOTE FOR KERNEL DEVELOPERS ONLY
you should not blindly merge these changes into your kernel. doing so can result in unrecoverable bricks!!! you need to check that certain patches are already merged in your kernel before enabling TRIM. please follow these steps; you can get help from this post. please contact me when in doubt, let's not revive the slumbering brickbug monster from hell, thank you!
UPDATE: CM 13.0 kernels are now available!!! (for CM 13.0-supported platforms only: i9100 and i777.)
UPDATE: several enhancements in new kernel batch:
CM 12.1 kernels are now available!!! (for CM 12.1-supported platforms only: i9100 and i777.)
kernels can now be flashed with the official, restricted cyanogen recovery that is bundled with CM 12.1.
rom-independent kernels: kernels are no longer dependent one-to-one on specific official CM builds (they might work with other roms too), and their names no longer reference a specific CM build.
although there are no official CM 11 builds for the i777, thanks to rom independence CM 11-based kernels for that device are now available.
CM 11 i9100-to-i777 cross-flash kernels for the i777 may now work with other i9100 roms besides official CM.
UPDATE: Dic 25, 2014: a holiday present!!! as kernel maintainers swiftly acted to patch PFBug, @Gustavo_s took the plunge and merged TRIM support in his latest kernel. i have verified that his kernel is as safe as mine regarding TRIM. finally a more mainstream kernel is getting this functionality, hopefully i will be able to discontinue my kernels soon!
UPDATE: great news, we have fixed FPBug!!! fixed TRIM kernels are online!
UPDATE: this project now supports all roms and kernels!
if you are not running CyanogenMod M snapshots, please see this post.
this project restores TRIM capability to CyanogenMod kernels for the Galaxy S2 family of 4210-based devices: i9100, i777, d710 and n7000. TRIM is needed to avoid "aging" of the state of the eMMC, the internal flash storage, that eventually slows the device to a crawl. TRIM functionality is built into android 4.3 and later. however, due to historical and safety concerns, TRIM capability was removed from the CM kernels for these devices (and from most if not all other AOSP-based kernels).
an in-depth discussion of this matter, including safety, risks and current state of the kernels for various devices, can be found in the main project thread. you can review that content if you are curious. get the source for this project: patches and patcher script are here (git) and base system here (repo). for instructions on how to recreate my kernels from source, see this post.
STATS: Nov 5: 500+ kernel downloads (latest version only).
Oct 1: 250+ kernel downloads (then-latest version only), top 5th thread in its forum (ThreadRank).
PROJECT STATUS: testing still needed on MAG2GA TRIM bug-affected devices before TRIM patches go mainstream. IMHO, TRIM patches are ready to be merged into mainstream kernels. kernel maintainers please read the warning at the very top of this post!
UPDATE: kernel wifi issues fixed! thanks to invaluable help from @mparus. also, ART works just fine.
What to expect
some users see big changes while others do not. there are many different eMMC models with different firmware versions embedded in these devices, and it is clear that some are faster than others. it is even possible that some eMMCs may have firmwares that completely ignore trim commands. following are some benchmarks and comments submitted by users.
@defecat0r run before-and-after benchmarks and packed it all in this neat graph (thanks so much!):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
@defecat0r also says: "I've been dicking around copying stuff back and forward, factory resetting and restoring cwm recoveries while on this kernel for a day now, if this fix was going to trigger superbrick i'm sure it would have done it by now. As far as i'm concerned this is safe as houses. [...] This is the biggest thing to happen to these devices since i don't know when!" (post)
@smoke2tun got better results: "My phone is blazing fast". he says: "The phone is really snappy and responsive. [...] After runing Antutu v5.1 the overall score is 17816. On NeatRom the score had an average of 11000." (post)
@Roxxors: "My phone had become so unbearably slow I was about to toss it in the garbage, [...] I'm coming from NeatROM 4.1.2, and let me tell you something, after installing C11 M9 with this kernel, my phone is FLYING." (post)
@|Vyp|: "Nice work, the device is flying now." (post)
@bihslk: "OMG! Installed CM11 M10 and your TRIM. Phone is flying now,,, WoW" (post)
@burninghouse: "i installed it and i can say only one word....."AWESOME"... My s2 is blazingly fast with same battery life" (post)
@dirtyhewr: "Omg... I don't think my device has ever been this fast... No lags at all" (post)
@Dudebowski: "[...] the increase in write ops nearly doubled! Regardless of the numbers for proof, this trim along with the floater fix [ed. note: FPBug] has made this device enjoyable to use again for the first time in years. The change in responsiveness after trim is night and day." (post)
thank you so much for the feedback and benchmarks guys!!
When things do not work
then again, some users do not get big improvements. check out the case of @desvariando.
speculation about these cases can be made. TRIM failing to provide advantages can be attributed to one of two causes:
when the fstrim command is run on some devices, it reports success but runs in zero time instead of taking the usual couple of seconds it takes on most devices. it looks like samsung disabled ERASE/TRIM support in some eMMCs, as a stopgap measure while they researched the issue further and before they output a final fix. if your eMMC trims in zero time, there is probably no realistic way to ever trim it. once your device gets slow, it can never be rejuvenated. if you fall under this group, and you have not yet ever filled the device's internal memory and your device still performs well, i would reduce the internal sdcard partition in size asap and leave a healthy sized area of 2GB inaccessible. this overprovisions the eMMC and ensures that it will never ran out of untrimmed space (assuming that the disk area you are leaving out is in fact still trimmed from factory). UPDATE: so now i know of a way to trim these untrimmable devices. it is extremely dangerous though (unless you have JTAG access to the eMMC). these eMMCs have a command to resize their boot partitions (boot0/boot1). these partitions are treated differently from all others by these modules. you can think of them as separate, safe, small, virtual disks; even if you write all over the main disk, you will never touch these partitions. also, wear leveling on the main disk will never move data around on these partitions. contrary to data on the main disk, once you write something here, it stays written forever (until you write something else). because they are treated differently, the eMMC needs to know their size. for versatility there is a non-standard command that will resize these partitions, and as a side effect it will repurpose the rest of the flash as the "main disk", creating all of its FTL structures from scratch. this full, low-level reformatting will fix a brickbug-damaged eMMC and will also trim an untrimmable device. the trick is to resize the boot partitions to some strange value, then resize them back to original size. all data everywhere will be lost, including the bootloaders, and this is why it is so dangerous. these phones will brick unless there are proper bootloaders and friends in place (though with JTAG access you could restore all this data). so the procedure would go like this: boot into recovery, make backups of all partitions you care about (bootloaders, EFS, etc), resize boot0/boot1, resize them back, and restore the needed partitions. but if anything goes wrong before you finish... you have a brick! because it is so dangerous, AFAIK this procedure has never been attempted to fix a brickbugged S2, much less to just trim one. but it has been carried on successfully on devices that boot from alternative sources when their eMMC is wiped, check it out here.
your device still had a reasonable amount of trimmed space when you installed this kernel and trimmed, and was not in need of trim. this can happen if you never filled the device's internal memory throughout its entire lifetime, or if you trimmed your device recently without knowing it. you could have trimmed by using the stock 4.1.2 kernel (which is TRIM-capable) in two ways: by wiping data from android or recovery, or by using an app such as LagFix.
otherwise, your device should be more responsive and use less battery after trimming. the need for trim is a well established reality that no FTL-based flash storage can escape.
STOP!!! DRAGONS AHEAD!!!
in theory there could be risk of hard-bricking your device forever. i believe this risk to be non-existent, based on reasons i detail in the aforementioned thread, and also based on recent experience: many people are already using these kernels without any kind of incident. however, the standard disclaimer applies: you accept full responsibility for what happens to your device.
READ and FOLLOW the instructions carefully.
Downloads
for the supported devices, you will find IsoRec-compatible CyanogenMod-based kernels here. (old kernels without IsoRec support can be found here. yet older retired kernels without FPBug fix are still available here.) note that for some supported devices, no releases or M snapshots are currently being produced. for those devices i can produce kernels based on known 'stable' nightlies if users ask.
A word about CyanogenMod 10.1.3
UPDATE: great news, we have fixed FPBug!!!
there are no CM stable releases for 4210-based devices after CM 10.1.3. the sad truth is that the kernel for these devices is broken. this affects all roms, not just CM. there seems to be some unidentified defect in the hardware itself, and no workaround for it has been implemented in the kernel so far (if such a thing is even possible). after years, @cgx finally observed the bug in action and now we at least know what we are up against. it is nasty as hell: random stack corruption. in layman's terms, any process can randomly misbehave, crash, be corrupted, corrupt data, etc... all bets are off, anything could happen. and it looks like this might never be fixed.
for whatever reason this was not much of a problem in the CM 10.1.3 days. these days, with a much more advanced and demanding android, the bug is real trouble. most people find that the last reliable CM version for their 4210-based device is 10.1.3 (including the CM team itself). i made kernels for this version, find them in the downloads section.
NOTE: the CM 10.1.3 kernels are untested. do take a nandroid! and please post your results.
Instructions
prerequisites: you need to already be running a fully official version of CyanogenMod supported by this project. (i mean fully official: dual booters, alternative kernel/recovery users, etc are not invited to this party.) you will replace your current official CM kernel with the patched, EXACT SAME VERSION kernel from this project.
download this app and run it to check if your device is affected by hardware bugs. root is requested but not needed for this test. do not trust the app's verdict! instead use the reported eMMC model name and the firmware revision (fwrev) to look up your eMMC in this table.
is your eMMC model an MAG2GA? if so you are affected by TRIM bug. WARNING: this configuration is untested. my kernels should be safe but they have never been tested on this particular eMMC, so risk cannot be completely ruled out. please read this post and decide whether you would like to test. testers are needed! i believe this is the last remaining piece of evidence needed to establish the general safety of trim on this family of devices and start pushing for its inclusion in the standard kernels, which is the ultimate objective of this project. UPDATE: things are looking much better, see this post. testing is still needed though, please help. UPDATE: MAG2GA eMMCs with fwrev 0x0E can be found in d710 devices and were tested to TRIM without problems. i personally believe this configuration to be safe.
are you affected by WL Bug? impossible. according to the available data, no 4210-based device has ever been produced with this eMMC... SO YOU MUST BE MISTAKING. please double check your situation; then post. (in any case, this bug is supposed to involve data corruption only, and not bricking.)
are you affected by Brickbug? my kernels contain samsung's fix for this bug, but samsung's fix was never exercised in practice with TRIM. i will accept ONE volunteer to test. i do not want more than one device to brick if the test fails. know that testing can potentially brick your device beyond repair. i would prefer someone with a compromised S2 (eg: lost IMEI, cracked screen) to do the first test. please post your willingness to test on this thread (include eMMC and fwrev). UPDATE: many people affected by this bug are already using my kernels without incidents. i personally believe this configuration to be safe.
if you are not affected by the previous bugs, you run no special risks by flashing my kernels.
you should start on a supported official CyanogenMod; if you are not already running it, flash it now and test it.
optional: as an extra safety step, back up your EFS and store it OUTSIDE your phone. you should have done this years ago! you never know when you might need that backup.
optional: preferably no apps should be moved to the internal sd card (check 'apps' in settings). this could slow the device a bit, but is no problem otherwise. note that apps moved to the EXTERNAL sdcard can cause BIG SLOWDOWNS.
optional: make sure you have 20% (or at the very least 10%) free space in your internal 2GB /data partition (where apps are normally installed). you will not notice speed improvements unless/until you have free space in /data.
optional: if you have been on official CM (including kernel) for a long time, and this is the first time you are going to trim your device, please contribute benchmarks. install Androbench and run all benchmarks, it takes just a few seconds. in the history section you can see most if not all results in a single screen; please take a snapshot for your before-and-after comparison.
make a nandroid backup. if you need to back out of the change for whatever reason, you will be happy to have it.
download the appropriate kernel for your CM build (includes CWM-based recovery). flash it without wiping. (at any time you can reflash official CM without wiping or upgrade to a newer CM -loosing TRIM support, of course.)
reboot.
install the LagFix (free) app from xda (the market version is declared to be incompatible with the i9100). go to the lagfix tab, check the 3 partitions, and tap on run. grant root access. the 3 fstrim operations should be successful ("partition was trimmed" means success).
UPDATE: there is a replacement app for LagFix called Trimmer that has several advantages over the former: is fully free, can schedule TRIMs, and is compatible with Android 5.
alternatively, instead of using lagfix you can run one of these commands (these are better because they also trim /preload):
# on the phone in the terminal app:
su -c "fstrim -v /system; fstrim -v /data; fstrim -v /cache; fstrim -v /preload"
# on your PC if you are connected to the phone via adb:
adb shell su -c "fstrim -v /system; fstrim -v /data; fstrim -v /cache; fstrim -v /preload"
reboot.
optional: contribute benchmarks if you qualify. run Androbench again to take an 'after' snapshot and share your before-and-after shots below.
your device should now run FAST... profit!
Please donate hardware to test
i do not have any of the supported devices to test, i am developing blind. i would gladly accept an i9100 with a cracked screen as a test bed if you can send it to an address in USA or Argentina (or any other supported device).
But wait, there's more...
Automatic trimming
android 4.3 and later should trim all writable file systems each night during charging automatically (/cache, /efs, /data and /preload). you do not need to invoke fstrim or lagfix manually again. if you want to be extra tidy you can invoke lagfix after each flash of a CM upgrade to trim /system (which is normally read-only).
because of this offline auto trimming, android 4.3 and later should not mount partitions with the discard mount option (which implements online trimming whenever space is freed), but CM does anyway. this is a bug that slows down the device and i have uploaded a patch to CM's gerrit. my kernels fix this as of Sep 14 2014.
if you use CM 10.1.3 (android 4.2.2), you might be thinking that you need to regularly trim the file systems yourself (you could use scripts or lagfix premium for automation). but as of Sep 14 2014 my kernels mount /cache, /data and /preload with the discard option, meaning that freed space on these partitions is immediately trimmed (which, again, slows down the device compared to offline trimming but is better than no trimming at all). so you only need to invoke lagfix after each flash of a CM upgrade to trim /system if you want to obsess about it. (the /efs partition is not mounted with discard; call me superstitious.) btw, i made the /preload partition writable (it is normally read-only in CM 10.1.3) so you can trim it and/or use it for whatever purpose you want. i could create 10.1.3 kernels without the discard mount option for those who wish to roll their own periodic trim feature; just ask.
The internal sdcard partition
the majority of the phone's flash is devoted to the internal sdcard partition which is formatted in a vesion of FAT. unfortunately the linux kernel file system driver for FAT is unable to trim its free space. some people format this partition to ext4 for performance and safety reasons (google). if you do that, you can fstrim it.
The preload partition
these devices have 0.5 GB ext4 /preload partition (also called "hidden"). in CyanogenMod it is unused and should be empty (you can check with the file manager). you can manually fstrim this partition (open a terminal on the phone and type: su -c "fstrim -v /preload" or from the PC via adb: adb shell su -c "fstrim -v /preload") or format it from my recovery to increase the trimmed free space in your eMMC, effectively increasing its over-provisioning by 0.5 GB. this makes the eMMC faster and extends its useful life.
UPDATE: i have removed the trim-on-format functionality (partition wiping) from the kernel patches, and thus all future kernels. there are no safety concerns with the previous kernels, but there can be problems if someone uses my patches to build a complete ROM (as opposed to just a kernel, as i have been doing). please refer to the commit for details. [Oct 3]
Adjusting partition sizes
you can repartition your phone to better distribute available flash space. i recommend vestigial /preload (unless you want to go back to stock roms later), 1 GB /system (the original 0.5 GB /system is too small for android 4.4 and gapps; 0.75 GB is enough, but the Nexus 5 comes with 1 GB, so i guess google expects it to keep growing), 6 GB /data (of which you should always keep 2 or 1 GB free to provide the eMMC with trimmable free space -remember the FAT partition does not trim), and the rest (about 8 GB) used for the internal sdcard. you can format the internal sdcard as some FAT or as ext4. (but windows does not understand ext4, but there is MTP... google!)
you can use ODIN (windows-only) or heimdall to repartition. @Roxxors contributed a nice partitioning how-to that you should read. note that he embedded my M9 kernel in his ODIN files. to create a file with the right kernel for your needs, read this.
here are some PIT files (these files are for the i9100 16 GB only, but you can use PIT Magic to roll your own):
0.5 GB system
0.75 GB system
1 GB system, 3/4/6 GB data
1 GB system, 8 GB data
1 GB system, 4 GB data, small preload
1 GB system, 6 GB data, small preload <-- this PIT is buggy!
(see attached file for a replacement i made; includes a script to repartition from linux using heimdall.)
in general, 2 GB, or even 1, of trimmable free space (ie: free space in the /data partition) will probably be more than enough to speed up your device, with rapidly diminishing gains over that.
UPDATE: due to a bug in CM, the recovery is unable to format the /preload partition. formatting is needed after repartitioning. to manually format, open a terminal on the phone and type: su -c "mkfs.ext2 /dev/block/platform/dw_mmc/by-name/HIDDEN" or from the PC via adb: adb shell su -c "mkfs.ext2 /dev/block/platform/dw_mmc/by-name/HIDDEN" (you can also use other commands such as mke2fs and mkfs.ext2.)
PLEASE NOTE: this is not a partitioning thread!!! please DO NOT seek partitioning help in this thread. please post in an appropriate thread instead. this thread is for KERNEL ISSUES ONLY. thank you!
XDA:DevDB Information
BrickbugAftermath-i9100, Kernel for the Samsung Galaxy S II
Contributors
Lanchon
Source Code: https://github.com/Lanchon/BrickbugAftermath-SGS2
Kernel Special Features: CyanogenMod kernel with TRIM support
Version Information
Status: Stable
Created 2014-08-10
Last Updated 2016-04-17
TRIM On Other Roms And Kernels
TRIM on custom roms
when running any non-trim enabled kernel, significant speed benefits can be obtained by overprovisioning the eMMC. as long as a portion of the eMMC is in the erased state (trimmed) it will perform well, even if the kernel is not able to trim. this can be seen for example when the device is new: non-trim kernel and still the device runs nicely. as time goes on, normal usage causes the eMMC to be written all over, reducing the amount of trimmed space to zero and killing performance. this situation can be avoided in two ways: 1) by using a trim-enabled kernel that will trim space once it is no longer used by files, or 2) by setting aside an area of the eMMC and never write to it, effectively keeping it in the erased state. this second option is called overprovisioning in SSD parlance.
those of you wanting to run official CM kernels, CM nightlies, or other custom roms altogether can still obtain most of the benefits of a trim-enabled kernel without one by overprovisioning your eMMC. the stock partitioning of the 4210-based devices includes an 0.5 GB /preload partition that is just perfect for the job.
Requirements:
you have not repartitioned your device and shrank the /preload partition to enlarge other partitions.
your custom rom does not use the /preload partition. (CM does not, and I do not know of any that does... but google!)
you are not using dual-boot or other mods that use the /preload partition.
NOTE: if you have shrunk /preload and enlarged /system to 1 GB you can still follow these steps to overprovision using the free space in /system, but you will need to redo them every time you flash a new rom. otherwise, if you have an 0.5 GB /preload, you can do these steps once and just forget about the whole thing (until you flash something to the /preload partition, that is).
Instructions:
NOTE: please read step 9 now and decide if you want to use a root file manager to delete everything in /preload before you start or if you want to try to format the partition with your current recovery.
READ THIS POST IN FULL. find out which bugs your eMMC has if any, and decide whether to run the risk of trimming.
download to your device the newest trim-enabled kernel for your particular device from here.
download to your device a recovery-flashable copy of the kernel that you are currently using. (or else make a nandroid backup in step 6.)
if you want, download to your device the recovery trimmer script attached to this post. (see step 11 for more information.)
reboot to recovery.
make a nandroid backup if you do not have a flashable copy of your current kernel on your device. (make sure your nandroid is compatible with CWM-based recoveries.)
flash the trim-enabled kernel.
in the advanced section, choose reboot recovery. now you are temporarily running a trim-enabled kernel.
in the mounts and storage section, choose format /preload. (make a nandroid backup first if unsure of its contents.)
NOTE: it has been reported that format /preload does not work. this is a bug in CM's recovery. you may want to adb shell to the device to delete all files and folders under /preload, including those hidden. free space in this partition will remain trimmed when you later use the phone so it is important that most of the partition be empty after this step. (bug report)
still in the mounts and storage section, mount (if necessary) the following partitions: /system, /cache, /data and /preload.
choose one of these two options:
attach your device via USB to your PC, open a terminal, and type adb devices to verify that your device is reachable and authorized. (if it is not, under linux type adb kill-server; sudo adb devices to troubleshoot the issue; under windows try restarting the adb server from an administrator console.) in the terminal type adb shell "fstrim -v /system; fstrim -v /data; fstrim -v /cache; fstrim -v /preload" to trim. for each partition, fstrim should output a message stating the number of bytes trimmed; this indicates success.
flash the attached recovery trimmer script. you will not have any indication of success using this method. (make sure you have mounted the applicable partitions in the previous step!)
flash your old kernel back or, equivalently, restore your nandroid. (you can advance-restore only the boot partition if you want.)
reboot and profit.
TRIM on rooted stock android 4.1.2
this is beyond the scope of this project, but still some people may be interested.
Instructions:
make sure you are rooted.
WARNING: MAKE SURE YOU ARE RUNNING STOCK ANDROID VERSION 4.1.2 (THE RELEASE, NOT A LEAKED VERSION) OR YOU WILL DESTROY YOUR DEVICE DUE TO BRICKBUG!!!
READ THIS POST IN FULL. find out which bugs your eMMC has if any, and decide whether to run the risk of trimming.
WARNING: MAKE SURE YOUR EMMC IS NOT AFFECTED BY TRIM BUG OR YOU WILL DESTROY YOUR DEVICE!!! if you have trim bug, you must not trim on a stock kernel, end of story.
also, it is assumed that release (not a leak) 4.1.2 stock kernel contains this patch and thus is brickbug safe. but there might be different versions, and there is no way to be sure if the corresponding source code was patched by samsung, so...
WARNING: IF YOUR EMMC IS AFFECTED BY BRICKBUG, THE POSSIBILITY HARD BRICKING YOUR DEVICE CANNOT BE COMPLETELY RULED OUT without access to the kernel source code. proceed at your own peril, or better yet, switch to a custom rom/kernel.
install the LagFix (free) app from xda (the market version is declared to be incompatible with some 4210-based devices). go to the LagFix tab, check the 3 partitions, and tap on run. grant root access. the 3 fstrim operations should be successful ("partition was trimmed" means success). alternatively, those with busybox installed can try issuing the fstrim commands themselves. in particular, you must do this to trim /preload. you can also look for the fstrim command in the private files of LagFix.
UPDATE: there is a replacement app for LagFix called Trimmer that has several advantages over the former: is fully free, can schedule TRIMs, and is compatible with Android 5.
reboot and profit.
NOTE: i assume there is little free space in /system and /preload in stock roms, so most benefits will come from trimmed free space in /data. this space will get overwritten in time so you will need to periodically trim.
Recreating My Kernels From Source
i have been wrongly accused of not providing full source code to my kernels. to counter this accusation i am providing step-by-step instructions on how to exactly recreate any of the kernels published in this project from source. to start, all you need to know is the filename of the kernel you want to recreate. then simply follow these steps:
identify and obtain the CM release that corresponds to the kernel based on the kernel filename. example:
kernel: kernel-cm-11-20140915-NIGHTLY-Lanchon-TRIM-20140916-n7000.zip
CM release: cm-11-20140915-NIGHTLY-n7000.zipnote that nightly releases are not kept for long in CM's download servers. that is why i mirror all relevant nightlies right beside my kernels in the downloads section.
extract the build manifest (/system/etc/build-manifest.xml) from the CM release zip file.
using the manifest, checkout the source code corresponding to the release to ~/android/system by following these instructions.
identify the version of the patches that corresponds to the kernel based on the kernel filename. example:
kernel: kernel-cm-11-20140915-NIGHTLY-Lanchon-TRIM-20140916-n7000.zip
branch: cm-11
date: 20140916
tag to match: cm-11-20140916
identify the corresponding tag in my github repo and checkout its tree to ~/android/brickbug/BrickbugAftermath-SGS2. if no tag matches exactly, use the tag in the same branch that sports the closest earlier date.
run ~/android/brickbug/BrickbugAftermath-SGS2/scripts/repo-patch apply to apply the patches.
(repo-patch apply functionality used to be provided by standalone script apply in old versions.)
build the kernel using these instructions.
finally, you can run ~/android/brickbug/BrickbugAftermath-SGS2/scripts/repo-patch reset to unpatch your source tree.
(repo-patch reset functionality used to be provided by standalone script reset in old versions.)
Sh*t...
erdal67 said:
Sh*t...
Click to expand...
Click to collapse
lol brickbug
well someone will have to the guts to try. if you read the main thread (very long), i argue that it is probably safe to run my build in your phone... but then, there's only one way to know for sure
erdal67 said:
Sh*t...
Click to expand...
Click to collapse
Got the same Revision (19) according to the cm table this Rom could! But not must brick our device?
empulse92 said:
Got the same Revision (19) according to the cm table this Rom could! But not must brick our device?
Click to expand...
Click to collapse
i'm sorry you are affected. i personally think it would not brick (for reasons explained in the main thread, you are invited to chip in).
but i could brick! there's risk.
we will never know until somebody tests...
Lanchon said:
i'm sorry you are affected. i personally think it would not brick (for reasons explained in the main thread, you are invited to chip in).
but i could brick! there's risk.
we will never know until somebody tests...
Click to expand...
Click to collapse
I think i may give it a try... Unsure if i should usw another pit? Got 2gb (stock) for now you suggestet to use 4or 6 GB? I got some Mainboards hat home with destroyed imei chips, seems to be good testers if the chip is the same :highfive:
Another question: is the fw Version of the chip upgradeable via Odin vor heimdall? Is it possible to acces the Software used by this chip?
empulse92 said:
I think i may give it a try... Unsure if i should usw another pit? Got 2gb (stock) for now you suggestet to use 4or 6 GB? I got some Mainboards hat home with destroyed imei chips, seems to be good testers if the chip is the same :highfive:
Click to expand...
Click to collapse
boards with lost IMEIs? that would be great to test!!! no big loss in the worse case.
don't bother with the PIT files. just follow the main instructions. this is to test if it TRIM works without bricking in those chips. if you later want to set up a phone for real use, you can try resizing the partitions (i would for my phone).
exactly the same chip! VYLOOM 0x19 :victory: (date differs , 06/2011 but i guess this wont make a big difference at least )
edit: bootin...:fingers-crossed:
edit 2: succesfully booted,
empulse92 said:
exactly the same chip! VYLOOM 0x19 :victory: (date differs , 06/2011 but i guess this wont make a big difference at least )
edit: bootin...:fingers-crossed:
edit 2: succesfully booted,
Click to expand...
Click to collapse
cool!! thanks!!!
and? did you use lagfix?
did u trim /sdcard?
Lanchon said:
cool!! thanks!!!
and? did you use lagfix?
did u trim /sdcard?
Click to expand...
Click to collapse
i did dont know if there are errors if trim isnt supported or not but for now... see yourself
note : play store says lagfix app is incompatible with this device i got the app from xda
http://forum.xda-developers.com/showthread.php?t=2104326
Click to expand...
Click to collapse
empulse92 said:
i did dont know if there are errors if trim isnt supported or not but for now... see yourself
note : play store says lagfix app is incompatible with this device i got the app from xda
View attachment 2891398
Click to expand...
Click to collapse
thanks! yes i'll update the app link then. those trims were successful, and yes it shows errors when you try to trim and the kernel doesn't support it.
i guess now you should use that phone and see if it bricks... for now its looking like the chances of bricking are going way down.
could you do two more tests?
try to trim /sdcard (steps in my first post)
then enable ART (debugging menu) and and see if it boot loops or not.
thanks!
no error when trimming sdcard... should i wait some more before trying art?
empulse92 said:
no error when trimming sdcard... should i wait some more before trying art?
Click to expand...
Click to collapse
great! did the trim sdcard command took some time, like a second or two? or did it end absolutely immediately, like a no operation would?
no, everything checked ok, you can try ART. i think it should work. if it doesnt, wipe data from recovery (i think you are using an empty phone anyway, right?)
there was no delay after using the command.. just as you said, as if nothing happened. this is why i was wondering^^ but still not sure about this
yep the phone is empty, but i cant get into recovery or download mode .. time to set up adb
edit: device offline-.-'
edit 2: i am retarded and forgot to press the home button :')
edit 3: alrighty, now it boots but after wiping its still dalvik cache vm
empulse92 said:
there was no delay after using the command.. just as you said, as if nothing happened. this is why i was wondering^^
yep the phone is empty, but i cant get into recovery or download mode .. time to set up adb
edit: device offline-.-'
edit 2: i am retarded and forgot to press the home button :')
Click to expand...
Click to collapse
hmmm... i've read somewhere the android shell sends stderr to limbo. i just tried to fstrim /sys on my nexus and not a word, exits immediately. on my linux PC it says "fstrim: /sys: FITRIM ioctl failed: Inappropriate ioctl for device".
i'll look into this further. meanwhile, are u testing ART?
EDIT: i dont know why no error is printed. but on android, if you fstrim with -v option you get text if successful:
[email protected]:/ # fstrim -v /system
/system: 0 bytes trimmed
[email protected]:/ # fstrim -v /data
/data: 2399477760 bytes trimmed
[email protected]:/ # fstrim -v /sys
1|[email protected]:/ #
so if you do fstrim -v /sdcard and you get no output, then the kernel is unable to trim FAT32. if this is the case, it would pay to find a alternate solution to this in the long run.
enabling art forces bootloop, formatting data reverts back to dalvik :silly:
no chance to use art for now^^
edit: here's a logcat but i'm not sure if it shows a normal boot or the art bootloop
https://drive.google.com/file/d/0Bw86veXkn-fiZ2FnU3lqdkFuWVE/edit?usp=sharing
edit 2: another screenshot (dont be confused i didnt change the time zone yet)
empulse92 said:
enabling art forces bootloop, formatting data reverts back to dalvik :silly:
no chance to use art for now^^
edit: here's a logcat but i'm not sure if it shows a normal boot or the art bootloop
https://drive.google.com/file/d/0Bw86veXkn-fiZ2FnU3lqdkFuWVE/edit?usp=sharing
edit 2: another screenshot (dont be confused i didnt change the time zone yet)
View attachment 2891493
Click to expand...
Click to collapse
thanks!
assuming official M9 has working ART, there must be some trouble with my build setup. my OpenPDroid build has the same thing, it is not related to TRIM. oh well...
your screenshot clearly shows there is no TRIM support for FAT32
i will think of what to do next. in any case, if you turn off ART and flash this on your working phone (with 20%+ free space in your internal partition) you should notice a big improvement in responsiveness and diminished lags. (a friend told me "feels like a different phone", but maybe he is exaggerating.) i still warn against doing it! i would exercise the internal storage on this phone for a while, installing big apps then deleting them, flashing the rom a couple more times, and using LagFix to trim all partitions.
or you can make a backup of your current phone and restore it here, then lagfix, and see if the increased speed justifies the risk. its your call...
for now i have nothing else to ask you to test. thank you very much!!! you've been amazing help!!!
using this on my daily phone now :good:
empulse92 said:
using this on my daily phone now :good:
Click to expand...
Click to collapse
oops! are you sure??? i hope nothing bad happens...
after LagFix trimming and rebooting, how do you feel the phone in the way of responsiveness?