yashsingh1/xdaforums huggingface dataset:
[ZenFone 2 Android Development] TheSSJ:
Succeeded to build a bootable image this time :cool: Will send you the DL link to test first. If Qemu works I will publish the kernel, otherwise I will roll back to v44 again (it's not like I would have already wasted horrendous amounts of hours on this cursed kernel). Also I have built it in form of loadable modules so the people can decide if they want to load the KVM modules or not, that's why you need to load up the modules via shell script.

[MENTION=3466024]LostSoulFly[/MENTION]: Did you manage to get the script executed now? Try to execute the script normally via adb (while the system is already booted up). Normally it can't be init.d anymore as it is working properly. You could pipe the output to a logfile located in /cache to see if it throws out an error message.

Cheers
[ZenFone 2 Android Development] dutch45612:
All good [MENTION=2388665]TheSSJ[/MENTION] ;) ... All modules did load without errors and KMV support do his virtualizing job ;) ! Well done my friend. And please tell me, i can't seems to access the unlocked clocks of the GPU (it's the first time i flash your kernel so i didn't try the version 44 ) ... It's it normal?
[ZenFone 2 Android Development] aziz07:
Use init.d script in download section. Use AIDA64 for clocks.
[ZenFone 2 Android Development] XneofuX:
Just wanted to confirm: KVM and bridge are working :good: Thanks for all the effort! :victory:
[ZenFone 2 Android Development] Ntrasme:
Great news! Your kernel appears to be working on CM 12.1! https://www.reddit.com/r/zenfone2/comments/3e8m3c/cyanogenmod_121_first_impressions/ A redditor reviewed the latest build and said the rom booted with the kernel. This phone just keeps getting better and better.
[ZenFone 2 Android Development] aziz07:
Just to let you guys know that I found a better alternative to DS Battery Saver (Using 120Mb RAM and causing 120/h wakelocks!).

Its a 10Kb app lol It will force sleep 3 Cores when screen is off even with Performance governor. Here is the original thread but there is a newer play store version:

http://xdaforums.com/showthread.php?t=1745517
[ZenFone 2 Android Development] Ntrasme:
Is this better than power nap forcing deep sleep? Have you tried it on the zenfone yet? Seems promising!
[ZenFone 2 Android Development] aziz07:
Yes, I think its better since power to the 3 CPU cores is completely off when screen is off, not even at min 500Mhz frequency. All other apps only disable wifi, gps and sync. I can do those manually as I need my notifications right on time without wasting battery. That way 1 core is enough for music, radio, download, notifications etc

Just installed it and its working great as I can see in 3C Tool box which core was Off and When; there was no Red Offline before using this app when screen was off with performance governor. Also, in AIDA64 I see a drop in overall temperatures when I turn back on the screen which proves further that its working. (Phone feels colder when screen is off also versus without the app).

I used the 1.86$ (He well deserve more for this lmao) playstore version as it was updated recently and supports lollipop but its 300Kb and not 10Kb :laugh:

Best of all is that nothing runs in background, it apparently apply a script either manually or automatically at boot.

I installed it about 5 min ago and screen was off once for a short time to see if there is red offline status (2nd ss uploaded later):

btw I just installed GravityBox for the 1st time and was astonished by how much you can customize UI just like CM with Stock ROM. e.g. Immersive mode, status bar design, more audio steps, advanced power menu etc See the status bar in my screenshot :good: There is PIE controls but I like LMT PIE as it has much more customization with 2 Layers, 14 actions/apps for 2nd layer (Short/Long press) and 10 for 1st layer. Open apps in a fraction of a second lmao

You can also have screenshot, immersive desktop, advanced reboot recovery bootloader and screen video record menu with power button long press.
[ZenFone 2 Android Development] TheSSJ:
Didn't think it'd have booted :laugh: maybe replacing the ramdisk from stock to cm would help fixing some of his issues though...

Interesting, as I am struggling with the 2 faulty governors I thought about moving on implementing hotplugging techniques, maybe the app teaches me how to aggressively do so. Also there is still the intel compiler which is waiting :D
[ZenFone 2 Android Development] aziz07:
Maybe a governor that shuts off 3 cores and downclock the remaining core to 500Mhz when screen is off? The 4 cores then bump to 2.33Ghz (Or any max freq value set in cpu app) when screen is on. That would hugely improve idle battery life without affecting performance. :)
[ZenFone 2 Android Development] HaiDM:
Noob question: How can I overclock my 1.8Ghz CPU to 2.3Ghz ? My phone already using this kernel but I can't set the CPU clock higher than 1.8Ghz (via Kernel Auditor)

