For those still around: mk2k aosp kernel [v0.8]

Search This thread

xxseva44

Senior Member
May 16, 2019
550
239
Canada
LG V20
Google Pixel 4a 5G
That's the worst part actually, i only managed to ascertain that it works on the first transmission because my IR app had a preset that worked on my LGTV right at the start. Mi Remote for example behaves just as your app is behaving, where my TV doesn't respond at all to it, so i guess the phone's IR hangs no matter if it sends the correct signal or not. The only difference there is that my H910 still flashes the IR light even after the first transmit while using Lean Remote, but with a massive delay between each cycle and even freezing the app for a while, but still, only the first command is issued.
Reason it only sends one signal per flash of the kernel is that after it sends that command, the ir drivers crash
 

askermk2000

Senior Member
Jul 9, 2015
1,229
2,670
Moto G
LG G5
Strange thing is, I found download for gamma kernel H850. I tried both v0.0.6 and v0.0.7 still couldn't get any light from the led.
It was discussed in the thread how IR works with those, but that was back with LOS 15.1 and possibly LOS 16.

IDK what's going on in my case (the app itself?). I think I'll just get back to the kernel stuff. This needs some proper debugging which
I'm sure many of you are better suited than me.
 

AShiningRay

Senior Member
Sep 1, 2021
312
291
Xiaomi Redmi Note 4
LG V20
Issue is most likely kernel related OR consumerIR related. Reason it works on gamma is that it's using an older version of the linux kernel source compared to say los 18.1. After the kernel was upstreamed, Ir broke.
I suppose we should narrow it down to a version where the IR works. Considering that there is only one upstream commit touching LG's IRRC driver implementation(which i assume is the one being used by the phone), and that upstream can be found here, i might be able to revert the codebase to an older version than that one, fix up some things so it boots on my SD821 H910 and then test it.
But is it confirmed to be working by someone in the community? No matter where i check, even outside of XDA the reports are kinda conflicting on that front.

Edit: Yeah... i don´t think this will work because reverting the commit above basically removes LGE's UEI IRRC driver, so that same driver has effectively two states in gamma's repo: 1 - Non Existent, 2 - Identical to LOS 18.1 after the upstream. And the fact that i couldn't find any relevant commits other than that one even going as far back as January 1, 2016 makes the situation even messier, as i have no idea how to go about checking the IR even on gamma now. There are some changes on other IR drivers and codecs such as lirc where the LOS source has newer code, so i will try to revert those back instead and see if it works, but does the phone even use lirc?
I don't think reverting a simple "check for integer overflow" will fix the problem. I am not a ROM developer, so i have no idea about the way the IR communicates there, does it use more than the LG's driver from the kernel? If so, it would help a lot to know the underlying steps taken by the infrared such as libs used and etc, making it easier to pinpoint where the problem could be if it is in the kernel.
 
Last edited:

askermk2000

Senior Member
Jul 9, 2015
1,229
2,670
Moto G
LG G5
Ok, we are getting close after all :)
I do hate doing debugging and routine testing, but eventually got around to trying a different IR app, Lean remote as AShiningRay mentioned.
So now I got some response from the TV, on my kernel, but only first try. Then I tried Gamma kernel v0.0.6 again and damn it works properly, and
finally I tried the self-compiled gamma kernel (gamma-pie branch) and that one works too. This was on Lighthouse android 11.

So then we can't really be far from figuring it out. There's no doubt now, gamma kernel as it is on github, works! period.
Two possibilities as I see it:
1 - The commit above (v20: Import LG msm8996 LineageOS base on top of CAF.) contains some subtle edit.
2 - Gamma uses a newer CAF base kernel (don't know exact tag), one or more of those caf patches must have solved something.
 
  • Like
Reactions: AShiningRay

AShiningRay

Senior Member
Sep 1, 2021
312
291
Xiaomi Redmi Note 4
LG V20
Ok, we are getting close after all :)
I do hate doing debugging and routine testing, but eventually got around to trying a different IR app, Lean remote as AShiningRay mentioned.
So now I got some response from the TV, on my kernel, but only first try. Then I tried Gamma kernel v0.0.6 again and damn it works properly, and
finally I tried the self-compiled gamma kernel (gamma-pie branch) and that one works too. This was on Lighthouse android 11.

