yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] xenyz:
/system/etc/init.d/01gamma

#!/system/bin/sh

# bundi gamma
echo "0 39 119 1 6 0 2 0 1" > /sys/devices/virtual/misc/gamma_control/gamma_b
echo "0 39 119 1 6 0 2 0 1" > /sys/devices/virtual/misc/gamma_control/gamma_g
echo "0 39 119 1 6 0 2 0 1" > /sys/devices/virtual/misc/gamma_control/gamma_r

# lg gamma
echo "114 21 118 0 0 0 80 48 2" > /sys/devices/virtual/misc/gamma_control/gamma_b
echo "114 21 118 0 0 0 80 48 2" > /sys/devices/virtual/misc/gamma_control/gamma_g
echo "114 21 118 0 0 0 80 48 2" > /sys/devices/virtual/misc/gamma_control/gamma_r

Edit: fixed LG gamma values
[Nexus 4 Original Android Development] HdSht:
Is it normal that bundi has 9 parameters while lg 10 ? :confused:

Plus, 4 anyone looking for gamma presets download this spreadsheet: http://d-h.st/W8us .

(not owned/ created/etc etc by me, just found it on semaphore thread) :).
[Nexus 4 Original Android Development] xenyz:
Hey you're right, it must have been a copy&paste error on my part.

The gamma interface ignores everything after the 9th value, so I guess it doesn't matter. I edited my earlier post with the correct values. Thanks!
[Nexus 4 Original Android Development] CalculatedRisk:
Hello,

What is the latest version of this kernel for 4.4.4 KitKat? I searched the original post and thread but I can't seem to find the info. Also, what is LRX and KTU? Thanks.
[Nexus 4 Original Android Development] xenyz:
Check the OP again, LRX is Lollipop/5.0.1, and KTU is KitKat/4.4.4. There are downloads for each.

[MENTION=4203114]mrg666[/MENTION] I was playing around with settings, and these seem to result in less CPU time for Android OS in battery stats. It might be worth testing.

#!/system/bin/sh

#autosmp
#echo 2 > /sys/kernel/autosmp/conf/cycle_up
echo 125 > /sys/kernel/autosmp/conf/delay

# governor
echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
echo 3 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo 20000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
[Nexus 4 Original Android Development] mrg666:
I will check, xenyz. Thanks!

KTU kernel is the last kitkat build, lolcakes.
[Nexus 4 Original Android Development] HdSht:
Woooooo android 5.1 is out and even if it wasn't released (yet) for nexus 4 it reports kernel updates for mako:

07bd8dc mako: update prebuilt kernel

c72fb5f mako: update prebuilt kernel

I think Google stole your work [MENTION=4203114]mrg666[/MENTION] :p.
[Nexus 4 Original Android Development] xenyz:
[MENTION=4203114]mrg666[/MENTION] I have some news after poking around a bit more:

It seems the touch boost spamming the logcat isn't as benign as we thought. I measured logd using almost 30m of CPU time in ~ 24h uptime.

So, the usual fix is to remove the shared lib power.msm8960.so right? Well, this also happens to break the battery saver mode in Lollipop.

So, looking around a bit, I've discovered that [MENTION=3750240]stratosk[/MENTION] once again has the solution: he includes a dummy program to attach to the socket the power lib is looking for, which silences the log spam and allows battery saver mode to work 100% since all shared libs are present.

Perhaps you can get his permission to include the small utility 'mpdfake' and ramdisk edits to hook mpdfake to /dev/socket/pb ?

Right now, I'm testing it by using your anykernel to flash on top of Semaphore 3.0.2, on top of Terminus ROM stock kernel.

Since doing this, logd has only used ~3m of CPU time in ~12 h, mpdfake has used 10s, and the placebo effect makes it go even faster. :)
[Nexus 4 Original Android Development] mrg666:
Thanks xenyz. Since I don't user battery saver and delete power_mem8960.so, I havent noticed battery use of logd. I will check mpdfake in the weekend. What a smart idea on Qualcomm's part to make battery saver mode dependent on battery wasting code such as touchboost and mpdecision :rolleyes:

