yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] mrg666:
I was hoping to find a Nexus 5 but I found a deal to buy an LG G2 recently. This will be a larger project than I planned since I will need to develop the ROM as well. But I am hoping that the G2 kernel will be compatible with Nexus 5. I have done a unified kernel before for HTC EVO3D CDMA and GSM versions. I think it is doable for LG G2 and Nexus 5 too. I am not selling my Nexus 4 though. I will backport relevant development in G2/N5 kernel to N4 kernel and keep MiRaGe/N4 up to date. I will ask help for testing when I have enough progress.
[Nexus 4 Original Android Development] monza1412:
may I ask what G2 variant have you bought? I was looking forward for the D800, but Im afraid of the rom/kernel differences I may encounter with the D802, coming from a nexus is not easy to get used to a locked device.
[Nexus 4 Original Android Development] txuki2005:
[MENTION=4203114]mrg666[/MENTION] Miles thanks for help. I will test your recommendations. I think that activate and use another frequencies without OC is more difficult to adjust VDD.

Have a god day!
[Nexus 4 Original Android Development] mrg666:
It is D800.
[Nexus 4 Original Android Development] mrg666:
New MiRaGe build is available in the OP.

- backported many cpufreq driver and ondemand governor updates from mainline Linux

- modified dt2w to make it work on any screen position (multi-touch double taps are filtered)

- disable dt2w by default after suspend with power button

Now dt2w works just like the LG knock-knock. It also seems to be working easier with the latest modifications. Check it out and let me know, please.

Cheers!
[Nexus 4 Original Android Development] jimyiak:
Since 5.1 i can't use your kernel with simpleAOSP..even with clean flash when it boots system crashes all the time..:confused:

sent by nexy 4
[Nexus 4 Original Android Development] mrg666:
Sorry for that. I'll take a look but I can't promise compatibility with a custom ROM since I only use the stock ROM. Usually, custom ROMs cause such incompatibilities with stock AOSP. Maybe the devs want their own kernels used with their ROMs. I can't blame them; it is easier to fix problems with the default kernel. I can't blame you too, if you want to use MiRaGe :cyclops: What else can I say,
[Nexus 4 Original Android Development] HdSht:
Everything's working fine..well not just fine..it's more like awesome :good:. Thanks for your hard work man *o*.
[Nexus 4 Original Android Development] jacomail95:
Just thinking... I always liked the LG led blinking when dt2w detected, so i wanted to make, if possible, a feature request for this kernel :) thanks for time and reading my post :) have you all a nice day :)

Inviato dal mio Nexus 4 con Tapatalk 2
[Nexus 4 Original Android Development] mrg666:
Since the Nexus 4 LED is at the bottom, blinking LED will be probably unnoticed since the hand will be covering it.

I am using Power Toggles to suspend without power button. If you add the lock-screen toggle to notification toolbar, just swipe down and touch the lock-screen button; it is very handy.
[Nexus 4 Original Android Development] xenyz:
Isn't the screen turning on when dt2w detected enough? :)

Thanks for the update. 9 days up time on last release.

[MENTION=4203114]mrg666[/MENTION] do you see any problem with running thermald? The weather is getting warmer so I don't mind the battery temp throttle.
[Nexus 4 Original Android Development] mrg666:
I wanted dt2w to work like D800. So I modified it. I think it is better this way.

Thermald is working fine AFAIK. Can you be more specific?
[Nexus 4 Original Android Development] xenyz:
Msm-thermald doesn't do the battery temp throttle like system/bin/thermald. I've noticed my battery getting warm and wanted the stock thermal throttle at 37 C.
[Nexus 4 Original Android Development] ihancioglu:
Hi,

Guys who wants to run viper4android with Mirage, Would you please run following command as root?

/system/xbin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };"

Then let me know, It looks working fine for me.

This command should execute on every reboot, best way to do this via init script.

Thanks,
[Nexus 4 Original Android Development] guimendes:
[MENTION=4203114]mrg666[/MENTION], after latest update, I noticed my device "locked" on high brightness using automatic brightness and the problem was solved after a reboot. May this be kernel related? I'm on stock 5.1, with Xposed (not latest version).
[Nexus 4 Original Android Development] mrg666:
I will take a look at it before the next update.

V4A is working since one of the previous MiRaGe builds; I am using it. There is no need to run an additional command.

