yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] sirxdroid:
Some custom kernels can replace executables or libs such as mpdecision, thermald, etc. that go in /system/bin or /system/lib so flashing boot.img is not enough. If you know the previous custom kernel didn't replace anything like that you can just flash the boot.img as you said, or a stock boot.img.

Also, if you know your ROM uses the stock kernel, you can simply flash the reset kernel & components from motley's thread (N4_422_stock_kernel_and_components.zip):

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

It's a lot easier to remember to simply dirty flash your ROM again and not worry about it. The caveat is that you may need to also flash GApps again if your ROM doesn't automatically back up and restore your GApps when you dirty flash (EOS is one ROM that I use that backs up the GApps, I'm sure many others do too).
[Nexus 4 Original Android Development] Mercado_Negro:
Thanks a lot, I didn't know that. Very very helpful :)

Cheers!
[Nexus 4 Original Android Development] crazy_dj:
So My phone just froze. I don't know if it was the kernels fault, but I attached the kmsg I extracted with the semaphore app.

https://docs.google.com/file/d/0B4QXolJNNZpoNmNibFpUSi13UDQ/edit?usp=drive_web

Gesendet von meinem Nexus 4 mit Tapatalk 2
[Nexus 4 Original Android Development] io53:
The led triggers was a great idea. Very useful as long as it does not mess with the led notifications while the screen is off :).
[Nexus 4 Original Android Development] eep2378:
Is anyone lowering the max freq with this kernel? I rather not have to use two different apps, one just for lowering the max freq

Sent from the Nodes of Ranvier
[Nexus 4 Original Android Development] sirxdroid:
I don't think this file is visible to anyone else. You need to make it public.
[Nexus 4 Original Android Development] Mercado_Negro:
Wow, you actually posted this as yours and didn't even add a link to my post or credited me. I'm not against helping others, that was cool, the thing is people should respect the work of others and at least give some credit to those who spent one or two hours creating something. No heartfeelings, just didn't feel right.
[Nexus 4 Original Android Development] domg73:
It happens with any CPU gov...

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] stratosk:
One more test if you don't mind.

Please use ondemand and set touch load threshold to 1.
[Nexus 4 Original Android Development] domg73:
Ok... Done.

Ondemand, touch load threshold to 1, 384mhz min freq.

Flickering as always :(
[Nexus 4 Original Android Development] stratosk:
OK, could you please try the attached version (it's for 4.4.3).

Change made only for fast bin CPUs.
[Nexus 4 Original Android Development] domg73:
Hmm.. the phone boots fine... but after the screen goes off... it won't turn on again (SOD)... I have to hard reboot the phone...

Tried 3 times...3 SODs
[Nexus 4 Original Android Development] stratosk:
Confirmed. But does this resolve flickering?
[Nexus 4 Original Android Development] domg73:
I'm playing with it avoiding to turn off the screen... so far I had no flickering with min freq 384mhz...

I'll keep using it for some times... I'll report back in a few minutes

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

Well, after about 15 minutes of toying around the flickering seems gone... but... what if it's triggered by a suspend/resume? we can't be sure about that because of the SOD.
[Nexus 4 Original Android Development] stratosk:
This is good (about the flickering). Let me try to stabilize it (if I can).
[Nexus 4 Original Android Development] twowheeler:
This shows what a good person you are stratosk!
[Nexus 4 Original Android Development] capoooro:
Great man.

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] IgnorCZ:
This is like a movie .... Even if i have not this problem with flickering, I am waiting how it will end :) ... [MENTION=3750240]stratosk[/MENTION] is magical man ...

btw thanks so much for quick upgrade of kernel for 4.4.3 ... it's amazing ;)
[Nexus 4 Original Android Development] stratosk:
Well, this seems to be more complex than I thought.

And I didn't find a way to overcome the SOD issues.

The problem seems to be related with the minimum frequency.

The minimum frequency (384MHz) uses a different clock source (called PLL_8). All other frequencies in the frequency table use another

