yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] stratosk:
3.1.2, with some bug fixes and small code improvements.
[Nexus 4 Original Android Development] gorilla p:
I understand default settings are the devs prerogative, and a lot of people set their default low CPU freq to 384k. I would like to see the 192k freq be available to be set manually however. I've only found 2 kernels that have both conservative governor and allow 192k freq. Any chance of this?
[Nexus 4 Original Android Development] q-doth:
sir are this kernel support touch control ??
[Nexus 4 Original Android Development] OrrPenn18:
Yes, this is one of the few kernels which works smoothly with Touch Control.

Never had one error with Semaphore and TC :)

Mucho gracias, stratosk!
[Nexus 4 Original Android Development] stratosk:
Conservative is of course available. I'm sorry, I will not add 192MHz freq.
[Nexus 4 Original Android Development] stylez:
It would have a negative impact due to the fact that at 192k the system actually finds it harder to run programs OS and will increase battery drain hence why 384k and it takes less to upscale.

Best bet is to UV on the higher frequencies

Thanks stratosk for providing a rock solid kernel and for keeping up development your time is very much appreciated :)
[Nexus 4 Original Android Development] alen1901:
I do not agree. I know qualcomm officialy documented that this cpu min freq must be 384mhz, but i used kernels with 192mhz and 200 and something mhz, and not a single problem. And i used it with heavy undervolt too (150mv). Maybe it depends on cpu type? Also i didnt have any battery drain with or without undervolt. :) but really, on this kernel we dont need lower than 384mhz, its a beast like it is. ;)
[Nexus 4 Original Android Development] stylez:
I won't split hairs and take up the thread to disagree but what i would say is that my own personal use of android since the days of G1 I've noticed an increase in battery life when dropping frequency to a very low MHz, also the under volt on the lower frequencies this can have a negative impact and cause instability.

But I'll agree this is the perfect kernel out of the box experience ;)
[Nexus 4 Original Android Development] ak:
thanks to @thracemerin:

Q: If the 192mhz and 304mhz steps use the same undervolt settings, how can 192mhz use less power?

A: The formula for power consumption is: P = f * c * V ^ 2

Where: P = power consumption, f = frequency, c = capacitance and V = voltage

So: since c is constant in this case, and we'll assume you've used the lowest UV possible (600mV)

At 304mhz: P = 304 * c * 600 ^ 2

At 192mhz: P = 192 * c * 600 ^ 2

This means that 304mhz uses approximately 1.58 times more power than 192mhz over the same time.
[Nexus 4 Original Android Development] MuertoKo:
BUT I'd take more time to be finished, hence the improve on battery gots nerfed.

Enviado desde mi Nexus 4 mediante Tapatalk
[Nexus 4 Original Android Development] thracemerin:
In the testing I did on 162MHz & 192MHz vs 384MHz, the actual power consumption was almost exactly the same where one would assume that there would be some improvement on a full 100-1% cycle.
[Nexus 4 Original Android Development] manpildo:
So basically what you get at 192MHz is worse performance on the same power consumption? If that is the case then it makes total sense why it's the stock min frequency.
[Nexus 4 Original Android Development] thracemerin:
There are people who swear they get more battery on 192MHz or 162MHz, so it would depend on usage (or possibly placebo). There is an increased risk of stability issues if you go below the manufacturer's recommended specs also.
[Nexus 4 Original Android Development] manpildo:
162MHz? Haven't seen that, even my old Galaxy Gio didn't go so low :eek:
[Nexus 4 Original Android Development] pitjago74:
And 50Mhz...The Dev...«Franlov» made it 8 months ago for 4.2 ;)

Enviado desde mi Nexus 4 mediante Tapatalk
[Nexus 4 Original Android Development] stratosk:
This is true. Lower frequency means lower power consumption.

But the question is: how long the CPU stays in this freq (compared to the stock min freq)?

The second question is: why qualcomm chose 384MHz as the min freq?
[Nexus 4 Original Android Development] ak:
freqs

For this questions we should study all docs related to soc.

the great thing about Android is that it allows you to experience and this cool, otherwise we would have a single kernel, one Rom and no fun.

For example, the majority of users do not know that the GPU when idle has a frequency of 27Mhz and not of 128Mhz.
[Nexus 4 Original Android Development] stylez:
Yeah but that's all stats without the software usage if you lower the MHz then the actual amount of time to process the event to which will take longer more strain more drain.