I don't think this is kernel related. One of the mods on your phone is probably causing the problem.
[Nexus 4 Original Android Development] HiM@L:
so...how did u get V4A working..?. rightnow i am using Cataclysm based on stock ROM... and your anykernel version of recent update... should i just flash the v4a zip?
[Nexus 4 Original Android Development] xenyz:
I believe the boot image version has the sepolicy changes from Chroma devs. It should work just fine on Cataclysm.
[Nexus 4 Original Android Development] HiM@L:
so it has to be boot image version not any kernel version?
[Nexus 4 Original Android Development] xenyz:
If you look on [MENTION=3332811]faux123[/MENTION] github he has developed an in-kernel thermal monitor called intellithermal. I believe there are also patches to access more thermal sensors. I can dig around if you're interested in changing it.

I went ahead and enabled system/bin/thermald anyways, but it seems to like putting 1.7 GHz as the max freq when throttle is removed.
[Nexus 4 Original Android Development] ihancioglu:
As mrg666 stated, you can use boot image version. If you don't want boot image or another kernel, you can test supolicy command to get working. I just install apk and install driver.
[Nexus 4 Original Android Development] xenyz:
I had to use this flashable version that makes it a system app and changes audio_policy.conf in order to get it to work with the sepolicy change you posted, but I can confirm it does work on Mirage anykernel & Cataclysm ROM.

OT but I have to say the viper4android info on XDA forums is a mess.
[Nexus 4 Original Android Development] jer_ying_fd:
Is it a good idea to use the ondemand governor this kernel has (well since it has many updates thx to mrg666 :)) and have 4 cores always online for more performance and less heat in less intensive tasks (it's hot where i live and having 4 cores at lower frequency really helps) or is interactive better in this case since it does not scale to always? Or does ondemand actually have similar behaviour? Thx!
[Nexus 4 Original Android Development] mrg666:
New MiRaGe build is available in the OP

Changes:

- backported interactive governor from AOSP common 3.10 kernel and enabled as an option

- many ext4 optimizations and updates backported from Linux mainline

- clean up my changes in dt2w code

- remove log spam from lge touch driver

If you try the latest interactive governor please post your feedback. We can keep it as an option.

Enjoy!
[Nexus 4 Original Android Development] mrg666:
Ondemand keeps the cpu frequency lower through more precise frequency estimate for given load. Interactive usually scales the frequency faster in both directions so that intermediate frequencies are used less. I think ondemand is more battery friendly. But this does not mean ondemand is less responsive than interactive. Please try both of them in the latest build and let us know.

Keeping 4 cores always online does not save battery. Actually just the opposite; 4 cores always online uses more battery and heats the device. Let autosmp do its job. It is designed to be responsive with minimal overhead.
[Nexus 4 Original Android Development] xenyz:
[MENTION=4203114]mrg666[/MENTION] I hope you don't mind but I've been posting a modified anykernel installer for your kernel in the Cataclysm ROM thread. I didn't even think to ask first...
[Nexus 4 Original Android Development] mrg666:
Not at all. Thanks for letting me know.

You could start a new thread if you are interested in taking over the anykernel updater packages and maybe modifying the source to add/remove features or make CM kernels. I can just link to your thread instead of posting the anykernel updater packages.
[Nexus 4 Original Android Development] Pollie81:
Am i missing something? I keep getting the error zip file corrupt when flashing..
[Nexus 4 Original Android Development] xenyz:
Yes, you are probably missing part of the file. :)

Did you check md5 sums provided in OP against your download?
[Nexus 4 Original Android Development] Pollie81:
[emoji23]

I redownloaded 4 times.. [emoji22]
[Nexus 4 Original Android Development] jacomail95:
Mediafire gave me also many issues, so i used Opera Mini Browser to download the kernel

Inviato dal mio Nexus 4 con Tapatalk 2
[Nexus 4 Original Android Development] mrg666:
I have just downloaded all packages without any problems. Please try again.
[Nexus 4 Original Android Development] Pollie81:
I still now what was the problem, I never had it before but downloading on my PC worked. I tried several ways on the n4 but it kept giving issues..
[Nexus 4 Original Android Development] HdSht:
I'd like to set 2 cores as min online to test something but i don't know what file to edit..At first I thought it was the online file but that one shows the cores actually running. Any suggestions ? Ty.