clock source (called HFPLL). I think the latest is more power hungry.

The PLL_8 also uses lower level 2 frequency. Maybe the issue is there. I think that stock kernel scales up more aggressively from 384 to higher frequencies and also scales more aggressively the level 2 frequency (from the minimum 384MHz).

In the test kernel I uses the HFPLL also for the 384MHz (with higher level 2 freq) but this causes SODs.

I also tested 378MHz min frequency (which seems more appropriate from the HFPLL) but with also no luck.

It's too late for me for other tries so I will continue tomorrow.

I think I will try to add an intermediate freq between the standard min 384 and 486 (just a little bit higher than 384). So, if someone has issues the intermediate freq could be used a minimum. Of course this is just a workaround, but I can't think something else at the moment.
[Nexus 4 Original Android Development] motherninja:
Hi Stratosk, I'm tried to flash version 2.1.5 into KK 4.4.3 and my Wifi aren't working anymore. Other features are allright. I am waiting for an update :)

Right now, I am back into using stock kernel again. Thank you
[Nexus 4 Original Android Development] dmourao:
There is a test version avaliable for 4.4.3. :good:
[Nexus 4 Original Android Development] motherninja:
Thank you for your info, I can found it in the previous page. :good:
[Nexus 4 Original Android Development] choipadu:
Flashed 2.2.0 and working good with purity rom. 2.2.1 giving me random reboots. Fast binned cpu.
[Nexus 4 Original Android Development] domg73:
Why not adding a lower freq instead of an intermediate one? 384mhz as default (looks more "standard") and something like 204mhz as minimum...
[Nexus 4 Original Android Development] hughfollett:
Thanked by error... I think that the problem is on 384, lowering the freq won't help

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] artifex21:
I think he posted the 2.2.1 version just so domg73 could test it for screen flickering. Use 2.2.0 instead
[Nexus 4 Original Android Development] snak3ater:
That sliding menu bug is back... Noticed today in tapatalk & trickster mod app..

Now it's there in goodge stock kernel as well.. [MENTION=3750240]stratosk[/MENTION] : any idea what might be causing this bug? Because it shouldn't happen in stock kernel.. It used to happen in kernels having s2w/s2s features... You fixed it once in semaphore.. But now that bug is back :(

Sent from my rastakat powdered Nexus
[Nexus 4 Original Android Development] stratosk:
I don't know about stock.

But a usual workaround is to suspend/resume your device (using power button). Does this work for you?
[Nexus 4 Original Android Development] stratosk:
I also had SOD with lower freqs using PLL.

So this is another test version with standard 384MHz with PLL and an intermediate freq 405MHz using HFPLL.

Please set min freq to 405MHz and check if

1) Flickering is gone

2) SOD does not happen anymore.

Please note that 405MHz uses HFPLL. So having min freq to 405 means that HFPLL will be enabled all the time = more power consumption.

https://www.dropbox.com/s/qxf237vnmsy3vhf/Semaphore_N4_2.2.2.zip
[Nexus 4 Original Android Development] domg73:
No flickering and no SOD using 405mhz....

About the more power consumption I think a little UV should compensate...

I know this is just a workaround and not a real fix... but l really appreciate your work.

Thank you!
[Nexus 4 Original Android Development] stratosk:
Thank you for testing!

I will try to decrease default voltage on 405, and probably this will be the permanent workaround to this issue.

I also use this latest version with min 405MHz. I don't know if it's placebo but it seems more smooth with that freq as min (maybe because of the increased L2 freq)
[Nexus 4 Original Android Development] domg73:
It's not placebo... i noticed it too :)
[Nexus 4 Original Android Development] ihancioglu:
Hi [MENTION=3750240]stratosk[/MENTION], It is not placebo. I have applied related patch in the past. If we set higher L2 freqs for lower cpu freqs, device is working on lower freqs more. So this causes reduce a heat but there is no affect for battery life(negative or positive). Also bring better responsiveness for UI.

You can take a look my acpuclock file.