It's an obvious observation that lower frequency = more battery life until you add into the equation the working power to do x task.

In no way saying that its a defo as times have changed and every kernel is different also even the ammount of governors has significantly decreased since signal dual core processors.
[Nexus 4 Original Android Development] ak:
Depends .... the cpu governor is one of the culprit ... :highfive:
[Nexus 4 Original Android Development] stylez:
Lol yeah you'll see I was editing above :D
[Nexus 4 Original Android Development] thracemerin:
This is why usage is important, if we're talking about screen off race to idle situations then doing the operations at 192 or 162 may actually be slow enough to require more time out of deep sleep thus costing more battery power, if we're talking about screen on idle operations (such as reading an ebook) then 192 or 162 may in fact save some power but we're still talking about seconds (maybe minutes, but not 10s of minutes) in a 100-1% discharge cycle.

Qualcomm chose 384 because certain iterations of these chips had stability problems below that level (doesn't mean all of them or even this particular SoC), to ensure the best possible user experience they chose a speed that ensures maximum stability.
[Nexus 4 Original Android Development] stratosk:
I think we all agree that just changing the min freq it's not a guarantee that we will save more power.

There are many factors into the equation. Even in your example about screen on idle operation, you can't be sure that you will save more power. Because in case the hotplug driver uses 1 CPU at low loads then the CPU will use power collapse idle state. This means that having the CPU in 192 or 384 will make no difference (on idle).
[Nexus 4 Original Android Development] thracemerin:
Yes, you're trading stability for the potential of a few minutes extra battery (in a best possible case scenario), it certainly doesn't seem like a good trade to me.
[Nexus 4 Original Android Development] fajarlazuarding:
What does up treshold mean ?
[Nexus 4 Original Android Development] stratosk:
Over this threshold (which measures the average load across all CPUs) the driver will start to put online a CPU.

Below this threshold the driver will put offline CPUs.
[Nexus 4 Original Android Development] gorilla p:
I've heard the "stability" argument a few times, and this may be the case with other phones, but with my Nexus4, I have had NO trouoble with the 192K minimum frequency. I have slightly undervolted all frequencies as well via trickster mod.

I have 192K at 687500 with no crashes. When the phone is sleeping it uses VERY little battery

I was having to charge my phone a couple times a day using the standard settings and 384K minimum with Ondemand governor. This offers good performance, don't get me wrong, but with the specs on this phone, performance is not an issue unless you're doing a good amount of 3D rendering/gaming and multitasking. Most people browse the web, check e-mail, read forums, make calls and text. For this people can benefit from decreased performance overhead in exchange for improved battery life.

Because of this, I decided to switch to the conservative governor because of its preference to stay at lower frequencies for a longer period of time before ramping up as needed. Similar to Ondermand, just not as quick to race to top frequencies.

I then wanted to be able to set a lower minimum frequency as I may leave my phone while doing something, sleep, take a nap, etc. and have as little power draw as possible while keeping the phone running. Only a couple kernels offered both Conservative governor and 192K minimum frequency.

I switched to this and set the frequencies to min - 192K/Max - 1512K

I slightly undervolted each frequency evenly via Trickster mod so 192k=687500mv/1512=1012500mv

I undervolted slightly more and the browser I used started crashing so I went back to the above settings to avoid stability issues. (These may vary for others based on CPU binning. Mine was "fast".)

Also with the amount of time given spent on the homescreen, I changed to a dark background which in multiple tests has been shown to reduce battery drain.

With these settings, after using my phone regularly (browsing, calls, texting, modifying, a few reboots, etc.) my battery has went without charge for 1 day and 9 hours and is at 5%.

I was at home most of the time. This was with Wi-Fi on and connected most of the time. GPS disabled. Data disabled at 10% battery.

You can see where I set my phone down and went to sleep. As the phone went to sleep, hardly any battery was used.

Battery Screenshot

If you're routinely getting enough battery life so that you only have to charge when you go to bed, then great. But if not, then isn't it worth trying something that may help? Not to mention, giving the option for the 192K only does just that. It gives people the option to set that as their minimum should they choose to go in and manually do so. I don't see the harm.
[Nexus 4 Original Android Development] thracemerin:
I'm not discounting what you're saying, but every chip is different even ones from the same bin can be different, so the fact that your phone can handle it doesn't mean other "fast" chips can handle it and you have to consider those with "nominal" and "slow" chips as well. Like I said too, there are certain usage patterns that may benefit more than others from the lower clock, but for most people we are talking about a few minutes per charge cycle.
[Nexus 4 Original Android Development] stratosk:
Did you compare conservative/192 with conservative/384?

Also a clarification: when the phone is in suspend min freq is absolutely unrelated.
[Nexus 4 Original Android Development] stylez:
Screen on time?
[Nexus 4 Original Android Development] gorilla p:
Idk what the onscreen time was I really wasn't planning on sharing the info. I just thought I'd share what I did to significantly improve battery life in my situation and propose giving people the option to change a setting should they wish to take the time to do so. If anyone wants me to run any apps to monitor any battery stats to provide more info next time just let me know. I plan on leaving this configuration for the foreseeable future.
[Nexus 4 Original Android Development] -iNSiGhT-:
In battery stats, click on"screen" to see screen on time.

Paranoid mako
[Nexus 4 Original Android Development] szucsgf:
Thanks for sharing your experience. It's nice that you've given your setup lots of thought. I agree that the 192MHz step is a good option to have that can save power. However I feel the need to point out three things:

1. Your personal frequency settings have nothing to do with the phone's power consumption with screen off. At those times your phone should be in deep sleep most of the time, which is a lower power state than 192MHz.

2. Everything I've read indicates that only amoled displays use less power displaying black. What tests are you referring to?

3. Total uptime is meaningless without also sharing screen on time. 1d9h uptime with 2h screen on is very different than with 4h screen on.

I don't mean to criticize, just to clarify a few things.
[Nexus 4 Original Android Development] fajarlazuarding:
So its mean, if i set it higher or 100 then my cpu will only run 2 core at all?
[Nexus 4 Original Android Development] -iNSiGhT-:
No, it means your CPU will stay on 2 cores until it (CPU charge) reach threshold. When threshold is reached, CPU will activate one core more (a third in this case) and CPU will run on 3 cores.

If CPU charge reach the threshold again, CPU will activate the fourth core, if it goes below, CPU will inactivate a core.

CPU using the right number of cores depending of its charge.

Paranoid grouper
[Nexus 4 Original Android Development] gorilla p:
OK, I wish I had known that at the time, I'll check that nex time and post results.
[Nexus 4 Original Android Development] zwodziarz:
Kernel suckz

OMG thiz kernel suckz! Reboots, bootloops, crasheza smashez
[Nexus 4 Original Android Development] stratosk:
I'm working on explosions too! But I didn't manage to do it, so far.
[Nexus 4 Original Android Development] panart:
Very helpful post, thanks for the in depth explanation of the issues you have.:silly:
[Nexus 4 Original Android Development] stylez:
If you can't be constructive with your posts and not be rude then keep opinions to yourself, xda is a dev community and they work hard to provide for the community any more posts like this and the only response you'll get is infractions on account - banned.

Take that as a warning!
[Nexus 4 Original Android Development] zwodziarz:
That was a joke hehe but the kernel reboots indeed - it seems like I got a faulty cpu cause it can't handle overclocking or undervolting(I flashed a kernel which was slightly undervolted, haven't done it myself). Anyway great work on that one works really smooth battery life is superb although got this crashes with "X" screen when using GPS, hardly surfing Chrome etc. that was killing me. I have also reported that the sound was distorted when playing on loudspeaker - seemed like the dynamics wasn't great(using PlayerPro) and I haven't noticed it on my actual MirageKernel
[Nexus 4 Original Android Development] fajarlazuarding:
Ah i get, so which one better in term of battery life ? Lower or higher value ?
[Nexus 4 Original Android Development] ciprianruse88:
Latest Purity rom+latest semaphore undervolted. 105 hours up time without reboot.If you wanna be helpful post a damn last_kmsg !

