yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] DarkenCypher:
Mrg666!!! I remember you from the optimus v scene! Nice to see you again!
[Nexus 4 Original Android Development] mrg666:
I remember you too. Hello there.
[Nexus 4 Original Android Development] mrg666:
I have updated today's builds to include a patch for the interactive governor that will hopefully eliminate a seemingly harmless kernel warning. Please update if you have already downloaded today's build. Sorry for the double post today. I will keep quiet for a while.
[Nexus 4 Original Android Development] fabian.m:
Using your kernel since yesterday with a clean aosp build and it's flying. Thank you very much.
[Nexus 4 Original Android Development] nedooo:
It's clear that this kernel is your build for your own use and it's great you are sharing it here.

Errr...one or two things may I ask?

Will you ever consider to implement gama control and 450 MHz gpu OC?
[Nexus 4 Original Android Development] nibla101:
I understand you don't want to add unnecessary stuffs to your kernel, but please consider faux sound or some sort of sound control, the stock volume is painfully low when listening to music with headphones. :fingers-crossed:
[Nexus 4 Original Android Development] mrg666:
Thank you for the suggestions, guys. I will start with adding the sound patches. Let's test the recent set of changes for a couple of days first. Then, I want to clean up the warning messages in the kernel log given by WARN_ON(timekeeping_suspended); in timekeeper.c. I will add the sound patches soon after that.

I have done overclocking with all of my other kernel projects but N4's quad-core processor warms up really too quickly and it is already more than powerful enough. I am not sure if overclocking is really necessary. I might just add it for completeness.

I am not sure how Gamma control could be useful for N4. The colors on the LCD screen are very natural to me and the stock ROM has no Gamma control. If N4 had an AMOLED display with oversaturated colors (like SGS3), I would have considered it however.
[Nexus 4 Original Android Development] DrummerMuppet:
OCing on a quad-core device doesn't make much sense to me - the N4 is quite powerful already without it, IMHO.

If I may say, please keep your kernel as close to stock as possible. Simple is good too, and there are plenty of other choices for people who need more features.

Thank you for your work!
[Nexus 4 Original Android Development] alen1901:
Yeah, dont bloat your kernel. Ok, sound patches are good for many people listening the music but if it affects performance or stability, its not worth it. Also, gpu oc is really not needed on this phone, its powerfull enough for at least 2 more years with its specs. Also if you add oc step, it would replace stock 400mhz which is crazy, and if you add one more step in gpu freqs, its more codes and goes away from simple and clean. My opinion. :)
[Nexus 4 Original Android Development] mrg666:
It seems we agree about overclocking. And, don't worry, I will not bloat the kernel.
[Nexus 4 Original Android Development] mrg666:
I have uploaded another build.

- fixed the warning messages in the kernel log

* Revert "msm: cpufreq: boost freq of online cpu(s) to max on resume"

- ARM: hw_breakpoint: enable HAVE_HW_BREAKPOINT feature flag

My suggestion is to wait for the kitkat update after this build.

Cheers!

Edit: On a second thought, I added QSEECOM back to test its removal a little longer before making it public.
[Nexus 4 Original Android Development] zwodziarz:
Hey, I don't know what will KitKat bring but I want to ask: Is there any option U'll add a red LED on charging and a green LED as the battery is full feature? Cause I was on Semaphore and have it configured that way, although the kernel was making my device coming to an "X" load screen from time to time(stock rom) and I came to this thread found Your kernel works really nice, the overheating is practically gone(that's the main reason i unlocked the bootloader and flashed a kernel) battery life's decent(although not as good as on Semaphore) really appreciate Your work!

Have a question: Previously my first custom kernel was Linaro 4.8.2(NEO 15) then this Semaphore one. On the first one I got crashes all the time phone was rebooting etc. Some say it was this colorfix issue I haven't found it and flashed Semaphore then got this X screens lags - I flashed Your kernel. As You said that every module is enclosed in kernel, do I need to wipe anything now so the kernel works like it should work? Sorry for interrupting I'm a bit noobish just want my phone to perform like it should ;)
[Nexus 4 Original Android Development] mrg666:
You don't need to wipe anything, the modules left by the other kernels will not be any problem. But if the system was modified in other ways, there can be problems.