Thanks
[ZenFone 2 Android Development] crpalmer:
Don't believe everything that you read.

This kernel overwrites the ramdisk with the stock ramdisk. That makes it incompatible with CM12.1 and should not be used with it if you are doing your own builds of CM.
[ZenFone 2 Android Development] TheSSJ:
I thought so too,that's why many kernels are provided one time for stock and one time for CM, would have tested it anyways before pushing a kernel for CM
[ZenFone 2 Android Development] ImjuzCY:
Overclocking isn't supported by this kernel as stated in first post. In other words, you can't use anything higher than 1.8Ghz if you have the 1.8Ghz version of the phone. And most probably overclocking will never be added into this kernel. :)
[ZenFone 2 Android Development] TheSSJ:
Yep, many thanks for answering this :)

There are some problems hindering me to do OC/UV:

1. I can't find the file which sets the frequencies for the CPU

2. I miss the knowledge until how much I could OC without damaging the HW (also I strongly assume that the frequencies can't be set in some source code as the 1.8GHz phones don't show frequencies above this, so this seems to be a feature of the CPU itself to tell the kernel which frequencies it supports, which is kinda cool if my assumption is true)

3. I aim for a good balance between battery and performance, thus OC/UV is not so important for me (there has to be a touch of me in this kernel after all :P )

What is still set as a "To do" for me can be found in the OP (and of course if some of you suggest something I will definitely take this into consideration)
[ZenFone 2 Android Development] LostSoulFly:
This is driving me crazy. I can't seem to execute it. I even tried to output a log but the log never gets created.

I can't run from a terminal on my phone or from adb.

I've renamed it from init.sh to script. I've tried calling it just GPU. I've tried creating it directly on my phone. Nothing worked.

I just added it to one of the L speed scripts and it seems to be working. I can't figure out why it doesn't think it's a file. I am able to rename and rm the file, so it's obviously there..

1|root@Z00A_1:/system/etc/init.d # ./script
./script
tmp-mksh: ./script: No such file or directory
1|root@Z00A_1:/system/etc/init.d # ls
ls
LS00Cleaner
LS00Cron
LS00IO
LS00Kernel_tweaks
LS00Kill_media_server
LS00Ram_manager_BL
LS00Seeder_enlarger
LS00VM_tweaks
LS00Zipalign
script
[ZenFone 2 Android Development] Ntrasme:
It's case-sensitive. Do "LS", not "ls".
[ZenFone 2 Android Development] LostSoulFly:
What? ls worked just fine for listing directory contents.
[ZenFone 2 Android Development] TheSSJ:
can you run ls -l (it is a "small L" as it can be confused with a "big i". it will display the rights)

there we will see if the owner is correct and the permissions it has
[ZenFone 2 Android Development] ansebovi:
2. no it wont show freq,we must create freq in codes...atleast thats how in many snapdragons,...

actually just one problem in ur query,..you didnt say anything about what you want to execute
[ZenFone 2 Android Development] AL_IRAQI:
What is Kernel Caches ?
[ZenFone 2 Android Development] aziz07:
Maybe ZRam?
[ZenFone 2 Android Development] Angelictears:
Is there progress regarding touchboost bug? Feels sluggish without touchboost. I prefer to use yanactive,but without touchboost it's sluggish sometimes.

Other than that, all working great on my 550ml
[ZenFone 2 Android Development] Ntrasme:
What I did is I just copied the tunables from Yankactive into interactive. Reboot to fix the touchboost bug, then make above hispeed to 80000, Touchboost duration to 20000, and min sample time to 20000.
[ZenFone 2 Android Development] TheSSJ:
There won't be a fix on kernel side: http://xdaforums.com/showpost.php?p=61973780&postcount=326

Some Android OS component sends touchboost events to a hardcoded location. I could make a quick and dirty patch symlinking touchboostpulse file if another gov than interactive was used and setting the owner to system when interactive is running but honestly this problem should be addressed to Asus to get this patched. Unfortunately changing governor requires root,so I'd say nothing will happen then :-\

/EDIT: I seem to have succeeded in hotplugging as soon as the screen is off. Will monitor this for a while and report back

/EDIT2: Nah, had to roll back :D

Basically I need to check first if the CPU is doing some work and let it finish before I can hotplug it. Then I noticed this line https://github.com/TheSSJ/android_k...lob/master/kernel/kernel/power/suspend.c#L260