https://raw.githubusercontent.com/hihancioglu/kernel_msm/master/arch/arm/mach-msm/acpuclock-8064.c

If you modify the acpuclock table in this way, you can also decrease ondemand touch_load a little bit but with same affect :)

Thanks,
[Nexus 4 Original Android Development] stratosk:
Hi,

I'm not sure that this is true. Governors don't know anything about L2 freqs.

They only select the CPU freq independently from L2 freq.

I can't see how you increased the L2 freqs. Can you elaborate a little bit more (maybe the patch in your github)?
[Nexus 4 Original Android Development] stratosk:
Let's say it a release candidate version.

I applied the latest changes to every PVS bin.

Now we have 405MHz frequency (with the same voltage as 384MHz). Use it as minimum if you have flickering issues (with a little bit more power consumption and bit more better performance).

I will release it "officially" later tonight, if there will be no issues.

Thanks for testing!
[Nexus 4 Original Android Development] carlos67:
Lost wifi completely going from 2.1.5 to 2-1.2.2. Purity rom 4.4.2
[Nexus 4 Original Android Development] stratosk:
Latest test and rc versions are for 4.4.3 only.
[Nexus 4 Original Android Development] carlos67:
oops! Sorry for not reading. Back to 2.1.5 it is then.
[Nexus 4 Original Android Development] domg73:
No problem to report... everything is working as expected!
[Nexus 4 Original Android Development] Fenvarien:
+1

Working perfectly fine and stable here.

disce aut discede
[Nexus 4 Original Android Development] haget83:
Flickring happens on very few devices. I always had Very sporadic flikr on bottom part of The screen using semaphore or Mirage but This happens unexplectaly Very few times, so is not a problem (for me)

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] domg73:
On mine flickering was nearly unbearable... almost constant... on bottom half of the screen...
[Nexus 4 Original Android Development] stratosk:
New version 2.2.2

- Merge latest changes from Android KK 4.4.3 kernel source

- Added 2 more tunables to dyn_hotplug to control timer for up and down CPUs: up_timer_cnt (default 2 = 1sec) and down_timer_cnt ( default 10 = 5sec)

- Small improvement to dyn_hotplug

- Introduce a new 405MHz frequency to be used as minimum in case of flickering issues on some devices. This freq uses an HFPLL instead of the PLL_8 (which is used by 384MHz freq) and uses a higher L2 freq. Please note that a little bit more power consumption is expected (but with a small performance increase). Thanks [MENTION=4175599]domg73[/MENTION] for reporting and testing.
[Nexus 4 Original Android Development] TheQuarterMile:
Haven't moved to 4.4.3 yet but was following the thread for obvious reasons.. Kudos to stratosk! Very few developers have this kind of attitude!

Just a question.. Ppl not affected by the screen flicker issue can use the 384Mhz frequency without problem like before? And setting minimum to 405Mhz with UV can balance the battery performance to the normal level?
[Nexus 4 Original Android Development] davidcd13:
Is that it works with CM11 4.4.3 ?

Thank you for your work.

Envoyé de mon Nexus 4 en utilisant Tapatalk
[Nexus 4 Original Android Development] yarisd4dturbo:
No it doesn't work on cm ?

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] davidcd13:
OK ?

Thank you.

Envoyé de mon Nexus 4 en utilisant Tapatalk
[Nexus 4 Original Android Development] IgnorCZ:
Hi ... There should be some variant of Stratosk's Semaphore which works with CM ... somewhere on the XDA ;)
[Nexus 4 Original Android Development] urim225:
Search for jolie kernel
[Nexus 4 Original Android Development] Coolgoly:
Jolie works on aosp,not

on cm.
[Nexus 4 Original Android Development] perfoliate:
Pandan kernel is a cm semaphore based kernel. Not yet updated for 4.4.3 yet though.

http://xdaforums.com/showthread.php?t=2597377
[Nexus 4 Original Android Development] urim225:
Yup you are right i am sorry. Panda kernel is Semaphore based for CM11, maybe that will work for him
[Nexus 4 Original Android Development] stratosk:
Thanks for your kind words!

