yashsingh1/xdaforums huggingface dataset:
[ZenFone 2 Android Development] ImjuzCY:
I downloaded the script and put it in /etc/init.d folder and removed .txt from the file name. But after I reboot, I checked the max_freq file, it still shows 64000 0. But if I execute the script from kernel adiutor, the file changes to 533000. It's like init.d isn't working. On v43sse
[ZenFone 2 Android Development] TheSSJ:
I have submitted a first set of patches to see if it fixed the problem, will build and check when I'm back home.

https://github.com/TheSSJ/android_k...mmit/545f7908014ee58f6346c3646dcc16227e6a7a8f

Confirmed, I was able to reproduce the error...

Maaaaaan, you change one thing and the friggin' thing breaks again! Need to check what I broke with my last build when I'm back home....
[ZenFone 2 Android Development] URBANIUS123:
where i can find the script for the gpu? i checked the first page but i can't find it, please help! good kernel but much slower than stock on HD games like NBA2K15 and bombsquad (5-10 fps less)
[ZenFone 2 Android Development] Ntrasme:
Yea, I think Init.d only executes the first script. ZRAM is working well (i think). Using free in Terminal shows a swap file.
[ZenFone 2 Android Development] aziz07:
I don't think 640Mhz work since even manually forcing 640Mhz results in 533Mhz cur_freq ; the driver file itself says it only works with 200-533Mhz. It was compiled to use 533Mhz max and that might be the reason why Intel did not market the Atom 3570 chip advertised with 640Mhz G6430 GPU. No device has it yet since it was released in 2014. I did play with GPU files, eventhough AIDA64 showed 200-640Mhz in GPU Range, current frequency displayed above remained 533Mhz regardless of 3D apps or forcing 640 by a script.

p.s: How can SSE and Intel Toolchain boost Android speed? Aren't they designed for other OS? I read that basically, the Intel chip is ''emulating'' ARM codes and this degrades performance a lot.

---------- Post added at 02:14 PM ---------- Previous post was at 02:08 PM ----------

Go to the top and look right under search thread ; there is a download section.
[ZenFone 2 Android Development] TheSSJ:
http://xdaforums.com/devdb/project/?id=10665#downloads

You should modify the script to use performance governor, see here a script ready for usage:

http://xdaforums.com/showpost.php?p=61946362&postcount=263

Unfortunately not - I only have 1 script in my init.d and that's the GPU one :) Maybe /sys/class/devfreq/dfrgx is not ready when the init.d part is being executed, then I would need to move the whole scripting to the end of the boot sequence

I fear so too - it seems to be a Hardware limitation. Also I have read the advertising with 533MHz, too. At least the GPU now runs at 200MHz instead of 320.

SSE is an extended instruction set concerning operation with vecors, which uses special registers to compute matrix computations much faster than normal (if I recall correctly).

Also the intel toolchain is designed to increase computing performance of certain operations done by the Intel SoC (floating point or integer computations for example, see here)
[ZenFone 2 Android Development] Ntrasme:
I tested out a script that creates a file in sdcard0 and echos "Hello World" to it. The script doesn't run at boot. Both the GPU and Test scripts run fine through smanager, but not on boot. And is ZRAM a one time thing? If init.d wasn't working properly I thought ZRAM wouldn't enable.
[ZenFone 2 Android Development] aziz07:
I thought SSE was limited to windows and linux. Single-thread Floating-point is already higher than snapdragon 810 and galaxy s6 edge with stock settings.
[ZenFone 2 Android Development] lyeith:
SSE is simply a vector instruction set thats available to intel processors. ARM processors like the snapdragon have their own equivalent known as NEON, and they are thus not specific to any operating system.

what TheSSJ has done is to set the flags telling the compiler to compile the kernel with SSE instructions. Which means, whatever part the compiler is able to optimize to use the extensions, it will do so, which should result in a appreciable increase in performance.

As for the intel compiler thing, different compilers generate different machine code given the same source code, and the corresponding code runs differently depending on the underlying processor architecture. In this case, since intel knows their processors best, they have developed a compiler that generates code that runs best on their own chips. Again.. more performance :)
[ZenFone 2 Android Development] aziz07:
Limited to 8 thanks / day haha. Thanks 4 the info!
[ZenFone 2 Android Development] TheSSJ:
Quick update: I am rebuilding the kernel right now to see if sioplus will work. At least I definitely fixed the init.d issue now. The scripts there will be executed after the boot completed flag was set. The reason for the GPU frequency not being set at all was that init.d was called before the sysfs directories were created. So the script succeeded in creating a folder /sys/class/devfreq/.../max_freq, but after the GPU driver was initialized, the file got replaced by the default setting again...

