yashsingh1/xdaforums huggingface dataset:
[Moto G 4G Android Development] bedalus:
I use the generic toolchain and add architecture optimisations in the makefile.

Once you have zImage-dtb you can pack it into a bootimg, but you need to flash the modules too, so you might as well do it all at once in a cwm/twrp flashable zip. Just download mine and replace my zImage-dtb with yours, and replace my modules with yours. If you're unsure about the module folders, let me know
[Moto G 4G Android Development] Kayant:
Ha perfect thanks so much for the answers... That all I needed.
[Moto G 4G Android Development] wurstel:
first off, awesome kernel, i am running v2 and i really like it. v4 on the other hand, seems broken: i have terrible slowdowns and sometimes my phone doesnt wake up at all.
[Moto G 4G Android Development] bedalus:
I'm quite surprised to hear that. You're using moto g 4g factory rom?
[Moto G 4G Android Development] wurstel:
yes, i'm on stock kk, on moto g 4g. do you reccomend a dalvik/cache wipe?
[Moto G 4G Android Development] bedalus:
No, I recommend against it, it's a waste of time, the kernel has nothing to do with cache or dalvic.

I'm benchmarking both versions of the kernel now to see if there's any slow down
[Moto G 4G Android Development] CJMom:
v4 works well for me.

what benchmark software were you using for this test?
[Moto G 4G Android Development] bedalus:
I'm pretty sure it works well. I've had zero issues with it.

Benchmark app:

https://play.google.com/store/apps/details?id=com.andromeda.androbench2

It was one of the only ones I could find that would do /data benches
[Moto G 4G Android Development] Bazilli:
I lost my wifi after restoring stock kernel, luckily i get it back by restoring whole nandroid backup. Kernel works fine, i flashed stock only for benchmark purposes. :D ^

e: my bad, i did not read op properly.. I just forgot to backup system/lib/modules.
[Moto G 4G Android Development] knizmi:
I think I may have experienced the same behavior in my CM12 kernel for Falcon. At first the phone was getting slower and slower until it was almost unresponsive and I was not even able to wake it up. Kind of like it was running out of free memory.

It occured to me twice yesterday - at one time I was just pulling dmesg through adb (nothing strange there) and the other was after I woke it up from deep sleep.

Don´t want to sound scary - at the time when I experienced this I was using other patches besides the ones from [MENTION=6295391]bedalus[/MENTION] (updated oom, powersuspend and a couple others) and I thought the problem might be in them. I´ve deleted those patches, so my CM12 repo is almost on par with Moggy v4 and no problem so far. It´s just that the description from wurstel seems exactly like what I saw...

--EDIT-- Never happened again when using bedalus' patches only.
[Moto G 4G Android Development] bedalus:
I haven't had any such problems, and my uptime now is 80 hours. More if you count the time before rebooting to do the test above.
[Moto G 4G Android Development] bedalus:
I've added one of my favorite mods, zcache: [link removed]

This version is for testing purposes only

EDIT: I don't think it's working. I think tmem_put isn't storing the pages. I'm working on a solution

EDIT2: Frontswap definitely isn't doing anything. I've removed it and will just use cleancache. However it still isn't clear if zcache is actually restoring any pages successfully, so I'll continue to investigate

EDIT3: It's only half working, so I'm not going to do a proper release with this mod.
[Moto G 4G Android Development] whisper13:
Take your time man :) [MENTION=6295391]bedalus[/MENTION]
[Moto G 4G Android Development] crakeron:
Is battery life improved by the kernel or is it negligeable?
[Moto G 4G Android Development] whisper13:
From my exp, it reduces lag significantly, no re-draws from nova launcher, batt life increased by 15-30mins on my daily usage, my average SoT is 4-5hrs wifi and mobile, no games

And i believe in the work of [MENTION=6295391]bedalus[/MENTION]

I've been using his kernels since the Nexus S days :)
[Moto G 4G Android Development] bedalus:
I managed to hack together a pretty decent nexus s kernel despite being completely new to it all. I'm approaching things with a bit more care these days!
[Moto G 4G Android Development] knizmi:
What I like is that you don´t merge tons of random patches that most people have absolutely no idea what they do, but rather update parts of the kernel that make sense, like filesystem...
[Moto G 4G Android Development] crakeron:
Yeah, what repulses me from custom kernels is all these features that seem superficial, and that seem to be thrown into the kernel without true comprehension of how to implement them in a clean way or how they work.