Basically it is already disabling all CPUs when it is going to sleep mode
[ZenFone 2 Android Development] Ntrasme:
So the phone is already shutting off cores without needing any mod/script? Never mind, just read that last line. :p
[ZenFone 2 Android Development] aziz07:
I tried 3C Toolbox with [MENTION=2539550]corrsea[/MENTION] advice to turn off Cores when screen is off in Device Manager section. You can also downclock the remaining core to 500Mhz. It seems to only turn off 2 Cores, so with 3 Cores off, battery should be even better with Performance governor ; note how Core #2 is not offline (Green Rectangle) even though I am using the same settings for other cores.

If this can be setup in the Kernel, it will be applied faster, much more convenient and without relying on an app :

p.s: This is with Performance governor and SuperZen Stock ROM running in parallel to this amazing Kernel ; screen was off. Once screen is on, all 4 Cores are back to 2.33Ghz.
[ZenFone 2 Android Development] Techronico:
Since nothing is going to happen from Asus' side of things, could you provide the quick and dirty fix mentioned? You could name it something cool like "QuickFix for Lazy Asus Touchboost Hardcoding" or "QFLATH" for short.
[ZenFone 2 Android Development] ansebovi:
Wow cool but i thought this :) already since deep sleep never consume any battery..

And hotplugging need in screen on time.. But from my test of switching off 2 cores didn't increase screen on time..

Can any other test this pls... Use kernel auditor, turn off 2 cores and test it please
[ZenFone 2 Android Development] Ntrasme:
Governor might have an effect on your findings. Some compensate for the lack of 2 cores by making first 2 run faster. Others ignore the fact that 2 cores are offline and act as if they are working.
[ZenFone 2 Android Development] ansebovi:
maybe but i tested with adpative,ondemand and conservative x...none of them improved :(
[ZenFone 2 Android Development] aziz07:
Can you disable 3 cores with Kernel Adiutor and post 3c toolbox screenshot? The right circle never shows offline status yet the left one does show both, offline and online.

Edit: I manually disabled mpdecision and was able to shutdown 3 cores threw terminal but how can this be automated?
[ZenFone 2 Android Development] aziz07:
SoT is not affected by shutting down cores when screen is OFF. Its logical and your results are normal.

To increase SoT, you have to disable cores when screen is ON.

Its like if there is 2 governors, one for screen off and one for screen on.

This is handled by the mpdecision file.

adb root

adb stop mpdecision

adb shell

echo "0" > /sys/devices/system/cpu/cpu1/online

echo "0" > /sys/devices/system/cpu/cpu2/online

echo "0" > /sys/devices/system/cpu/cpu3/online

**Note that running 1 core [MENTION=2670407]500mhz[/MENTION] will greatly reduce performance.

Also, from your earlier screenshots, you have lots of background apps including facebook etc. All these will decrease SoT.
[ZenFone 2 Android Development] ansebovi:
yep thats what i said...kernel auditor will turn off core in screen on time and screen off time[if its not in deep sleep i mean]...

and turning 3 cores gives heavy lag,so i turned off 2 cores only..as u can see only 2 cores running...at conservativex[it always try to be in low freq,checked via terminal also..see the pics]
[ZenFone 2 Android Development] TheSSJ:
Quick update: fixed the touchboost problems when using interactive (it grants write access to root, root group and others). Still when using yankactive or any others I can't just create a folder with a symlink unfortunately. Also creating sysfs entries is not easy as doing "mkdir /sys/xxx/interactive". This needs to be workarounded by the kernel, but creating a link is the showstopper at the moment.

Found the file which is responsible for the hardcoded touchboost path: /system/lib/hw/power.mofd_v1.so

If I would have the source of it, I could make it more dynamic by just searching which governor is active at the moment and setting touchboostpulse to 1 only if this tunable exists...man...this would stop the flooding of logcat
[ZenFone 2 Android Development] Veselchak787:
Dear TheSSJ. Its a gerat work! Thank you bro!

Can you put in the head of this topic link on last stock kernel for simple rolling back to stok kernel?

Best varian zip for TWIRP.

Please.
[ZenFone 2 Android Development] Techronico:
Is the possibility of bugging Asus about this something that would benefit the community? We could get the Asus rep who lurks around here to pass on a request? Sounds like they should release the source of that file without fear of competitors copying the techniques they use because of its bad coding.
[ZenFone 2 Android Development] TheSSJ:
Well, then I would need more than just the source of this component as it is using other shared libraries unfortunately...^^

Would be easier if Asus would publish a small update to patch the power library properly ( [MENTION=438582]Tuanies[/MENTION] : Is this something you can influence?). Basically from the fixed path it should be transformed like this:

List the content of the directory /sys/devices/system/cpu/cpufreq/

For each found directory check if there is a file named touchboostpulse in it and set it to 1 for boost (if the according event is caught) or 0 for unboost

Done. Also every stock governor would need to be changed to Attribute 222 (write write write) so that non-root processes can write the file too. Or they set the owner of the module to system in order to avoid the permission denied errors.

Hi,

please go here and download the stock boot.img you like. Place it on your sd card and then use the install zip button in TWRP (you need to press "Images..." on the bottom right to see the boot.img then).
[ZenFone 2 Android Development] cangcan:
goooood news indeed for the compiler and support by intel..

anyway take your time in building the kernel, theres no rush and we will always glad to be your tester.. who knows maybe we may hit 7-8 hours of SOT with your kernel later :) this device is already fast in terms of performance, for me I only need better battery + performance wise.. thank you for your hard work [MENTION=2388665]TheSSJ[/MENTION]
[ZenFone 2 Android Development] crpalmer:
Deleting the cmd_line parameter of the img_info is quite likely to give you problems.

