yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Android Development] sudokamikaze:
The SINAI-N4 Custom Kernel​

Based on Spezi77's Hellspawn Kernel with upstream features & fixes

F2FS Support

A lot of hotplugs & Governos & I/O scheds

Latest Changes & Fixes from upstream

Clean & Stable sources

Regular updates

And more!

Important information:

Only for Advanced users!

Use THIS kernel adiutor to tweak kernel

Enable any hotplug you like and choose governor, other tweaks you can configure yourself and for your own purposes

Known-issues

- Firefox videoplayback doesn't work for some roms

Installation

1. (Optional)Wipe cache/dalvik cache

2. Flash kernel zip over stock kernel of the ROM

3. Reboot system

Downloads:

Nougat/Oreo AOSP BASED: AFH

Nougat CM/LOSBASED: AFH

DO NOT FLASH AOSP based kernel over CM/LOS Oreo rom, you will get "color problems" & LineageOS 15.1 doesn't supported (yet or still)

SPECIAL EDITION, Only for Unlegacy-Android ROM

Nougat/Oreo: AFH

Pie: AFH

Credits:

Special thanks to

- AOSP

- Unlegacy-Android team

- HUGE THANKS TO spezi77

- AdrianDC

- Chipp_a

- frap129

- Basketbuild

- hellsgod

- zaclimon

- rostifaner

- ganachoco

- txuki2005

- yoinx

- Cl3Kener

- franciscofranco

- faux123

- eng.stk

- stratosk

- show-p1984

- mrg666

- Defconoi

- neobuddy89

- flar2

- CallMeAldy

- AK

- Alucard

- And anyone I forgot to mention

XDA:DevDB Information

SINAI Nexus 4 kernel, Kernel for the Google Nexus 4

Contributors

sudokamikaze, spezi77

Source Code: https://github.com/Sudokamikaze/SINAI-N4

Kernel Special Features:

Version Information

Status: Stable

Current Stable Version: Build 2018-08-16

Stable Release Date: 2018-08-16

Created 2017-05-30

Last Updated 2018-10-31
[Nexus 4 Android Development] *Jonny*:
thanks for your support, work with lineageos?
[Nexus 4 Android Development] ze7zez:
For the time being, I do not have time to check the action, but I have placed a link to SINAI-N4 in my favorites.

Is the SINAI name from the peninsula?
[Nexus 4 Android Development] sudokamikaze:
Check post, i added kernel for CM
[Nexus 4 Android Development] sudokamikaze:
Yes
[Nexus 4 Android Development] hauckk@sfreserves.org:
Finally a new kernel for nougat thanks so much for your hard work it supports multirom in case anyone was wondering also has USB otg hack and dt2w support
[Nexus 4 Android Development] hauckk@sfreserves.org:
This kernel does not flash over custom kernel it has to be flashed over a ROMs stock kernel see screenshots
[Nexus 4 Android Development] ze7zez:
OK

Installation works effectively.
[Nexus 4 Android Development] sudokamikaze:
Unpack your custom rom zip on pc

Then fastboot erase boot

and flash your rom stock kernel