That's why bedalus's work attracts me: keeping it simple.

BTW: Is over clocking the CPU possible on our device? Just pure curiosity. I've read that GPU OC is in the kernels in the forum, but nothing about CPU

Also: Is the double tap to wake feature difficult to include into the kernel? Are you by any chance interested in adding it?
[Moto G 4G Android Development] bedalus:
I think OC is possible, but I'm not looking at that yet, and dt2w is possible but I don't want to add it as it is a battery drain and my one experience of an in-kernel solution had too much instability
[Moto G 4G Android Development] knizmi:
If you are talking about CPU overclock, then it is not possible. At least on falcon, but I doubt it would be possible on peregrine as well. The clock generator (the HW part) is locked and is unable to work at higher frequencies than the specs say. So unless you grab a soldering iron and replace it, CPU is capped at 1,19 GHz ;)

You can add overclock to kernel and system will even report that it works at higher frequencies, but it will not. That´s why there are no OC kernels anywhere.
[Moto G 4G Android Development] crakeron:
Thank you for the info ;).

Is under clocking the CPU possible? Or at least limiting the Max frequency? (Like a stamina mode would)
[Moto G 4G Android Development] whisper13:
OT but i just got an MFN for the XT1045 ret.us, seems i cant post on the non lte version general section

Might as well post it here cause it think [MENTION=6295391]bedalus[/MENTION] has an XT1045 :)

Flashing back to stock for a while
[Moto G 4G Android Development] crakeron:
Whaaaaaaaaat? :confused:
[Moto G 4G Android Development] whisper13:
Lol, i got an MFN invite for early access to Android Lollipop Stock Rom for the Moto G 4G
[Moto G 4G Android Development] crakeron:
Cool! =D Keep us updated and report any bugs you may find ;)
[Moto G 4G Android Development] bedalus:
Wow, I'm shocked. I'm keen to investigate the code now!
[Moto G 4G Android Development] knizmi:
Try it. If you really get this working, you're gonna get famous ;)

Anyway, when others were trying to get OC to work, they all thought that they succeeded - system reported 1.4, even 1.6 GHz. But whenever you threw any kind of a CPU-intensive task at it, it always performed just like on 1,2 GHz. So the conclusion is that it's HW limited (see PLL clock generator).
[Moto G 4G Android Development] bedalus:
version 5: http://d-h.st/vwke

Changelog

- add some upstream patches to help improve the interactive governor select the best frequency

- switch off some debug config options

Mog Shot

While looking for a funny cat picture to go with this release I stumbled on this:
[Moto G 4G Android Development] bedalus:
Looks like an accurate assessment, I tried the obvious approach (see top commit here) and got the additional frequency steps, but no actual improvement in performance. I couldn't track down any code that actually limits the frequency, but I couldn't find any documentation anywhere that states it's a hardware limitation either. I've got a suspicion that the problem lies in the device tree, but I spent an entire day scrutinising it to no avail. In the end this phone has plenty of power considering how cheap it is, so it's hardly a big issue!
[Moto G 4G Android Development] crakeron:
On the other hand, is underclocking possible?
[Moto G 4G Android Development] bedalus:
Yep, what sort of thing are you after?
[Moto G 4G Android Development] crakeron:
Curiosity mainly. Most kids only talk about overclocking to gain performance and play games. I on the other hand would rather gain battery life by undervolting (preferred. OEMs don't always to a good job when choosing what voltages to apply to the CPU at different frequencies), or underclocking.

In my opinion, a quand core CPU like ours, but running at 1Ghz instead of 1,2 seems like a good balance for "classic" everyday use. The best would be keeping the actual frequencies but seeing if we can apply lower voltages, without loosing stability
[Moto G 4G Android Development] bedalus:
There's this big myth that under-volting improves battery life. True there's no point wasting amps by applying more voltage than required, but the voltages are likely to be as low as they can be within tolerance allowed by chip fabrication consistency, as well as assumed consistency of the regulators and battery itself, etc... These things are built to spec, and don't leave the factories without being tested! Obviously, when the top quality battery, regulators, and silicon all chance to make it into the same device, you can run just perfectly well with a bit less voltage. But how much advantage do you get if you are lucky enough to have one of these devices?

I actually measured all this in a study stuff a while back, using an ammeter to take proper readings across the battery. While a reduction in voltage does save a small amount of power, it's a teeny-tiny amount compared to just having the screen on. Much bigger savings can be made from keeping the CPU frequency low.

I wrote a governor on the Nexus 4 based on a mix of ideas from ondemand/interactive/conservative, but the basic idea was to scale up quickly but never to more than was required in order to save some power without having too much impact on performance.

I'm sure I could do something similar here if there's any interest in a power saving kernel.
[Moto G 4G Android Development] crakeron:
Wow. Really interesting stuff! :)