I am watching the Google's kernel repository and I will update the kernel as soon as possible after 5.1 code is released.
[Nexus 4 Original Android Development] jer_ying_fd:
Which values should I change to make it less conservative as it lags in light games like hill climb racing. Or should I just set minimum CPU to 2? Thx.
[Nexus 4 Original Android Development] HdSht:
Just leave it at default settings. Nobody has never reported slowdowns. I can play smoothly limbo even with battery saver on :).
[Nexus 4 Original Android Development] jer_ying_fd:
Yes, but the fact is that I can't play hill climb racing smoothly when it's at default settings, which is why I'm asking. And hill climb racing isn't a heavy game at all.
[Nexus 4 Original Android Development] mrg666:
I thought you first asked if there is a kernel setting that can improve your gaming experience. Now, what I understand from your post is that you know that a different kernel setting improves your game. In any case, I don't think there is a kernel problem since the games and benchmarks I tested didn't show any lag. And there were no consistent reports of such a problem. I would only suggest trying 2 cpus minimum. Actually, I would simply delete that game. I wouldn't change the kernel to waste the battery life for everyone else to make a bad game run better.
[Nexus 4 Original Android Development] Flak:
Rastapop + Mirage = hill climb without lag for me.
[Nexus 4 Original Android Development] jer_ying_fd:
Doesn't matter which rom I use, maybe something wrong with my device
[Nexus 4 Original Android Development] ihancioglu:
I just deleted "power.msm8960.so" and reboot but touchboost error logs still flood my logcat..
[Nexus 4 Original Android Development] xenyz:
It looks like it's actually the power.mako.so shared lib spewing those messages in Lollipop.

BTW, renaming the file to get it out of the way is usually a better idea than deleting it, just in case you need to put it back.
[Nexus 4 Original Android Development] Raza Qadri:
Is euphoria not supported by this kernel?

Whenever I flash it I get system ui fc it goes away when I flash stock ROM
[Nexus 4 Original Android Development] ViperX85:
I'm running purity rom 5.0.2. with franco r216. Can I just simply flash this over franco kernel?
[Nexus 4 Original Android Development] HiM@L:
no....flash the stock kernel first then flash this.
[Nexus 4 Original Android Development] xenyz:
If you use the regular installer, it writes over the boot partition, so there's no need to do this for stock.

If you use a custom ROM, flash your custom ROM's kernel first to get any ramdisk changes the dev made in place, then flash the new anykernel installer.

However, since the discovery of touch boost spamming the log and causing logd to use a ridiculous amount if CPU, currently I would recommend flashing stock/custom ROM kernel, then flashing Semaphore 3.0.2 anykernel to get [MENTION=3750240]stratosk[/MENTION]'s workaround, and then finally flash Mirage anykernel installer to get [MENTION=4203114]mrg666[/MENTION]'s beast of a kernel in place.

edit: added links
[Nexus 4 Original Android Development] mrg666:
This is correct. I think deleting power.msm8960.so was sufficient before lollipop. I forgot updating the second post, I will do now.

I think deleting/renaming these libs is a good solution. I never use battery saver mode in lollipop but I will check what is not working without these libraries. If only the frequency limiting part is not working, that is actually not a big loss, IMHO. I am skeptical about the advantage of limiting the maximum frequency since all cpu tasks will take longer at lower frequency. But the power savings are most significant when the cpu is idle. Completing the task quicker and spending more time at idle could offset the advantage of power saving at limited frequency.
[Nexus 4 Original Android Development] dazrok:
Hi, Is there a reason why my phone is heating with this kernel? I'm on the LRX kernel, thanks.
[Nexus 4 Original Android Development] mrg666:
There is not enough information for helping you in your post. Please search the thread for a similar problem. As far as I can remember, there hasn't been such a report before. I certainly don't see any heat problem with stock ROM. An app you had installed or, if you are not using the stock ROM, an orphaned deamon/service due to ROM incompatibility with MiRaGe could be causing such heat problem. Try to find which app is using the CPU or restore the default boot image to check if the problem is kernel incompatibility. Of course, it is always an option to choose another kernel that works for you. I recommend using the default kernel with a custom ROM.
[Nexus 4 Original Android Development] dazrok:
Sorry for the shortage of information.

I'm using stock lollipop, 5.0.1

I did search the form for something like this but didn't came up with anything.

The heating happens mainly when browsing in Chrome and light multitasking. Also when using YouTube.

The one thing I can say I doesn't happens when I put the phone in ideal, the only thing is that I didn't notice it before flashing the kernel.
[Nexus 4 Original Android Development] mrg666:
Sorry, I am not able to replicate the problem. For me, Chrome doesn't cause any heat, YouTube and Hangouts video chat barely warm up.
[Nexus 4 Original Android Development] dxxvi:
Hi All, could anybody tell me a couple of ROM's compatible with this kernel and have the option to set the date to this format "Mon Mar 16 2:27AM"?

