yashsingh1/xdaforums huggingface dataset:
[Moto Maxx Android Development] RoboCuz:
I used to get a lot of reboots with batter in the 20% - 40% range, and I've changed my settings Kernel Auditor to

- Max Freq of 2572 MHz

- Global Voltage of -50

and I seem to have solved it, at least for me, with those two tweaks (your mileage may vary). This is after about 8-10 days of testing, so preliminary results, but it appears promising. Running the latest RR (v5.8.3-20170428) with the latest kernel (v48).
[Moto Maxx Android Development] jcarter3729:
I just tried your method and my phone went down to 30% but instead I set the maximum frequency to 2265MHz. Before I tried this my phone would always just automatically shutdown at around below 60% - 50%

Thanks :good:
[Moto Maxx Android Development] fgl27:
no logs no extra info great post...

not a kernel problem... working here just fine.
[Moto Maxx Android Development] Raistlen0:
The app crashes or the phone shuts off?
[Moto Maxx Android Development] LucasMC90:
Compatibility with AOSP Extended ROM V 4.1?

Hi, guys.

Does anyone know if this Kernel work with the AOSP Extended ROM V 4.1?

Thanks a lot

Lucas
[Moto Maxx Android Development] adrihdez21:
You can try it and tell us ?
[Moto Maxx Android Development] zys52712:
Seeing people talk about maple in this thread but I can't seem to find it.
[Moto Maxx Android Development] ChazzMatt:
That's because you don't read the change logs. :p

https://github.com/bhb27/BHB27Kernel/wiki/Changelog-M-and-N
[Moto Maxx Android Development] lipebotelho:
Kernel lost after flashing kernel
[Moto Maxx Android Development] djdalfaro:
[MENTION=5747496]bhb27[/MENTION]

is this kernel included in your latest RR rom, or do I need to install it separately?

Thank you
[Moto Maxx Android Development] Hlcpereira:
I'm not [MENTION=5747496]bhb27[/MENTION] but I can answer you.

No it isn't. The kernel include on RR it's the stock CM/LOS Kernel encoded for Nougat. The BHB Custom Kernel you install separately.
[Moto Maxx Android Development] ChazzMatt:
Right, none of the advanced [MENTION=5747496]bhb27[/MENTION] custom kernel versions have ever been included with any of [MENTION=5747496]bhb27[/MENTION] maintained ROMs. Those are "stock" CM/LOS kernel with basic options, the exact same kernel used in ALL Quark custom ROMs (which are not Motorola stock firmware-based).

[MENTION=5747496]bhb27[/MENTION] advanced kernel is a standalone kernel which a user can choose to install, if they wish. It can even be installed on stock Motorola firmware (like Verizon Marshmallow) as long as the user has unlocked bootloader and TWRP installed.
[Moto Maxx Android Development] fgl27:
BHB27-Kernel-V49​

For Nougat and Marshmallow, Custom and Stock ROM.

Download BHB27-Kernel Click here

Changelog Click here

Note:

Use this with the latest version of my mod KernelAdiutor-0.9.9.4.+40 or up to control the many featuring of the kernel.

Download Kernel Adiutor App

Bug report are welcome, make with in the most accurate description possible, do not spare words, screens and logs, a bug that I can't understand and can't be reproduced, I can't fix.

Always post a bug with [MENTION=5747496]bhb27[/MENTION] and a log .zip

BHB27 Kernel Adiutor > Logs > One click all Logs to a ZIP

If the device Random reboot all the logs are lost so just described like I ask above
[Moto Maxx Android Development] Meruem:
So I can install this kernel with the CosmicOS rom without problems, right?

This would improve battery time and performance?
[Moto Maxx Android Development] ChazzMatt:
Yes, you can install it.

Battery time and performance are sometimes opposing goals. ;)

With this advanced custom kernel you will have more options (governors, I/O schedulers, etc) to tweak your phone.

Different people have built kernel profiles which I'm sure they would be happy to share.
[Moto Maxx Android Development] fgl27:
BHB27-Kernel-V50​

For Nougat and Marshmallow, Custom and Stock ROM.

Download BHB27-Kernel Click here

Changelog Click here

Note:

Use this with the latest version of my mod KernelAdiutor-0.9.9.4.+40 or up to control the many featuring of the kernel.

Download Kernel Adiutor App

Bug report are welcome, make with in the most accurate description possible, do not spare words, screens and logs, a bug that I can't understand and can't be reproduced, I can't fix.

Always post a bug with [MENTION=5747496]bhb27[/MENTION] and a log .zip

BHB27 Kernel Adiutor > Logs > One click all Logs to a ZIP

