yashsingh1/xdaforums huggingface dataset:
[Sony Xperia M] thichthat:
It's time to eat marshmallow!

Note #1:

SELinux is now set to Permissive by default to fix problem with radio in marshmallow. I didn't mention that in change log because Google will not happy to know that.

Note #2:

In this release, I focus on optimizing processes which are used many times in one second. These code can be found in sensor drivers because the have to read data and report to system hundreds of times in a second.

By removing some verbose calculation and hard-coding their result, we can save more cpu cycles.

Note #3 (IMPORTANT):

If you have problem with mobile data, try removing battery and inserting it again.
[Sony Xperia M] Bonoboo:
It's risky: I afraid, that next time Google can ban whole developer account.
[Sony Xperia M] thichthat:
Don't be worry. This is hard to detect because the change is made inside the kernel (and it also be compressed). Many apps was banned/warned because change selinux from user space, using "setenforce" command. That's easier for google to detect.

Don't speak aloud, just whisper ;)
[Sony Xperia M] Nicklas Van Dam:
Marshmallow Compatibility added :D , great and let's try :D

but [MENTION=4929675]thichthat[/MENTION] how to install it on marshmallow? TWRP still not work properly on AOSP 6.0?
[Sony Xperia M] thichthat:
Did you try using FOTA recovery?
[Sony Xperia M] Nicklas Van Dam:
Yes, and FOTA recovery can detect my encrypted sdcard?
[Sony Xperia M] Antrikos48:
Don't. Replacing

i = (sizeof(short)*8-(BMA250_ACC_LSB_LEN+BMA250_ACC_MSB_LEN));

with 6 accomplishes nothing. Any optimising compiler will evaluate it at compile time and hardcode the result where it is used. But now that you have hard coded it, you will have to change that piece of code every time one of these defines changes.
[Sony Xperia M] thichthat:
Thanks for the useful information. I just replace it to make sure that compiler will not do anything else. There will be no reason to change this value because this IC is embedded on the board. Also, if there're any new commits for this driver, I'll merge it manually.
[Sony Xperia M] Antrikos48:
Yeah I know that the codebase is unlikely to change, but it is good advice to avoid premature optimisation if you get involved with anything more serious in the future :)
[Sony Xperia M] dim^n:
Fm tuner not working. Spirit 2 warned that fm driver in kernel is not the right one. In v5.3 r1 there was all right.
[Sony Xperia M] thichthat:
Maybe that's because of some commits about FM radio taken from Ron's repo. They will be revert in next build.
[Sony Xperia M] AdrianDR94:
Same here, please fix. Thanks for your hard work.
[Sony Xperia M] mankokoma:
Dumb Q: Why Google play Store at all? can't you post apk just here?
[Sony Xperia M] dim^n:
Another problem - after boot speaker gain increases call speaker vol only for one call, after it call speaker becomes quiet, as if speaker gain set to 0.
[Sony Xperia M] ndrancs:
And Yes if you can. Please separate vol call and media.
[Sony Xperia M] thichthat:
Did you mean the gain wasn't applied to earpiece? Did your speaker volume is turned down or you hear no sound? Can you check if settings are not overwritten after calling?

Ok I'll try to add it. Sound card driver is becoming a mess for me..
[Sony Xperia M] thichthat:
When I release first version of apk, I had problem with uploading it to xda. Uploading to host wasn't a good idea too. Therefore, I used my brother's account to publish it to gg play. Also, google gives me a comfortable enviroment where I can manage installing count, user review and FC report. You can also update the app easily, by enabling auto update for it.
[Sony Xperia M] dim^n:
It applied but only for first call per each boot. Volume of voice call resets to 0, changing gain in app affected only media speaker, call speaker becomes louder only after reboot.
[Sony Xperia M] thichthat:
I still can't find the problem. Speaker gain works well for me in every call.

I'll not make an option to change earpiece volume because the stock value is already quite high. I add speaker and headphone gain

only for testing

, because stock speaker volume is very high and gaining it too much can damage your speaker.
[Sony Xperia M] dim^n:
[MENTION=4929675]thichthat[/MENTION], problem appears on last version. This option is usefull for me, cause call speaker too quiet on some snd_soc_msm_sitar file, that have other good settings. Sitar file with loud call speaker setting becomes quiet with this kernel btw. So I have to use gain anyway. Also I increased headset vol to hear better people with Im talking and media speaker to dicrease used vol steps, cause 30 steps is too many for speaker but ok for headset. But increasing speaker gain to 15 good for calling but too much for music. And, Im sure, that option usefull for people, that knows, what they're doing. If they dont, they can damage phone without gaining anyway... So please provide gain separately for two speakers, cause I cant update, if I want to hear anything during call.
[Sony Xperia M] thichthat:
OK. Don't worry. I'll try to add an option to adjust earpiece volume, and also allow you to turn off this feature if it causes problems.
[Sony Xperia M] Mysteryagr:
Nui kernel settings casuing lag in UI, games, and heavy apps