Thanks.
[Nexus 4 Original Android Development] enrunn:
Can't tell you many roms. I use Terminus for quite a while now. This kernel works great with it. The date can be adjusted in many different ways. I think your format should go too.

Gesendet von meinem Nexus 4 mit Tapatalk 2
[Nexus 4 Original Android Development] xenyz:
I also use Terminus with Mirage, and you can see the date format you'd like is available on the status bar:
[Nexus 4 Original Android Development] leolawliet:
Yes but unfortunately I had an accident with the phone at work and the digitizer has been cracked ever since. That explains why I took so long to respond. I have the replacement digitizer, I just need the adhesive and I'll be able to fix it. Thank goodness the LCD is fine.
[Nexus 4 Original Android Development] mrg666:
I hope you will fix the n4 soon. It is still a very capable device and runs lollipop great.
[Nexus 4 Original Android Development] icu64:
You should put this in the op
[Nexus 4 Original Android Development] HdSht:
Is anybody using viper4android :) ?
[Nexus 4 Original Android Development] CalculatedRisk:
Yeah, it's great :)
[Nexus 4 Original Android Development] HdSht:
On which rom do you use it and are you running it in compatibility mode or normal ? :). Ty in advance.
[Nexus 4 Original Android Development] CalculatedRisk:
I'm running it on stock 4.4.4, and with "normal" mode. However, because I am using it on stock ROM, it doesn't work everywhere (ie. Youtube, etc), and only works with certain applications. If you are on a custom ROM, it should work with every application that outputs audio.
[Nexus 4 Original Android Development] xenyz:
[MENTION=4203114]mrg666[/MENTION] can you consider pulling this recent commit to ondemand by stratosk?

Also, did you check how much CPU usage Android OS uses with autosmp delay 125 vs 100? It seems to be a pretty big difference to me. I've noticed that with it set to 125 or 130, Android System uses about 1.5x the CPU of Android OS, but with default delay of 100, it's closer to 1 or 1.1x. I should really do a more scientific study, but this shows something.
[Nexus 4 Original Android Development] mrg666:
That commit only adds down_threshold to sysfs. There is no change/improvement in how ondemand works if you are not tweaking that parameter. Down_threshold is already there and hard coded as 5, currently. I will add the commit with the next build after Google releases the mr1 source code.

autosmp delay determines the time in milliseconds between each work function cycle. Smaller delay means work function is cycled more frequently, larger number means less frequently. More frequent cycles of autosmp (smaller delay) makes it more responsive to hotplug events and OS feels more fluid but this also leads to higher cpu load by the workqueue in the kernel. So there is an optimal value for delay between wasting power and being responsive based on human perception. How much delay in the hotplug events can we notice? I think 100 ms is optimal and 125-130 should not make any noticeable difference ... 500 for sure.
[Nexus 4 Original Android Development] xenyz:
Good to hear. Can you make a 5.0.1 release for those of us waiting on Xposed support as well?

I tried out Semaphore with down_threshold 10 and find it helps with battery life a small amount, so that's why I thought it would be good for Mirage users as well.
[Nexus 4 Original Android Development] mrg666:
Are you still looking for better battery life than this :)

I will try to upload the new build tomorrow after work.
[Nexus 4 Original Android Development] HiM@L:
are u running stock rom or other custom rom ?
[Nexus 4 Original Android Development] xenyz:
I use location reporting, Google Now, trusted zone Smart Lock, dt2w, etc. All kinds of apps, media players, browsers and readers. If I can save a bit of battery, I'm all for it.

My battery stats usually look like this.
[Nexus 4 Original Android Development] mrg666:
stock rom
[Nexus 4 Original Android Development] mrg666:
New builds are up with the ondemand modification xenyz asked. There are no other changes. If you are not into tweaking, there is no need to update. I will post the next build for 5.1.

[MENTION=3118524]xenyz[/MENTION] please report how it works since the patch had to be modified slightly for MiRaGe.

Thanks to stratosk for the patch.
[Nexus 4 Original Android Development] xenyz:
Looking good so far. CPU is definitely spending more time at lowest frequency with down_threshold 10. I will experiment with setting higher down thresholds for selecting lower frequencies and see if anything comes of it.

Thanks for the speedy patch!
[Nexus 4 Original Android Development] HdSht:
Sorry for disturbing you with my (stupid ?) questions [MENTION=4203114]mrg666[/MENTION] but:

1) I'm using the non oc version and trying to uv by 50mv ends up to be a -100mv :eek: ..is that normal ?