It is odd to hear that your battery life was better when the phone was heating more. It is usually the other way around. Give it some more time to see the battery life.

I am not sure about the led mods. That is such an insignificant feature for hacking the kernel. As I stated in the op, I normally don't add new features without a very good reason.
[Nexus 4 Original Android Development] zwodziarz:
Yea but Semaphore solved the overheating a bit, although while I was using GPS it heated up a little. But for example it lasted longer while listening to music - I listened for 30minutes and battery dropped only 2%. On Your kernel (18/10 ver) today I've been using Chrome for about 3hours on HSDPA - the battery dropped to 50%. Rom stock, interactive/noop 384/1512mhz
[Nexus 4 Original Android Development] mrg666:
Thanks for the report. When it comes to battery reports, I learned in the past years of developing kernels that they are always very inconsistent. I do my best to optimize and then it is what it is. So I can't help much with that.
[Nexus 4 Original Android Development] zwodziarz:
Found an issue: while my phone was charging now touch screen became a laggy from time to time when I locked/unlocked the screen it came back to live then after few minutes again - lagging. Got that problem while phone was plugged in on USB debbuging but thought it was normal then - haven't reported that issue while charging
[Nexus 4 Original Android Development] mrg666:
I just checked what you described but I am not able reproduce; it is as smooth as always while charging for me. Please post dmesg when that happens again.
[Nexus 4 Original Android Development] :
thanks
[Nexus 4 Original Android Development] mrg666:
Thanks to [MENTION=4128576]bedalus[/MENTION], the battery drain during sleep is finally improved. I am observing <0.5% per hour battery drain now. The culprit was Qualcomm Crypto Engine which was supposed to increase efficiency by enabling hardware acceleration for crypto functions. Instead it was increasing the battery drain.

The update is available in the OP with the following changes

- disabled QCE which was draining the battery

- Linux 3.4.84 (this is rc1 patch, will be released soon)

Enjoy!

EDIT: see the screenshot of 10% battery drain in ~20 hours below.
[Nexus 4 Original Android Development] xenyz:
Good stuff man, been testing out your work for the past day or so. The OC kernel doesn't work well on my phone, I usually can only get away with -75 on my fast bin. Oh well.

Here's an interesting setting for the interactive gov you should try out:

echo "1026000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq

echo "1" > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy

echo "85 1026000:90 1350000:95 1458000:99" > /sys/devices/system/cpu/cpufreq/interactive/target_loads

Going to boot up the new release now.
[Nexus 4 Original Android Development] jimyiak:
I'm facing some flickering on xda app while scroling up and down..like lag or something...with interactive and ondemand too...

neXus⁴ running kitkat 4.4.2
[Nexus 4 Original Android Development] Connor Baker:
Flickering... Like jittering or stutters?

Connor Baker
[Nexus 4 Original Android Development] jimyiak:
Yes..and on some other apps like cpu spy...

neXus⁴ running kitkat 4.4.2
[Nexus 4 Original Android Development] Connor Baker:
So the screen is not flickering? It's just stuttering from the cpu ramping down. Change the governor values to ramp up more easily and for longer.

Connor Baker

---------- Post added at 04:25 PM ---------- Previous post was at 04:24 PM ----------

Do you think that this would be an important addition to the kernel? It's a possible security hole. I'm not sure if you've already addressed it though.

https://www.codeaurora.org/projects...hecks-putusergetuser-kernel-api-cve-2013-6282

Connor Baker
[Nexus 4 Original Android Development] jimyiak:
Which values are these you mean on interactive govenor?? :rolleyes:

neXus⁴ running kitkat 4.4.2
[Nexus 4 Original Android Development] Connor Baker:
I'd recommend these settings. Of course, your battery life will decrease respectively because it will be keeping the CPU at a higher frequency for longer.

Connor Baker
[Nexus 4 Original Android Development] mrg666:
That patch has already been applied. Thanks!