what are the recommended I/O and governors to avoid this?
[Sony Xperia M] ndrancs:
Try intellidemand gov and fiops or bfq I/O, btw I am not feel any lag that you tell, even I'm play game like: walking war robots and asphalt 8
[Sony Xperia M] SunitTalwar:
are you sure asphalt 8 works without lag (your graphic setting ??)

most other apps work without lag i do agree but asphalt 8 lags a lot with this kernel maybe due to change in sensor drivers :confused::confused:

but over all the best kernel with so much features

[MENTION=4929675]thichthat[/MENTION] one more bug in gpu settings the interactive governor option does not stick it reverts back to the previous one i.e ondemand or performance

also buddy can add some more colours to your app too maybe materialize it :p
[Sony Xperia M] Mysteryagr:
I have lags in seige fall game, facebook and messenger apps, and sometime whatsapp take a lot of time to start.
[Sony Xperia M] thichthat:
I don't use my phone for gaming so I can't make sure that all mod/tweaks are effective. If you experience lags, please send me a dmesg (or kmsg/logcat).

Gpu driver was updated and interactive gov was removed. I just forgot to remove it in the app. (For me, I can't feel much diffrent between interactive and ondemand).

Materializing is really difficult for me and it must take me much time more time.
[Sony Xperia M] Agu_Ra:
Using edge gesture gives us opportunity to use phone without navbar. Simply add to build.prop:

qemu.hw.mainkeys=1
[Sony Xperia M] Agu_Ra:
BTW, NUI, can you make current virtual menu button configurable and add the same slot on the left side? And also it would be nice to swipe not from the bottom of screen, but from bottom parts of left and right edges (just like in music controls, but on the bottom). If it is not very hard, of course.

BTW, if I'm not mistaken, you can add built-in option to hide navbar without editing build.prop.

Just create a trigger in /system/kernel/ and add to init.sh:

if [ $(cat /system/kernel/hidenavbar) = 1 ]
then setprop qemu.hw.mainkeys 1
fi

But I'm not sure it'll work.
[Sony Xperia M] thichthat:
Yes. That's a good idea too. I'll add it in 5.5_r1 (because 5.5 is ready to be released tomorrow evening).

It works for me, too. But someone using other devices reported that systemui FCs after adding that line to build.prop.
[Sony Xperia M] thichthat:
V5.5 is ready!
[Sony Xperia M] sidsharma2201:
Apps getting killed frequently

Even though M has 1GB ram. It struggle to keep a Skype call with opening and zooming in a pdf document. Any solution from kernel side or I'll have to greenify apps?

RAM management really sucks. I don't know if it's kernel issue or CM.

Any help advice are welcome

Thanks
[Sony Xperia M] manieks999:
I don't think if there is really solution for your problem. First of all is not full 1GB ram (861MB for me ), secondly it's low - end phone with bad cpu and gpu, thirdly Skype is really demanding app. I know what you feel because i play real racing 3, and when anything happens beside game it ends in 70% at hard reboot. Phone call, screen lock, sms. 1GB ram is very low, I don't even know how i lived with 300 Ram on htc wildfire. My next phone MUST have 2GB of ram or more. It's just our precious android...

But if you really must try using ram manager, or some scripts to manage ram. And ofc greenify most of the apps. This app is doing magic for me.
[Sony Xperia M] Ydraulikos:
This is a very nice article which explains a lot about the android memory management.

The best way to reduce RAM usage without sacrificing performance is by tweaking the dalvik.vm values in build.prop. For our device (hdpi, 1gb) this paper suggests to reduce the dalvik heapsize to 174mb. This is the value where the runtime can run even resource intensive apps without invoking the GC too often and therefore saving a significant amount of memory per app. You can enable ZRAM and adjust the LMK values too. Also I've never seen a kernel with KSM support for our device so this might be a nice feature to add for NUI ;)
[Sony Xperia M] thichthat:
ZRAM is not a good feature to add because it can destroy your nand flash. Anw, I'll read more about it. But I recommend using swap file in sdcard.

KSM is disabled in our phone now. I didn't notice about it. I used KSM on my old xperia go and I couldn't feel much different after enabling it. Anw, I'll enable it in next release for testing.
[Sony Xperia M] thichthat:
Did you try using low ram mode in tweaks > android side? After enabling it, if UI becomes ugly, enable force high end gfx in settings > development
[Sony Xperia M] sidsharma2201:
Yeah about that.. Can you explain a bit about low RAM mode and low memory killer tweak.?

You never explained them before
[Sony Xperia M] dim^n:
I found good solution for memory cleaning - in developer options I set process limitation to 3 and now memory much cleaner and interface smoother on smartfone and tab. It resets after boot, I set it automagically with tasker and secure settings. Maybe it can be set via init.d or build.prop, I dont know.

[MENTION=4929675]thichthat[/MENTION], really, what is "low memory killer tweak"? What it changes?

where is that option on cm11?
[Sony Xperia M] thichthat:
I brought OOM adj from supercharger, so the low memory killer will work more correctly. For me, I haven't see any lags when opening many app in background.

I don't remember exactly. It should be in settings > performance
[Sony Xperia M] dim^n:
Thanks, NUI, everything fine, except swipe to control music. How does it works? I cant use dat. Ive enabled service.
[Sony Xperia M] thichthat:
Play a song, turn off screen and try swiping from right upper corner to left. It should work on many AOSP based player like google play music, amp, apollo,...
[Sony Xperia M] dim^n:
[MENTION=4929675]thichthat[/MENTION], its not working. Any gestures dont affect on playback.
[Sony Xperia M] Agu_Ra:
Do you use the latest version of the kernel? As there was one build with broken music control. And also try it with other players, maybe the problem is in your player.
[Sony Xperia M] sidsharma2201:
OT

Any other ROM as stable as CM used in conjecture with Nui kernel?
[Sony Xperia M] AdrianDR94:
I think all cm based roms. I used NUI with RR.
[Sony Xperia M] ndrancs:
I use mokee rom, release version. It's stable as is cm based with some Tweaks from mokee team.
[Sony Xperia M] thichthat:
I'm using crdroid final build. It's very stable and all features work fine. I'm thinking about changing to mokee but I'm just too lazy..
[Sony Xperia M] dim^n:
yes, the latest version of kernel. Its not the player, in tweak settings I enabled vibration, but it never vibrates when I try to swipe.
[Sony Xperia M] Agu_Ra:
Let me explain you a bit how it works. The service "NUI Music Control" works on userspace level using Android API, it detects if the music is playing and only then enables needed features on kernel level using sysfs. So if you don't enable the service or if you enable it but the music is not playing or your player doesn't report to system that it is playing audio "swipe to control music" will be disabled in sysfs and you won't get any reaction to swipe gestures. So the problem can be in NUI Music Control service (it is just disabled or doesn't work on KitKat, AFAIK, you are still using AICP KitKat) or in your player. You can check it by enabling music control manually, run in terminal or adb shell:

su
echo 1 > /sys/android_touch/swipe2media

And then check do you get at least vibration.
[Sony Xperia M] Alex_Gamer:
I'm having no sim card issue sometimes and I have to reboot to make it work :/ I'm on resurrection remix lp
[Sony Xperia M] dim^n:
[MENTION=5917809]cucumber09[/MENTION], ahh, I thought it works always, not only when music plays. It works now on kitkat.

But only on upper half of screen, why? Its inconvenient to use.
[Sony Xperia M] Agu_Ra:
'Cause thichthat decided so, you can ask him to add option to switch tracks by swiping from the middle of screen edge, I don't think it is hard to add. BTW, earlier I also thought it is not comfortable way to use it, but eventually I've got used to it. It is even more comfortable in the case your phone is in your pocket.
[Sony Xperia M] thichthat:
Update disable internal storage for 6.0

Disable internal storage mod for 6.0 marshmallow

FAQs:

We have adopting storage on marshmallow. Why do we need that?

Adopting storage has some disadvantages: Firstly, you'll have to format your sdcard. Secondly, you'll have to format your sdcard again every time you change ROM (or wiping data partition). That means you must spend more time to backup all data.

Guide:

Make sure you don't have 2nd partition on sdcard

Just flash NUI_MOD_marshmallow.zip attached below this post.

Tested on AOSP alpha 1, CM13 alpha 1, beta 1, 2 and 3.