"by failing to prepare, you are preparing to fail" - Benjamin Franklin
[Nexus 4 Original Android Development] zwodziarz:
Ok I wanna be helpful I'll flash the kernel then I'll wait till my phone stuck in a bootloop/crash/ and then (If the device still works) I"ll post You a kmsgmg!
[Nexus 4 Original Android Development] szucsgf:
Higher.
[Nexus 4 Original Android Development] ihancioglu:
Hi [MENTION=3750240]stratosk[/MENTION] ,

Touch screen stopped working after phone call. I have attached logcat output before reboot and last_kmsg after reboot.

Hard buttons was okay, power and volume buttons.

Touchwake enabled, no UV.

Thanks,

Ibrahim
[Nexus 4 Original Android Development] benbugohit:
:( TouchControl/S2W/S2L bug strikes again...

:fingers-crossed: keep in mind it's an experimental feature.
[Nexus 4 Original Android Development] stratosk:
Hi, my friend.

Good catch! Very helpful log. I think I know what's wrong and I'm trying to resolve it.

I will let you know about the results.
[Nexus 4 Original Android Development] eluspo:
Hi sir [MENTION=3750240]stratosk[/MENTION]! Good day to you. I just want to ask if i can flash any kernel over sema without any issues? Tia
[Nexus 4 Original Android Development] stratosk:
Hi! good day to you too.

Semaphore does not change _any_ file in /system partition.

This means that if you want to flash other kernel you have to options depending of the flash method (of other kernel):

1) If other kernel uses any kernel updater method then you should flash ROM's stock kernel and then the other kernel

