yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi 2] RadarNyan:
New Kernels (for KitKat) doesn't work with TDB enabled?

I've not been updating my phone for quite a while, today I got some time and decided update my phone to latest CM11 build, everything went smoothly, then I noticed after all these months, the official kernel still has the problem that user defined min/max cpu freq changes on it's own, so your kernel is my last option.

BTW, I'm happy to see that you're still maintaining this kernel, thanks :D

I tried to flash UPDATE-AnyKernel2-khaon-kernel-aries-kitkat-13-02-2015.zip

Flashing process didn't say any error, but I got stuck at bootloader (white Mi logo) for 10+ minutes and still no go.

Since the file name didn't include "tdb" like it did before, I grabbed khaon_kernel_aries_tdb-13-01-2015.zip from "Former builds" folder and tried to flash it (twice, once over the first kernal, second time after I re-flash the rom) but still can't get my phone booted.

So I had no choice but to go back to the last build that I know worked on my phone, which is khaon_kernel_aries_tdb-09-11-2014.zip (Yeah... pretty old build hum?) so I flashed it over 13-01-2015 build and finally got my phone booted, and that old kernel still works on the latest nightly build (hooray!) I'm fine with the old kernel but still, would be nice if you can check what went wrong when you're free :)

Mi2S standard version (16GB), CWM recovery 6.0.5.0, TDB enabled,

Latest CM11 on system 2 (ext4) and activated, system 1 is empty (formated both /system and /data)
[Xiaomi Mi 2] Khaon:
Hello it's written in the OP I think this is not compatible with sys2.

Sent from my Xiaomi MI2s.
[Xiaomi Mi 2] m11kkaa:
Did u use cp -R --preserve=all ? otherwise all permissions and context information are lost.
[Xiaomi Mi 2] Khaon:
That's even a thing I didn't think of but he is right. Those context restrictions are a pin in the the ass p

Sent from my Xiaomi MI2s.
[Xiaomi Mi 2] Alecsandru90:
the permissions are the same , at least for wi-fi drivers, but fails , don't know why yet but it does-it , calls, cameras, bluetooth , all are working fine , only wlan doesn't want to work fine (GET STUCKED AT OBTAING IP ADRESS), i can upload a clean twrp backup of system , would you take a look at that?