If the device Random reboot all the logs are lost so just described like I ask above
[Moto Maxx Android Development] Septfox:
[MENTION=5747496]bhb27[/MENTION] A question and related feature requests.

The hardware buttons under the screen respond to touch (with a vibration) while the screen is off...why is this? A side-effect of DT2W support?

Would it be possible/viable to treat the buttons as media controls (Previous Track/Play(Pause)/Next Track in order) while the screen is off, as an optional alternative to long-pressing the volume buttons?

Also, an option to repurpose Sweep2Wake so it can serve as media control might be interesting. Music apps usually use left/right swipes for next/previous tracks, so I think being able to with the screen off would feel natural.
[Moto Maxx Android Development] fgl27:
does't happens to me, hw keys are off if screen is off always to me, how did you enable that?

I don't recall if there is a featuring for that on some ROM.

check flar2 threads the dt2w and s2w must work fine on quark, the hw keys I never try, as the tread says no off screen workaround as today.

https://xdaforums.com/android/apps-games/app-button-mapper-customize-hardware-t3361340

https://xdaforums.com/android/apps-games/app-wake-gestures-t3030399

btw those can cause wake look that can consume your battery a lot.
[Moto Maxx Android Development] Hlcpereira:
In RR 5.8.3 this happens either. It's happens only enabling the DT2W on KA. In both of the kernels (The "stock" and the BHB27-Kernel). Actually in all Quarks Nougat ROMs I notice this occurring.
[Moto Maxx Android Development] fgl27:
I never notice it, I always disable vibrate on tap (or wherever that is call on others ROM).

I see if that can be Split.
[Moto Maxx Android Development] Septfox:
Sorry, I should have searched first. I thought it was something that needed to be modified in the kernel.

Wake Gestures works pretty well. I'll keep an eye on battery usage, but it doesn't seem to be draining much (if any) more than having DT2W/S2W on :good:

To expand on what [MENTION=7838323]Hlcpereira[/MENTION] said: the button vibrations seem to be caused by DT2W being on, however, it's not KA-related because Wake Gestures also causes it.

It's not a serious problem or anything, it isn't as if the buttons are triggering wakeups or launching apps. They just...buzz.
[Moto Maxx Android Development] fgl27:
Like I wrote on the top, what is making it vibrate is "vibrate on tap" from ROM not from wake fetuaring, that is a ROM thing you can disable in settings > sounds, but I assume you like it because you leave that on.

As the kernel keeps screen touch sensor on when wake featuring is enable, and hw keys are part of the screen the ROM vibration doesn't get it is off and vibrates, so this is not a kernel or ROM bug, is a misunderstand of both is complicated to find were to fix and how, I will try to find how but may take a while.
[Moto Maxx Android Development] ChazzMatt:
OK, I'm confused. Let's try to clarify, please? What you all are describing is called "haptic feedback". And you are talking about the three capacitive (hardware) buttons at the bottom of the display, yes?

I'm on RR 6.x, so maybe RR 7.X is different, and I'm running stock kernel, but...

1) when my display is on (not dark), then the backlighting for the capactive buttons also light up. When the capacitive button are lit, if I touch any of the three buttons I feel a vibration. This is on purpose, to reassure me the device did understand my touch.

2) However, when the display is locked/DARK/off (nothing on the screen, even though the phone is on), the capactive buttons backlighting is OFF (they are also dark) and haptic feedback is also turned off. Touching the dark buttons gives no "vibration", as there is no action for the buttons to do.

3) The EXCEPTION to this is when there is a Quark Ambient Display notification on the screen. The display is dark and locked, but if my hand comes close to the phone, I will see a notification (clock time, a message, a calendar reminder, etc). The capacitive buttons are still DARK (no backlighting), BUT if I touch them (with a notification on the dark display) I do feel the haptic feedback vibration. However, since my display is LOCKED, there is no action available for the buttons to do until I unlock my display. (If my phone display did not have a security lock, touching one of the those buttons would probably trigger an action.)

But again, if the screen is completely dark with no notification on the screen (even clock, completely dark), if I touch the dark (not backlit) capacitive buttons, there is NO haptic feedback vibration.

_______

Now, what exactly are you reporting that is different from these three points I have described?
[Moto Maxx Android Development] fgl27:
this makes me believed we don't have capacitive buttons, but a extended touch sensor acting as buttons, because dt2w makes the screen touch sensor be on, if click on the "hw buttons" it triggers "vibrate on tap" when the screen is off.

after all is all glass, I'm not the expert on how the hw is, need to look to code to understand the sw.
[Moto Maxx Android Development] Septfox:
This is the key thing:

When DT2W/S2W is off, the panel and digitizer are powered off and it behaves as expected.

When wake gestures are enabled but button vibrations are off, they're still presumably being triggered but are disabled/set to 0, which is why bhb27 (and probably most users) didn't notice it. It's when you have both gestures on and button vibrations >0 that the bug occurs.

It seems that whatever handles the haptic feedback (wow, haven't seen that term used in ages, remember back when it was one of the popular buzzwords?) isn't being notified that the display panel is off, and only cares that the digitizer is powered and awaiting touches.

To be fair, whoever put together button feedback for the Quark probably didn't expect this situation to pop up, since it didn't ship with DT2W and they probably didn't know the hardware supported it.

That would be my guess as well. It seems like that would be a more cost-effective way to go about it, rather than putting in multiple sensors as older designs did.

There's no rush to fix it, no worries. Only two of us have brought it up, and as more of a curiosity than a complaint...by the sound of it, it'll be more trouble to fix than it's worth. The button presses are still trapped (it doesn't look like they even cause logcat or dmesg output), so it's just a harmless thing.

If it does get bothersome, one of us users can write a quick script to disable/enable button vibrations while the screen is off/on. A bit hacky, but far less trouble :good:
[Moto Maxx Android Development] fgl27:
Kernel Adiutor update

KernelAdiutor-0.9.9.4.+41.BHB27-Mod.apk​

Download Kernel auditor

Changelog

Installation

Just Install the apk on any ROM enjoy it.

If encounter any problem:

Clear data of yours BHB27 Kernel Adiutor app + deleted the KernelAdiutor and KA_profiles folder from internal memory (if not possible by the android file manager use TWRP one), reboot to recovery and clean/wipe Dalvik and cache before reporting things.

You can make a copy of profiles.json file inside KA_profiles folder (in case you save a profile), after the reboot place it back on the folder then apply the setting on the app, if encounter problem after the apply the profile is the problem deleted it and redo the cleaning and don't use it again...

This helps when the apps functions are odd, misbehaving and or slow to load/display.

Sharing profiles

The only thing need to share a profile is the file profile.json in side KA_profiles folder, it can be just simple copy and past to another devices, the file is very small and easy to share.

Use my version of Kernel Adiutor to better support this Kernel. :good:

[IMG="XDA Labs"]https://img.xda-cdn.com/oshFRo1rSEHTP5__wCXMO3e3u-I=/http%3A%2F%2Fimgs.xda-labs.com%2F0621sigs%2Flarge%2Fcontributor.png[/IMG]
[Moto Maxx Android Development] fgl27:
BHB27-Kernel-V51​

For Nougat and Marshmallow, Custom and Stock ROM.

Download BHB27-Kernel Click here

Changelog Click here

Note:

Use this with the latest version of my mod KernelAdiutor-0.9.9.4.+41 or up to control the many featuring of the kernel.

Download Kernel Adiutor App

Bug report are welcome, make with in the most accurate description possible, do not spare words, screens and logs, a bug that I can't understand and can't be reproduced, I can't fix.

Always post a bug with [MENTION=5747496]bhb27[/MENTION] and a log .zip

BHB27 Kernel Adiutor > Logs > One click all Logs to a ZIP

If the device Random reboot all the logs are lost so just described like I ask above
[Moto Maxx Android Development] ghpranav:
Regarding monitor mode

[MENTION=5747496]bhb27[/MENTION], if I'm not wrong our mobile has Qualcomm Atheros qca6174, which must support monitor mode. But I'm not able to get monitor mode working in my Kali NetHunter. Monitor mode is also not listed in supported interface modes list. Is it possible to add it's support?
[Moto Maxx Android Development] fgl27:
you can search a little bit more for what you wanna...

as far I know on linux you need iwconfig to change wifi mode, we don't have that on android anymore probably by same reason we have that "only position independent executables (PIE) are supported. Aborted "

the below is from my linux box

iwconfig --help
Usage: iwconfig [interface]
interface essid {NNN|any|on|off}
[COLOR="Red"] interface mode {managed|ad-hoc|master|...}[/COLOR]
interface freq N.NNN[k|M|G]
interface channel N
interface bit {N[k|M|G]|auto|fixed}
interface rate {N[k|M|G]|auto|fixed}
interface enc {NNNN-NNNN|off}
interface key {NNNN-NNNN|off}
interface power {period N|timeout N|saving N|off}
interface nickname NNN
interface nwid {NN|on|off}
interface ap {N|off|auto}
interface txpower {NmW|NdBm|off|auto}
interface sens N
interface retry {limit N|lifetime N}
interface rts {N|auto|fixed|off}
interface frag {N|auto|fixed|off}
interface modulation {11g|11a|CCK|OFDMg|...}
interface commit
Check man pages for more details.