2) Is the V value of the 1,40-1,45Ghz step correct ?

Thanks for your time :).
[Nexus 4 Original Android Development] mrg666:
First, you don't need apologize for asking a question.

I think you have an error in the voltage definitions. The voltages are specified in steps of 12500 microvolts (12.5 millivolt or mV). For example 1.2V is specified as 1200000 and the next voltage step is 1212500 (1.2125V). To undervolt by 100mV (100 millivolt), you will subtract 100000 from 1200000 which will be 1100000.

See the file /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
[Nexus 4 Original Android Development] HdSht:
It's exactly what I did:

echo -50000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels

but as I reported it ends up by being a -100mv.
[Nexus 4 Original Android Development] mrg666:
That command will not work. I need to check the code to see what would happen but you are lucky that the phone didn't crash right away. Just look at the file. You will see that vdd is defined for each frequency on a separate line. You cannot subtract 50mV from all of the frequencies at once with such a command.

You could use one of the kernel tuning apps to do this. Or change the vdd values for each frequency separately and save your commands in a script in init.d. IMHO, if the OC kernel is not working stable for you, it is not worth undervolting your cpu.
[Nexus 4 Original Android Development] xenyz:
It does work, but I believe you have to pass it as a string, not an integer.

From my ever-evolving /etc/init.d/00mirage:

# voltage
echo "-50000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels

Voltages:
[Nexus 4 Original Android Development] mrg666:
This is good to know. Thanks! I still do not recommend changing voltages with a single command. Because you will not know at which frequency cpu is crashing.

It could be time consuming but the following is the method I use.

1) undervolt highest frequency

2) test stability

- if failed raise voltage

- if passed underclock to the next highest frequency

3) goto 1
[Nexus 4 Original Android Development] mrg666:
LOL, I am not sure what to do with your feedback but I am sure AK would be happy to hear about this. I hope you have thanked him.

I just checked and .... nope, you didn't thank AK for his kernel yet. You are more into discouraging the devs than thanking them, huh?
[Nexus 4 Original Android Development] fabian.m:
He's just a troll probably...

Keep up your good work :thumbup:
[Nexus 4 Original Android Development] Jonathan10117:
Enjoying the kernel so far, just have a few questions; do you recommend ondemand or interactive for battery life? My understanding is ondemand is considered the more battery friendly governor but I'm not sure. Also in trickster mod I see the MP-Decision is off, does that mean your hotplugging solution is already on? Or do I have to turn on MP-Decision? Thanks for the kernel!
[Nexus 4 Original Android Development] C4SCA:
Dont use trickter, uninstall trickster, flash stock kernel, reboot, flash mirage and use nofrills cpu

sent from my NEXUS 4 tasting KitKat for the first time
[Nexus 4 Original Android Development] zwodziarz:
Anybody using this on latest Purity ROM? If yes, any issues?
[Nexus 4 Original Android Development] mrg666:
I developed a special hotplug driver (autosmp) which is on by default. So there is no mpdecision in the kernel and the user-space mpdecision is turned off. You can verify with system monitor lite that unused cores are turning off.

Interactive governor has the best balance of performance and battery life. You can use nofrills to change the governor and scheduler. But I would leave the defaults as row scheduler and interactive governor.

I have tried to minimize the number of tunable sysfs parameters in MiRaGe kernel for better performance. Just flash and forget it. You don't need to tune MiRaGe since I have optimized it as much as possible already.
[Nexus 4 Original Android Development] Jonathan10117:
Cool thanks, makes things much simpler
[Nexus 4 Original Android Development] :
Just seen this thread for first time. Interesting reading the OP. I'm looking forward to perusing your commits :)
[Nexus 4 Original Android Development] mrg666:
Thanks for stopping by. Please let me know if you have any comments on the source code

This goes without saying but feel free to use anything you find useful in the repo.
[Nexus 4 Original Android Development] jawz101:
I'm trying to figure out how to use git-stitch-repo. I just figured I'd throw that out there.

When I was messing with your Optimus V kernel I was mainly cherry picking and decided I wanted to use a git gui because I wanted to see if it would shorten the learning curve with a version control system.

Ended up using SmartGit mostly since it seemed to be the most polished product but it feels like it's an app that would've been great to learn on when they first made it and then gradually get acclimated to their layout.

Off topic but I off topic is why I like talking to mrg666 in the first place

Also, apparently Eclipse has a bundle geared towards kernel development. Coupled with eGit it'd be nice if I could use Eclipse from repo managment all the way to compile time