Get the latest version of:

https://github.com/xiaolu/mkbootimg_tools

(this should include my patches to support the second bootloader so you don't need to change manually) and then cherry-pick in this change:

https://github.com/xiaolu/mkbootimg_tools/pull/12

into your repo and then use that mkboot to unpack/repack your kernel.

Let me know if that works for repacking the boot.img without needing to edit any files and furthermore if it fixes some of your wakelock issues.
[ZenFone 2 Android Development] TheSSJ:
Hi,

Already using that tool with your 2nd address patch ;)

The script has problems parsing the command line when reaching the double quotes. this is the only snippet I deleted: _gsm.mux_base_conf="ttyACM0,0 ttyXMM0,1". Will cherry pick the quote fix though, thanks for that.

I already pinned the wakelock down to xhci driver which is requesting it. But either the usb hub or sth else is never going to suspend mode and I can't debug that properly..

/EDIT: copied now the exact boot cmd line params, still 100% wakelock on hsic_s3
[ZenFone 2 Android Development] Shafwan7:
for sure will wait for 550 stable release soon
[ZenFone 2 Android Development] jrior001:
I merged the latest source drop (2.19.40)last night, there's a few USB/charger driver updates. Hopefully one of those is the fix you are looking for.
[ZenFone 2 Android Development] aziz07:
I am really interested in overclocking the GPU since its the weakest component of this amazing phone. The PowerVR G6430 GPU used here is the same used in ipads, ipad air for example, but with ~150mhz higher clocks so I see no problem increasing the gpu by 80mhz as a start especially that it won't idle at that and the phone already runs very cool under performance setting vs other phones such as the G3. Good job Asus on the cooling heatsinks and bigger design to allow more cooling efficiency ; Asus is well known in the computer components area such as video cards for providing excellent cooling, products and service. If you won't game a lot, especially that its not meant for that, you can probably reach 150mhz overclock which is good for large gpu pdfs and other gpu intensive applications with gpu rendering ; plus improving overall Android smoothness and even lowering power consumption for 4k+ videos by offloading the CPU. The Intel CPU is amazing especially because it runs commands no other mobile CPUs can run such as x86 and x64 codes ; many people are already running the preview copy of windows 10 on this phone natively without emulator and getting as close as possible to a real pc. Multiboot managers are already popular for Android and Linux and the G6430 gpu here is compatibe with OpenGL 3.x/4.x , OpenGL ES 3.0 and DirectX 10. A CPU overlock of 170Mhz to 2.5Ghz doesn't hurt too as its running on 22nm tech vs Snapdragon 28nm.

I mean, the Zenfone 2 is running a 2 years old GPU, same as iphone 5s, and still managing to reach ~50K in Antutu so imagine if its weakest corner is strengthened -.- I am knowledgeable in computer overclocking (windows & Linux) ; I would like to know how to overclock the gpu and I will contribute as much as I can if someone explains me how it works.

p.s: I read that the Asus kernel is x64 but Android itself is x32, how is that? x64 is required to take full advantage of 4096mb RAM perhaps thats why the phone shows 3.8GB instead of 4GB? With a native x64 Android version, Intel CPUs will gain much more performance than its counterparts.

Thanks!
[ZenFone 2 Android Development] TheSSJ:
Hi,

forked your source and there is a difference now. The hsic_s3 wakelock is reduced greatly, but now power manager uses up about 70% and the phone's running at 500MHz when the screen is off. The problem seems to just have moved...