if you can fix the PIE error you can use a iwconfig binary that can be found on xda.
[Moto Maxx Android Development] ghpranav:
I got iwconfig working by setting up Kali NetHunter in my mobile. I'm able to use any Linux command without any PIE error using Kali NetHunter. But the only thing is monitor mode isn't working. See the screenshots.
[Moto Maxx Android Development] fgl27:
what is the result when you use the "iwconfig" command to change mode?

that needs to be done with wifi down.
[Moto Maxx Android Development] ghpranav:
This is what I got. No luck yet...
[Moto Maxx Android Development] fgl27:
I don't think that application can access the interface as if it was on android, to really do that you need to give the command via adb on a shell via pc or using a terminal app, via emulator that will not happen.

but google don't wanna you do to that so unless you make a ROM that allow you to do what you wanna, you may be need to go back to KK and SuperSU.
[Moto Maxx Android Development] Einheit-101:
Can I flash this simply over my MGC24 MM stock rom with BHB kernel 4.4, that is rooted with Magisk? Or do I need to uninstall Magisk/the old Kernel first? I don't want to break something terribly. Magisk is nothing to joke with lol.

With that old 4.4 kernel I got a LOT of issues and I am curious about this new version now.
[Moto Maxx Android Development] ghpranav:
Every thing else is working fine on emulator, just like as if it was terminal app, except for monitor mode. Maybe it can be fixed by tweaking kernel? Well, maybe, even I don't know. You definately have more idea about kernels than me.

And about that PIE security thing, I'll try to bypass that feature by patching few files by Monday & I'll report you back with further details...

Monday edit:
[MENTION=5747496]bhb27[/MENTION], as I had told before today I tried lot of things to bypass that pie security feature. And I patched the linker file accordingly to online guides, but nougat linker file doesn't exactly match with Lollipop file structure. And there's no guide anywhere for nougat. Anyway I tried my best & this is what I got:

In terminal, I ran the code first time with default linker file. And second time with patched linker file. And both times I got different outputs. Even though the second time I didn't get any PIE related errors, but I'm getting some "illegal instruction" error. So, can you please please patch the linker file for me? I have attached both the linker files (default and patched)
[Moto Maxx Android Development] fgl27:
I don't have time or experience to do that I have no idea were to begin, go for kit kat that is the best solution, I'm not going to do something that is not a thing to all and you can do yourself.
[Moto Maxx Android Development] fgl27:
Kernel Adiutor update

KernelAdiutor-0.9.9.4.+42.BHB27-Mod.apk​

Download Kernel auditor

Changelog

Installation

Just Install the apk on any ROM enjoy it.

If encounter any problem:

Clear data of yours BHB27 Kernel Adiutor app + deleted the KernelAdiutor and KA_profiles folder from internal memory (if not possible by the android file manager use TWRP one), reboot to recovery and clean/wipe Dalvik and cache before reporting things.

You can make a copy of profiles.json file inside KA_profiles folder (in case you save a profile), after the reboot place it back on the folder then apply the setting on the app, if encounter problem after the apply the profile is the problem deleted it and redo the cleaning and don't use it again...

This helps when the apps functions are odd, misbehaving and or slow to load/display.

Sharing profiles

The only thing need to share a profile is the file profile.json in side KA_profiles folder, it can be just simple copy and past to another devices, the file is very small and easy to share.

Use my version of Kernel Adiutor to better support this Kernel. :good:

[IMG="XDA Labs"]https://img.xda-cdn.com/oshFRo1rSEHTP5__wCXMO3e3u-I=/http%3A%2F%2Fimgs.xda-labs.com%2F0621sigs%2Flarge%2Fcontributor.png[/IMG]
[Moto Maxx Android Development] fgl27:
BHB27-Kernel-V52​

For Nougat and Marshmallow, Custom and Stock ROM.

Download BHB27-Kernel Click here

Changelog Click here

Note:

Use this with the latest version of my mod KernelAdiutor-0.9.9.4.+42 or up to control the many featuring of the kernel.

Download Kernel Adiutor App

Bug report are welcome, make with in the most accurate description possible, do not spare words, screens and logs, a bug that I can't understand and can't be reproduced, I can't fix.

Always post a bug with [MENTION=5747496]bhb27[/MENTION] and a log .zip

BHB27 Kernel Adiutor > Logs > One click all Logs to a ZIP

