yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] xenyz:
If anyone wants to play around with c-states, here is an init.d script I was using for a while on KitKat. Personally, I didn't notice any difference and just stopped using it when LP arrived. YMMV

#!/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=1
#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] icu64:
The other three cores can't use power collapse?
[Nexus 4 Original Android Development] icu64:
By the way, I'm going to do a test on the battery with all 4 cores on (turned off hot plugging) so far after undervolting this seems pretty cool to the touch so that works out as far as heat goes. We'll see about the rest
[Nexus 4 Original Android Development] ihancioglu:
Yes only CPU0 can use power collapse and other cores should be offline.

You can't enable retetion with Semaphore.(patches are missing in kernel) Also I don't recommend standalone power collapse for CPU0. Because Semaphore uses only CPU0 active while screen off and CPU0 causes SoD while in stand alone power collapse state.
[Nexus 4 Original Android Development] ihancioglu:
[MENTION=3750240]stratosk[/MENTION],

This tool will be handy for you and others who wants to play deeper with Qualcomm

https://play.google.com/store/apps/details?id=com.quicinc.trepn
[Nexus 4 Original Android Development] manpildo:
So in theory is it more beneficial then to have minimum 2 cores online like it is currently by default or 1?
[Nexus 4 Original Android Development] jacoghi:
Kernel is really smooth. Newest version is amazing in terms of performance. I had some problems with reboots, not sure though whether is rom or kernel related. Using it with euphoria, last was a kernel panic. I always have 4 cores online, BTW.
[Nexus 4 Original Android Development] Mercado_Negro:
Here you go:
[Nexus 4 Original Android Development] Naa Laa:
RBG at 255?
[Nexus 4 Original Android Development] Mercado_Negro:
Yes.
[Nexus 4 Original Android Development] jiovaxrs:
so perfect :) and smooth
[Nexus 4 Original Android Development] mundixx:
Hi stratosk, are there plans to change the calibration interface in the semaphore app? Like, entering a value to a specific parameter (ex., mids) instead of an init.d like entry currently used?

I think it'll be more user friendly that way and easier to play with the color settings spreadsheet.

Also, how about some presets? :D

Tapatalked from my AOSPA Nexus 4
[Nexus 4 Original Android Development] qtekker:
Done! I dirty flashed the odexed rom. Now I'm sure I have a clean install. Thanks!
[Nexus 4 Original Android Development] Naa Laa:
[MENTION=5087599]Mercado_Negro[/MENTION]

Thank you for your reply again but these values are for PA Halfbreed. Do you happen to know the values for PA Contrasty?
[Nexus 4 Original Android Development] sirxdroid:
What is the conversion trick to go from the values in the spreadsheet to the Semaphore ones?
[Nexus 4 Original Android Development] CrimsonSmear:
64 68 118 1 26 0 72 48 1 RED

64 68 118 1 26 0 72 48 1 GREEN

64 68 118 1 26 0 72 48 1 BLUE

RGB @ 245 244 240

Based on the above, I would garner decimal values in the following layout:

greys, mids, blacks, 1, contrast, brightness, saturation, whites, 1, COLOR
[Nexus 4 Original Android Development] Mercado_Negro:
Exactly, thanks for replying ;)
[Nexus 4 Original Android Development] arief347:
is there anyone confirm touch control working properly for 0.8.0 version?

i already try, no luck..
[Nexus 4 Original Android Development] mundixx:
Not supported. We have touchwake :D

Tapatalked from my AOSPA Nexus 4
[Nexus 4 Original Android Development] arief347:
and how to use that? :angel:
[Nexus 4 Original Android Development] mundixx:
Download Semaphore Manager app from the market. You can see this under the Tweaks tab.

Tapatalked from my AOSPA Nexus 4
[Nexus 4 Original Android Development] arief347:
ok thanks bro, i use trickster mod, so if i press power button and touch it doesn't happen anything right?

it's on when screen, off it self

this feature like AK kernel on galaxy nexus, am i right?

sorry for my bad English..
[Nexus 4 Original Android Development] BLADESMAN1889:
Hey Guys,

