[KERNEL] MiRaGe - for HTC EVO3D Sense-ICS/AOSP-JB - 3.0.101 - 01132014

Search This thread

mrg666

Senior Member
Aug 4, 2011
1,966
4,784
There are many kernel options for EVO 3D/V and most of them are excellent. The difference of MiRaGe is, first of all, it is mine and I like to use my kernel :) MiRaGe is a very lean, updated, optimized, overclocking kernel.

I am posting the kernel here so that I can return at least a small part of what I have received from the open source community. I thought the amount of time I have spent for MiRaGe could be useful for others as well. In short, take it if you want it, leave it if you don't. ;) But comments, suggestions are always welcome.

There are several custom ROMs in this forum and they can be incompatible with a different kernel. If you are running a custom ROM please use the kernel that the ROM developer recommends. If you know what you are doing and don't need hand holding, you will do what you want anyway.

Changes
  • separate builds for stock HTC/Sense ICS ROM and AOSP JB ROMs
  • based on the latest HTC official source
  • updated to current Linux 3.0 patch level - some of the most irrelevant commits for shooter board were omitted
  • added cifs, tun modules
  • enabled usb otg and added otg-wakelock
  • enabled autogroup scheduler option in CFS to improve interactive responsiveness
  • compiled with gcc 4.7.4 Linaro toolchain with -O2 optimization
  • CPU clocked at default 1.512 GHz, enabled higher overclock up to 1.7 GHz
  • 3D GPU overclock to 320 MHz, added 160 MHz low frequency to save battery
  • 2D GPU overclock to 266 MHz, added 160 MHz low frequency to save battery
  • smoothed voltage curve to increase stability and added CPU voltage table for user control
  • added 467 MHz bus speed to support 1.6 and 1.7 CPU frequencies
  • decreased the number of frequency steps using 108 MHz steps to increase efficiency of interactive governor
  • enabled cpu stats
  • backported staging/android drivers and updates from Google android-3.0 and 3.4 kernels
  • backported many msm/kgsl (a220) driver updates from CAF msm-3.4 and removed the unnecessary a3xx part of the driver
  • upgraded msm/qdsp6 sound driver to v3 from v2 from CM htc_msm8660 kernel
  • backported many ARM optimizations/updates/fixes from Linux 3.8 and CAF msm kernels
  • backported latest interactive cpu governor from Google android-3.4 kernel, set as default
  • backported ondemand governor from CAF msm-3.4 kernel
  • removed unnecessary cpu governors - governors available: <interactive>, ondemand, performance, powersave
  • backported latest ROW I/O scheduler from CAF msm-3.4 kernel
  • removed unnecessary i/o schedulers - schedulers available: <row>, noop, ondemand
  • backported bcm4329 wifi drivers from CAF msm-3.0 kernel, enabled AP_ONLY for WiFi tethering
  • backported bcmdhd wifi driver from CAF jb_chocolate for JB kernel
  • backported workqueue from Linux 3.6 to enhance the hotplug performance of kernel-based mpdecision
  • backported rwsem from Linux 3.11
  • completely revised kernel-based msm_mpdecision for performance
  • removed kernel debug bits, debugfs for security, and bugverbose for lower memory use
  • switched to simple FIFO net scheduler
  • added patch [v4] binfmt_elf.c: use get_random_int() to fix entropy depleting
  • backported latest Qualcomm Crypto Engine (QCE) from CAF msm-3.4
  • QDSP6V3 Hexagon driver enabled
The details of all changes and source code are available at my Github repo for Sense/ICS and AOSP/JB


Downloads
The CDMA version of MiRaGe kernel and related thread is here
These are an any-kernel-updater package that contain zImage + modules