Yes, that's right.

384MHz can be used exactly like previous versions.

I really don't know how much could be the power consumption impact using 405MHz as minimum.

I use it since yesterday (I also UV). I didn't have noticeable different in battery.
[Nexus 4 Original Android Development] 22sl22:
Thanks for the new 4.4.3 update stratosk, working good on my own rom :good: View attachment 2786290
[Nexus 4 Original Android Development] jtwebfusion:
Awesome Battery Life!!!

I'm getting awesome battery life on the Omnirom rom. This kernel rocks! Thanks!
[Nexus 4 Original Android Development] kooocko:
2.2.2 working fine so far, much smoother than the stock kernel, especially in Temple Run 2 :)
[Nexus 4 Original Android Development] brsclkr:
Smoother but not good enough hellscore about battery life, ondemand gov. it drains battery too fast on mobile data.
[Nexus 4 Original Android Development] TheNerd:]:
Try tweaking the kernel to suit your needs. If not maybe this kernel doesn't work for you. Go back to hellscore if that suits you, but don't go spouting the virtues of hellscore here. This is the semaphore thread. If this kernel doesn't work for you just quietly switch back to your daily driver. No need to provide criticism that is neither constructive or helpful in the growth of semaphore.

Don't get me wrong both are fine kernels, but there's a hellscore thread and a semaphore thread. Keep them separate.
[Nexus 4 Original Android Development] brsclkr:
i think i couldnt explain it clearly, sorry for that. already told "its smoother"

i just wanna get some advises about to prevent battery drain
[Nexus 4 Original Android Development] urim225:
Uv and online cores to 1 that helps a bit but in general this kernel uses a bit more battery on 3g at least for me but now i uv it by -170 and i have 5 SOT
[Nexus 4 Original Android Development] TheNerd:]:
Sorry I misunderstood. I can't help you with that because I myself am not using semaphore. I just wander through the forums trying to help where I can.
[Nexus 4 Original Android Development] borito24:
Congrats on the 1M views! You deserve it! ?
[Nexus 4 Original Android Development] ihancioglu:
Hi [MENTION=3750240]stratosk[/MENTION],

I am sending freq usage statistics of my kernel and semaphore. I am using ondemand and same values for both kernel. Also I am using stock mpdecision, it causes stay on 1024 much more as touch input boost. But it is staying on lower freq more. I was thinking that is L2 bus speed optimization related.

semaphore	maya

FREQ	time in state	%	time in state	%

384	1328638	87.89	1301970	70.25

486	20108	1.33	62255	3.90

594	16416	1.08	74583	4.68

702	10465	0.69	51353	3.22

810	8715	0.57	35853	2.25

918	6547	0.43	23667	1.48

1026	51824	3.42	216273	13.50

1134	7009	0.46	16838	1.05

1242	5331	0.35	11141	0.69

1350	6488	0.42	9148	0.57

1458	6492	0.42	7000	0.43

1512	43632	2.88	43127	2.70
[Nexus 4 Original Android Development] stratosk:
Hi,

As I mentioned in my previous post, I didn't understand your changes.

Could you please be more specific?

About your statistics:

How did you take the measurements? What did you run?

I can't see any benefit in your kernel using mpdecision. Semaphore spent 17% more in lowest frequency
[Nexus 4 Original Android Development] ihancioglu:
I have attached the related patch. I used cpu spy plus to take stats.

You are right , it was not a fair comparison with your hotplug driver and mpdecision. I am downloading your sources now and will apply the changes.

I will do some routine things(reading mail, youtube video, etc.) for specific time period and let you know about the new results.

Thanks,
[Nexus 4 Original Android Development] stratosk:
Thanks, I will check the patch.

Anyway, IMHO you have to run exactly the same things for exactly the same time if you want to extract safe results.

If you want to compare dyn_hoplug/ondemand with mpdecision/ondemand it's ok.
[Nexus 4 Original Android Development] stratosk:
OK, let's see the patch.