Sorry for the inconvenience!
[ZenFone 2 Android Development] Ntrasme:
Thanks for your hard work. Will your kernel be compatible with the upcoming CM build? From my experience CM comes with its own kernel doesn't it? Also, I'm not sure if it's the intended behavior, but yankactive isn't using touchboost. I read that it's a tuned interactive, but it is not boosting on touch.
[ZenFone 2 Android Development] TheSSJ:
v44 is out with working init.d and sioplus

Need to check, I used our interactive govs as code base, so if YA doesn't have touchboost, then our interactive govs shoudldn't have this too.
[ZenFone 2 Android Development] Ntrasme:
Yea, tested it. Interactive governor does not touchboost with the kernel.

EDIT: I haven't flashed the new one yet I will report back.
[ZenFone 2 Android Development] TheSSJ:
By the way-don't know if the kernel works with cm12, maybe it's sufficient to replace the ramdisks,maybe some more stuff is needed. Need to see once it is out (also I want the kernel to be stable first before beginning a cm build :) )
[ZenFone 2 Android Development] Ntrasme:
Touchboost works in the latest version, must have been some sort of a bug. Init.d working perfectly.
[ZenFone 2 Android Development] AL_IRAQI:
[MENTION=2388665]TheSSJ[/MENTION]

do you think it's possible to enable sweep to wake or wake the device with capacitive buttons ?
[ZenFone 2 Android Development] TheSSJ:
If you can link to a kernel which supports that,then why not?
[ZenFone 2 Android Development] AL_IRAQI:
Here you are

http://xdaforums.com/showthread.php?t=2233665

and wake the device with buttons can be done by editing Generic.kl but i didn't find all buttons only home ?
[ZenFone 2 Android Development] corrsea:
I'm about to test your kernel on The latest CN firmware v2.19.40.20. Just thought I'd mention that on the previous CN v2.19.40.18 the capacitive buttons could wake the phone.
[ZenFone 2 Android Development] AL_IRAQI:
Can you please share /system/usr/keylayout folder to check the changes

Thanks
[ZenFone 2 Android Development] Ntrasme:
I was able to replicate the touchboost bug. It happens if you go from standard interactive governor to yankactive. The touchboost tunable becomes 1833, and the CPU does not boost on touch. Switching back to Interactive does not bring it back and the tunables for Interactive are changed to 1833 for touchboost. Maybe this is a bug from using the 1.833ghz version instead of the 2.3ghz version? Interactive touchboost works fine if you do not change to yankactive, then it stops working.
[ZenFone 2 Android Development] corrsea:
Will try but they don't work on v.2.19.40.20 which I am currently running.

Here goes zip attached
[ZenFone 2 Android Development] ImjuzCY:
Do you mean that init.d if working after boot complete like how emulated init.d work? If yes, I would rather have a proper init.d that execute during boot and use a separate init.d emulator to set gpu clock.
[ZenFone 2 Android Development] Bushcrafter:
I just flashed the latest Project T kernel img and ran Antutu. Here is my score.:)
[ZenFone 2 Android Development] aziz07:
You can break 50K (~50200) with 720P resolution, see my previous posts xD

I finally succeeded in powering off cellular radio getting ride of the red bar in battery details even with airplane mode on. Dialing *#*#4636#*#* or entering simtoolkit threw 3c toolbox and disabling radio did the trick however you have to redo this at every boot ''NVM its now autoapplied after reboot''. (Before --> After) Now it won't waste battery and get hot during traveling, in a metro or anywhere with no or low cellular signal. Both ways, I only use it for voip.
[ZenFone 2 Android Development] Bushcrafter:
I will have to give that a try! Thanks for the tip.:good:
[ZenFone 2 Android Development] Niropa:
[MENTION=2388665]TheSSJ[/MENTION] what toolchain do you use to compile your kernel?
[ZenFone 2 Android Development] aziz07:
He mentioned Intel Toolchain v15 earlier I think.
[ZenFone 2 Android Development] ansebovi:
using v44,init.d works well,btw lspeed tweaks are working now only..[maybe ur old init.d had issues]