May NOT works on some class 4 or lower sdcards
[Sony Xperia M] icoolguy1995:
Will it work on stock kernel too?
[Sony Xperia M] thichthat:
You must use nui kernel, because this kernel will replace some files in ramdisk with files extracted from the patch.
[Sony Xperia M] icoolguy1995:
Ok I flashed the patch nothing happened :(

This patch merge internal storage into sdcard right?

If right then I just flashed the patch after Installing the kernel, what did I done wrong?
[Sony Xperia M] Agu_Ra:
No, it just disables /data/media/0 emulated storage as internal storage and makes the SD as the default storage instead. It has nothing to do with Marshmallow SD formatting, just too different things.
[Sony Xperia M] Alex_Gamer:
Can anyone help with the sim connection lost? Please.
[Sony Xperia M] dim^n:
[MENTION=5917809]cucumber09[/MENTION], yeah, thats all right, cause I use it rotated on 180°.

Found serious problem - OOM killer dont work at all. I flashed original AICP kernel, and then problem dissapears. The only way is to limit processes to 2-3 to run in background, that I noticed earlier. But time to time ram overfilled and M freezes. Whats that?!
[Sony Xperia M] Agu_Ra:
kmsg (/proc/kmsg) or last_kmsg (after reboot) or you are liar. But I'm not sure if OOM logs in kmsg, you can try also logcat and try to make system to run out of memory. Paste it in terminal or adb shell, make system freezing by filling RAM, reboot and post logs here.

su
cat /proc/kmsg > /sdcard/kmsg.log &
logcat > /sdcard/logcat.log
[Sony Xperia M] op3n:
hello all. A silly question: I tryed to move all data from internal stor. but after i restart the phone system apps is crashing. What is the path from system or only internal storage? What can i do??? thanks a lot!:highfive:
[Sony Xperia M] thichthat:
It works well for me. I tried opening many apps and the phone close some of them to prevent running out of RAM. Did you tried using LMK tweak in tweaks > android?

Yes, OOM debug messages are included in kmsg.

To solve some problem will RAM, KSM and ZRAM will be added in next version.

To all: if you have any problem/errors, please post your kmsg here.
[Sony Xperia M] thichthat:
Which data did you move? Can you post the kmsg/logcat?
[Sony Xperia M] op3n:
i didnt take an logcat also i dont know how to take. What can i tell you is that i use fx file explorer, and i have principally 2 partition: internal storage and memory card storage; separately i have system and system root. I tryed to move the internal st. The nice thing is that: after i flash via twrp rec. one of 3 patches, memory card is seen like internal, and its ok, but trebuchet,clock,aosp keyb.,etc apk its stop to respond and crash continously. sorry for english. explain to me what can i do? or tell me what explorer you use and step by step what data, like to an old man:p thannks
[Sony Xperia M] op3n:
really? if dont post a log file, you dont answer me? :)) pff
[Sony Xperia M] Bonoboo:
[MENTION=4929675]thichthat[/MENTION]

Please, if you have time, explain advantage of this tweaks:

- Low RAM mode

- Dynamic Fsync

Also again thanks for such awesome kernel!
[Sony Xperia M] thichthat:
Sorry recently I was too busy so I couldn't go to the forum. This mod seems to be not compatible with ROM you're using. You should flash backup.zip and then try using xinternalsd with xposed.
[Sony Xperia M] thichthat:
You can read mode information here:

Low RAM mode (this is a feature come from android): https://source.android.com/devices/tech/config/low-ram.html