I don't use xda app but I don't see any general performance problem. There are some stuttering apps on my phone too. And I always get rid of them as soon as I find a better alternative. I can't change the kernel to make bad apps perform better.
[Nexus 4 Original Android Development] mrg666:
I fixed a past error and reposted the latest build. The only change is that I disabled GENTLE_FAIR_SLEEPERS again. I thought previously that it was ineffective since I couldn't see any changes. But I was struggling lately to find the reason why the IO benchmark scores were lower in the latest builds. I finally found that the reason was enabling the GENTLE_FAIR_SLEEPERS. Disabling the GENTLE_FAIR_SLEEPERS again brought the IO performance back to the previous level. To be specific, the IO score of Quadrant was down to 4100 from the levels of 4800. So the new builds are in the OP as always. And, I am sorry about these back-to-back builds. I will keep quiet for a while :)
[Nexus 4 Original Android Development] jawz101:
People like updates
[Nexus 4 Original Android Development] criminalzen:
yea :)
[Nexus 4 Original Android Development] xenyz:
Hey [MENTION=4203114]mrg666[/MENTION], I found something else you may want to play around with. I'm trying to figure out why devfreq picks 128 MHz for the min_freq of GPU when you have 27 MHz available. I'm not smart enough to figure it out after comparing a few kernel sources, but I'm sure you are. :)

I thought originally it has something to do with the tunables on the link below, but on boot up /sys/devices/platform/kgsl-3d0.0/devfreq/kgsl-3d0.0/min_freq is 128000000 and even after changing it to 27000000 the cur_freq and target_freq are unchanged.

Not a big deal, just something I was screwing around with.

https://github.com/mrg666/android_k...0d1a4710f317ce1d/drivers/gpu/msm/adreno.c#L86
[Nexus 4 Original Android Development] mrg666:
Interesting! There might be hardware limitations to reduce the GPU speed down to 27MHz but it is worth checking out.
[Nexus 4 Original Android Development] xenyz:
​

Other kernels use 27 MHz no problem with the ondemand governor.

I dug a bit further, could this be the issue? It is acting like it's 'missing' the last of the freq table index, i.e. 400, 320, 200, 128, 27...

https://github.com/mrg666/android_k...8ce#diff-1f5f517c87b16d9bd7ee02437140a876R385

If I get this right, it's grabbing the index from here using the above.
[Nexus 4 Original Android Development] mrg666:
You need to check arch/arm/mach-msm/clock-8960.c. See fmax_gfx3d_8064. 128000000 is set there. I will check if it makes any difference to use a lower frequency. But the problem is 3D clock is not only set for 3d graphics. We can have problems with video and jpeg images too if you check that file.
[Nexus 4 Original Android Development] apatal:
Naw, man. It's cool. Keep pushing the envelope. It's what xda and developers like you are here for. :)
[Nexus 4 Original Android Development] ak:
The problem is related to the fact that the frequencies are not reported correctly to the user space.
[Nexus 4 Original Android Development] ihancioglu:
Hi [MENTION=4203114]mrg666[/MENTION],

As soon as I applied the workqueue patch from Linux 3.6.11, I get compile error. I could not find related commit for this error.

In file included from include/trace/ftrace.h:571:0,

from include/trace/define_trace.h:86,

from include/trace/events/workqueue.h:121,

from kernel/workqueue.c:283:

include/trace/events/workqueue.h: In function ‘ftrace_raw_event_workqueue_queue_work’:

include/trace/events/workqueue.h:37:1: error: ‘struct cpu_workqueue_struct’ has no member named ‘gcwq’

In file included from include/trace/ftrace.h:778:0,

from include/trace/define_trace.h:86,

from include/trace/events/workqueue.h:121,

from kernel/workqueue.c:283:

include/trace/events/workqueue.h: In function ‘perf_trace_workqueue_queue_work’:

include/trace/events/workqueue.h:37:1: error: ‘struct cpu_workqueue_struct’ has no member named ‘gcwq’

scripts/Makefile.build:307: recipe for target 'kernel/workqueue.o' failed

make[1]: *** [kernel/workqueue.o] Error 1

Makefile:949: recipe for target 'kernel' failed

make: *** [kernel] Error 2

make: *** Waiting for unfinished jobs....

Any idea for this error?

Thanks in advance,
[Nexus 4 Original Android Development] haget83:
This happened to me using semaphore and Last mirage releases. The screen has (sometimes) 1, 2 rapid blinks in The lower part of display. Switching to another kernel The problem disappear. Have u an idea what could be The problem? So i can try to investigate..

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] mrg666:
Can you give me a link to the patch and specify which repo you are applying it to?