you don't have system/lib/modules in lolipop btw and isnmod doesn't seem to work (insmod init_module failed (exec format error)

edit: dhdcp fails( init: Warning! Service dhcpcd_wlan0 needs a SELinux domain defined; please fix!)

dirty fix : enable static ip
[Xiaomi Mi 2] RadarNyan:
Did I miss something? All I can find related to system 2 is:

Well... my /data is NOT using f2fs, so this affects me too?
[Xiaomi Mi 2] Khaon:
Sys2 is not supported.

------------------------

I have uploaded a new build that should fix the sound lock gain to reset.

Next thing is the auto disabling of hotplugs.
[Xiaomi Mi 2] Khaon:
new build online :

f2fs update to ustream

enabling a hotplug driver disables the others.( enable intelli plug disables mako for example).
[Xiaomi Mi 2] Camogyp:
Khaon, can you add to your kernel support for call recording?

For example, here is a program for recording telephone calls: Skvalex CallRecorder

I have always used this program, but after upgrading to Lollipop can not use - the voice is not written, need support in the kernel.

I tried using Exposed module - EnableCMCallRecorder, but even he does not write or anything, just a noise. :crying:
[Xiaomi Mi 2] no_means_no:
today I had an incoming call without any hearing on both sides. tested on another caller with same result. After reboot eveything is fine again. I'm on latest PAC ROM KK with latest kernel update from [MENTION=4577448]Khaon[/MENTION] :eek:
[Xiaomi Mi 2] T3sla:
[MENTION=4577448]Khaon[/MENTION] just installed the latest kernel, is there a problem with cpu speed steps?After installing, rom and System Monitor reported minimum speed 486.So i check minimum speed is 384 set in rom but there is not such speed if you open the menu, only 378.So i set minimum cpu speed to 300, only core 0 seems to work at that speed while others stay above 486.Has something to do with new speed steps table?I'm using pac man rom (KK)

Edit 1: Maybe the speed of other cores reported wrong by the program i was using, audiator.But in rom minimum speed was set to 384 despite that doesn't exist.

Edit 2: Huge issue with sound, when i plug in headset sound goes to 0 no matter what i do.It's like someone is pressing the volume down constantly cause you can see the volume bar all the time, doesn't close as when behaves normal.This happens only with headset.
[Xiaomi Mi 2] TbMa:
same on latest kernel
[Xiaomi Mi 2] T3sla:
Weird that only we reported this issue.Doesn't anyone else have this bug?Very strange...i tried also with latest CM nightly and i had the same issue (beside the classic mic problem) so i think it's not rom related.
[Xiaomi Mi 2] no_means_no:
Sorry if this question does not belong here:

as this kernel update seems not to work on mokee ROMs, but I love them both, I'm just curious why this is not working? sorry for my technical noobness !
[Xiaomi Mi 2] T3sla:
[MENTION=4577448]Khaon[/MENTION] another issue with 13-1 kernel, seems i can't pass 1.89 ghz no matter what frequency above this i choose.Did you install some kind of speed limit according to speed bin?I can't use the newest kernel because of the sound issue i describe above.
[Xiaomi Mi 2] Khaon:
Sorry, was not very active on this device as cm12 is still under progress.

[MENTION=4551503]no_means_no[/MENTION] Mokee ROMS DOES not use CM as core but CAF, making the ramdisk and other things not compatible, IT COULD BE, but for now, only cm based rom are supported.

[MENTION=4438984]T3sla[/MENTION] Indeed you are right! I only use UC/UV, I dont oc. Quite funny to see, I wonder what is limiting the upper freq to 1.809-(its 1.809 not even 1.89actually!)/ I will check about that tomorrow.

Ab out the sounds, Like i said, your sysfs entries sound headset must be to the minimum( however IT SHOULD BE TO THAT VALUE), if you set it back to zero you will hear sound in the headset... until nex reboot.
[Xiaomi Mi 2] T3sla:
I'm not using OC either, i was just curious about antutu score.Btw UC has little impact on battery life and in my opinion isn't worth it, you can check this test if you're interested.It is useful on some situations and usage patterns though.

I didn't quite understand if it's my fault or my headphone's fault that i have weird behavior but no big deal, i'm happy with the 13-1 kernel and i'm waiting for stable lollipop too so that's ok.
[Xiaomi Mi 2] Alecsandru90:
here you go at 1.89 ghz
[Xiaomi Mi 2] Khaon:
Just to notice people, m1cha said he will be working most likely this weekend on cm12, will start to work again on the kernel and rom as soon as that is done.
[Xiaomi Mi 2] T3sla:
It's a little beast after all...maybe at 2+ ghz it can break the 35K barrier.

Great news!
[Xiaomi Mi 2] Alecsandru90:
I'm using f2fs for /system /cache /data and ext4 for sdcard
[Xiaomi Mi 2] acastrocab:
will this kernel work with ivan asop based on lollipop?or cm12?
[Xiaomi Mi 2] Beyaz66:
[MENTION=4577448]Khaon[/MENTION] Do you plan to update the KK version of your Kernel (as there is still some things to tune or fix)? Do some git pull requests may get tour attention if we give a band?
[Xiaomi Mi 2] T3sla:
I was about to ask the same thing yesterday.I'm having lately some reboots issues that might be related to gps, cause it happens most when i use some kind of sportstracker app like runkeeper.I'm using pac rom stable cause it doesn't have the mic bug issue, as far as i know other cm based roms need "hacks and tricks" to work properly.Anyone else having random reboots?
[Xiaomi Mi 2] Khaon:
Sup, holiday time I am gonna upload a kernel release. Regarding my current set up I had few with too low voltage for 1134 ~ 1.89. KEEP in mind those freq step use an higher cache speed than the stock one. The gape between 1026 and 1134 may be more than just 25mVL.
[Xiaomi Mi 2] Khaon:
Ofc I merge pull request.... when I noticed those :D.

From the very beginning it seems lollipop's image works flawless with kitkat. However requires some ramdisk modificay. Will upload one and you can tell us?

ABOUT mic problems, it is related mostly to Google service's try to stick with up to date gapps.
[Xiaomi Mi 2] T3sla:
Maybe voltage it's the problem, i thought that 25 mv was more than enough.For your new release pls take a look if you have time at the issue that cpu won't go higher than 1.8 ghz despite setting higher max frequency.Also is cpu frequency table correct?Cause if you set min freq 378 it doesn't go under 486.It's like kernel can't find 378 so uses 486 instead.Though if you select freq from trickster it works ok.
[Xiaomi Mi 2] Khaon:
Hello everyone new build online:

changelog:

f2fs updated to upstream revision

sync with cm's msm,android common,micha branches

thrown intellithermal for a simple msm_thermal (thx [MENTION=3292224]franciscofranco[/MENTION])

updated mako_hotplug

wifi driver updated

anykernel is smater to clean entries that result with unwanted freq speeds
[Xiaomi Mi 2] T3sla:
Will test today and report.
[Xiaomi Mi 2] T3sla:
Kitkat version not booting, tried last cyanogen nightly and pacman rom.Stuck's at bootanimation.I'm using twrp if that has something to do.
[Xiaomi Mi 2] Khaon:
can you provide the following things?

/fstab.aries.*

/init.aric.rc

logcat

ty
[Xiaomi Mi 2] bialabs:
Same problem here, with CyanogenMod 11 of 8 March.

I'll try to send logs
[Xiaomi Mi 2] T3sla:
Sorry man i don't have a second phone so i had to restore backup.Maybe i'll try tomorrow, how do i provide those files?Booting in recovery and using adb?
[Xiaomi Mi 2] Khaon:
First, Make sure to enable developers option and adb

from a shell prompt while bootlooping

adb shell cat /fstab.aries.patched > fstab.txt

adb shell cat /system/bin/mount_ext4.sh > mount_ext4.sh

adb shell mount > mount.txt

adb shell cat /system/bin/mountext

adb logcat -v time -d > logcat.log

:good:
[Xiaomi Mi 2] T3sla:
Doesn't work, i'm getting device offline error.Also i checked with twrp's file manager there is only fstab.aries not fstab.aries.patched.
[Xiaomi Mi 2] hieron123:
confirm bootloop.

By the way, does your kernel include some fix for the annoying msm_hsic_host wakelock?
[Xiaomi Mi 2] Khaon:
the fstab is part of the ramdisk therefore is loaded upon booting. The rom has its own so does the recovery

Eww it was a stupid mistake of mine, was related to random number generator. It is fixed, I just booted on latest cyanogen 11 nightly.
[Xiaomi Mi 2] T3sla:
Booting successfully now.But i can't solve that damn sound problem with headphones, when plugged in phone gets to silent.You said some time ago that sysfs entries must be edited but which ones?Can you shed some light here?Thanx!
[Xiaomi Mi 2] hieron123:
Hey I tried to flash it on top of my current CM11 install and it failed to boot past the MI logo. Maybe I didnt install correctly but to my knowledge you

1st flash ROM(which includes stock kernel)

2nd flash custom kernel (to replace stock)

right?
[Xiaomi Mi 2] Khaon:
Well I wanted to try another sound engine, franco's or alucard's. This issue will be most likely solved like this.

Yeah! Latest build I have pushed on my google drive booted on april cm nightly.

But make sure to flash my kernel package over a clean rom install because it will dump the current ramdisk to repack my kernel image with it.
[Xiaomi Mi 2] hieron123:
OK it worked!
[Xiaomi Mi 2] T3sla:
Looking forward to new sound engine then!
[Xiaomi Mi 2] Khaon:
I have uploaded a flushable zip for kk and lollipop.

Just tried it on lollipop. Seems to work. Sadly Franco sound only support headphone volume control.

Shouldn't be too hard to squash faux modification for the speaker if some people want it.
[Xiaomi Mi 2] T3sla:
If you have time you're more than welcomed to do that, and i'm more than willing to test it.Will give a try today to the current one.And again thanx a lot man!!!
[Xiaomi Mi 2] T3sla:
Kitkat version stuck on bootanimation like previous version, maybe same issue?
[Xiaomi Mi 2] Khaon:
Oh yeah and I was lik e 100% sure I had authored the fix for kitkat. EW.

Anyway, you will have to reflash anyways :D. I have added the sound registers for speakers volume. The hardwork was done by franco so was not a big deal to enable extra sound registers.

However, while franco allows up to -20/+20 on earphones I have allowed -10/10 boost on speakers. If this value needs to be increased report.

Just tested it works... Uploading the build.

Report if you face the lock reseting itself making the boost value goes back to 0.
[Xiaomi Mi 2] Khaon:
Oh I realized I didn't give the sysfs entries.

They are located there

/sys/devices/virtual/misc/soundcontrol/

I will make a pull request to add those into kernel audiutor and aero kernel.

Aero kernel allows you to add custom sysfs entries
[Xiaomi Mi 2] T3sla:
For me -10/10 seems enough.I'm not sure what you mean with lock reseting.I set higher values with trickster and after reboot values were set to 0 again until trickster delay passes and change them again to the values i set them.I don't know if you mean setting them manually.

Thanx for clarifying that!!!

I was playing with an app called sysfs explorer looking for soundcontrol entries, very small and simple unfortunately doesn't allow editing...wtf.I saw that fast charge has an entry available_charge_levels with more than i thought options which i assume are mamps.Are all those levels used?Can we change for example fast charge from the current value(is it 900?) to 700?

Edit: One small bug that i found is that battery life extender has a default entry of 101.Didn't test yet if it's working all right.
[Xiaomi Mi 2] T3sla:
[MENTION=4577448]Khaon[/MENTION] Had two reboots till now.I already gave 37.5 mv more for 1134+ compared to lesser freqs, gonna try with 50.How much are you using?
[Xiaomi Mi 2] Khaon:
Sup, I am using 800 with +15mv each step and from 1134 I start with 1000 + 25( i usee 1150 on 1728)

fast_charge is only relevant when you plug your device into an usb. usb 3.0 is 900 ma but if its connected to the pc its only 450. therefore its usefull when you dont put your phone charge on a wall plug.

when ble is =101 it means it is deactivated
[Xiaomi Mi 2] T3sla:
Well...i was way too lower.I was on 378 at 725, 1026 at 875 mv and 1728 at 1050 mv with your 27-10-2014 kernel.And that was one hell of a rock stable kernel!Not a single one reboot for 2 months.Yes i know that was without increased L2 cache speed.With your 13-01-2015 was +25mv at 1134+ freqs, couple of reboots.But with latest kernel seems +50 from the 27-10 kernel is necessary.Still somewhat lower from your settings 1728 at 1100 mv.Will report again how that goes in a few days.
[Xiaomi Mi 2] Beyaz66:
[MENTION=4577448]Khaon[/MENTION], your latest (24/04) build works like a charm! New sound control seems better.

I'm trying to check if build.prop changes I'd like to use are valid and learn some things by the way. I need Your opinion.

According to this in pm.h:

enum msm_pm_sleep_mode {
MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT = 0,
MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT = 1,
MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE = 2,
MSM_PM_SLEEP_MODE_POWER_COLLAPSE = 3,
MSM_PM_SLEEP_MODE_APPS_SLEEP = 4,
MSM_PM_SLEEP_MODE_RETENTION = MSM_PM_SLEEP_MODE_APPS_SLEEP,
MSM_PM_SLEEP_MODE_POWER_COLLAPSE_SUSPEND = 5,
MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN = 6,
MSM_PM_SLEEP_MODE_NR = 7,
MSM_PM_SLEEP_MODE_NOT_SELECTED,
};

#define MSM_PM_MODE(cpu, mode_nr) ((cpu) * MSM_PM_SLEEP_MODE_NR + (mode_nr))

Sleep mode would be set as 7. Am I right? What is the NR sleep mode?

Things are inverted in Kconfig

config MSM7X00A_SLEEP_MODE
int
default 0 if MSM7X00A_SLEEP_MODE_POWER_COLLAPSE_SUSPEND
default 1 if MSM7X00A_SLEEP_MODE_POWER_COLLAPSE
default 2 if MSM7X00A_SLEEP_MODE_APPS_SLEEP
default 3 if MSM7X00A_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT
default 4 if MSM7X00A_SLEEP_WAIT_FOR_INTERRUPT

I can't figure out the default sleep mode (What is it?) and I'm even not sure to look into the right place (Where to look?). If explanations are too long just show me the part of code and tell me the default mode, then I'll try to understand by myself.

Googling gave me only mysterious copy/pasts of build.prop tweaks lists.
[Xiaomi Mi 2] Beyaz66:
[MENTION=4438984]T3sla[/MENTION], are you sure that your custom table is not shifted since 300mhz freq step was added? I faced this with trickstermod.

And I had to make an increase at 1026mhz too after L2 cache changes. Focus on hardly used freq steps from 1026, make them run more often to find the culprit. Maybe you'll be better to increase more and decrease again one freq at a time...

Here's my (extrem uv'ing) example config. I can't go lower than: 216=650mv + 25mv each step up to 918=825mv; +75mv 1026=900mv; +37.5mv 1134=937.5mv .... 1728=1187.5
[Xiaomi Mi 2] T3sla:
If by shifted you mean because of the extra speed steps that have been added voltage table moved some steps to the lower states, i always make a clean install and set up voltages again from scratch, so i think that's not the case.But since you mention it, which app are you using?Kernel audiator seems nice.