Can I flash without resetting the kernel ? I've Been using Franko with Whitehawkx Nightlies but I have deliberately just flashed the Nightly without Franko (no wipe for several weeks) so I shouldn't have to use the reset right ?

Sent from NEXUS⁴ via XDA app [AOKP\/\/hitehawkx]​
[Nexus 4 Original Android Development] pitjago74:
Or 4.2.2 stock -kernel and components:D

Enviado desde mi Nexus 4 usando Tapatalk 2
[Nexus 4 Original Android Development] funcrusher:
Correct. If you flashed the nightly without flashing franco, then you don't have to flash the reset. You should be on whatever the stock kernel is of that aokp rom -- so just flash Semaphore.
[Nexus 4 Original Android Development] BLADESMAN1889:
Thanks Fella's :) :thumbup:

Not enough thanks left to give 1 each - & I didn't wanna leave anyone out :p

Sent from NEXUS⁴ via XDA app [AOKP\/\/hitehawkx]​
[Nexus 4 Original Android Development] icu64:
Wait so his kernel only uses one core when the screen is off? Why not put that in the op? ._.
[Nexus 4 Original Android Development] stratosk:
Theoretically (I'm not sure) it's better to have 1 min core to succeed the deepest C state on idle.

But, I don't think the gain is too much.

Thanks! There was a hardware error:

[ 3896.872943] L1 / TLB Error detected on CPU 1!

[ 3896.873065]	CESR = 0x00000001

[ 3896.873126]	CPU speed = 1512000

[ 3896.873187]	MIDR = 0x510f06f2

[ 3896.873278] D-cache tag parity error

[ 3896.873339] D-side CESYNR = 0x00008282

[ 3896.873401] Kernel panic - not syncing: L1 cache error detected

I'm can't do much. Do you undervolt?

No, the kernel uses by default 2 cores when the screen is on or off.
[Nexus 4 Original Android Development] Pradhan_89:
Flashed v 3.1.0 with latest euphoria 5.1. Running so smoothly. Thank you so much [MENTION=3750240]stratosk[/MENTION]
[Nexus 4 Original Android Development] jokermithun:
Went back to Stock rom from chroma rom and flashed semaphore kernel.

i must say its awesome combo...Thank u:thumbup::)

Sent from my Nexus 4
[Nexus 4 Original Android Development] HiM@L:
testing Semaphore 3.1 with Cataclysm 5.1....running awesome here. Thanks for the great work as usual.
[Nexus 4 Original Android Development] manpildo:
I set it to 1 core during the day and by now I forgot I'd done that until I checked synapse. I felt absolutely no performance drop whatsoever, 5.1 simply feels just so optimized. Don't you think if running 1 core would help save marginal amount of power while retaining its speed, that it would be best to default to minimum 1? Or is there also additional power drain when constantly hotplugging two cores?
[Nexus 4 Original Android Development] stratosk:
I think that maybe the difference will not be noticeable.

For sure, it depends on usage.

You could try to compare between 1 and 2 cores min, but I'm sure that you will need scientific benchmarks to notice the difference.
[Nexus 4 Original Android Development] jacoghi:
Nope, but I have the OV checkbox disabled. That's kinda funny, cause I normally use the phone UC at 1350 MHz, and I was just changing the settings to increase the maximum clock to 1512 when it happened. Does that clarify something for you? Thanks anyways, phone is perfectly stable.
[Nexus 4 Original Android Development] ihancioglu:
My friend, I was pretty sure about one core online while screen off but just checked once again.

Screen On:

root@mako:/ # cat /sys/devices/system/cpu/online
0,3

Screen Off:

root@mako:/ # cat /sys/devices/system/cpu/online
0

Thanks,
[Nexus 4 Original Android Development] stratosk:
Of course you are right. I checked again.

My bad, I forgot my own code...
[Nexus 4 Original Android Development] stratosk:
Maybe it's related with the change of freq, but I really don't know. I hope it's really a 'random' issue because I didn't change something related for a long time.

Please let me know if this will happen again.
[Nexus 4 Original Android Development] ihancioglu:
As the default value of dyn_hotplug/up_threshold is 25(very aggressive), its getting more core online even low loads(even every swipe).. on the other hand, dyn_hotplug/down_timer_cnt is 10 (5 seconds) so wait 5 seconds before offline cores. Another setting of dyn_hotplug is bring 4 cores online while wake the device... IMHO you don't use the device with one core on regular tasks , mostly 3-4 cores :)