And second I tryed the interactive governor under different situations (normal use, monitored idle states and benchmarking) and my personal opinion is that ondemand is still better. First i notices some slowdowns when scrolling pages (e.g. the third page in antutu that shows device specs) and then the benchmark went from 27k+ to 25k+ (I know this doesn't mean anything but I did that just in case :p).

Anything else is just awesome as always :good:.
[Nexus 4 Original Android Development] Tommy-Geenexus:
/sys/kernel/autosmp/conf/min_cpus is what you are searching for.
[Nexus 4 Original Android Development] mrg666:
Any other experiences with interactive governor?

Clearing the cache in system settings (storage) might help.
[Nexus 4 Original Android Development] Nakbleu:
Does this kernel support color calibration with Display Control?
[Nexus 4 Original Android Development] lilgiz:
I just want to thank you for adding back the interactive option. While I haven't been able to make any definite performance or battery improvements by using it, I do appreciate the "tweakability" of interactive. Thanks again!
[Nexus 4 Original Android Development] Fenvarien:
I'm very thankful for that too, I really like the Interactive governor and always try to use it on my devices.
[Nexus 4 Original Android Development] mrg666:
Yes, please search for gamma control in this thread.

No problem. I didn't know interactive was so much wanted. I will not remove it again, then. This is not the interactive I had removed earlier though. After the latest cpufreq updates, I was able backport the latest interactive from AOSP 3.10 kernel.
[Nexus 4 Original Android Development] lilgiz:
[MENTION=4203114]mrg666[/MENTION] Are you familiar with the BFS cpu scheduler patch by Con Kolivas for the Linux kernel? I was just wondering if it was applicable to the Android kernel. I'm very pleased with it on my desktop, but I've never seen any mention of it for Android.
[Nexus 4 Original Android Development] mrg666:
I am also using BFS with my custom Ubuntu 4.0 kernel together with BFQ. I had used BFS in the old Gingerbread days with 2.6 kernels as well. But there is no BFS patch for 3.4 kernel. I was able to build with 3.5 patch but kernel didn't boot. I just didn't keep working on it after that.
[Nexus 4 Original Android Development] xenyz:
[MENTION=4203114]mrg666[/MENTION] I know interactive is the default governor on the N6, but is it also default on the G2?
[Nexus 4 Original Android Development] mrg666:
Stock G2 has both interactive and ondemand builtin and ondemand default. But it is 3.4 kernel on G2. Neither interactive nor ondemand are updated like we have with MiRaGe. I haven't started developing the kernel for G2 yet.
[Nexus 4 Original Android Development] xenyz:
Usually about twice a year I screw around with interactive, so you gave me a good excuse to try it again.

Same thing different iteration: ondemand is smoother and faster than interactive, while interactive seems to use lower frequencies and marginally less battery.

I used to care about every last minute of Screen Time, but these days I want a smooth ride, especially on 5.1. Any kind of hiccup or slowdown is very noticeable, when the OS is so quick.

BTW, every time I've switched back to ondemand from interactive, I get punished for straying from the one true governor with a kernel panic. I doubt it's worth your time or effort to track it down though.
[Nexus 4 Original Android Development] bertans:
:crying: :crying: :crying:

It means you didn't start developing for N5 too... can I add some other crying smiley? :p

ps. I'm joking but I really miss N4's MiRaGe on my N5
[Nexus 4 Original Android Development] mrg666:
Can you post your kernel log? I am going back and forth between the two governors but cannot see kernel panic.

[MENTION=2149302]bertans[/MENTION]: I hope I can find the time and motivation to start the new development soon.
[Nexus 4 Original Android Development] xenyz:
Sure, I saved one, see attached. I was running interactive for a day or so; maybe it only happens after some time.

I was looking into thermald some more, and it seems to have one small issue on Mirage vs. stock kernel: The stock kernel has a shared cpufreq policy, whereas Mirage lets you set each CPU to a different frequency. I spent some time in your git repo trying to sort out where the change happened, but I could only find a reference in drivers/cpufreq/acpi-cpufreq.c:556

#ifdef CONFIG_SMP
dmi_check_system(sw_any_bug_dmi_table);
if (bios_with_sw_any_bug && !policy_is_shared(policy)) {
policy->shared_type = CPUFREQ_SHARED_TYPE_ALL;
cpumask_copy(policy->cpus, cpu_core_mask(cpu));
}

Could you perhaps compile a test version with it set to CPUFREQ_SHARED_TYPE_ALL without the checks, to see if it can be set from there?

Edit: Or maybe it should be set in cpufreq.c?

The problem I've found is that thermald can only set sysfs entries with uid/gid system, but when cores go offline and online, permissions and ownership are reset to root/root and 644, except for core 0 which never goes offline and has it set up from init.d:

# Assume SMP uses shared cpufreq policy for all CPUs
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

thermald can not throttle cpu1-3 when thermal alarms are triggered at the moment, but it could if cpufreq was set to a shared policy.
[Nexus 4 Original Android Development] mrg666:
[MENTION=3118524]xenyz[/MENTION]: Thank you for the kernel log and the thermald information. I will work on the fixes in the weekend.
[Nexus 4 Original Android Development] xenyz:
Here is another interesting link I've found while researching cpufreq shared policy. There's really not a lot of info on it though.
[Nexus 4 Original Android Development] mrg666:
Thanks for the link. But I still can't replicate the kernel panic you have posted. I tried one of the patches in your link and, actually, that patch caused the kernel panic. So I reverted it for now. If you are doing something specific for the kernel panic, please describe.

Also:

If you look at /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor you wil find the governor specified correctly after changing the governor. And, there is no scaling_governor file for the other cpus (cpu1, cpu2, cpu3), and there is no cpufreq directory either. I am looking at cpufreq code to confirm this but, it seems to me, cpufreq policy is already shared by all cpus since it is only defined for cpu0. Please let me know if I am missing something here.
[Nexus 4 Original Android Development] xenyz:
I changed interactive hispeed_freq to 1134000, perhaps that caused it?

You have to turn off hotplugging to see the cpufreq dir on cpu1-3; it is created and destroyed as CPUs go on and offline.

A workaround for thermald would be to create scaling_max_freq with uid/gid system(1000) and perm 0644 but I'm not sure how.
[Nexus 4 Original Android Development] mrg666:
That shouldn't be problem. I will keep testing for the panic.

How did you turn off hotplugging? Do you mean disabling autosmp?
[Nexus 4 Original Android Development] mrg666:
5.1.1 update of MiRaGe is available in the OP.

- ramdisk and code updates from LMY47V build

- interactive and conservative updates

I am not able to see the kernel panic xenyz reported. So I am not delaying the 5.1.1 update. I will keep checking but the kernel works fine for me. If you see any problems please post together with the kernel log.

Have fun!
[Nexus 4 Original Android Development] xenyz:
I set min_cpus to 4.
[Nexus 4 Original Android Development] mrg666:
That doesn't disable autosmp, just prevents from unplugging the cores. The proper way to disable is the following.

echo N > /sys/module/autosmp/parameters/enabled

The above command suspends the work function altogether.
[Nexus 4 Original Android Development] xenyz:
I should have just said that you need the CPU online to see the cpufreq dir in the sysfs.

BTW, battery saver mode expects the same behaviour of cpufreq. Currently, it only lowers cpu0 to 1026 MHz when enabled.
[Nexus 4 Original Android Development] jer_ying_fd:
What is the cpu frequency limit in the hotplug section? What does it do when compared to the up/down threshold of the governor? Thx
[Nexus 4 Original Android Development] Ivan609:
Mrg666 is it possible to revert dt2w as it was in 041815? I use power button to switch screen off a lot, and therefore i deactivate dt2w so this new update is unusable for me. I reverted to 041815 for now couse of this. Alo since you use viper would you please post youre v4a settings and did you notice any battery drain when using high quality driver version?
[Nexus 4 Original Android Development] xenyz:
You can adjust the setting yourself in /sys/devices/virtual/input/lge_touch/dt_wake_pwr_disable
[Nexus 4 Original Android Development] mrg666:
Xenyz replied before me. You can add the command in init.d to make permanent. The full command would be the following.

echo 0 > /sys/devices/virtual/input/lge_touch/dt_wake_pwr_disable

If you haven't setup init.d yet, this was discussed in the thread before. You can post your questions too.

Regarding v4a, I use the high quality driver and enable it only for headset. This way, v4a does not work for phone and speaker and doesn't affect the battery life. It causes distortions with speaker and phone anyway. The other settings are completely up to your personal sound preferences.

EDIT: I have added the directions to setup init.d in the second post.
[Nexus 4 Original Android Development] monza1412:
I get 2 reboots today when changing the governors, from ondemand to interactive and from interactive to conservative, not undervolted no any mayor change, maybe someone can replicate it. I would like to show a log but i don't know how to get it.

Anyway, I'm using latest mirage anykernel version, purity rom and synapse as a kernel manager.
[Nexus 4 Original Android Development] poondog:
Hi sir, is this what you're looking for?

http://ck.kolivas.org/patches/3.0/3.4/3.4-ck3/patches/3.4-sched-bfs-424.patch

I haven't tried to merge it myself. But it comes out of the 3.4.y ck3 patchset. Did you see much benefit with the patchset on a mobile ARM device?
[Nexus 4 Original Android Development] mrg666:
It was long time ago and I remember now that there was a problem with that patch too. Let me try again. Thanks!
[Nexus 4 Original Android Development] poondog:
Alright buddy, just thought you may be interested from the post I read a week ago :P Best of luck

I have been following your work since Evo 3D kernel :)
[Nexus 4 Original Android Development] mrg666:
EVO 3D was so much fun. Please stop by anytime :cool:
[Nexus 4 Original Android Development] xenyz:
I stopped fiddling with the governors and have a week uptime on the latest. Everything is running great, thanks [MENTION=4203114]mrg666[/MENTION] :)
[Nexus 4 Original Android Development] mrg666:
I am still working on using shared policy. I didn't like the omnirom patches. There should be a simpler solution. The kernel is working fine until then.
[Nexus 4 Original Android Development] :
can I use this kernel to the CyanogenMod 12.1 (LMY48B) for nexus 4 ?
[Nexus 4 Original Android Development] deani77:
AFAIK this kernel not compatible with CM based ROM.
[Nexus 4 Original Android Development] :
that `s bad , that is not compatible with CM :crying:
[Nexus 4 Original Android Development] mytie:
Hello, is there somewhere I can get the early 5.1 builds of Mirage? I really miss the super battery life :(
[Nexus 4 Original Android Development] mrg666:
More information would be good. Do you see more battery use while sleep or screen on? Have you started using dt2w? Are you using stock Android?
[Nexus 4 Original Android Development] mytie:
Hello thanks for the response

I have a standard every-day mixed use of airplane mode+wifi and 3g usage, I noticed better battery life on airplane+wifi with the latest kernel but when 3g is on it drains a lot faster than the old one.Even when 3g is off (i.e no data+wifi) battery is draining significantly faster than with the slightly modified kernel (I actually only want color adjustment from a kernel,stock is otherwise fine)

I am on latest rastapop, no dtw,

At night with airplane mode on (during sleep that is) drain is ~2% for 7-8 hoiurs

Thanks in advance
[Nexus 4 Original Android Development] mrg666:
I have been testing the battery life but I wasn't able to find anything abnormal yet.
[Nexus 4 Original Android Development] jimyiak:
I had a strange problem with your kernel..on cataclysm rom i set interactive govenor via trickster and when i set back to ondemand the phone reboots...

sent by nexy 4
[Nexus 4 Original Android Development] mrg666:
I am working on fixing that problem. It is happening since I have backported the updates from mainline Linux for cpufreq driver which required bringing policy per cpu patches. I need to use shared policy again. Xenyz already reported that switching back and forth causes problems. There is no stability problem otherwise. I will fix this in next build.
[Nexus 4 Original Android Development] mytie:
By all means I did not say it was abnormal, it s just that an early version of the kernel worked better for me (ie better battery life) so I searched for it and I couldn t find it.

If there is a dropbox or sth where I can find earlier kernels it d be great, otherwise I ll keep using the latest, cheers
[Nexus 4 Original Android Development] mrg666:
I think what you see is related to the OS update not kernel. Anyhow, you can try the builds below. Please let us know.

http://www.mediafire.com/download/d3xgarc591c4ped/MiRaGe_mako_anykernel_LMY_041815.zip

http://www.mediafire.com/download/2dzxq4f78z14iir/MiRaGe_mako_kernel_LMY_041815.zip

http://www.mediafire.com/download/104vz0xy6288358/MiRaGe_mako_oc_anykernel_LMY_041815.zip

http://www.mediafire.com/download/4deda53v954jdjn/MiRaGe_mako_oc_kernel_LMY_041815.zip
[Nexus 4 Original Android Development] mytie:
Thanks a lot, I will be coming back with the result,

Cheers!
[Nexus 4 Original Android Development] xenyz:
[MENTION=4203114]mrg666[/MENTION] looks like a worthwhile update for bfq was released. Here's the changelog.

Also, it sounds like they're closer than ever to being included in mainline Linux.
[Nexus 4 Original Android Development] mrg666:
I haven't seen the bfq update before. It seems like an important update. I think this is the best IO scheduler for interactive use. It would be great if it is included in the mainline kernel. Let me test and if everything goes ok, I will upload the new build with this patch by the weekend. I have been working on fixing the shared cpu policy in cpufreq but it will probably not be ready by then.