and i tired the 640mhz with init.d for gpu ,..but still its in 533mhz..any idea y?
[ZenFone 2 Android Development] aziz07:
Intel capped it [MENTION=4053416]533mhz[/MENTION] , there is no way of getting 640Mhz as it would heat a lot during gaming. Be happy with 200-533Mhz :D
[ZenFone 2 Android Development] ligu:
[MENTION=2388665]TheSSJ[/MENTION], I noticed your changelog only state the date for each version. Would it make sense to indicate the version numbers also?
[ZenFone 2 Android Development] cangcan:
[MENTION=2388665]TheSSJ[/MENTION], how about using this toolchain? It does support x86_64 kernel build.. if you can build two versions of Project T kernel, one with Intel C++ and another one with Uber toolchain, it would be awesome. But im just asking and not demanding..
[ZenFone 2 Android Development] Ntrasme:
On the touchboost issue, it seems to be triggered on changing to any other governor. If you switch from interactive to another governor, it no longer boosts on touch when you switch back. Can anyone else confirm this issue?
[ZenFone 2 Android Development] aziz07:
Did you try to manually change touchboost threw kernel adiutor?
[ZenFone 2 Android Development] Ntrasme:
Yea, apparently the kernel sets the touchboost freq to 1833 when you switch. I changed it to different values but it doesn't bring it back.
[ZenFone 2 Android Development] ansebovi:
i seen the range of frequency is from 200 to 640mhz...and ssj said he unlocked every freq,so y it didnt get 640mhz even after i fix the maxfreq to 640mhz?

or do u think even after he unlocked every freq, intel capped at 533mhz? then what is the use of unlocking 640mhz??
[ZenFone 2 Android Development] aziz07:
He unlocked the full range from 200-533. It was 320-457 with stock. Try changing target freq and current freq to 640 000 ; they will reset. If you look in TheSSJ's github gpu files by Intel, you will see that Intel wrote in there that the driver was built to work from 200-533Mhz. They even talk about overheating, thats why there is no device that uses the Atom 3570 with the intended 640Mhz GPU.
[ZenFone 2 Android Development] cieffe54:
Update new version for 550 here: http://xdaforums.com/zenfone2/development/kernel-project-t-zenfone-2-ze550ml-t3160785
[ZenFone 2 Android Development] chobztopz:
[MENTION=2388665]TheSSJ[/MENTION] please add zzmoove governor

http://xdaforums.com/galaxy-s3/development/info-cpu-governor-zzmoove-t2326544

https://github.com/zanezam/cpufreq-governor-zzmoove

There's many profiles & settings you can choose with one single governor. One that I like is zzgaming, based on performance with new scaling block enabled to avoid cpu overheating during gameplay.
[ZenFone 2 Android Development] ansebovi:
i just seen the available freq of stock and in this kernel...only640mhz is added..and stock seems to have from 200 to 533mhz... or am i wrong about avail freq????
[ZenFone 2 Android Development] TheSSJ:
Gee, that's what I call active community :D

Okay, need to look into that, thanks for the feedback

No, it's not emulated. Init procedure will set a flag named "on boot-completed-flag", where some services are started like "adb on" or others which I don't recall. There I have inserted my script to be executed so that we can sure that every directory structure is created before our scripts begin to run - so it is still run as part of the boot procedure, just moved from the middle to the end of the sequence.

Currently still using gcc 4.8, I am trying to get it work with ICC, but I got to a point where the compiler has a bug: https://software.intel.com/en-us/forums/topic/562429

It is not able to execute a simple define switch replacing "for_each_cpu_worker_pool" with a normal for-loop

What I at least plan to do is (which is way more doable) to compile parts of the kernel with ICC and link them together, should be way easier than compiling the whole kernel

Good idea, will insert this info

Noted, maybe it is more based on gcc as icc is doing. A hybrid approach of using 2 toolchains actually sounds pretty awesome

I'll try, but I noticed that many governors put the phone to SoD instead of being able to be woken up when pressing power - indeed there is the lack of knowledge on my side...

The whole range is unlocked, but the HW is refusing to take 640MHz, there is nothing on driver side that I can do about. So the driver IS able to tell the GPU to use 640MHz, but the GPU itself shows the middle finger and uses 533. See the original code here:

https://github.com/TheSSJ/android_k...ules/intel_media/graphics/dfrgx/df_rgx.c#L744