Instructions and Recommendations
  • Flash Image GUI must be used when flashing the MiRaGe kernel first time over the stock kernel since any-kernel-updater script will not be able to expand the stock encrypted boot image. If the EVO3D is still S-ON, Flash Image GUI is also recommended for flashing the MiRaGe kernel since Flash Image GUI bypasses S-ON safely and easily.
  • When the kernel package is flashed in the recovery, /system/bin/mpdecision and /system/bin/thermald are deleted since the kernel comes with corresponding kernel-based services. However those two binary files are not deleted by flashing the kernel using Flash Image GUI. So after flashing the MiRaGe kernel for the first time over the stock kernel, either flash the special package above or reflash the kernel in recovery to delete these files separately. This is required only once after the initial MiRaGe kernel upgrade.
  • I have tested the kernel with S-ON stock HBOOT 1.57/1.58 and also S-OFF JBear HBOOT 1.57.5757/1.58.5858/1.50.5050. Because the kernel upgrade package is an any-kernel-updater package (i.e. existing boot image is upgraded with new kernel binary), it should work with all HBOOT versions.
  • Against the widely claimed misconception, there is no need to wipe dalvik-cache with kernel flash. If you still want to wipe it for your superstition, there is no harm either other than wasting your time and wearing off the flash memory :)
  • If you try to flash the kernel in 4ext recovery while you are S-ON and get caught in a boot loop, you can boot into the fastboot (volume-down and power buttons) and recover the boot partition using the following command.
    Code:
    fastboot flash boot boot.img
    You will need your original boot.img saved on your hard drive first. You can find the original boot.img in your original nandroid backup or in the stock-kernel package above if you are using the stock ICS ROM. In any case, please do a nandroid backup before flashing anything. For the boot image in the nandroid backup to work, you should have the same (or compatible) hboot when it was backed up. For example, the boot image that was working with v1.58 hboot will not boot with 1.50 but will boot with 1.57. I will not accept any responsibility with the loss of your phone or its warranty.
  • I use the excellent No-frills CPU Control app for controlling/changing the minimum/maximum frequencies, cpu governor, I/O scheduler and also monitoring the CPU stats. Normally, you don't need this app unless you want to control these settings, overclock, or monitor the CPU stats.
  • Using Kernel Tuner or similar apps is not recommended. I have optimized the kernel and MiRaGe kernel doesn't need any tuning/tweaking. Please don't post about kernel problems without mentioning that you are using kernel tuner.
  • Don't use the JB kernel with stock ICS ROM. Don't report problems to ROM developers without specifying that you use a different kernel with their ROM.

Credits
Thanks to Johnnyslt, Sultanxda (Android1234567), and Bigwillyg for their collaboration and help
Thanks to faux123, showp1984, MikeC84, Agraben, and Coolexe for their earlier development and patches
Special thanks to Koush for any kernel updater and joeykrim for Flash Image GUI
Thanks to LeslieAnn for testing USB OTG
Thanks to howpathetic for testing and help with the GSM build
Thanks to sellers86 for additional testing
Thanks to Christopher83 for the Linaro toolchain packages
And, also thanks to Linux, Google, CAF, CM, HTC developers, and all developers on XDA.

Battery Use and Performance for Reference
Battery life corresponds to light daily use with the original OEM battery and CPU @1.7 GHz overclock
The benchmarks are the best values with CPU @1.7 GHz overclock
0qv4.png
 
Last edited:

mrg666

Senior Member
Aug 4, 2011
1,966
4,784
How to build

If you are going to distribute your builds, please don't build your binaries with the same name (i.e. MiRaGe) and distribute in this thread. I would recommend you to start an alternative thread. Otherwise the problem reports will be too confusing for everyone.

First requirement is an ARM toolchain for cross compiling, i.e. using an X86 computer to generate ARM binary. I use Linaro tool chain for cross compiling like many others since Linaro specifically develops tool chains that produce optimized code for ARM architecture.

Linaro toolchains can be downloaded from Linaro binary page. The Linaro-12.03-gcc-4.6 toolchain is very stable/reliable and I recommend starting the development with this toolchain. After the kernel build is successfully done and tested, you can switch to later versions. The toolchain can also be built from the source code available at Linaro website. Cristpoher83 distributes binary packages built from source and I use his 4.7.4 package. It is very reliable. I don't use the experimental gcc-4.8 based toolchains (as of July 2013) since they don't build reliable kernels for me yet.

The binary Linaro toolchain package needs to be expanded in a certain directory, probably inside the home directory. The source code for kernel is available in my Github repo, You can either download the kernel source as a compressed package or you can git-clone it with the following command (you will need git installed in your Linux computer)
Code:
git clone https://github.com/mrg666/android_kernel_shooter.git

The kernel source can again be in a specific home directory.

After the source and toolchain are prepared, copy the configuration file for shooteru, arch/arm/configs/shooter_u_config, as .config to the root of the kernel source and use the following command to build the kernel
Code:
make ARCH=arm CROSS_COMPILE=~/android/android-toolchain-eabi_46/bin/arm-linux-gnueabi- zImage modules -j6

Replace j6 in the above command according to the number of cpus you have on your computer.
Also set CROSS_COMPILE based on the directory you have expanded the binary toolchain package in your home directory.

I use Xubuntu 13.04 x64 (currently) on my Linux workstation that has a Phenom II X6 CPU (960T unlocked to 6 cores and overclocked to 3.4 GHz), 8 GB RAM, 500 GB HD. The compile time is about 1m32.824s for me using all 6 cores. I have been using Ubuntu since version 10.04 to build Gingerbread, Jellybean, and Linux kernel and updated the OS to each and every new version, all of them worked just fine. There is no magic version of Ubuntu. The build problems arise from the package requirements not the OS version.