I did undervolt my Motorola Defy by quite a bit a few years ago, but Motorola really did a ****ty job at it back then, so it did improve battery life. I guess things are far more optimised since, what you say makes sense.

And yeah I could be interested in some powersaving measures, I'm no maniac though. All moderate ^^
[Moto G 4G Android Development] bedalus:
version 6: http://d-h.st/vTx

Changelog

- switch debug config options back on!

- rebuilt with latest linaro toolchain, optimised for A7 by [MENTION=4825437]Christopher83[/MENTION]

Mog Shot
[Moto G 4G Android Development] CJMom:
Thanks!

But what are those "debug config options" that removed in v5 and why did you got them back in v6?
[Moto G 4G Android Development] bedalus:
I disabled function tracing (which adds a bit to the size of the kernel) but then my wifi behaved oddly and I wondered if it was due to that change, so revert just to be safe. Maybe I'll try again some time.
[Moto G 4G Android Development] CJMom:
If it helps, I have no problems with wifi in v5, what problems did you have? it disconnected? it's maybe something that I don't notice
[Moto G 4G Android Development] bedalus:
I also froze some system apps like modem stats and things, so it could also have been that, but I'm not taking any chances
[Moto G 4G Android Development] bedalus:
Can someone in the latest version post their results of the attached IO benchmark app?

EDIT: Nevermind, I did it myself.

The test was to compare a bfq version, but even the latest bfq is still nowhere near cfq.
[Moto G 4G Android Development] crakeron:
Haven't unlocked my BL yet, i'm planning to + root and install your kernel, but i'm waiting for the 5.0.2 OTA update first.
[Moto G 4G Android Development] bedalus:
5.0.2 will probably require a new kernel
[Moto G 4G Android Development] crakeron:
Yeah i know, just waiting to see what options i'll have
[Moto G 4G Android Development] bedalus:
Test version: http://d-h.st/BT1x

I've pulled in a few updates for ION and binder (see my github). It's resolved one issue I was having with one particular app, wordfeud, that couldn't keep track of whether it was already launched or not!

This version will need someone who can dedicate a few days to some hardcore testing before we label it safe for everyday use.
[Moto G 4G Android Development] bedalus:
Latest test version: http://d-h.st/M2Ef

Feedback on test versions helps me improve the kernel!

For stable see this post

Changelog

- optimised square root algorithm

- SLUB allocator optimisation

- file system access time logging disabled by default

- raised max bus and made default at interactive boost frequency
[Moto G 4G Android Development] bedalus:
version 8: http://d-h.st/8Wso

Changelog

- optimised square root algorithm

- SLUB allocator optimised

- file system access time logging disabled by default

- small increase to max bus speed

- - made this speed default at interactive boost frequency

- disabled unused cpu driver code

- several ion and binder updates from upstream

- falcon has an mr3 branch, but these updates missed peregrine, so import them

- - includes further gpu driver updates

Mog Shot
[Moto G 4G Android Development] marcars:
finally custom kernel for moto g lte! Thanks!!!
[Moto G 4G Android Development] Pupet_Master:
I just download this kernel and i like it. It is very smooth, optimized and it do change the phone for the better.

How ever there is one issue (at least for me).

On 3C toolbox i had a profile to set the CPU governor to performance and on screen off to Userspace locked at the min freq of the phone (so on deep sleep i'm sure it will never go beyond the min freq and i only allow two cores to work).

Now with the kernel the profile do not get applied. I can live without the perfomance profile as your kernel interactive is performing better actually. But to know that some apps will wakelock my phone and tune the freq higher then the min one and to know it will use the 4 cores instead of 2 if need bother me.

Does interactive with your changes on deep sleep stay at the min freq? Or is there a way to apply the 3C toolbox CPU profiles with your kernel?
[Moto G 4G Android Development] Level99:
Just installed v8 to give it a thorough runthrough tonight! Thanks for giving the XT1045 a bit o' love. The stock rom has been my favorite of any phone, just seemed like the kernel and LMK weren't the most optimized. This definitely helps address some of my qualms with it!
[Moto G 4G Android Development] Pupet_Master:
Just for a quick update.

I found out the "issue" i had, it wasn't that 3C Toolbox did not apply the profile to the CPU governors and core.

The thing is that with your Kernel the Performance and Userspace governor are gone, they no longer are listed/exist so said application couldn't apply the profile i had.

As your interactive profile actually out perform the stock performance profile i was using on the screen on i do not mind this.

So my workaround was to make another profile, where it use the interactive at min and max clock for when the screen is on and to use interactive only at the min clock and to shut down the other 3 cores of the CPU when the screen is off/deep sleep.

Sorry about the previous post as i just found a way to have what i need ;)