2) If other kernel does not use any kernel update (e.g. Franco) you may flash it without doing anything else.
[Nexus 4 Original Android Development] eluspo:
Thanks a lot sir [MENTION=3750240]stratosk[/MENTION]! By the way what is an any kernel update? If its not too much to ask, can send me a link for the stock 4.3 kernel or upload it here. Appreciate your helpfulness sir and by the way your kernel is super smooth. Didnt encounter any issues at all :)
[Nexus 4 Original Android Development] stratosk:
Any kernel updater is an installation script that inherits the existing initramfs and packs it with the kernel image. So, you may flash the kernel in any ROM, using the ROM's initramfs. The problem is that if you flash it over a custom kernel it will inherit all the changes of the custom kernel. So you need to flash the stock kernel first and if your old kernel made changes to /system, you also need to dirty flash the ROM.

You may find stock boot.img here:

https://developers.google.com/android/nexus/images

Just unzip the nexus 4 image.
[Nexus 4 Original Android Development] eluspo:
Thanks a lot sir [MENTION=3750240]stratosk[/MENTION] :)
[Nexus 4 Original Android Development] stratosk:
OK, as I said I think I found the issue:

Touchwake is enabled and it's activated due to screen inactivity. The screen goes off and a wake lock is held. Phone rings and Semaphore Manager app disables touchwake *. You answer the phone and during call wake lock expires and touchwake disables touch.

* Touchwake driver didn't release an existing wakelock when user was trying to disable touchwake. This was OK if the screen is off (99% of the cases). I prepared a test version that I think handles properly this scenario. You may test it if you want.

Thanks again for your finding and your log.
[Nexus 4 Original Android Development] Barbatos19:
For this issue too maybe everyday. Also got some unexpected reboot maybe ROM issue because it boot on paranoid boot animation. Bit it's OK as I'm not that demanding after all. By the way I'm Running PArc2 sabermod. I think the official PARC² is much stable on me but I'm kinda lazy changing ROm again.hahaha I'll just wait for kitkat.
[Nexus 4 Original Android Development] capoooro:
Great... For this it was a random bug. I had it when I used the phone a lot. Tnx

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] miksontije:
if we are do a flash semaphore kernel over a stock,and there is an semaphore kernel update,do we have to flash stock kernel again or just do a semaphore update over old one using recovery. and one question more.is nesesery to wipe cash and dalvik anywhere in proces of updating kernel(before or after we flash new one)
[Nexus 4 Original Android Development] mylord92:
If you use only 2 cores, you should set min and max online cores "2". Also you gonna set it 100 then your device reaches 100% load and cpu will use 3. & 4. Cores.

Nexus 4 cihazımdan Tapatalk 4 ile gönderildi
[Nexus 4 Original Android Development] stratosk:
No need to flash stock when update Semaphore. My installation script will update initramfs if needed.

No, you don't have to clean cache or dalvik.
[Nexus 4 Original Android Development] danieleb89:
Hi, it's not strictly kernel related, how can I get the log of the temperatures? Is it included in kmesg? (i have a problem with wireless charger...)

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] pitjago74:
Exatcly when I Flash your kernel ( new versión over The last version ) I do it with out wipe.....I love your kernel so far:D