fastboot flash boot boot.img (boot.img of your custom rom that unpacked on your pc(

Then go to recovery and flash kernel

But backup rom(/boot and /system in twrp) before this for safe
[Nexus 4 Android Development] sudokamikaze:
If you need best expirience, configure kernel in Kernel adiutor, hotplug not enabled by default(will be fixed in new releases) and set "Screen off max frequency" to 486 MHz, Intellihotplug configured by default but not enabled :c
[Nexus 4 Android Development] ha7ak3:
Nice kernel!
[Nexus 4 Android Development] AntonioJaramillo:
Has OTG hack?
[Nexus 4 Android Development] Has_anDroid:
multırom twrp ground zero rom mako 7.1.2 kernel flash error
[Nexus 4 Android Development] hauckk@sfreserves.org:
Yes See screenshot
[Nexus 4 Android Development] hauckk@sfreserves.org:
Did you flash the siani kernel above the ROMs stock kernel I flashed it in this order for a nougat ROM with siani kernel

Clean flash is my recommendation

ROM

gapps

then Sinai kernel

Then magisk or SuperSU

then reboot

If that doesn't work flash up to twrp 3.1.1.0

Then wipe all partitions except internal storage

Then install in order above

And then boot into primary ROM and reinstall multirom twrp using multirom manager app

Just my best guess
[Nexus 4 Android Development] dcshallot:
there's a new build by lineage os today.
[Nexus 4 Android Development] nefescalanadam:
With Los 14.1 + custom kernel + stickmount i cant use Otg. How u can use ?
[Nexus 4 Android Development] hauckk@sfreserves.org:
Use kernel auditour mod and turn on otg in miscellaneous controls
[Nexus 4 Android Development] sudokamikaze:
I find a solution how to fix sound lag! in the morning i set default hotplug to autosmp, and all day i noticed a music lag, try to use mako hotplug.
[Nexus 4 Android Development] sudokamikaze:
Yep! but now i have less free time then before, try to flash Nougat version on marhsmallow, it may work, but backup /system & /boot
[Nexus 4 Android Development] dcshallot:
Mako hotplug seems only active 2 cores. In many times, apps lag. And core 1+2 1512mhz, 3+4 offline.

Update: now I use mpdecision, lag once (but maybe cause by unexpected touching I was biking)
[Nexus 4 Android Development] sudokamikaze:
It always keep 2 cores online and will online additional cores based on load conditions.
[Nexus 4 Android Development] dcshallot:
I agree, but I can't notice it active all cores. And the qq lag so much. Then I switch to kernel adiutor immediately the cores only work in 2.
[Nexus 4 Android Development] Cristiano Lira:
Can you use WhatsApp without gapps? And messenger? Tell us more how do you live without it, how do you get the apps, I got interested on your SOT.
[Nexus 4 Android Development] moriel5:
Makes sense, and I am glad that you understood my meaning of noGAPPS as being without microG either, I shall edit my previous post to make that clear.

Update: Previous post edited.

---------- Post added at 06:05 PM ---------- Previous post was at 05:59 PM ----------

I don't use Whatsapp or Facebook (even the Messenger) (I had deleted my Whatsapp account a few years ago, followed almost immediately with my Facebook account, and a bit later, my Google account, due to the privacy issues), however I can say that Whatsapp does, as I had setup my family's devices without GAPPS either (they use Whatsapp), although I am considering on installing microG for them (they are still reliant, to a certain degree, on Google). No idea about Facebook Messenger, although I believe that it does not require the Play Services either (as Facebook are trying to compete with Google on that front).

As to how I get by without GAPPS, I had never really required them, preferring to do things manually (so I did not use Google's synchronization and the like), and also I had been using competing services since before Android had existed (Yahoo then, now ProtonMail) since I grew up with them, so even when using GAPPS, I kept removing them when they were not needed (Rooted my first phone, a Pomp King 2 (W99) on day 1), and installing them when they were, untill I had no more need of them, so essentially, I had been running a noGAPPS phone (I had completely stopped using them when on a Nexus 5) a few years before I had left Google.

However, I still use a few Google apps (in such a way that they don't call home if I do not want them to):

Google WebView, GBoard (modified to remove the language packs, and Google Text-to-Speech.

My main sources are XDA Labs, F-Droid, and APKMirror, although I also use APKPure when I have no choice.

In short, I don't really need the Play Services.
[Nexus 4 Android Development] sudokamikaze:
Some info about new release, hellspawn(and my kernel too but not enabled) have a DynHotplug, but official kernel adiutor doesnot work with it. But here a mod of it

Thanks [MENTION=5091819]spezi77[/MENTION]
[Nexus 4 Android Development] Emandroid:
This new Dynhotplug will be released or is it in the 19.06.17 version?
[Nexus 4 Android Development] sudokamikaze:
Dyn hotplug already implemented but not enabled. Now i trying to build kernel with gcc 7
[Nexus 4 Android Development] Emandroid:
Ok thank you. Good work
[Nexus 4 Android Development] dcshallot:
I played coc for a while, and the cpu stat table in kernel adiutor only shows 2 cores, the 2 others always offline.

Btw, this installation is totally new, because a few days ago, a reboot kick me out of system, it can't never boot into launcher. I had no ways them I wipe system and data.

Lineage OS 20170615
[Nexus 4 Android Development] majster95:
So you can use intellliplug, for me works fine but i have same issue with mako hotplug.
[Nexus 4 Android Development] dcshallot:
Intelliplug lag a lot now. Strange, I use around, mpdecision is the last choice.

So, I don't understand the warning. Changing frequency may cause problem? Max or min frequency? Thermal? What's the problem?
[Nexus 4 Android Development] sudokamikaze:
Who using nitrogen os, download mod of kernel adiutor and open last tab to enable otg. Proof on screenshot
[Nexus 4 Android Development] sudokamikaze:
Kernel updated!

VERY IMPORTANT! Use kernel auditor mod before flashing build!

Changelog:

Enabled DYNHotplug

Switched to diff branch(linaro version) with OpenMP support

Optimized kernel with openmp
[Nexus 4 Android Development] dcshallot:
After install the kernel + wipe dalvik+cache

reboot into launcher, wait for a while, auto-reboot.

It always went into launcher for a few seconds then reboot.

So I hurry checked the kernel adiutor mod. Found the MPDecision and Dyn_plug were enabled at the same time. Then disabled MPDecision. Rebooting seems stoped. Logcat-0 is generated at that time(rebooted a lot before, I can't use localterminal, then I connected to PC). But maybe not including the reboot logs.

The log shows lots of Exceptions, so, I rebooted to recovery used Fix Context.

Logcat-1 is generated.

Should I flash latest open gapps again? It's beans gapps mini now.

I don't know whether it's right or not: Thermal

65℃ 70℃ 1350MHz

70℃ 75℃ 810MHz

75℃ 80℃ 384MHz

84℃
[Nexus 4 Android Development] dcshallot:
Dyn_plug only uses 2 cores (min 2 cores max 4 cores).

It's use core-0 and core-2, the 2 others always offline. I think yours kernel would be not compatible with lineage OS yet.
[Nexus 4 Android Development] dcshallot:
For lineage OS, alucard hotplug is a relatively stable one. It can active all cores, no reboots, no music lag(bioshock,min 594, max 1512, max off screen 1350, max off screen 4 cores). It can be used as a daily driver. Let's dance:victory:
[Nexus 4 Android Development] fajera:
Yes i know about it i have so enabled but it was usb not mounted :-/
[Nexus 4 Android Development] Emandroid:
Yesterday I used the new hotplug with hellsactive and bioshock

I can say that it is smooth with heavy works

But when I need more power (ex. Opening google maps, Facebook) I see only a lot of lags for some seconds :/
[Nexus 4 Android Development] sudokamikaze:
Nice mate!
[Nexus 4 Android Development] *Jonny*:
I installed Nitrogen Os and works great, without any music lags and sod <3
[Nexus 4 Android Development] Likn'_ùs:
Hi!

Trying this kernel out with the latest version of PureNexus! I'll let you know how it behaves!

Cheers..! ;)
[Nexus 4 Android Development] ttocs99:
Hi may I ask what's the recommended settings for battery life I'm on nitro os and idle battery drain is to much for my liking thanks
[Nexus 4 Android Development] dcshallot:
:crying:a reboot. I saw the logs, they are all after reboot.

If I enable the option"store logs"with buffet size 256kb, would it be stored, the reboot issue?
[Nexus 4 Android Development] sudokamikaze:
I have a battery drain on nitro too, but i switched to PixelDust

Governor set to intelimm and hotplug alucard or makohotplug, gpu set to 200MHz
[Nexus 4 Android Development] ttocs99:
I've switched to what you have said and noticed a lil bit of lag maybe because of intellimm should I raise minimum frequency I'm on 384mhz at moment

---------- Post added at 12:32 PM ---------- Previous post was at 12:31 PM ----------

I would reflash but I like nitro it's pretty solid
[Nexus 4 Android Development] *Jonny*:
Yeah on lineage os i was better sot than nitrogen os but we can't have all :(
[Nexus 4 Android Development] sudokamikaze:
I'm using pixeldust, and i think this better then nitrogen
[Nexus 4 Android Development] ttocs99:
I've just made the switch I'll post back see if sot and bat life differs
[Nexus 4 Android Development] dcshallot:
I can't use qq on pd, if I remember right. That there's an issue.

If you have time, try lineage OS that other hotplugs are not stable.
[Nexus 4 Android Development] spezi77:
What's qq?
[Nexus 4 Android Development] dcshallot:
The last post to pixel dust by me was may 23, I submitted that the alipay can't access network, and network stat issue, battery drain. Lineage is my last chance.
[Nexus 4 Android Development] moriel5:
I am pretty sure it's a chinese social network app.

I used to use QQGames (an update to AIM brought integration with it) about 9 years ago, before it was bought from AOL by some chinese company.

I hear that the social network is rather popular in China.
[Nexus 4 Android Development] dcshallot:
Interesting~ last_kmsg has the reboot reason though I don't know what it told.

[50227.782688] msm_pm_wait_cpu_shutdown(): Timed out waiting for CPU 0 SPM to enter sleep state

This may be helpful.
[Nexus 4 Android Development] dcshallot:
A reboot this morning.
[Nexus 4 Android Development] xenyz:
I've noticed that (on Fake Nexus) both dyn_plug and mpdecision are both enabled by default. I've manually turned off dyn_plug, just using mpdecision, and haven't had any reboots yet.
[Nexus 4 Android Development] dcshallot:
Perhaps, the reboots only happen in lineage os.
[Nexus 4 Android Development] M4rf0:
Also in lineage os with this kernel is problem with video player for example in firefox. On stock Kernel it works on quanta and sinai video will not be working. How this problem can be related with Kernel?
[Nexus 4 Android Development] Cristiano Lira:
Phone is using much more power with this kernel in comparison with stock, in stock while dozing it uses almost no power during many hours while with this kernel the phone uses more than 1% per hour. Can you fix this? This is the only reason I don't stick with this kernel.
[Nexus 4 Android Development] sudokamikaze:
What rom you using?
[Nexus 4 Android Development] sudokamikaze:
Also i have this problem, try to use Chromium SWE
[Nexus 4 Android Development] sudokamikaze:
Guys what do you think. Now i implementing new features, and i find intresting feature. When phone in sleep small utility changes IOSched to noop to save battery. Do you want it in new release?

And to due big problems(Reboots, not working video, etc) in LOS(CM) variant i wanna drop support because i can't fix it, no idea to fix, i can support it but you have problems, bad experience and other.

Also i successfully ported blu_plug(hew hotplug) but it don't have on/off toggle, it by default enabled, and no way to disable or work with other hotplugs. I can provide test build for anyone who wanna test it
[Nexus 4 Android Development] M4rf0:
Yes I know that chrome works OK, but why this affect Firefox? Is there a problem with codecs or what? I use Firefox on all my computers and I will lose sync feature if I will use chrome :) Is there any possibility to repair this? I have installed this kernel on my device and it works perfect but because of this Firefox problems I go back to stock kernel :/
[Nexus 4 Android Development] sudokamikaze:
By default dyn_hotplug enabled. mpdecision enabled by your rom
[Nexus 4 Android Development] sudokamikaze:
Yep, i'll try to fix it
[Nexus 4 Android Development] M4rf0:
I'll be waiting in impatience :D Figers crossed!
[Nexus 4 Android Development] sudokamikaze:
Forgot to ask, which rom you using?
[Nexus 4 Android Development] M4rf0:
At this time crDroid 3.4, very stable. Before it, I used Resurection Remix but it is no longer supported for N4.
[Nexus 4 Android Development] hauckk@sfreserves.org:
I can test the new hotplug if you want

I don't have a PC at the moment though ?

I'm clean flashing an aosp nougat rom later today
[Nexus 4 Android Development] sudokamikaze:
I provide build later, if you experience some problems(music lags/etc) report it
[Nexus 4 Android Development] sudokamikaze:
Hi, here build, AFH
[Nexus 4 Android Development] Cristiano Lira:
Unlegacy.
[Nexus 4 Android Development] sudokamikaze:
Don't used this rom, but I think, problem like in nitrogen
[Nexus 4 Android Development] hauckk@sfreserves.org:
I'm downloading right now will report back tommorow afternoon
[Nexus 4 Android Development] *Jonny*:
[MENTION=7970097]sudokamikaze[/MENTION] You think you can fix problem on Lineage OS? (music lag) I was nitrogen, now i have Pixel Dust but still Battery performance was better by ~ 20-30% on Lineage :(
[Nexus 4 Android Development] dcshallot:
Now I'm using carbon ROM. Based on aosp. Seems has battery drain issue and before I use smartmax and mako-plug, it reboot in bioshock+alucard.
[Nexus 4 Android Development] sudokamikaze:
Try intellimm + dyn/mako-hotplug
[Nexus 4 Android Development] Cristiano Lira:
Why? This rom is the most stable, pure AOSP, by the guy who fixed the camera on our phones.
[Nexus 4 Android Development] sudokamikaze:
I don't used this rom* and dunno how to fix this problem
[Nexus 4 Android Development] sudokamikaze:
Updated

New link in op post

Currently, not building LOS/CM variants to due problems, when i fix it i'll provide new build for LOS/CM

Changelog

GPU Optimizations, now getting more fps

Blu_active governor

IOSched switcher, when device sleep it change to noop sched automatically to reduce battery drain

Some vunerables fixes

Crypto speedup and UNALIGNED access enabled
[Nexus 4 Android Development] hauckk@sfreserves.org:
Seems to work well for me I had a few Bluetooth disconnects at first but I haven't had one for awhile

WiFi isn't disconnecting

At first I had music lag till I raised the max screen off frequency cpu to 1512 since then I haven't noticed any music lag

This is my setup in ka mod

See screenshots
[Nexus 4 Android Development] sudokamikaze:
Thanks a lot mate! Check out new build
[Nexus 4 Android Development] sudokamikaze:
Finally i find a fix to audio lags

When you changing hotplug do this:

Disable your hotplug, then go to CPU tab, manually enable all cores, then enable your hotplug
[Nexus 4 Android Development] dcshallot:
I'm downloading nitrogem OS:silly: carbon ROM has random reboots with your kernel.
[Nexus 4 Android Development] sudokamikaze:
Give a try with pixeldust
[Nexus 4 Android Development] dcshallot:
I've tried in May 23. The issue made me out of alipay. I need this to purchase. If nitrogen have major bug which preventing the daily actions, I would try pd again.

There's another thing is that I download the ROM zips so difficult, even use shadowsocks or gae.
[Nexus 4 Android Development] dcshallot:
What's msm_hsic_host wakelock? Now I've disabled it, seems ok, nothing happened.

I'm using nitrogen+ondemand+mako-hotplug. The others governor and hotplug would drain battery.
[Nexus 4 Android Development] xenyz:
It's the way the SoC communicates with the radio, as they are separate in the N4. I'm not sure you can disable it without losing cellular.

I just hit 100h uptime on latest(7/7/17) with ondemand / mpdecision. Seems stable enough, nice job [MENTION=7970097]sudokamikaze[/MENTION]
[Nexus 4 Android Development] dcshallot:
In nitrogen, seems not work. I followed your steps: disabled all hotplug, CPU cores were all activated, then enabled mako-hotplug. Sometimes, still has lag. Anyway, it didn't reboot anymore.

Btw, where's mpdecision? The last post says ondemand+mpdecision is stable. I'd like to use it. Quanta kernel didn't have additional CPU features so it is stable.
[Nexus 4 Android Development] *Jonny*:
do you have music lag on AOSP rom? lol I don't have that problem on nitro :)
[Nexus 4 Android Development] dcshallot:
Can I use the app 'autostarts'? I block many background auto starts permissions of Chinese apps. Would these block actions cause lag? But I allow Google apps do anything. I use Google music player.
[Nexus 4 Android Development] dcshallot:
Just rebooted.:p
[Nexus 4 Android Development] sudokamikaze:
About wakelocks, just don't touch him, it working and not creating any problems

Thanks mate!
[Nexus 4 Android Development] sudokamikaze:
Thanks about reporting issue, now i understand why its rebooting. In last_kmsg i saw that many apps killed by LMK(low memory killer), i'll fix it in next release(1~3 days to it)
[Nexus 4 Android Development] sudokamikaze:
Mako_hotplug have lags, I can confirm it because i used it
[Nexus 4 Android Development] dcshallot:
Low memory killer I use very aggressive. Can't I use it?
[Nexus 4 Android Development] xenyz:
You have to turn off dyn_plug manually and then turn on mpdecision

Use kernel adiutor or another app, or terminal:

# echo 0 > /sys/module/dyn_hotplug/parameters/enabled
# start mpdecision
# stop mpcpusetd (Only for Fake Nexus ROM)
[Nexus 4 Android Development] dcshallot:
Thanks, but I didn't find it. I'm using nitrogen.
[Nexus 4 Android Development] sudokamikaze:
I already fixed this issue, in next release it will be
[Nexus 4 Android Development] sudokamikaze:
Where's mpdecision? It not build by default in my kernel(disabled) If someone using it i can enable it
[Nexus 4 Android Development] sudokamikaze:
You can, but it killed many apps and then kernel panic happend
[Nexus 4 Android Development] dcshallot:
Rebooted this morning.

Ondemand/alucard(I can't find mpdecision in KA)/default lmk settings

And, music lag happen.
[Nexus 4 Android Development] sudokamikaze:
Please test it with this build: AFH
[Nexus 4 Android Development] xenyz:
Your kernel installer disables it of course, but on Fake Nexus it is started again after boot in init scripts. This is probably the only ROM that does it.
[Nexus 4 Android Development] dcshallot:
Thanks! If reboots still happen I will report.

And, is there a way to optimize KA to apply settings? The phone lag for a long while after boot before applying KA settings.
[Nexus 4 Android Development] dcshallot:
Reboot happened.
[Nexus 4 Android Development] sudokamikaze:
I need to add some hotplug to ramdisk, it fix reboots but create reboots when Ka apply settings
[Nexus 4 Android Development] dcshallot:
? how about you modify another KA.
[Nexus 4 Android Development] sudokamikaze:
Noticed that:

[ 4319.424507] mako_hotplug: resume
[ 4319.446878] [Touch D]touch enable
[ 4319.450846] mipi_dsi_panel_power : reset start.
[ 4319.452830] AutoSMP: resumed

You using 2hotplugs?
[Nexus 4 Android Development] dcshallot:
No, now only alucard. Mako-hotplug is disabled since you said it had lag issue.
[Nexus 4 Android Development] dcshallot:
Settings are as images.
[Nexus 4 Android Development] sudokamikaze:
Do you have a telegram?
[Nexus 4 Android Development] dcshallot:
You mean phone? If you want chatting, I can use hangout.
[Nexus 4 Android Development] sudokamikaze:
It is a messenger
[Nexus 4 Android Development] dcshallot:
I'm downloading. Send me a contact~
[Nexus 4 Android Development] sudokamikaze:
Send via PM, check yours PM's
[Nexus 4 Android Development] Mrcactuseater:
You should make a telegram group chat so everyone can jump in and help :)
[Nexus 4 Android Development] sudokamikaze:
New build, check this out! Link in OP post

Enabled CM/LOS variant

msm_hsic_host: reduce wakelock

LMK Fixes
[Nexus 4 Android Development] dcshallot:
Reboot~ I was charging and playing coc(just finished launch coc).
[Nexus 4 Android Development] Emandroid:
During these last days I saw that the camera is very slow while saving photos...It's terrible because while it is saving a photo, camera il laggy

Is there a solution?
[Nexus 4 Android Development] dcshallot:
A reboot log:D
[Nexus 4 Android Development] *Jonny*:
Thanks for your work, you fixed music lags on los? :confused: :cowboy:
[Nexus 4 Android Development] sudokamikaze:
Lags I noticed only on dyn hotplug and mako-hotplug
[Nexus 4 Android Development] M4rf0:
Any changes in new build with video problemems in LOS?
[Nexus 4 Android Development] sudokamikaze:
I can't even find how to fix

BTW New project is coming. Quanta kernel fork
[Nexus 4 Android Development] hauckk@sfreserves.org:
That's really cool ? thanks for the awesome work :victory:
[Nexus 4 Android Development] sudokamikaze:
Guys, i created a fork of Quanta kernel, if someone don't like this kernel, or having issues try this kernel