So then we can't really be far from figuring it out. There's no doubt now, gamma kernel as it is on github, works! period.
Two possibilities as I see it:
1 - The commit above (v20: Import LG msm8996 LineageOS base on top of CAF.) contains some subtle edit.
2 - Gamma uses a newer CAF base kernel (don't know exact tag), one or more of those caf patches must have solved something.
That's great! I'm in the process of updating my kernel to linux 3.18.140 right now (done, i just need to apply some fixes in order for it to boot as there were some conflicts) and adding some CAF patches as well. Once that's done, i'll take a look at the IR again, editing gamma to boot on my phone should clear some things up as i debug it.

And about the possibilities, yes, both are equally valid as the commit i mentioned has some sparse changes not present on Lineage's source, some related to IR and whatnot, but it is a lot of files to check through and will definitely take a while to go through. Hopefully we get to the end of this, since the IR is kinda crucial for some.
 

askermk2000

Senior Member
Jul 9, 2015
1,229
2,670
Moto G
LG G5
Issue is most likely kernel related OR consumerIR related. Reason it works on gamma is that it's using an older version of the linux kernel source compared to say los 18.1. After the kernel was upstreamed, Ir broke.

So IR was functional on stock lineage kernel before being upstreamed?
My stock lg kernel is also upstreamed, and I'm sure I would have gotten many complaints if IR broke. Not to say it's impossible, but at least it didn't break on the stock kernel for some reason.
 

AShiningRay

Senior Member
Sep 1, 2021
312
291
Xiaomi Redmi Note 4
LG V20
So IR was functional on stock lineage kernel before being upstreamed?
My stock lg kernel is also upstreamed, and I'm sure I would have gotten many complaints if IR broke. Not to say it's impossible, but at least it didn't break on the stock kernel for some reason.
That's actually a good point, i'll strip the boot.img from an older LOS 15.1 rom to test if the upstreaming was the problem. For completeness sake, the kernel versions i am currently testing are as follows:
mk2000 & Swan -> v.3.18.140
LOS 18.1/Lighthouse Stock -> v3.18.113
Gamma Oreo Stable(the one i just confirmed to have the IR working, gamma-pie throws many errors here) -> V3.18.71

So yes, the Gamma Kernel is running an older version of 3.18 and the IR works fine there. That leaves us with 2 things: Either the kernel upstream broke the IR, which i will verify shortly, or Gamma has some commits that fix it when compared to Lineage's sources like the CAF upstream i linked some time ago. I will also run a git log on lineage's commit history to check if there is anything suspicious after i test the old lineage kernel. As it stands, only gamma managed to get the IR working on my H910.

Small edit: Will be testing the lineage 15.0 kernel source instead since 15.1 also seems to have been updated do 3.18.113. At least on github, LOS 15.0's branch appears to be running on v3.18.78 which is the closest one yet to gamma.

Edit 2: Yeah... things aren't looking good. I couldn't find a LOS 15.0 kernel or even a 15.1 for that matter(x86cpu's requires drive access and i'm not even sure he will answer) and also didn't manage to compile a working one as well. Not only that, but the lineage's sources definitely had the IR broke as far back as 3.18.102 at least, which is the oldest one i managed to compile with some changes and a supposed IR fix committed in the same code base here. All newer LOS kernels should already have that fix, and that means that this fix itself does not help much. Even compiling the kernel after reverting it to this exact commit results in a non-working IR. To be honest, i don't know what to do now because all commits related to the IR are either newer than 3.18.102, or do not fix the problem. If anyone else has a tip or anything that may help solve that i'm all ears.
 
Last edited:
  • Like
Reactions: askermk2000

xxseva44

Senior Member
May 16, 2019
550
239
Canada
LG V20
Google Pixel 4a 5G
That's actually a good point, i'll strip the boot.img from an older LOS 15.1 rom to test if the upstreaming was the problem. For completeness sake, the kernel versions i am currently testing are as follows:
mk2000 & Swan -> v.3.18.140
LOS 18.1/Lighthouse Stock -> v3.18.113
Gamma Oreo Stable(the one i just confirmed to have the IR working, gamma-pie throws many errors here) -> V3.18.71

So yes, the Gamma Kernel is running an older version of 3.18 and the IR works fine there. That leaves us with 2 things: Either the kernel upstream broke the IR, which i will verify shortly, or Gamma has some commits that fix it when compared to Lineage's sources like the CAF upstream i linked some time ago. I will also run a git log on lineage's commit history to check if there is anything suspicious after i test the old lineage kernel. As it stands, only gamma managed to get the IR working on my H910.

Small edit: Will be testing the lineage 15.0 kernel source instead since 15.1 also seems to have been updated do 3.18.113. At least on github, LOS 15.0's branch appears to be running on v3.18.78 which is the closest one yet to gamma.

Edit 2: Yeah... things aren't looking good. I couldn't find a LOS 15.0 kernel or even a 15.1 for that matter(x86cpu's requires drive access and i'm not even sure he will answer) and also didn't manage to compile a working one as well. Not only that, but the lineage's sources definitely had the IR broke as far back as 3.18.102 at least, which is the oldest one i managed to compile with some changes and a supposed IR fix committed in the same code base here. All newer LOS kernels should already have that fix, and that means that this fix itself does not help much. Even compiling the kernel after reverting it to this exact commit results in a non-working IR. To be honest, i don't know what to do now because all commits related to the IR are either newer than 3.18.102, or do not fix the problem. If anyone else has a tip or anything that may help solve that i'm all ears.
Then yea it's an incompatibility between the kernel and consumer ir
 

askermk2000

Senior Member
Jul 9, 2015
1,229
2,670
Moto G
LG G5
I will try building the H990DS variant , Will send here.

Does the Lineage H990 work with *DS? Because it's basically the same setup/config
I'm using on my kernel. I remember doing some fancy things on my stock kernel to
differentiate between single and dual-sim, but I don't recall exactly what now.

If needed I can do something similar here probably.
 

Mysteriouslog6

Senior Member
Aug 21, 2018
142
27
LG V20
Xiaomi Redmi Note 5 Pro
Does the Lineage H990 work with *DS? Because it's basically the same setup/config
I'm using on my kernel. I remember doing some fancy things on my stock kernel to
differentiate between single and dual-sim, but I don't recall exactly what now.

If needed I can do something similar here probably.
Will check and report tomorrow , Currently the V20 isnt being used.
 

Black6spdZ

Senior Member
May 7, 2006
793
88
Waterford MI
That's actually a good point, i'll strip the boot.img from an older LOS 15.1 rom to test if the upstreaming was the problem. For completeness sake, the kernel versions i am currently testing are as follows:
mk2000 & Swan -> v.3.18.140
LOS 18.1/Lighthouse Stock -> v3.18.113
Gamma Oreo Stable(the one i just confirmed to have the IR working, gamma-pie throws many errors here) -> V3.18.71

So yes, the Gamma Kernel is running an older version of 3.18 and the IR works fine there. That leaves us with 2 things: Either the kernel upstream broke the IR, which i will verify shortly, or Gamma has some commits that fix it when compared to Lineage's sources like the CAF upstream i linked some time ago. I will also run a git log on lineage's commit history to check if there is anything suspicious after i test the old lineage kernel. As it stands, only gamma managed to get the IR working on my H910.

Small edit: Will be testing the lineage 15.0 kernel source instead since 15.1 also seems to have been updated do 3.18.113. At least on github, LOS 15.0's branch appears to be running on v3.18.78 which is the closest one yet to gamma.

Edit 2: Yeah... things aren't looking good. I couldn't find a LOS 15.0 kernel or even a 15.1 for that matter(x86cpu's requires drive access and i'm not even sure he will answer) and also didn't manage to compile a working one as well. Not only that, but the lineage's sources definitely had the IR broke as far back as 3.18.102 at least, which is the oldest one i managed to compile with some changes and a supposed IR fix committed in the same code base here. All newer LOS kernels should already have that fix, and that means that this fix itself does not help much. Even compiling the kernel after reverting it to this exact commit results in a non-working IR. To be honest, i don't know what to do now because all commits related to the IR are either newer than 3.18.102, or do not fix the problem. If anyone else has a tip or anything that may help solve that i'm all ears.
I have 15.0 and 15.1 LOS 996 Roms if that's what you're looking for. Also, just flashed the .5 kernel and get the old scrambled video after boot.. I haven't seen that issue in years ;) but glad few of us still running these nice old phones
 
Last edited:

AShiningRay

Senior Member
Sep 1, 2021
312
291
Xiaomi Redmi Note 4
LG V20
I have 15.0 and 15.1 LOS 996 Roms if that's what you're looking for. Also, just flashed the .5 kernel and get the old scrambled video after boot.. I haven't seen that issue in years ;) but glad few of us still running these nice old phones
Well i tried those kernels a few days ago (got them from x86cpu) and they are a no-go in newer roms like LOS 18.1 or Lighthouse, but it seems the IR never worked in their kernel at all according to x86cpu's post about Lineage 15.1. Even Gamma's IR seems unintentional tbh. We're still looking at it, but we have no idea how to fix this particular problem yet... it just gets a bit exhausting after consistently turning the kernels upside-down trying to figure out what is causing the IR to fail.
 

stingbandel

Senior Member
Nov 23, 2005
457
50
Hi, I am.using 0.6 version on my h990ds. When I want to charge the phone, I usually turn it off then plug the charge. But since I use this kernell, it will automatically turn on the phone and the touch screen is not working. I have to remove the battery then turn it on again without plugging the charging then the touch screen will work. After that I can plug in the charger back with the phone turned on and all the problems with the touch screen is gone. So basically it cannot charge the phone with the phone in off condition…
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Hey

    This will not be a (much) maintained thread. This is the main thread: G5 forum

    Kernel is for Lineage based roms. Works with Android 11

    US996 = Officially unlocked
    US996Dirty = Unlocked "the other way"

    It was tested to give about 30% longer battery life, using youtube playback constantly, than stock lineage/lighthouse kernels.
    Stock (original lg) rom was tested also, which lasted 7h in the test. The same as my kernel, but I dare say my kernel will be faster
    in addition, but it's obviously difficult to compare stock vs lineage in that manner (stock being very old un-optimized userspace).

    Keep in mind the number above is from G5 which has a 2800mAh battery. The tester's battery was also a bit worn.

    -----------------------------
    Downloads:
    V0.8 - Androidfilehost
    Beta builds - Androidfilehost
    -----------------------------

    UPDATE - feb 14 2022
    Version 0.7 Beta2 uploaded. You'll find it in the link above.

    UPDATE - april 26 2022
    For H990 - version 0.7 beta4 - To solve crashing (obsolete with 0.7 stable build)

    UPDATE - june 28 2022
    Version 0.7 uploaded -- Built with gcc12.1, disabled kpti for better performance and enabled zram (with upstreamed lz4, zsmalloc, zram)
    Removed the old builds from this post

    UPDATE - feb 19 2023
    Version 0.8 uploaded

    Source

    Thanks to @AShiningRay
    I've put his undervolt, and tweak to schedutil in v0.7
    3
    Uploaded v0.8, link in 1st post.

    • Updated few things from LG Pie kernel source.
    • Added more CAF camera patches.
    • Underclock no longer standard, only for H990.
    • Less logspam from the touch driver.
    • Using latest Arm/Linaro GCC 12.2 + some new optimization flags.
    2
    I will try building the H990DS variant , Will send here.

    Don't bother, I'm building now. I forgot the 990 is also a very common device.
    I will also upload the final/stable build for each device at some point.

    Edit: Added to post #1
    2
    As far as i tested some time ago, gamma kernel had the same behaviour after flashing, but i tested that one on LOS 17.1. It might be because my refurbished V20 is a bit weird in regards to the SoC. No matter where i check it, the phone reports a Snapdragon 821 (MSM8996Pro) with clock tables all the way up to 2.34Ghz and etc even on LG's stock rom, which i find really strange because the V20's are supposed to have a Snapdragon 820, so i'm not really sure if that is the reason behind the fastboot problem, since both LG stock and Lineage's kernel works just fine.
    Ah ok. I know why then.
    You see, me and Omar removed some board definitions from our kernel to make it smaller. Those where definitions for sd821 V20s - which we gathered was for some prototype devices which would likely never be in circulation.
    But here you are with one such device :eek: :LOL:

    Edit: see here: https://github.com/stendro/msm8996_...a80921570789d20375f0b62516be3c6973ccb3375552a
    2
    I've uploaded v0.7 beta2 which should fix the above issue.
    Version 0.7 Beta folder