I will keep an eye to catch if that happens on my device. If you find a way to replicate it consistently, please let me know.
[Nexus 4 Original Android Development] ihancioglu:
commit 1e4e40e3ad2b34519608f103566d065c347fd70d from your master
[Nexus 4 Original Android Development] haget83:
i did some research, this problem happens to very few people.

http://xdaforums.com/nexus-4/orig-d...e-n4-2-0-0-t2232898/post48834818#post48834818

http://xdaforums.com/nexus-4/orig-d...e-n4-2-0-0-t2232898/post48835405#post48835405

In my opinion could be a problem caused by an app..

I keep my eyes open :cool:
[Nexus 4 Original Android Development] mrg666:
That patch applied fine in my repo but it was long time ago. Some other patch apparently changed workqueue.h since then. You can check what made the change in file history. Or ...

See mathkid's fix below and take the part just for workqueue.h.

https://github.com/mathkid95/linux_lg_kitkat/commit/26b4e491ee0253c39e94087e1ad663697548f556

Don't forget thanking him for the fix :)
[Nexus 4 Original Android Development] pirigu:
hello does it to me with the last two releases of the kernel ... I have the same app for months and I do not think it's the fault of the app! Even to me changing kernel disappears ...:crying:
[Nexus 4 Original Android Development] mrg666:
As much as I would like to help, you need to help me first to replicate this problem. I can't do anything otherwise without seeing the problem.
[Nexus 4 Original Android Development] xenyz:
I'm betting it has to do with the C1 state. Some devices just have problems with it. Try this script below:

#!/system/bin/sh

########### Retention States (C0,1,2 or 3) ###########

### C0 (WFI) - Shallowest Sleep (default enabled)
C0=1
echo "$C0" > /sys/module/pm_8x60/modes/cpu0/wfi/idle_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu1/wfi/idle_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu2/wfi/idle_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu3/wfi/idle_enabled

echo "$C0" > /sys/module/pm_8x60/modes/cpu0/wfi/suspend_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu1/wfi/suspend_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu2/wfi/suspend_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu3/wfi/suspend_enabled

### C1 (Retention) - slightly deeper sleep
C1=0
echo "$C1" > /sys/module/pm_8x60/modes/cpu0/retention/idle_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu1/retention/idle_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu2/retention/idle_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu3/retention/idle_enabled

echo "$C1" > /sys/module/pm_8x60/modes/cpu0/retention/suspend_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu1/retention/suspend_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu2/retention/suspend_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu3/retention/suspend_enabled

### C2 (Stand Alone Power Collapse) - deeper sleep
C2=1
echo "$C2" > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled

echo "$C2" > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled

### C3 (Power Collapse) - deepest sleep
C3=1
echo "$C3" > /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu1/power_collapse/idle_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu2/power_collapse/idle_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu3/power_collapse/idle_enabled

echo "$C3" > /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled

############ eof ############
[Nexus 4 Original Android Development] mrg666:
Good suggestion but retention only caused flickering when enabled on core0. I have disabled it on core0 since then. It would be great if [MENTION=1958679]pirigu[/MENTION] and [MENTION=4981499]haget83[/MENTION] can test this. You can also use a root file explorer to write "0" in all retention files if running the script is a problem. If that helps, please let me know and I will disable retention completely.
[Nexus 4 Original Android Development] haget83:
I'm on semaphore now (i was testing) and problem is the same (as months ago). I go back to mirage kernel and disable c0 c2 and c3 using faux Clock. I will let u know
[Nexus 4 Original Android Development] mrg666:
Please try one by one starting with c1 (retention), then c2 (standalone_power_collapse). I would leave the others alone. Looking forward to your feedback.

Edited: to correct the c states in question.
[Nexus 4 Original Android Development] fluffier:
Hello! These are my first cycle results with the latest bersion of this kernel KOT 032214

Most of my apps a greenefied.
[Nexus 4 Original Android Development] xenyz:
[MENTION=3685904]ak[/MENTION] disabled this, and then re-enabled this a few weeks later. Perhaps he will respond with his reasons.
[Nexus 4 Original Android Development] Fenvarien:
C1 retention works fine for me, if it's enabled for core 1-3 but disabled for core 0. :good:

disce aut discede
[Nexus 4 Original Android Development] Kaka88:
Im looking for kernel which is simple and giving me great battery life..

Maybe this one that i looking for..

I'll give it a try.. :)
[Nexus 4 Original Android Development] jimyiak:
Until 50% battery i had 3SOT but after 50% drains a little bit faster i think although very good battery ;)

neXus⁴ running kitkat 4.4.2
[Nexus 4 Original Android Development] mrg666:
Enabling retention (c1) and standalone_power_collapse (c2) is adding some lag in the kernel response. I am currently testing the kernel without those to see if there is any noticeable increase in battery use. If I can't see much difference in battery use, I will not enable them by default in the next build. I haven't seen any confirmation yet but it is possible that some of the phone's screens flicker with c1 and/or c2 enabled. Users still can enable them if they want.

I have seen the clear advantage of disabling GENTLE_FAIR_SLEEPERS after reverting my first commit; kernel is more responsive. When I reverted, I had the impression that it was ineffective. But there were too many changes affecting the kernel performance at that time. Now that I have slowed down with development, I was able assess its effects more clearly. I will keep it disabled.

By the way, I will be tying the loose ends and tightening the last screws in MiRaGe which will be posted probably on Friday. I will be gone for a while starting next week.
[Nexus 4 Original Android Development] ak:
I have added userspace for disable gentle ondemand with synapse. :fingers-crossed:
[Nexus 4 Original Android Development] haget83:
Enabling c1 (retention) causing the screen flickering on my device.

No problem using c0,c2,c3

//* does this mean my phone has a weird chipset?
[Nexus 4 Original Android Development] Fenvarien:
Did you try to disable C1 for core0 like explained some posts ago? It works great here. You can use this script by xenyz to selectively chose the cores for a certain C-state. http://xdaforums.com/showthread.php?p=51342010

disce aut discede
[Nexus 4 Original Android Development] mrg666:
It is known that enabling c1 in core0 at idle causes flickering. That's why it is disabled. You were supposed to disable on all other cores for both idle and suspend.
[Nexus 4 Original Android Development] Kaka88:
What settings best for battery life? I mean governor and scheduler in this kernel..

This kernel is very simple, and i uninstalled my trickster mod.. :D

Thanks before..
[Nexus 4 Original Android Development] xenyz:
Although there's no author info and it's pretty basic, I can't take credit. I found the script in the bricked kernel thread a while back.

I'm switching between your last two builds trying to figure out if there is an advantage or not. The original reason you posted (IO throughput) I can't seem to duplicate though.
[Nexus 4 Original Android Development] Kaka88:
Its okay if i flashed the new version over the old one?
[Nexus 4 Original Android Development] mrg666:
I have uploaded the new builds and downloads links are in the OP. The changes are the followings.

- Disabled C1 and C2 power states by default. It is still possible to enable them via sysfs with the instructions in the thread. I have seen that there were no significant battery life savings by using these power states but disabling them improved the kernel response and potentially fixed some rare screen flickering issues for some users.

- Fixed a rare crash of kgsl driver. Nobody has complained yet but I recommend updating the kernel with this build

- kgsl patch to start GPU in high-priority workqueue to decrease latency

- Removed unused USB_NET drivers

- Removed scsi disk support.

- Updated bpf_jit compiler with several fixes

I think I have addressed all concerns in the recent posts and I believe MiRaGe is in a very good state right now. I need to take a break for a while. I don't expect but if there are any problems, I will be checking the thread in the weekends and will do my best to fix them.

Cheers!

Sure, that is the way you are supposed to do.
[Nexus 4 Original Android Development] haget83:
IF My device starts again to flickr i will look for u and I will find u :D

Have a Nice vacancy

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] Sir_gpm:
Dont use any app, the OP said is not a tweaker kernel :D

Enviado desde mi Nexus 4 mediante Tapatalk
[Nexus 4 Original Android Development] xenyz:
I switched the c states back on and went with ondemand and got this at 50% battery with the latest release:
[Nexus 4 Original Android Development] jawz101:
All this graph tells me is that an illuminated touchscreen consumes power
[Nexus 4 Original Android Development] xenyz:
It's all about how much power it's consuming.