Your kernel already outperform by much the stock one on the XT-1040. I will never go back, good job!
[Moto G 4G Android Development] marcars:
Can you add double tap to wake and s2s option to the kernel?
[Moto G 4G Android Development] Pupet_Master:
Anyone have problems using Onedrive?

When i open the APP it start fine, but once i login with the Microsoft account the app crashes. If it auto-login then it crashes when the APP open.

OneNote still work fine, so i imagine it isn't an issue with all Microsoft Ecosystem Apps.

Anyone else had this issue to find out if it is the Kernel or something else (as it was working before i flash the Kernel)
[Moto G 4G Android Development] mac1202:
Does flashify work to backup/restore the stock kernel in case of something goes wrong with this one.
[Moto G 4G Android Development] Pupet_Master:
There is another Kernel (from a spanish guy i think) for our device with stock rom.

He did add a lot of functions but the kernel isn't stable a this one here.

How ever he did post the stock kernel to roll back if we need.

Here it is:

https://drive.google.com/?authuser=...CEPTICON#folders/0B7zFFABEUl1XY1BpaWE1SHlHYkk

His instructions to put it back says to do exact what you have done to flash this custom kernel here. How ever you need to wipe the dalvik cache first.
[Moto G 4G Android Development] beeeto:
Love your work bedalus, and the mog shots too. Haha.

Thank you to bring these updates from falcon mr3 branch to peregrine. I didn't know they even were there.

Thanks again!
[Moto G 4G Android Development] bedalus:
No problem! I think they were relatively minor updates. L sure is taking a long time. But I'm interested in your CM11 project. I think you've done well to provide an up-to-date alternative to those who don't want to move to L before the official release.
[Moto G 4G Android Development] nklenchik:
Every time I try to download the kernel it downloads as an exe or Chrome gives me a red flag, what gives? Anyone else experiencing this?
[Moto G 4G Android Development] bedalus:
http://d-h.st/8Wso is the link you need. Make sure you find the correct download button, not some advert
[Moto G 4G Android Development] CJMom:
Hey I noticed there are 2 v8 versions:

v8.zip

v8b.zip

what the differences between each one of those? they don't have the same md5 sum.

I flashed the v8.zip when you released it. Should I flash v8b? Thanks.
[Moto G 4G Android Development] bedalus:
I can't remember, but 8b is the one to use
[Moto G 4G Android Development] baxtex:
So all you need is to Wipe caches adn flash teh zip and you are back on stock?
[Moto G 4G Android Development] Pupet_Master:
I think so, i never tested it but the guy who provide this zip for me said yes
[Moto G 4G Android Development] baxtex:
Just tried it and it worked fine. Thanks for the tip!
[Moto G 4G Android Development] bedalus:
Caches have nothing to do with the kernel, so there is no need to do any wipes when flashing.
[Moto G 4G Android Development] AndreiSant:
this kernel is good for battery ?
[Moto G 4G Android Development] bedalus:
It's got a slight bus increase and a higher bus at the default interactive frequency, so it should drain faster than stock, but in actual use, I don't think there is a noticeable difference
[Moto G 4G Android Development] nklenchik:
Does anyone have a mirror for 8b? Idk why I keep getting the wrong file download with OP's post
[Moto G 4G Android Development] sillycat98:
Well at least a few people have gotten to download this, I wanted to try it but download takes me to a bunch of ads and download now just reloads the same page over and over.
[Moto G 4G Android Development] nklenchik:
HERE is a mirror for version 8b for everyone getting ads when trying to download it on a desktop.
[Moto G 4G Android Development] whisper13:
[MENTION=6295391]bedalus[/MENTION] soaktest lollipop for 4G RetUs has started