Did you notice, that your kernel source is missing the IPU folder (which can only be found in the 2.12.40 version oddly).

But some great news ahead:

I downloaded the 2.12.40, copied 2.19.40 over and now I built a kernel (with all its modules) which does not have any sleeping bug any more!!

So now I am able to add governors and IO schedulers and have [MENTION=4970357]cangcan[/MENTION] test a kernel, which actually is able to sleep :D

Man am I happy now!
[ZenFone 2 Android Development] ImjuzCY:
Android is supporting 64 bits from Lollipop 5.0 onwards which is considered a breakthrough.
[ZenFone 2 Android Development] aziz07:
Most sources say that only Android M has native x64 full code. I know lollipop works with 64 bit CPUs but its not using the x64 capabilities. CPUZ shows lollipop as 32 bit and the phone displays 3.80Gb not 4.00Gb. Windows 32 bit too suffer from the same limitation in terms of Ram. I guess Android M supports 64 bit ARMv8 and I hope Intel x64 too.
[ZenFone 2 Android Development] cangcan:
awesome, cant wait to test it! and i think there are many people who's willing to test your kernel [MENTION=2388665]TheSSJ[/MENTION], just post it in the OP and we will be glad to try it out eventhough if it still has bug, thats what the community here for. And we know the RISK of it too :D
[ZenFone 2 Android Development] sorg:
Memory management is done inside kernel which is 64bit. So, your conclusion about limited memory due to 32bits is wrong. OS cannot use 100% memory for apps because of simple reason - some devices require pre-allocated (reserved upon boot) memory, especially GPU. The only limitation of 32bit Android (on top of 64bit Linux kernel) is how much memory can be allocated to 32bit application. And even here, it's more than any current Android application requires.

ZF2 software model can manage 8GB, 16GB and more of RAM without change anything. You only need to make SoC support of such amout or RAM and put more RAM chips. And you will be able to use whole RAM.
[ZenFone 2 Android Development] TheSSJ:
New release is out now in the download section, test at your own risk
[ZenFone 2 Android Development] chobztopz:
Really hoping that you reconsider about undervolt, could help for saving batt and heat problem. But this all already great! thank you! will try to flash
[ZenFone 2 Android Development] 29y6145:
Great work

Camera ok

Cpu work fine

Gửi từ ASUS_Z00AD của tôi bằng cách sử dụng Tapatalk
[ZenFone 2 Android Development] TheSSJ:
I am missing the basic knowledge about do's and dont's concerning CPU/GPU overclocking/undervolting. Maybe there are some devices out there with our same GPU, then I could check what needs to be done for graphics (if someone would research that I'd definitely look into this :) ).

But I am not willing to tinker with my CPU voltage if I don't know exactly what the outcome of certain code pieces is...

Cheers
[ZenFone 2 Android Development] aziz07:
Its ok, I got my answer from Asus themeselves in my other xda thread in Q&A. There are many other advantages with x64 even for <4Gb applications. The registers width, compression speed, processing, security, multitasking, app loading speed etc Just google 64 bit vs 32 bit, there is a nice article by Microsoft. Intel Android article here http://www.anandtech.com/show/7789/intel-talks-merrifield-moorefield-and-lte-at-mwc-2014 Otherwise, x64 wouldn't be popular for PCs. I am pretty sure that only a limited number of 32 bit PCs are still on stores shelves.

Asus are working on a future update to bring out x64 support but no ETA yet :(

Back on the subject, is it possible to ''overclock" the GPU with custom Kernel? It is designed to run higher by default in Apple products.
[ZenFone 2 Android Development] rlaw:
The PowerVR GPU is the same one found in iPhone 5S and clocked 100MHz or 150MHz higher.
[ZenFone 2 Android Development] TheSSJ:
There sometimes are reasons why GPU's are not clocked the way they are working in other devices. Maybe the big problem is heat dissipation here? http://images.anandtech.com/doci/7789/Screen Shot 2014-02-23 at 1.05.11 AM.png

Every component is included in the Moorefield SoC, so this assumption is not so abstract.

Also PowerVR G6430 is able to achieve 533MHz, must take a look at the source to see if it isn't already set like that maybe (when running GPU intensive operations of course)
[ZenFone 2 Android Development] aziz07:
The Zenfone 2 is one of the coolest cellphones I owned... The Lg G2 was the hottest, G3 then iphone 4. We can see big heatsinks under the backcover, other phones don't have these. Also, the phone design, being bigger than other 5.5" phones helps. Asus are know to have excellent pc components and cooling performance, e.g. pc video cards.