After unlocking, the current state looks like this (still not using 640MHz though :( )

https://github.com/TheSSJ/android_k...ules/intel_media/graphics/dfrgx/df_rgx.c#L744
[ZenFone 2 Android Development] dodongobongo:
Looks like you shouldn't have mentioned Android at all - that guy doesn't seem to care much about what the actual problem might be :p

However if this is the one thing holding you back at the moment, why not just manually pre-process it?
[ZenFone 2 Android Development] TheSSJ:
Because this shi**y for each loop is used in many other source files

I have noticed that I confused this statement with the for_each_cpu statement...sometimes I don't see the trees in the forest

Anyways, I might change the way of working with the Intel Compiler though. If I am successful, I will compile parts with icc (like Intel drivers and CPU) and others with gcc or UBER (but I need to check first as I am not switching toolchains so often :silly: )
[ZenFone 2 Android Development] omnikai:
Hi,

Thanks again for this great kernel!

I've not made any gpu changes, just zram enabled and cpu governor changes. But I'm getting rendering errors in Alphabear. Could this be related to the kernel?

Thanks again, loving the kernel and improved battery :D
[ZenFone 2 Android Development] TheSSJ:
Will set the frequency to 320MHz min_freq by default then, [MENTION=6116760]BASS55[/MENTION] also has graphic lags, so I think the guys aiming for battery life can set min_freq to 200MHz via init.d script
[ZenFone 2 Android Development] omnikai:
Sounds good. To be clear though, performance (frame rate) is fine, the issue is only visual artifacting. I've only seen that sort of thing due to overheating or other instability, not usually just underclocking. But of course I defer to your judgement!
[ZenFone 2 Android Development] Niropa:
nah I've had the same problem with stock kernel and alphabear. I just cleared cache, rebooted and it was fine.
[ZenFone 2 Android Development] omnikai:
I'll give that a try! [MENTION=2388665]TheSSJ[/MENTION], might be worth holding off on that change (at least on account of my experiences alone).

Update: Clearing cache & reboot didn't help, same thing.

Edit: Let me find another 3D game to try. Might just be Alphabear sucks (despite its addicting qualities).
[ZenFone 2 Android Development] Niropa:
damn sorry, weird it worked for me. I've had it in more then one game actually. sometimes it happens in that new dragon ball Z game and the game battle nations just shows black squares for the characters
[ZenFone 2 Android Development] helroz:
All work fine with the last update :)
[ZenFone 2 Android Development] TheSSJ:
Ahhh, it might be because of libhoudini (translating apps made for ARM to x86). Maybe when you cleared the cache houdini needed to rebuild the x86 version of your game and did it actually right (seems not so well performing unfortunately ^^)
[ZenFone 2 Android Development] TheSSJ:
Okaaaay, some good and some bad news.

Bad news first:

The touchboostpulse errors are nothing directly kernel related. PowerHal seems to have been modified by Asus to boost the cpu frequency using its property called touchboostpulse...

Some very intelligent guy seems to have hardcoded the path /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse into the HAL manager.

Then he noticed that PowerHAL was having a permission denied error, so he did the following in init.aosp.rc:

chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse

So processes with system privileges were able to read/write this property then. Switching governor (independent if the gov was preinstalled by ASUS or a gov inserted by me) resulted in the PowerHAL manager to throw out a "file not found" error (hard-pointing to interactive/touchboostpulse, which of course is deleted when you switch to another governor).

Switching back to interactive re-creates all files with a deadly side-effect: touchboostpulse belongs to root user and root group, thus PowerHAL having no access anymore as it is not running as root.

If you set the permissions of touchboostpulse back to system.system (chown system.system /sys/devices/..../interactive/touchboostpulse), the errors disappear...

So now to the good news:

It's nothing kernel related, so this troubleshooting is not my domain :)