Anyway the default values are very optimal for performance a bit cost of battery life. Stratosk's first objective is performance not the best battery :)
[Nexus 4 Original Android Development] M@rs:
Can you recommend good more battery friendly settings?
[Nexus 4 Original Android Development] Pradhan_89:
Can you try new modem from hrere and check whether you still face reboot or not :http://goo.gl/5eJ8Hv

I have used 5.1 stock radio in euphoria. You can flash LTE modem if you need LTE. I have faced one reboot before flashing this modem. Problem solved after flashing. You need to wipe dalvik and cache.
[Nexus 4 Original Android Development] jacoghi:
Had one more, because of the same thing, was trying once more to go to 1512.

[ 426.969784] L1 / TLB Error detected on CPU 1!

[ 426.969845]	CESR = 0x00000001

[ 426.969967]	CPU speed = 1512000

[ 426.969998]	MIDR = 0x510f06f2

[ 426.970059] D-cache tag parity error

[ 426.970120] D-side CESYNR = 0x00008d40

[ 426.970242] Kernel panic - not syncing: L1 cache error detected

So I'll just recheck the 25 mv ov checkbox and see whether it works or not. Will let you know. Maybe it's just my phone, it's a refurbished unit anyways, haha.

Edit: yep, guess the problem may be my phone, even checking the box I can't go to 1512. Got another reboot with the same saying, only difference being the d-side thing. That's kinda of annoying since I'm coming from kit kat where I didn't have this problem. Even though, I only changed to 1512 when I wanted to play some game, which I rarely do, so, not a big deal. Thanks once more for the great work.
[Nexus 4 Original Android Development] manpildo:
Increase up threshold and decrease down timer, I guess. I just increased up threshold to 50% and decreased down timer to 2.5 seconds and I noticed slight performance drop, but it's probably more battery friendly though. Your choice. I'll set them back to defaults because I prefer performance.

EDIT: Try setting up threshold to 100% :D Just to relive the days of 1 core devices. Awful.
[Nexus 4 Original Android Development] M@rs:
Haha I still have my xperia x10 as back up phone. :D it's horrible slow.
[Nexus 4 Original Android Development] stratosk:
Hmm... Weird issue. I didn't have other reports about this.

Most probably, is something in your device.

Do you have this issue only when you try to set max 1512?

I mean, did you try to change the max frequency to other values? Try this many times to check if the problem is there.

Another thought. From Semaphore Manager disable hotplug driver.

Then try to set the max frequency to 1512 from command line:

echo 1512000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

echo 1512000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq

echo 1512000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq

echo 1512000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
[Nexus 4 Original Android Development] Fenvarien:
Dear Stratos, my friend, I hope you and your family are well! Your kernel is running like a champ on the N4, which is now used by my wife.

Could you please take into consideration to add an option to disable d2tw when the power button is used. This could achieve some power savings when d2tw is enabled, but the user decides to switch it of for a longer time via power button.

The doubletap_pwrkey_suspend patch is available in the github of McKael (Mikael Berthe) here: https://github.com/McKael/FrancoKernel-mako/commit/40fe233cf244d2b5eb5b89815f9e4c0fa29c9269

I know you have a lot of family and work priorities. But maybe you find this code interesting too... ;)
[Nexus 4 Original Android Development] stratosk:
Hello my friend! Yes, we are OK. We survive in Greek reality... :)

I hope you and your family are fine!

Thanks for your feedback and for your continuous support! Enjoy your new device!

I was asked in the past to add this feature. I always had it in low priority in my TODO list.

But since you asked, I will add it in next version.

Thanks again for all your help!
[Nexus 4 Original Android Development] Midomad:
How this feature exactly work?

If i understand correctly If you use power button to wake the device dt2w is disabled?

How can we re-enable it?
[Nexus 4 Original Android Development] Gu$houn*:
You have dt2w enabled and once you turn the screen off via power button it's disabled until you will turn it on via power button again.

P.