The flash package is easy. Just use what I distribute as a template and replace zImage and modules inside the package with your build.

Now that you have source and can build the kernel, you can add all the features you want to the kernel ;)
 
Last edited:
P

phantom5

Guest
4ext is ideal with s-off. Don't forget nandroid backup!
Relevant Part:
Code:
Starting TWRP 2.5.0.0 on Tue Jul 30 16:05:48 2013

I:Set page: 'install'
I:Set page: 'flash_confirm'
I:Set page: 'flash_zip'
I:Set page: 'flash_zip'
Installing '/sdcard/Download/MiRaGe_shooter_test_kernel_881_gsm.zip'...
Checking for MD5 file...
I:Cannot find file /sdcard/Download/MiRaGe_shooter_test_kernel_881_gsm.zip.md5
Skipping MD5 check: no MD5 file found.
Copying files to /tmp...
minzip: Extracted file "/tmp/dump_image"
minzip: Extracted file "/tmp/mkbootimg"
minzip: Extracted file "/tmp/mkbootimg.sh"
minzip: Extracted file "/tmp/unpackbootimg"
minzip: Extracted file "/tmp/zImage"
Dumping boot image to /tmp...
about to run program [/tmp/dump_image] with 3 args
about to run program [/tmp/unpackbootimg] with 3 args
Updating kernel and making new boot image...
run_program: child terminated by signal 11
about to run program [/tmp/mkbootimg.sh] with 1 args
cat: can't open '/tmp/boot.img-cmdline': No such file or directory
cat: can't open '/tmp/boot.img-base': No such file or directory
Segmentation fault
run_program: child exited with status 139
script aborted: assert failed: write_raw_image("/tmp/newboot.img", "boot")
Flashing new boot image...
assert failed: write_raw_image("/tmp/newboot.img", "boot")
E:Error executing updater binary in zip '/sdcard/Download/MiRaGe_shooter_test_kernel_881_gsm.zip'
Error flashing zip '/sdcard/Download/MiRaGe_shooter_test_kernel_881_gsm.zip'
Updating partition details...
I:Unable to mount '/sd-ext'
I:Actual block device: '', current file system: 'ext4'
I:Set page: 'flash_done'
I:Set page: 'clear_vars'
I:Set page: 'install'
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Set page: 'advanced'
I:Set page: 'confirm_action'
I:Set page: 'action_page'
I:Copying file /tmp/recovery.log to /sdcard/recovery.log
 
Last edited:

howpathetic

Senior Member
Nov 14, 2012
380
582
Xiaomi Mi Mix 2S
Testing the Kernel

I flashed the kernel via EXT4(smartflash) on my Evo 3D GSM S-ON.
Everything is working (except wifi). I will be testing it now :)

Thanks for the kernel and welcome to the Evo 3D GSM world :)
I will update this post.
 
Last edited:
  • Like
Reactions: mrg666

mrg666

Senior Member
Aug 4, 2011
1,966
4,784
I flashed the kernel via EXT4(smartflash) on my Evo 3D GSM S-ON.
Everything is working (except wifi). I will be testing it now :)

Thanks for the kernel and welcome to the Evo 3D GSM world :)
I will update this post.

Thanks for the welcome.
Smartflash is sometimes unreliable. I recommend using Flash Image GUI if you are S-ON. See the MiRaGe thread in CDMA forum for details. I will update the OP with full post after the initial tests.

Thanks also for the initial feedback.
 
  • Like
Reactions: a1himik
P

phantom5

Guest
Thanks for the welcome.
Smartflash is sometimes unreliable. I recommend using Flash Image GUI if you are S-ON. See the MiRaGe thread in CDMA forum for details. I will update the OP with full post after the initial tests.

Thanks also for the initial feedback.

COnfirmed, everything but wifi works.

S-off.
 

mrg666

Senior Member
Aug 4, 2011
1,966
4,784
Just flashed it via Flash Image GUI, EXT4 doesn't flash the kernel properly.
Try to add
"set_perm_recursive(0, 0, 0755, 0644, "/system/lib/modules");"
to your updater script :)

I added the permissions line as you suggested in the updater script. It has not been a problem before ... but it makes sense since the problem looked like failing to load the wifi module. It is hopefully fixed now. I have also applied a fix for the camera. I would appreciate if you can test again. The newer 882 build is in the OP.
 
  • Like
Reactions: scariola

mrg666