Back to work
[ZenFone 2 Android Development] Ntrasme:
Manually changing permissions fixes interactive touchboost, but yankactive still doesn't boost. Maybe that's intended governor behavior?
[ZenFone 2 Android Development] TheSSJ:
The only trigger I could imagine which sends such a touchboost signal to the governor would be the Touchscreen. Will look into this as soon as I have some time (still that's no good programming style just hardcoding the path to the touchboostpulse file into a driver or OS component :silly: :rolleyes: )

Info: I am about to build my first kernel with KVM support. As I don't know how to use qemu and have no intentions learning it, I will need someone to test if his Windows guest machine is well performing or not. Will notify you about v45 as soon as it's uploaded

Edit: Uhhh, first build didn't boot at all...there must be some conflicts or missing config flags...
[ZenFone 2 Android Development] aziz07:
haha This kernel is getting overkill with all those tweaks. Can't wait for KVM and Intel Toolchain boost xD
[ZenFone 2 Android Development] itechnoguy:
I'm not sure why, but I can only hit around 38k on AnTuTu on the SuperZen ROM on a 551 (with BioShock + sioplus). I've also tried the test with other combinations of governors and right after reboots, but I haven't been able to hit 40k.

(I also tested the GPU clock speed at both 533 and 640, but it didn't seem to really have an effect on the 3D score)
[ZenFone 2 Android Development] aziz07:
Try performance governor with fiops. Use, AIDA64 to verify CPU & GPU frequency. Its for sure not running at 2330Mhz CPU and 533Mhz GPU.
[ZenFone 2 Android Development] Ntrasme:
1.8ghz version? That's around my range too.
[ZenFone 2 Android Development] itechnoguy:
I definitely have the 2.3 GHz model (Intel Z3580) and AIDA64 shows the CPU clock range as 500-2333, and the GPU as 200 MHz idle. Is it possible that a lot of background procceses would decrease the AnTuTu score?
[ZenFone 2 Android Development] aziz07:
Try the settings I stated earlier. The range does not tell at what frequency is the CPU currently running at. Look @ Core Clock and Governor. Use the init.d script found in Download section of this thread above. Background apps cannot decrease the score by that much unless the play store is installing apps or something.
[ZenFone 2 Android Development] itechnoguy:
Thanks aziz07, I used fiops and the AnTuTu score is back to the average.
[ZenFone 2 Android Development] corrsea:
Just to report first days use of the kernel on stock CN firmware using yankactive (no other kernel tweaks yet) throws up no issues. Battery life appears to have a 10-20% boost (5-7 hrs SOT as opposed to 4-6). I'll know better after a couple of cycles. Antutu down about 300 points to just over 47000 but I have zero concerns about that. Everything running fast and smooth.

Thanks for your great work on this.
[ZenFone 2 Android Development] dutch45612:
[MENTION=2388665]TheSSJ[/MENTION] if you need me to test the KVM version for you just tell me it would be my pleasure,i am currently trying to optimize virtualization on the platform.
[ZenFone 2 Android Development] TheSSJ:
As YA was designed to save some juice, it ramps down to the minimum frequency rather quickly, but tries to handle more load on lower frequencies before scaling up again.

Thanks, first I need to get a bootable version :D Don't know honestly why it doesn't want to boot, though :silly: I will need to compile KVM as module and check which errors are thrown out when trying to insmod them, could take a while...
[ZenFone 2 Android Development] aziz07:
Great work, never had a single freeze or reboot, Asus should contact you given all those tweaks :laugh:, there are many Asus members here on xda in Zenfone 2 section.

btw Here is my RAM usage with WiFi on/PIE controls etc and I was able to get 3350Mb free with L Speed + Asus boost but without settings app open ( takes 55Mb -.- ); Asus boost won't give me time to screenshot that, maybe with a camera in my spare time:
[ZenFone 2 Android Development] dutch45612:
No problem [MENTION=2388665]TheSSJ[/MENTION]... Ohh, and i guess if you'd like an hint about compiling the kernel with KVM modules included you could always ask [MENTION=684728]ycavan[/MENTION] over here :

http://xdaforums.com/zenfone2/orig-development/fhd-kernel-ze551-kvm-bridge-compiled-t3145055

His kernel already boots up some of the KVM modules... Thanks my friend.
[ZenFone 2 Android Development] LostSoulFly:
Can anyone help me figure out why this isn't working? I've named the file init.sh, created it in Notepad++, and put it in /system/etc/init.d, and set permissions to 755.

I've got kernel 0.44 installed.

None of it seems to be set. GPU max_freq is still 640, cpu is still interactive.. zram is not enabling.

#!/system/bin/sh

echo 200000 > /sys/class/devfreq/dfrgx/min_freq
echo 533000 > /sys/class/devfreq/dfrgx/max_freq

echo "yankactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "yankactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "yankactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo "yankactive" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

######################
# script made by dheeraj (dhlalit11)@xda-developers.com
# Modified for ZF2 by TheSSJ
######################
#
#
# resetting zram
echo 1 > /sys/block/zram0/reset
#
# setting zram size to 400 mb
echo 419430400 > /sys/block/zram0/disksize
#
# making zram swapable
mkswap /dev/block/zram0
#
# starting swap on zram
swapon /dev/block/zram0
#
# done