[sntfrmnxs4]
[Nexus 4 Original Android Development] Fenvarien:
That's great news, my friend! Thank you for your kindness and your support over the years. I'm still using my I9000 with Semaphore, when my new OPO ist charging! ;) And to be sure: The N4 is still an awesome device, I regularly snap it away from my wife and enjoy it's hand-friendly design and good performance. :good: :)
[Nexus 4 Original Android Development] jokermithun:
hello stratosk sir...can u share ur values of CPU 0123 in kernel app:o

Cataclysm N4
[Nexus 4 Original Android Development] Midomad:
I think his using the defaut values.

Ondemand/384/1512/25.
[Nexus 4 Original Android Development] soumoks:
[MENTION=3750240]stratosk[/MENTION], can you elaborate on the changes made in 5.1 and/or in your kernel. The overall experience feels fluid when compared to 5.0.

Running stock with your kernel and my n4 feels like it's running on butter :D
[Nexus 4 Original Android Development] stratosk:
New version 3.1.5

- Linux kernel 3.4.107

- Double tap to wake: add option to temporarily disable after power key pressed. Auto enabled again after device resumed. Enable this feature using the command:

echo 1 > /sys/devices/virtual/input/lge_touch/dt_wake_pwr_disable
[Nexus 4 Original Android Development] stratosk:
I didn't make any specific change for 5.1. I just merged Android's changes.

There are several fixes and improvements. You may see the full log here:

https://android.googlesource.com/kernel/msm/+log/android-msm-mako-3.4-lollipop-mr1

between tags android-5.1.0_r0.9 and android-5.0.1_r0.4.

I think the most important are the ARM crypto support for AES encryption (used in IPsec), and the changes in GPU driver.
[Nexus 4 Original Android Development] jokermithun:
So can i flash it on 3.1.0 version???
[Nexus 4 Original Android Development] vampire36:
Once again you prove your the best...Thanx for adding this feature :)

Appreciate all the efforts you put in :)

For me the best N4 kernel till date :)
[Nexus 4 Original Android Development] Fenvarien:
Thank you, my friend, great work! The new feature works just awesome.

θαυμάσιος :)
[Nexus 4 Original Android Development] Midomad:
I Totally agree,

The Best and the most underrated Kernel for N4.
[Nexus 4 Original Android Development] stratosk:
Your posts make me happy! :)

Thanks everybody!
[Nexus 4 Original Android Development] stratosk:
If you mean 3.1.5, yes.
[Nexus 4 Original Android Development] Mercado_Negro:
Indeed! This is one of the best kernels I've used in my N4. Thanks stratosk for all the hard work!
[Nexus 4 Original Android Development] MtG92:
I feel like I've been spoiled with Semaphore, because I can't use another kernel for very long...it just isn't the same ;)
[Nexus 4 Original Android Development] hoangtungst:
I very love your kernel on my old nexus 4 but now i am using lg g2 and can't find any kernel for g2 can be used like your kernel . Sorry but can you build another version kernel for lg g2 ? Sorry for my bad English and noob question.
[Nexus 4 Original Android Development] stratosk:
I'm sorry.

I don't own a LG G2 and I definitely need a device to build a kernel.
[Nexus 4 Original Android Development] bobgeneric:
What is the max CPU frequency for this kernel?
[Nexus 4 Original Android Development] eurochild:
stock 1512
[Nexus 4 Original Android Development] oxxshadow:
Anyone using the new bundi iphone colours on semaphore? If so, may you please share it? I know that the profile has been shared before somewhere on this thread, but that profile is the old one. There is an updated profile which is included in kernels such as hells core, franco, quanta, ect. Just wondering if anyone knows of this, or has a list of colour profiles for semaphore.

Thanks You
[Nexus 4 Original Android Development] xenyz:
Can you link to it? If you're referring to the gamma on Franco/quanta, it's the LG profile:

# 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
[Nexus 4 Original Android Development] fireillusion:
This is a list I found on this thread. Cannot remember at the moment who shared it first but it is not mine. I just concatenated cells in order to copy paste the values easily.

My favorite setting though is: 0 39 119 0 6 0 2 0 2 courtesy of gialakias
[Nexus 4 Original Android Development] gialakias:
Not mine. I found it in here. [emoji6]