Dynamic Fsync (I really don't know much about this feature): http://xdaforums.com/showthread.php?p=33381928#post33381928
[Sony Xperia M] ososmam:
[MENTION=4929675]thichthat[/MENTION]

Is there a way to use this kernel with stock 4.3 ?!

because of some features in stock like walkman (music), camera
[Sony Xperia M] adi2500:
No. This kernel is based on cm sources, that are different from 4.3 stock sources.
[Sony Xperia M] thichthat:
No, it's not possible. If you still want to use sony apps, you can use cooked cm-based rom like Stryflex,...
[Sony Xperia M] thichthat:
New version!

Here is Google's guideline for low RAM devices: https://source.android.com/devices/tech/config/low-ram.html
[Sony Xperia M] thichthat:
V5.6_r1

In old release, the init.sh was made to modify cmdline, which can prevent phone from booting to offline charging mode. That caused problems with some users (I only heard 1 user tell me about it). This algorithm was fixed in V5.6_r1. If V5.6 work well for you, you can safely disable offline charging mode (read change log).
[Sony Xperia M] ndrancs:
Still got the random reboot in 5.6 and 5.6r1 version. Last_kmsg linked to pastebin.com

pastebin.com/DfjQfb2j

I'm on 5.5 version right now.

Edit: new last_kmsg

pastebin.com/n129bZk2
[Sony Xperia M] Komapatient:
Are there alternative download methods for this kernel or just Play Store?
[Sony Xperia M] Agu_Ra:
You can try a workaround. >>Clickme<<

Just tested, it works for me.
[Sony Xperia M] Komapatient:
I know this workaround.

I was just looking for something like a flashable zip withou loading the apk and unpack it. Also I would like to have the option to revert back if there should be something wrong.

But I guess manually download the apk and save it is doing the trick to.
[Sony Xperia M] Agu_Ra:
It is possible to create flashable zip that will repack boot image with needed changes in ramdisk (they are needed to manage kernel settings and for implementing some functionality) and replace kernel image (zImage). Furthermore, it is not that hard, especially if using shell script as update-binary. Other thing is that using kernel without app requires manual configuration. Also some things are integrated with app (e.g. NUI music service, but it can be enabled/disabled manually via sysfs), so thichthat is barely interested in writing "appless" installation zip. BTW, if zip installation will be made, I can write interactive console script for configuring the kernel for those who don't want to use app, but I have no spare time for now.
[Sony Xperia M] thichthat:
I didn't save old apk files because I couldn't find a good hosting web to store all my files. For me, uploading to play store is very fast (about 1MB/s).

The app is made to fix some problem with permission, and it's not only extracting the zip file. It can be so bored if you don't use the app, cause almost all awesome feature can only be tunned by the app.

Anw, I'm still keeping all zip from v4.9. If someone can find a good server, I'll upload it. But downgrading it not recommended. If you have any problem, please tell me and also attach your kmsg
[Sony Xperia M] ndrancs:
Exactly I use this method for my personal update or downgrade the kernel.
[Sony Xperia M] Agu_Ra:
BTW, if you have Linux or Mac environment (I doubt Cygwin on Windows can be used as alternative), you can compile needed version yourself (you can compile even on any commit you want), but the sufficient ramdisk patch needs to be implemented too.

BTW, @thichthat, as recovery maintainer I have one suggestion: loading recovery from recovery.img in /cache, /data or /system (I sorted them by priority) folder if the file is present. I already tried doing such thing with /cache on your kernel and I succeed in one try. It would be useful to have that feature as option (either for developers or for users) and it is very easy to implement.

I want to commit it to all Sony devices on CM and Omni, but now I'm too busy, so will do this in January, I think. I have great plans for winter vacation: from some working on TWRP to installing Arch Linux as third system on my laptop, lol. Also I have an idea to format FOTAKernel as ext partition (I hope it will not brick the device, as for me it shouldn't, but I'm afraid a bit, moreover there isn't any method to restore hard-bricked nicki) and store there recovery image as recovery.img or ramdisk-recovery.cpio file (we can store even multiple recovery images, but it is barely needed as TWRP is now the only player on recovery arena), it would be far more easy than flashing FOTAKernel as image, but it'll need patched init.sh too and some changes in fstab's, so I doubt it would be easy to use it that way without patching every ROM or at least CM (globally via Gerrit, of course) and I doubt someone will accept that changes.

P.S.: I should've write it to TWRP thread, I'll maybe copy or quote it there later.
[Sony Xperia M] thichthat:
I don't think that putting recovery image to /cache, /data or /system is a good idea, because we'll wipe these partition if we want to install new ROM. Using FOTA partition still be the best way, because no action (except using flashtool) can format it.

Anw, I'll still add a code to detect if "recovery.img" is present and load it. But I suggest you should still use FOTA partition. Btw, it's a good idea to look at the LTAlable patition (mmcblk0p16, 16MB, formatted in ext4), which mounted to /lta-lable. I tried to write some files here and it's still be stored after flashing new ROM.
[Sony Xperia M] Antrikos48:
Why not upload them on Github (through the releases tab)?
[Sony Xperia M] Agu_Ra:
But for testing it is just perfect. The stable recovery image can be stored in FOTAKernel, and one for testing - in /cache. BTW, there is no need to wipe cache, there's nothing important there.
[Sony Xperia M] Alex_Gamer:
Definitely I can't use this kernel, I still getting the no sim recognition problem. :(

Enviado desde mi C1904 mediante Tapatalk
[Sony Xperia M] thichthat:
Can you send me radio log? (You can capture it by using this command "logcat -b radio" )
[Sony Xperia M] Alex_Gamer:
Terminal emulator, right?
[Sony Xperia M] thichthat:
Yes. Here's the full commands:

su

logcat -b radio > /sdcard/radio.txt

Wait for 3 secs and press 3 dots menu, choose close windows, yes. A file named radio.txt will be created to your sdcard.

Do the same things but replace commands with those one to capture kmsg:

su

dmesg > /sdcard/dmesg.txt
[Sony Xperia M] Alex_Gamer:
Right now I haved a black screen, here is the last_ksmg https://drive.google.com/file/d/0B1jKGJ7Waik1Szk3LUpKRnRESFk/view?usp=docslist_api