Enviado desde mi Nexus 4 mediante Tapatalk
[Nexus 4 Original Android Development] Barbatos19:
Just a question. What should I do if I shift to trickster mod? Do I need to clear cache and data on semaphore app first before deleting? And delete semaphore app first before installing trickster mod?
[Nexus 4 Original Android Development] MuertoKo:
The 2 steps you mentioned are a common good practise. Better to clean everything before switching apps. Even though I don't see the point of leaving Semaphore Manager imho but that comes to each one's preferences I guess.
[Nexus 4 Original Android Development] Barbatos19:
I kinda found the trickster mod good looking for me. Hahah. The monitoring what I mean :)
[Nexus 4 Original Android Development] MuertoKo:
For monitoring most of my needs I use System Tuner or "PerfMon" from ChainFire to have floating monitoring. Can have any of those but still use Semaphore to tweak the kernel.

You can as well install Trickster and keep Manager as long as you don't tweak values in both btw. So you can have Semaphore App AND Trickster for monitoring without an issue.
[Nexus 4 Original Android Development] Barbatos19:
What do you mean I can use it both? Conflict might arise between the two.
[Nexus 4 Original Android Development] a g bell:
Hmm l think your wrong:eek:
[Nexus 4 Original Android Development] MuertoKo:
No, no conflict if you only use them to monitor. Unless you start touching options those apps won't interefere. Of course, if you set 1.2Ghz freq in Manager and 1.4Gz in trickster those will conflict, but if you just monitor? There's no way there'd be any conflinct
[Nexus 4 Original Android Development] stratosk:
No temperatures are not included in kmsg. I don't remember if there are messages if the device is overheating.

I would suggest to uninstall Semaphore Manager app if you want to use trickster.
[Nexus 4 Original Android Development] robyroby0:
Great Work :good: [MENTION=3750240]stratosk[/MENTION], thank you very much for the kernel, I have only one question (maybe stupid):confused:, how does the touchwake? is enabled but does not go, I have to enable something else too? thanks
[Nexus 4 Original Android Development] stratosk:
Touchwake will be activated only when the screen goes off due to inactivity.

Then, for a specific period (you may select it in Semaphore app) you may "wake up" your phone touching the screen.

If you use power button to turn off you phone, touchwake will not be activated.
[Nexus 4 Original Android Development] robyroby0:
ok now it works:) thanks for the quick reply and thank you again for this amazing kernel:good::good:
[Nexus 4 Original Android Development] sfrique:
[MENTION=3750240]stratosk[/MENTION]

I don't see post about the new caf drivers...

I'm using PAC ROM and they are based in cm trees. There is any chance if making a release for cm?!?

I love this kernel. I used carbon and they have d the same problem...

I actually moved away from carbon because I couldn't use semaphore anymore.. So I'm trying new roms ....

But I love your kernel...

The developer for hellscore made a cm release that works with pac ..

A carbon developer said that to build a compatible kernel wouldn't be that hard... But they can't drop cm tree because of device support..

So.. Are any chances!?! =]]]

Thanks!!
[Nexus 4 Original Android Development] flame360:
I use this, with the latest carbon and got no problems.
[Nexus 4 Original Android Development] ak:
Carbon isn't based on caf ... You have to flash jwr version ...

AK :)

---------- Post added at 08:45 AM ---------- Previous post was at 08:33 AM ----------

I don't know where is the problem for Developers to make a cm kernel ... With 2 commits you can have a working release ...

AK :)
[Nexus 4 Original Android Development] stratosk:
Obviously, the problem is not the 2 commits.

CM team follow their path. They want to be incompatible with stock. It's fine with me. But. I'm not obligated to follow them.

I feel that I want to be more creative, discovering and developing new stuff than to investigate compatibility issues with CM.
[Nexus 4 Original Android Development] ak:
Obviously, my opinion was not referring to a developer in particular, I just wanted to say that I do not see the justification for a war to cyanogen when actually their job right now is better than many others.

Do not take it personally @ stratosk.

I know that the kernel must work hand in hand with userspace, and a cm kernel or rom does not work well with the AOSP version.
[Nexus 4 Original Android Development] Barbatos19:
Anyone experiencing unable to transfer files on MTP mode? It stuck on computing time remaining and the whole process hang for a long time. I'm on PArc2 sabermod. Experience this too on official PA