Unfortunately i sold my moto g 4G US retail :(

---------- Post added at 01:42 AM ---------- Previous post was at 01:39 AM ----------
[Moto G 4G Android Development] whisper13:
screen shot soaktest

[MENTION=6295391]bedalus[/MENTION] soaktest lollipop for 4G RetUs has started

Unfortunately i sold my moto g 4G US retail :(
[Moto G 4G Android Development] bedalus:
When there's a flashable stock rom I'll produce a L kernel
[Moto G 4G Android Development] patrickdg:
CIFS module

Is there a way to make Samba filesharing app to work ? Seems that cifs module is absent...

Thks for ur work !
[Moto G 4G Android Development] wurstel:
hi [MENTION=6295391]bedalus[/MENTION], do we know what causes the memory leaks in the Motorola phones (launcher redraws, background processes getting killed)? I read somewhere that it's an issue that could be fixed with custom kernels. is this fix already included in your kernel?
[Moto G 4G Android Development] CJMom:
I have the latest kernel version and it's doesn't affect the memory issue, I still have to manually change the LMK settings.

But it's still gives the phone a little performance boost in terms of app opening speed, and smoother scrolling.
[Moto G 4G Android Development] vivekdn2504:
Facing the same problem

Need to b sorted out
[Moto G 4G Android Development] baxtex:
Same problem here, My phone constantly kills of plex& deezer and other stuff. The most annoying thing is when I use Greader (RSS reader) and accidently press the home button, when I reeenter the app it reloads and my stuff is gone.
[Moto G 4G Android Development] stewyfallingup:
Same issue as above for my phone
[Moto G 4G Android Development] CJMom:
I found a issue with my device and I'm not sure if it's related to this kernel or this is something I did (I initially thought this might have to do something with the GPS bug the Moto G has but apparently it's not):

When I open Google Maps even with GPS off I can see the process /system/bin/akmd8963 is constantly using 2% of the CPU (kernel mode) even after I closed Maps and wiped it off the cache.

This process remains active and consume ~2% of the CPU until you reboot your phone.

I tried looking online what this process might be and its turned out the this connected to the magnetometer

If anyone using Moggy v8 kernel could confirm this, just open Google maps with GPS off, and exit it.

then go to Options -> Developer Options -> Show CPU Usage

wait a few seconds and check if you can see akmd8963 in the top of that list.

Thanks!
[Moto G 4G Android Development] cpvm:
Can you say what are settings that you change for the low memory killer?
[Moto G 4G Android Development] bedalus:
I can include cifs in the next kernel
[Moto G 4G Android Development] bedalus:
Is this an issue exclusive to my kernel?
[Moto G 4G Android Development] toge64:
So what improvements has everyone felt in this kernel? Smoother? Battery life improvement?
[Moto G 4G Android Development] CJMom:
Hello,

I investigated some more and it seems that only Google Maps causing this issue here is why:

Each time an app uses the compass the system is keeping a count of currently active apps that uses it.

When I open Google maps it raises this counter by 2 (instead of 1 like other apps) and when you close the app it decreases only by 1.

Therefore the system thinks some app using the compass and keeps it active (which lead to battery loss)

Other apps that use compass has no problems, So I think it's not kernel related. Could you test this in your device just to be sure?

I tried to update Google Maps to latest version + delete Appdata + cache with no change. Also Force closing the app after use does not help.

Thanks.
[Moto G 4G Android Development] patrickdg:
It'd be great, thank you so much ! Hope next release will be soon.

---------- Post added at 11:51 AM ---------- Previous post was at 11:46 AM ----------

Battery life is a bit better for me with this kernel : it can last about 2 days (every day use), until 4 days when i don't use my phone.

It's half a day better than stock kernel.
[Moto G 4G Android Development] ExoGato:
Hi, I tried out this kernel while using the official latest CM 12.1 nightly, but after flashing the kernel and flushing dalvik/cache, the phone (XT1039) would not boot anymore (stuck at the "unlocked bootloader" screen). With Spirit Kernel it works. Any ideas?
[Moto G 4G Android Development] bedalus:
My ideas are

1) This kernel is not compatible with L

2) This kernel is not compatible with cm

3) Read the OP

In other news, I have now got the OTA for peregrine, so I can develop a kernel for AOSP L
[Moto G 4G Android Development] ExoGato:
Yeah, probably one of the first two. Thanks for answering and good luck with the development!
[Moto G 4G Android Development] itslumxz2:
Hey folks, was wondering if there are any recommended kernel settings I could give a try to while running stock with Moggy8, been trying a few alternatives now but I'm looking for something that's more focused towards the battery life (as I'm sure we all are)

Thanks.