[Hero, G2 Touch Android Development] erasmux:
FAQ and Advanced Subjects

FAQ

0. When reporting a problem, do I need to include the ROM and exact kernel version I am using?

YES!

1. How do I flash the kernel update file?

You flash it from recovery, like any other custom ROM. If you are not familiar with recovery and/or haven't rooted your phone, start here.

2. Do I need to wipe anything when installing the kernel?

No you don't need to do any wipes. Just install the kernel through recovery and reboot :)

3. The update from recovery failed with errors/warning?

Please, in the same recovery session which you tried to apply the update and failed, select the "Move recovery.log to SD" from the "Other" menu and post in this thread with the recovery.log attached (for example in a .zip file).

4. After flashing the kernel my ROM does not boot

A logcat of the boot process might help me understand the problem. Using adb you can generate one with the following command and attach it to your report:

adb logcat > logcat.txt

You need to run this command relatively close to the start of the boot. Close the window after the phone is stuck for few minutes (say 2 mins with no change should do). You can start by running "adb logcat" and seeing if you get any output at all. If so, reboot once more and run the above command from the start of the boot (approximately).

Please also clearly state which ROM you are using and which kernel did work for you (which one did you use before).

To recover from such a scenario, boot into recovery and restore a backup of your working state. If you do not have a backup, and its the kernel fault, flashing your old kernel should solve the problem.

5. What min/max frequencies should I choose?

The short answer: min 176, max 614, if you have wake up issues up the min speed to 264 and then to 352.

To play with the speeds I suggest you install SetCPU (or similar app), so you can view and change your settings interactively. To change it permanently from the bootup see instructions on first post. You also use options like "Set on boot" in SetCPU if you prefer that.

The long answer:

The max frequency will effect the speed and responsiveness of your phone when screen is on. Note, that any speed above 528Mhz is above the specification of the manufacturer, hence is overclocking and could, in theory, shorten the life of your device. At high enough frequencies all devices will stop functioning, the exact threshold depends on your luck with your specific device. From my experience and knowledge, running at stable frequencies (or say one or two steps down to be on the safe side), should not harm your device - of course all overclocking is done at your sole responsibility.

As far as I know, almost all device can handle 652Mhz, most can reach the 691/710 area and some can even reach higher than the 748Mhz cap of this kernel. To find out which speed your phone supports, use SetCPU (or similar app), start from 614 for example and up the speed one tick a time. Don't select "Set on boot". At each step play with the phone a minute or two. If the phone gets stuck, reboot it (take out battery if necessary) and go one tick down.

Additionally, note the higher your max frequency the higher the battery drain will be when the screen is on. It is true that the display, data, wifi, gps, etc. should drain much more than the cpu. Still, I recommend staying in the sane frequencies range, no more than say 691Mhz (even if you phone can handle it).

Finally the min speed will effect standby battery life (when screen is off). From my experience there is a difference in battery life between 19Mhz and 352Mhz min frequencies but it is relatively small (much less than I expected). 19Mhz is not stable for me, almost stable, but over a period of weeks you will probably experience weird and possibly very rare instabilities. For me this was the when playing music with screen off the phone got stuck at 19Mhz (very hard to find this out), and became totally unresponsive until I rebooted it. Therefore, I recommend starting from 176Mhz, and if you have wakeup issues to bring it up. With 352Mhz you should have no wake up issues at all.

6. I am having wakeup issues (such as unresponsiveness to wakeup, weird coloring after wakeup, screen inversion, caller id not working on wakeup)

Up the min speed to 264 and then to 352. With a min frequency of 352 you should not have any wake issues.

See the FAQ #5 above for more information.

7. I am experiencing bad battery life with FlyKernel

First, please make sure to reboot the ROM at least one time after you flash the kernel. There have been reports that ROM/kernels behave badly on the first boot.

Personally, I do not do battery calibration, but if it makes you happy go for it. I do recommend at least charging the battery overnight, or a couple of hours after it has reached 100% to be sure it is full. Then use it, your regular usage for a few days and only then judge the battery life.

The battery percent indicator, over short periods of time seems extremely inaccurate and its very hard to reach any correct conclusions based on it.