Sent from my Nexus 5
[Nexus 4 Original Android Development] fireillusion:
As always my compliments to the dev. Excellent work.

I have a noob question: since I haven't done this before, how is the command "echo 1 > /sys/devices/virtual/input/lge_touch/dt_wake_pwr_disable" used? Where do I insert it?
[Nexus 4 Original Android Development] leninke:
Download terminal emulator from play store. You have put first su command, then the command above.
[Nexus 4 Original Android Development] fireillusion:
thank you for your answer.

done that.

my next question is: do I ave to execute it every time I reboot my phone (which in my case is daily?)
[Nexus 4 Original Android Development] leninke:
That's a good question, I think you have to do it, but to be honest I don't know, so we have to wait for the answer.

---------- Post added at 07:43 PM ---------- Previous post was at 07:40 PM ----------

I just tried, and you have to do it, after every reboot. Or maybe with tasker.
[Nexus 4 Original Android Development] urim225:
you dont have too, at least not for me. It works after every reboot
[Nexus 4 Original Android Development] fireillusion:
How did you do it? ?
[Nexus 4 Original Android Development] stratosk:
Thanks!

As lininke mentioned you have to do this after every reboot, using terminal emulator with su privileges.

It will implemented as option in next version of Semaphore Manager.
[Nexus 4 Original Android Development] ioucorsa:
Same for me here...

Just one time and works after reboot as it should...
[Nexus 4 Original Android Development] mistersixt:
Hi,

I am having issues while connecting to wifi access points, I am on the latest Chroma (latest build with 5.1.1_r1), with latest modem version .06 and Semaphore 3.1.5.

Please find the adb logcat here.

When enabling the wifi on the nexus-4 it looks like it is connected to the access point within a fraction of a second, a few seconds later all the other ESSIDs from the neighbours access points show up. The final result is an exclamation mark next to the wifi signal, and I am still connected via the 3G/UMTS. This happens with both of my wifi routers (AVM and D-Link), while my Nexus-5, Moto-G and all other devices are fine.

The devs from Chroma think it is coming from the kernel, strange is that it happens with AK or hC kernel, too. Any kernel dev or other dev that "sees" what wrong?

Any help is more than welcome,

thanks mistersixt.
[Nexus 4 Original Android Development] snak3ater:
Flash stock kernel in Chroma and then see if issue is still there. Or try factory image, flash semaphore and test it out. You will be able to see what's causing trouble here
[Nexus 4 Original Android Development] mistersixt:
It actually started happening with the stock kernel in Chroma, I then moved on to try other kernels, with the same results :( .

I opened a ticket https://code.google.com/p/android/issues/detail?id=79978 a while ago where I tried a factory image at the very beginning, same thing.

I am running out of ideas, so I was hoping that a kernel dev could see from the adb logcat what is happening as it is really annoying.

Regards, mistersixt.

[edit]I think it is always about those lines as far as I can see:

E/WifiStateMachine( 582): Did not find remoteAddress {10.31.0.1} in /proc/net/arp

E/ConnectivityService( 582): Unexpected mtu value: 0, wlan0

[/edit]
[Nexus 4 Original Android Development] stratosk:
If this also happens on your ROM's kernel and all other kernels then it's something in your ROM's end.

Please note that Google didn't officially released 5.1.1 sources for mako.

So, your ROM using 5.1.1 code, but kernels using 5.1.0. Maybe there are changes in 5.1.1 that will cause this issue.
[Nexus 4 Original Android Development] ioucorsa:
Just to inform [MENTION=3750240]stratosk[/MENTION] that although the tweak about disable dt2w with power button worked as it should and after reboot i realized last night that it stopped working and i found the file to realize that it had changed to "0" by itself for some reason....
[Nexus 4 Original Android Development] snak3ater:
http://xdaforums.com/showthread.php?p=60329218
[Nexus 4 Original Android Development] redj12:
Hi guys. I am on CM 5.1.1 and was on the stock kernel for some deys. I flashed Sema 10 min ago and my colors became weird. Some idea ?
[Nexus 4 Original Android Development] vampire36:
Sema is for aosp roms not CM...

For that download Jolie CM version