Still trying to piece together how that works. There's some way to use alternate compilers and whatnot. Slow learning since I'm not being paid for learning I guess :P
[Nexus 4 Original Android Development] mrg666:
My recommendation is using git on the command line directly. GUI's will only delay the time for learning it. I have not used any of the git front ends but I doubt that some of the really useful commands are accessible from those applications. You can also combine git with other utilities like "curl" to do commits in a very useful and quick way. I am not sure those applications will handle such kind of combinations.

I also don't use any integrated development environment for kernel. Again, command line and a simple text editor is enough for the kernel. My favorite text/code editor is SciTe.
[Nexus 4 Original Android Development] :
Yep, terminal is best for kernel work. Since most devs work with GitHub, you can append '.patch' to the url. You don't have to fetch the whole repo then. I'd use...

wget githubURL.patch
git am hash.patch

to do the equivalent of a cherry-pick. This way I can download and apply a commit in a few seconds.

I use gedit for all editing of patches and code, and I prefer meld for merging/comparing. But for getting the most from git, you've got to warm up to the terminal. :)
[Nexus 4 Original Android Development] mrg666:
I use

curl githubURL.patch | git am -

for the same purpose. But this one doesn't save a copy of the patch. A nice example to demonstrate the flexibility of command prompt, multiple ways of doing the same thing.
[Nexus 4 Original Android Development] DarkenCypher:
Started using this today. Feels great! Thanks mrg!
[Nexus 4 Original Android Development] :
Would love some feedback on a script I wrote: https://github.com/bedalus/nexus4/commit/55fc7085a821a9641f50ae451dcb603612f401af

It applies a list of patches but only if they apply cleanly, and only if they apply to code that is actually built. I developed it to keep up with the mainline, but I think it could be adapted for other sorts of work maybe?
[Nexus 4 Original Android Development] mrg666:
Sounds very interesting. I will check it out.
[Nexus 4 Original Android Development] jawz101:
That sounds really cool. I'll definitely have a look
[Nexus 4 Original Android Development] C4SCA:
[MENTION=4128576]bedalus[/MENTION] !!!! U here!!! Miss ur kernel on my Nexus S! Any chance on a N4 kernel?

(Sorry for the off topic)

sent from my NEXUS 4 tasting KitKat for the first time
[Nexus 4 Original Android Development] gravitysandwich:
Can't wait to try this kernel. I have used your kernel/ROM on the nook color, and it was basically one of the smoothest ones out there. Nice Work.
[Nexus 4 Original Android Development] alen1901:
Hint: check nexus 4 general section, for a name "moob" ;)

Sent from Pure Nexus⁴
[Nexus 4 Original Android Development] xenyz:
When it comes to undervolting, I don't put too much importance on getting the absolute lowest voltages. I just use a 'safe' undervolt (-50mV) and I'm done with it.

In fact, if you remember the old Galaxy Nexus threads on battery by bedalus, he showed that too much undervolting actually caused a higher power usage. I don't know if this is true for Krait, but it was eye-opening.
[Nexus 4 Original Android Development] mrg666:
If apps are frequently crashing and getting reloaded due to unstable undervolt, power is wasted. I have seen artifacts in the pictures taken due to unstable CPU too. Jpeg compression was creating garbage.
[Nexus 4 Original Android Development] HdSht:
The OC version is working wonders and I always used it..I was testing some things I've read around with the standard :).

Also, to end the discussion about this "issue" if we can call it so, this happens only on the anykernel format...the normal is not affected.

And last, thank you guys for your time, always a pleasure talk to ya:angel:.
[Nexus 4 Original Android Development] justthefacts:
Just flashed this kernel for the first time. It's a beast.

Would it be possible to add Faux Sound. I got to have it
[Nexus 4 Original Android Development] HiM@L:
as stated in OP....developers will never add sound enhancement to the kernel.....he suggests ViPER4Android.
[Nexus 4 Original Android Development] icu64:
Anyone have any color scripts they can share?
[Nexus 4 Original Android Development] HdSht:
Try this:

echo 0 64 255 1 255 0 206 97 1 > /sys/devices/virtual/misc/gamma_control/gamma_b

echo 0 64 255 1 255 0 206 97 1 > /sys/devices/virtual/misc/gamma_control/gamma_g

echo 0 64 255 1 255 0 206 97 1 > /sys/devices/virtual/misc/gamma_control/gamma_r

if you don't like it you sir have nothing to do here lmao :D.

Btw it's rgb 2.2.
[Nexus 4 Original Android Development] icu64:
That last part wasnt necessary but thanks