If you do want to report bad battery life, please state your settings (kernel version, min/max speeds, governor, etc.), over which period you have been testing the battery, under what usage, what is the battery life you are used to having with which kernel and what is the battery life you are experiencing now.

Note, that roughly speaking, I lose less than 1%/hour when screen is off (wifi, data, gps, etc. also off), and about 10%/hours when just screen is on but phone does nothing at all (again wifi, gps, etc. off). About 20%+/hour when stressing my phone (although I have no data plan so can't test that). I am using the latest FlyKernel @ smartass 614/176.

8. What size should I give the swap partition?

short answer: 0.

long answer: I do not recommend using swap on the hero, hence 0. If you have a very fast SD card, and want to try it, give it say 64Mb. Note that I know of no ROM for the hero which activates swap automatically - you'll need to add a init.d script or something to activate it (see a bit more info here). Let me know if you find a scenario where the swap gives substantial improvement over no swap.

Finally note that FlyKernel versions before 12 do not support swap.

9. Should I use ext2, ext3 or ext4 for my ext partition?

Short answer: ext4. Note that FlyKernel versions before 12 did not support ext4, ext3 is supported since version 10.

Long answer:

Previously, I was under the impression that a journaling file system is a very bad idea for flashable storage. I still think its not ideal but better than the other alternative:

I have been using dual booting, placing an entire development ROM on an ext2/4 partition and using it for development. And when using ext2 it would get errors almost every boot and every couple of days get corrupted to the point I needed to manually restore damaged files to get it working....

It seems that if you only use it for app2sd, there are very infrequent changes to this volume (only when you install a new app), hence it does not get corrupted. But this also means that ext4, in this scenario, will not pay much overhead because there are very few changes. And in the case there are many changes, if I have to choose between a slightly shorter SD life with ext4 (and then I can finally get a faster one ;)) or risking my data getting corrupted on a daily basis with ext2 - I prefer the first (ext4).

Questions 10-13 are now obsolete with smartassV2 - see the first post for details about it :D

10. Do I need a SetCPU (or similar) screen off profile with smartass?

No, smartass automatically limits the screen on frequency to >= 518Mhz to ensure responsiveness, and screen off frequency to <= 352Mhz to keep standby battery life under control. Much like HTC's perfllock, it does this at the kernel level so it is much better than app level screen off profiles.

11. Using smartass the CPU frequency does not drop below 518Mhz (with screen on)

Intentional to ensure responsiveness. From my testing, when screen is on battery drain difference of speeds < 518Mhz is not significant relative to the drain by the screen itself.

12. Using smartass the CPU frequency does go above 352Mhz (with screen off)

Intentional to keep standby battery life under control.

13. Using smartass the CPU frequency is always at its max (or always at 352Mhz when screen is off)

See "Monitoring the CPU frequency" in the "Advanced subjects".

14. I am experiencing spontaneous reboots

Please post, in this thread, with as much detail as possible about the problem.

Please also attach the last_kmsg, which you can get from example using:

adb pull /proc/last_kmsg

15. What happend to the BFS version?

With the FlyKernel-12 scheduler tweaks (CFS scheduler), it surpasses the BFS version in every way. I tried to compile a BFS from the FlyKernel-12 code but even in neocore, in which the BFS was always much better, the new tweaked CFS leaves the BFS in the dust. Hence, I see no reason to continue and build/support a BFS version. The hero-bfs_defconfig is still up to date in my sources if anyone wants to build it themselves.

*. I am experiencing an issue not covered in the FAQ which I believe is kernel related

Please post, in this thread, with as much detail as possible about the problem.

Please also detail why you believe this kernel related. The best "proof" that it is the kernel's fault, is to flash back your old kernel and verify the problem is solved, then reflash the new kernel and verify the problem reappears. In any case please detail the kernel and version(s) on which your are experiencing the problem and those on which you do not.

Advanced Subjects

* Monitoring the CPU frequency

Will rewrite this more clearly. In the meantime:

http://xdaforums.com/showpost.php?p=9925116&postcount=903

http://xdaforums.com/showpost.php?p=9929325&postcount=919 <-- Mainly this one!!!

http://xdaforums.com/showpost.php?p=9989996&postcount=970

http://xdaforums.com/showpost.php?p=10010110&postcount=990