-	[2] = { { 486000, HFPLL, 2, 0x24 }, 1050000, 1050000, 2 },
-	[3] = { { 540000, HFPLL, 2, 0x28 }, 1050000, 1050000, 2 },
-	[4] = { { 594000, HFPLL, 1, 0x16 }, 1050000, 1050000, 2 },
+	[2] = { { 486000, HFPLL, 2, 0x24 }, 1050000, 1050000, 4 },
+	[3] = { { 540000, HFPLL, 2, 0x28 }, 1050000, 1050000, 4 },
+	[4] = { { 594000, HFPLL, 1, 0x16 }, 1050000, 1050000, 4 },
[5] = { { 648000, HFPLL, 1, 0x18 }, 1050000, 1050000, 4 },
[6] = { { 702000, HFPLL, 1, 0x1A }, 1150000, 1150000, 4 },
[7] = { { 756000, HFPLL, 1, 0x1C }, 1150000, 1150000, 4 },

Here you increase the bandwidth level from '2' to '4' for the table entries 2,3 and 4.

The level 2 frequency remains unchanged (486000, 540000 and 594000).

static struct acpu_level tbl_slow[] __initdata = {
{ 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 950000 },
-	{ 1, { 486000, HFPLL, 2, 0x24 }, L2(5), 950000 },
-	{ 1, { 594000, HFPLL, 1, 0x16 }, L2(5), 950000 },
-	{ 1, { 702000, HFPLL, 1, 0x1A }, L2(5), 962500 },
-	{ 1, { 810000, HFPLL, 1, 0x1E }, L2(5), 1000000 },
-	{ 1, { 918000, HFPLL, 1, 0x22 }, L2(5), 1025000 },
-	{ 1, { 1026000, HFPLL, 1, 0x26 }, L2(5), 1050000 },
+	{ 1, { 486000, HFPLL, 2, 0x24 }, L2(2), 950000 },
+	{ 1, { 594000, HFPLL, 1, 0x16 }, L2(4), 950000 },
+	{ 1, { 702000, HFPLL, 1, 0x1A }, L2(6), 962500 },
+	{ 1, { 810000, HFPLL, 1, 0x1E }, L2(8), 1000000 },
+	{ 1, { 918000, HFPLL, 1, 0x22 }, L2(10), 1025000 },
+	{ 1, { 1026000, HFPLL, 1, 0x26 }, L2(12), 1050000 },

Here you replace the level 2 entry from '5' to to '2', '4', '6', '8', '10' and '12'.

So, the level 2 clock frequency remain unchanged.

What you actually do is to decrease the bandwidth (= clock X bandwith level) for frequencies 486 and 594MHz and increase the bandwidth for freqs 702MHz - 1026MHz.

Actually in Semaphore frequencies 486 and 594 are use more in a typical use. In these freqs you decrease thee bus bandwidth.

Frequencies 702 - 1026MHz are used less in Semaphore. And there you increase the bandwidth. Please note the default 'touch frequency' is 1134MHz in Semaphore.

In other words, I can't see the benefit from this patch (at least in Semaphore).

Thanks anyway for pointing this out.
[Nexus 4 Original Android Development] tatnai:
thanks for the great kernel. did a few searches but am still confused:

In Semaphore manager, "Double tap to wake" allows you to double touch the screen to wake the phone, and consumes a touch more battery because it has to keep the touchscreen powered on.

What is the Touch Wake setting for? Is it a different implementation of something similar to "Double tap to wake", or is it to control in InCallUI, preventing touching the screen from activating it when in a call? If the latter, when set to off (which is default), this means my phone screen will NOT respond to touches when I am in a call, correct?

My thanks.
[Nexus 4 Original Android Development] vampire36:
Touchwake allows you to wake the screen with a single touch inside prescribed time say 45sec. So say you reading something and screen goes off just a simple touch anywhere on the screen will wake it. :)
[Nexus 4 Original Android Development] tatnai:
thanks. noticed that Touchwake doesn't activate when using the power button but does with time-out sleep. it does, however, activate when using the sleep button from quick-launch shortcuts (on Purity ROM). I wonder if it is possible to keep the setting intact, but have it not activate with the quick-launch sleep shortcut (I would think the intended function is to only work with time-out sleep)? Stratosk?
[Nexus 4 Original Android Development] Jeckoo:
can you please include kexec hardboot patch?
[Nexus 4 Original Android Development] Gu$houn*:
A few times answered by [MENTION=3750240]stratosk[/MENTION] himself -> no.