If the device Random reboot all the logs are lost so just described like I ask above
[Moto Maxx Android Development] vinydasilveira:
If I install this V52, Will the battery failure problems stop, or has this issue only been resolved in RR 06/26? I am in RR 06/17 with the v52 kernel
[Moto Maxx Android Development] Septfox:
According to the changelogs, it's all kernel and KA changes. If you don't want to update your ROM, make sure to grab the new version of KA and install it manually.

Whether or not it's enough to "fix" the shutdown problem, well, that's what we're here to test. Our dev's battery is apparently pretty healthy, he needs those of us who are less lucky to be guinea-pigs :)

To quote the KA changelog,

You have to try it and see. I know I'm going to.
[Moto Maxx Android Development] Septfox:
I knew I wouldn't need my phone this morning, so I set the phone to 2.7ghz, disabled my CPU throttling script and let the battery run down to try out the new BCL driver. I dropped the low/high thresholds to 3100mv/3500mv since I know my battery is in ok condition.

At 25%, I was able to build DNA Dark with no issue, monitoring the CPU frequency (using the Developer Options overlay) and voltage with KA while substratum built, showed very fast and efficient throttling. It completed nearly as fast as with BCL off.

At 15%, there was a definite speed hit, as it was throttling enough that the frequency monitor couldn't catch most of the jumps back to full speed and it was staying at 1.9ghz more. The build still completed successfully, not even a hiccup.

It's worth noting that this was still faster than manually capping the CPU at 1.9ghz, so that should give an idea of how much quicker the throttling works compared to the relatively low sampling rate of the CPU monitor.

...then I went back to surfing the web, and had it shut off at 9% under light to moderate load. This was an automatic safety shutdown though, not a power cutoff; the battery capacity had suddenly dropped to 0% and caused Android to panic.

So the BCL seems to have still worked fine, I just need to try and recalibrate my battery.

Very nice work, [MENTION=5747496]bhb27[/MENTION] :good:
[Moto Maxx Android Development] pedrohxn:
[MENTION=5521404]Septfox[/MENTION] yeap, tested last night and worked beautifully.

I was facing shutoffs/reboots below 40% juice when cpu hit freqs >2688mhz.

I overvolted (don't even know if this is the correct term) the highest freqs + limited freq with the new BCL feature and boom... Solved!

Played Vainglory and Hitman till 12% and then shut itself down.

The new feature works accurately.

Amazing work [MENTION=5747496]bhb27[/MENTION].
[Moto Maxx Android Development] Septfox:
I've had a couple of kernel panics happen; one early this morning while I was sleeplessly browsing the internet, one in the car this afternoon while the phone was just sitting there asleep.

Last dmesg for both and kernel changes attached. I'm not sure what caused all those msm_vidc lines...some of what I was doing involved trying to fix html5 video in Firefox, maybe that was it.

On an unrelated note, I bought a little cheapy bluetooth receiver this afternoon out of curiosity. I can see what others are talking about with the sound dropouts, and it gets worse with the screen off (though this might be because I use zzmoove when the screen is off).

It also seems to cause a lot of logcat spam. Log snippet from a minute or so of playback attached.
[Moto Maxx Android Development] fgl27:
I need to take a long look at this, as a simple test, do cleanup of KA data, after reboot and reconfig all yours configurations, the app is not perfect and some times can cause problems after a long time of use, writing and rewriting values one on the top of the other can make it cause some random problems...

on the other day, I was watching freq using cpu overlay info, and I notice that on any cpu gov that I use, the freq lock on max freq every time the screen turned on, with makes no sense, after a clean of KA problemo solved...

let me know if after the cleanup any problems are show...
[Moto Maxx Android Development] Septfox:
Will do, thank you.

I'm reminded of something else, though: do you know why sometimes, if attempting to set a new governor or frequency, the setting doesn't take effect?

For instance I have a script set the governor to zzmoove when the screen is off, and conservative when on. But sometimes one or two cores "ignore" the echo and stay on the previous setting.

Even KA seems to be affected by this, when setting a governor or frequency there and switching to per-core control, one or two cores will sometimes be using the previous setting.
[Moto Maxx Android Development] ceelos218:
Can you screenshot your blc settings.. I want tot try it out.
[Moto Maxx Android Development] fgl27:
you can't change a core status if it is offline, that is one of the reason today is not advice disable cores.

KA try 10 times to change the values, before change it try to put the core online, but the hotplug may not allow it to stay online then it can't change..

you can try a loop, enabling the core before try a change, but don't use a infinite loop because it may never manage to achieve the change.