Senior Member
Aug 4, 2011
1,966
4,784
Thanks to howpathetic, I fixed the build script problem for WiFi. I am working on camera now. Hopefully that will also be fixed soon. The download is available in the OP again. Please report if you find any other problems. Thank you all for your help :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    There are many kernel options for EVO 3D/V and most of them are excellent. The difference of MiRaGe is, first of all, it is mine and I like to use my kernel :) MiRaGe is a very lean, updated, optimized, overclocking kernel.

    I am posting the kernel here so that I can return at least a small part of what I have received from the open source community. I thought the amount of time I have spent for MiRaGe could be useful for others as well. In short, take it if you want it, leave it if you don't. ;) But comments, suggestions are always welcome.

    There are several custom ROMs in this forum and they can be incompatible with a different kernel. If you are running a custom ROM please use the kernel that the ROM developer recommends. If you know what you are doing and don't need hand holding, you will do what you want anyway.

    Changes
    • separate builds for stock HTC/Sense ICS ROM and AOSP JB ROMs
    • based on the latest HTC official source
    • updated to current Linux 3.0 patch level - some of the most irrelevant commits for shooter board were omitted
    • added cifs, tun modules
    • enabled usb otg and added otg-wakelock
    • enabled autogroup scheduler option in CFS to improve interactive responsiveness
    • compiled with gcc 4.7.4 Linaro toolchain with -O2 optimization
    • CPU clocked at default 1.512 GHz, enabled higher overclock up to 1.7 GHz
    • 3D GPU overclock to 320 MHz, added 160 MHz low frequency to save battery
    • 2D GPU overclock to 266 MHz, added 160 MHz low frequency to save battery
    • smoothed voltage curve to increase stability and added CPU voltage table for user control
    • added 467 MHz bus speed to support 1.6 and 1.7 CPU frequencies
    • decreased the number of frequency steps using 108 MHz steps to increase efficiency of interactive governor
    • enabled cpu stats
    • backported staging/android drivers and updates from Google android-3.0 and 3.4 kernels
    • backported many msm/kgsl (a220) driver updates from CAF msm-3.4 and removed the unnecessary a3xx part of the driver
    • upgraded msm/qdsp6 sound driver to v3 from v2 from CM htc_msm8660 kernel
    • backported many ARM optimizations/updates/fixes from Linux 3.8 and CAF msm kernels
    • backported latest interactive cpu governor from Google android-3.4 kernel, set as default
    • backported ondemand governor from CAF msm-3.4 kernel
    • removed unnecessary cpu governors - governors available: <interactive>, ondemand, performance, powersave
    • backported latest ROW I/O scheduler from CAF msm-3.4 kernel
    • removed unnecessary i/o schedulers - schedulers available: <row>, noop, ondemand
    • backported bcm4329 wifi drivers from CAF msm-3.0 kernel, enabled AP_ONLY for WiFi tethering
    • backported bcmdhd wifi driver from CAF jb_chocolate for JB kernel
    • backported workqueue from Linux 3.6 to enhance the hotplug performance of kernel-based mpdecision
    • backported rwsem from Linux 3.11
    • completely revised kernel-based msm_mpdecision for performance
    • removed kernel debug bits, debugfs for security, and bugverbose for lower memory use
    • switched to simple FIFO net scheduler
    • added patch [v4] binfmt_elf.c: use get_random_int() to fix entropy depleting
    • backported latest Qualcomm Crypto Engine (QCE) from CAF msm-3.4
    • QDSP6V3 Hexagon driver enabled
    The details of all changes and source code are available at my Github repo for Sense/ICS and AOSP/JB


    Downloads
    The CDMA version of MiRaGe kernel and related thread is here
    These are an any-kernel-updater package that contain zImage + modules

    Instructions and Recommendations
    • Flash Image GUI must be used when flashing the MiRaGe kernel first time over the stock kernel since any-kernel-updater script will not be able to expand the stock encrypted boot image. If the EVO3D is still S-ON, Flash Image GUI is also recommended for flashing the MiRaGe kernel since Flash Image GUI bypasses S-ON safely and easily.
    • When the kernel package is flashed in the recovery, /system/bin/mpdecision and /system/bin/thermald are deleted since the kernel comes with corresponding kernel-based services. However those two binary files are not deleted by flashing the kernel using Flash Image GUI. So after flashing the MiRaGe kernel for the first time over the stock kernel, either flash the special package above or reflash the kernel in recovery to delete these files separately. This is required only once after the initial MiRaGe kernel upgrade.
    • I have tested the kernel with S-ON stock HBOOT 1.57/1.58 and also S-OFF JBear HBOOT 1.57.5757/1.58.5858/1.50.5050. Because the kernel upgrade package is an any-kernel-updater package (i.e. existing boot image is upgraded with new kernel binary), it should work with all HBOOT versions.
    • Against the widely claimed misconception, there is no need to wipe dalvik-cache with kernel flash. If you still want to wipe it for your superstition, there is no harm either other than wasting your time and wearing off the flash memory :)
    • If you try to flash the kernel in 4ext recovery while you are S-ON and get caught in a boot loop, you can boot into the fastboot (volume-down and power buttons) and recover the boot partition using the following command.
      Code:
      fastboot flash boot boot.img
      You will need your original boot.img saved on your hard drive first. You can find the original boot.img in your original nandroid backup or in the stock-kernel package above if you are using the stock ICS ROM. In any case, please do a nandroid backup before flashing anything. For the boot image in the nandroid backup to work, you should have the same (or compatible) hboot when it was backed up. For example, the boot image that was working with v1.58 hboot will not boot with 1.50 but will boot with 1.57. I will not accept any responsibility with the loss of your phone or its warranty.
    • I use the excellent No-frills CPU Control app for controlling/changing the minimum/maximum frequencies, cpu governor, I/O scheduler and also monitoring the CPU stats. Normally, you don't need this app unless you want to control these settings, overclock, or monitor the CPU stats.
    • Using Kernel Tuner or similar apps is not recommended. I have optimized the kernel and MiRaGe kernel doesn't need any tuning/tweaking. Please don't post about kernel problems without mentioning that you are using kernel tuner.
    • Don't use the JB kernel with stock ICS ROM. Don't report problems to ROM developers without specifying that you use a different kernel with their ROM.

    Credits
    Thanks to Johnnyslt, Sultanxda (Android1234567), and Bigwillyg for their collaboration and help
    Thanks to faux123, showp1984, MikeC84, Agraben, and Coolexe for their earlier development and patches
    Special thanks to Koush for any kernel updater and joeykrim for Flash Image GUI
    Thanks to LeslieAnn for testing USB OTG
    Thanks to howpathetic for testing and help with the GSM build
    Thanks to sellers86 for additional testing
    Thanks to Christopher83 for the Linaro toolchain packages
    And, also thanks to Linux, Google, CAF, CM, HTC developers, and all developers on XDA.

    Battery Use and Performance for Reference
    Battery life corresponds to light daily use with the original OEM battery and CPU @1.7 GHz overclock
    The benchmarks are the best values with CPU @1.7 GHz overclock
    0qv4.png
    28
    I think this testing was successful and we can keep this memory map in the stable builds. I have updated the JB build with the memory map patch merged in the OP. Thanks to Sultan (android1234567) for his gift to EVO 3D community. ICS version hasn't been updated.

    Although I had switched to Nexus 4 recently. I was still keeping my beloved EVO 3D. But I had to sell it yesterday to fund the purchase of another device (a GS3). This is the only way I can continue with my development addiction. :eek:

    So this concludes my development for EVO 3D since I don't have the device for testing anymore.

    Thanks to all of you, this has been real fun. See you all around.
    10
    MiRaGe kernel updated.
    - cpufreq: interactive: fix show_target_loads and show_above_hispeed_delay
    - workqueue: cond_resched() after processing each work item
    - cleanup kernel/network settings to eliminate more unnecessary code
    - shooter_u: fix keypad
    - unify shooter_u and shooter header files
    - Linux 3.0.96 patches
    Cheers!
    10
    I have updated the builds in the OP.
    - made sure interactive is the default governor after two reports at the CDMA forum
    - added a fix for a seemingly harmless kernel message about failing to set the cpu voltage.

    Please test and let me know
    9
    The following is a kernel built from the jellybean branch of MiRaGe kernel. I am sharing it here as a test kernel, please let me know how it goes if you test with your favorite jellybean flavor.

    http://www.mediafire.com/download/jnix74onu4qjfds/MiRaGe_shooter_u_test_kernel_1002_jb.zip Updated: 10152013

    Reminders: Don't use this kernel with stock ROM. Don't report problems to ROM developers if you use this kernel with their ROM.

    I am switching my phone to Nexus 4 very soon and I have already unactivated my EVO 3D CDMA service. I will keep checking this thread and try to keep the kernel updated as required. I am not expecting any problems based on the feedback in the previous months though. MiRaGe is in a very stable and reliable shape that the development had come to a natural end anyway. I had so much fun developing this kernel with your company. Cheers!

    Edit: Updated to include bluetooth and vidc fixes by johnnyslt.
    Edit 2: Updated again to include vidc crash fix and the ondemand governor backported from CAF msm-3.4.