P.
[Nexus 4 Original Android Development] oxxshadow:
I have experienced a couple SODS in my time of using this kernel for 5 days. I am on Purity Rom, but stock kernel settings, nothing enabled or tweaked other than Colors and double tap to wake. Any ideas? THe screen would become unresponsive, and I would have to hard reset the phone.
[Nexus 4 Original Android Development] capoooro:
Touch it with more than 4 fingers. It begin again to work[emoji2], really, it's not a joke

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 Original Android Development] vampire36:
You mean only activate on timeout and no other thing right ? I think thats not possible atleast with current implementation :)
[Nexus 4 Original Android Development] fortunz:
The question has been answered, but FWIW, I get tons of battery savings off exponential brightness. It kind of depends on how bright your environments are, but most of my use is indoors and in areas where, even in day time, the brightness level I now use comfortably is a little below the stock minimum brightness. I also find the exponential minimum brightness far easier on the eyes for pitch black night time reading.

I didn't start using semaphore for this, but it's definitely one of my favorite features. :D
[Nexus 4 Original Android Development] akulp:
Since TouchControl developing has stopped, is there any plan to integrate slide to lock/slide to wake function in Semaphore N4 kernel?
[Nexus 4 Original Android Development] jokermithun:
Is anyone using semaphore kernel with Rastakat latest build????

How is the experience????:confused:
[Nexus 4 Original Android Development] jimyiak:
I do...converted to f2fs though..everything good till now..just disabled the boost voltage and checking battery..

sent by neXus 4 using xda premium
[Nexus 4 Original Android Development] ABHISHEKSR:
Awesumm experience with great battery life...it keeps my phone asleep like a baby ...and smooth as silk
[Nexus 4 Original Android Development] stratosk:
New version 2.2.5

- Linux kernel 3.4.93

- ondemand: Be friendly towards latency-sensitive bursty workloads (backport 2 patches that intended for 3.16)
[Nexus 4 Original Android Development] MrToastedAndroid:
the website http://www.semaphore.gr is down? or is it just me?
[Nexus 4 Original Android Development] omer7:
Not opening at my end either.

---------- Post added at 07:07 AM ---------- Previous post was at 07:01 AM ----------

U need semaphore v2.2.5? Let me know i ll upload it for u.
[Nexus 4 Original Android Development] icu64:
and no its n you, the site is down
[Nexus 4 Original Android Development] playya:
site is still down please upload for those who may want to download... Thanks
[Nexus 4 Original Android Development] omer7:
Here's Dropbox link:

https://www.dropbox.com/s/2oayt36ejk1ogux/Semaphore_N4_2.2.5.zip
[Nexus 4 Original Android Development] playya:
good looking out I am sure many will be happy!
[Nexus 4 Original Android Development] stratosk:
semaphore.gr was down during (Greek time) night. There was an issue to vserver. But it should be OK now.

You can always find an alternative download link to this thread's downloads section (visible using a browser).

I'm sorry for the inconvenience.
[Nexus 4 Original Android Development] omer7:
Yes it's working now, thanks. ?
[Nexus 4 Original Android Development] Tak3r07:
You may share your method how to convert this kernel to f2fs? I would like to flash it onto my slimkat

Gesendet von meinem Nexus 4 mit Tapatalk
[Nexus 4 Original Android Development] mjehan:
Did you change any of the default kernel settings ? Because I was wondering whether I need to delete the Semaphore Manager App data since I have tweaked all the settings.