I have done stress tests on each frequency on the pre-L2cache speed increased kernel and was rock stable.With the first L2cache speed increased kernel i just followed Khaon's suggestion for +25 mv and was fine for a while then some reboots happened.But with latest kernel even 37.5 mv are not enough for the setup i was using.Now i'm at +50 mv, third day, stable.Still a bit lower on high speeds from your settings as i see but that 650 mv is alien!! I never thought that would be stable under 700 even on such low speeds.What is your speed bin?
[Xiaomi Mi 2] Beyaz66:
[MENTION=4438984]T3sla[/MENTION],

I use Aeros Control for its misc settings and hotplug (tricsktermod doesn't want to open the hplug control), trickstermod mod for the rest while keeping an eye on Kernel Adiutor which looks promising. And I wait the day I could say these are my final settings to fire up all these apps and let an initd script do its job. :) I have Bin0 PVS1.

Stress tests weren't enough to valid some voltages for me. They always were followed by one or two days of normal usage for each steps to determine good values. Anyway, it seems that you're on track.

Two things about the last version:

Are there some links in sound control to recheck?

Changing the in call volume have an impact on others (if I decrease it, others increase and vice versa). ACTUALLY, changing any value have an incidence on the others. I mean the sound I hear (not the values) in earphone/speaker decrease/increase if I increase/decrease mic_gain/etc...

If, in tricskter mod, I set HEADPHONE to X; IN CALL VOLUME BOOST to Y;

It, respectively, changes volume_boost to X and headset_boost to Y.

Same when done manually. It looks like there's a disagreement between headset/volume/speaker_boost.
[Xiaomi Mi 2] T3sla:
[MENTION=2378262]Beyaz66[/MENTION] I'm waiting also for that day but i hope it is in lollipop, which lately doesn't seem so near in future.Agree that stress tests do not show always the weaknesses, i encountered that a lot of times.

I didn't make any changes in sound control, i use a modified mixer_paths.xml for this job, since you are fan of init.d scripts you understand why.But experimenting now with trickster doesn't show any signs of the behavior you describe.I can't test it in a real call right now but trickster doesn't show any change in any other value, i made a restart to be sure.I can send you my modified mixer_paths.xml if you want, it normally boosts all sound controls speaker mic etc.
[Xiaomi Mi 2] hieron123:
bug: battery saver

I'm experiencing one problem:

If use battery saver and set it to 90% it charges to 90% once and after that the phone refuses to charge completelly. So for eg. when batt is drained til 30% and I put it on charger it doesnt charge.

That aside I'm loving all the extra options in this Kernel so two thumbs up for your work!
[Xiaomi Mi 2] Khaon:
Good question! As defined in the defconfig, the kernel runs MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT = 0

There are many doc over the internet explaining what is the purpose of runtime pm. However, the different mode are not really explained. (or I couldnt find something explaining qcom's mode, found that post guy that explain a bit the difference between those mode and this). Best is to look at the raw code.

arch/arm/mach-msm/pm-8x60.c

arch/arm/mach-msm/pm2.c

arch/arm/mach-msm/xiaomi/aries/board-aries.c

arch/arm/mach-msm/pm-data.c

arch/arm/mach-msm/cpuidle.c

Among others, each sleep mode has its own rpm values

Don't forget that this code is used also by laptops,etc. Dunno if the needs are the same than an android evice.

Oh yeah you are indeed right. Will add one boolean once it has reached the thresold and let allow charging after a decrease of lets say 35%? bounded ofc to a lower limit of 15%
[Xiaomi Mi 2] bialabs:
With latest version of kernel (KK) my phone sometime freezes. It happen when I open heavy websites on Firefox or heavy games as Asphalt
[Xiaomi Mi 2] xflier:
Same issue here
[Xiaomi Mi 2] Khaon:
Your current gpu and cpu settings are?

Sadly I have broken my device :/
[Xiaomi Mi 2] bialabs:
This settings from CM's performance menu:

CPU governor: ondemand

I/O: bfq
[Xiaomi Mi 2] xflier:
Mine are interactive and bfg
[Xiaomi Mi 2] bialabs:
:( can I downgrade?

Which version is stable?
[Xiaomi Mi 2] Khaon:
Him no idea of latest stable also I was using lollipop. But trying to'switch to sio or fiops may behave better. Otherwise I guess 20 or 30 days ago builds should be fine
[Xiaomi Mi 2] bialabs:
Please can you link me a 20/30 day ago build?

I'll try fiops
[Xiaomi Mi 2] Khaon:
https://drive.google.com/drive/u/0/...mMWwwMTJlS09vRVk/0B9kxrJw-dzUmVUtqQk0wX0RfUHM

Try first fiops on the latest kernel release to be sure before flashing an older one.
[Xiaomi Mi 2] bialabs:
With fiops no problem for now
[Xiaomi Mi 2] Khaon:
When you open a tab on chrome it writes in the partition data some information's like to reopen active tabs upon restart etc.

Seems bfq behaves badly. I suggest anyone to switch to fiops. I will release a new kernel when I got access to my computer. Will features f2fs up to date and few patches to catch up. I can integrate double tap to wake if anyone want it
[Xiaomi Mi 2] T3sla:
Do you think bfq could cause reboots?I was using the latest kernel for some time and had a lot of reboots.At first i thought undevolting was the culprit but even after default voltage settings kept having some from time to time.So now i'm with 27-10-2014 kernel which is the most stable i used so far, one reboot in 25 days.
[Xiaomi Mi 2] bialabs:
dt2w could be useful

Great work!
[Xiaomi Mi 2] Khaon:
No idea honestly what is the reason. But I think this only occur with KitKat . you are on KitKat ?

I could do a rollback to a former version to remove many fixes/patched introduced for lollipop and add f2fs latest sources and few other greartt this g
[Xiaomi Mi 2] T3sla:
Yeah, i'm on kitkat.Imho i don't see any big improvement with increased L2 cache speed, maybe cause cpu most of the time is working under 1134 mhz.Also the phone is pretty fast as it is so small differences aren't noticable at least to me.

You don't have to go into that trouble man since as i'm one of the few that have reboot problems and one of the few that are on kitkat.Also i'm perfectly happy with the 27/10 kernel.You could add some i/o schedulers and other improvements eg sound, to that kernel when you have time.