• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

askermk2000

Senior Member
Jul 9, 2015
1,184
2,630
Moto G
LG G5
There's also a possibility that those configs are only needed on older android versions, as that gamma branch is for android 9 and we are currently on 11. But nonetheless i will add those configs into my kernel and see if it compiles, then check if the IR status changes, shouldn't be much of a problem. I'll report back in a few hours.

Edit: Managed to test it sooner than expected (thankfully no repo sync was needed on lineage sources), and there was no change whatsoever, the infrared still fails after the first transmit signal.
The audit configs themselves are mostly used to audit file changes in the kernel so it is more of a system admin feature, while the devport one was more promising, since there was a chance that the IR could be using /dev/port as a way to let the apps interact with it directly, and considering how hacky some proprietary code can be (LG messes up even the KDZ recovery files sometimes, like with my old LG Leon, essentially making it unrecoverable), so you never know.
Turns out the lineage kernel source code has all of those configs defined in the files and they were just disabled.

Thanks for testing. I'm compiling gamma kernel now to see if it works, else there's no point in messing with that source.
Another interesting bit is module signature. Gamma has modules enabled and signature disabled. Then I though it might
be possible for blobs to be signed and verified in a similar manner as the *.ko modules in lib/modules.

I asked on irc with some knowledgeable folks, and the answer was: yes its possible. but I'll see at least if gamma works as is, if it does then that could be the cause.
 
  • Like
Reactions: AShiningRay

AShiningRay

Senior Member
Sep 1, 2021
70
30
Xiaomi Redmi Note 4
LG V20
Thanks for testing. I'm compiling gamma kernel now to see if it works, else there's no point in messing with that source.
Another interesting bit is module signature. Gamma has modules enabled and signature disabled. Then I though it might
be possible for blobs to be signed and verified in a similar manner as the *.ko modules in lib/modules.

I asked on irc with some knowledgeable folks, and the answer was: yes its possible. but I'll see at least if gamma works as is, if it does then that could be the cause.
Understood. As it stands, all modules compiled by the lineage kernel are test modules for TCP, IO Blocks, optional TCP algorithms and other nonessential things, everything else is baked into the kernel itself. The general lack of warnings of any kind pertaining to them also means that everything that should be compiled is being completed without any problems, unless lineage's default GCC and Clang are implicitly omitting those errors. I'm almost releasing my custom kernel here on the V20 subforum as well, so it will be easier to find people to test it too.
 

askermk2000

Senior Member
Jul 9, 2015
1,184
2,630
Moto G
LG G5
Ok, so it seems it didn't work.
I haven't used the phone previously as a remote, but I got Asmart remote on there, and have a samsung tv in standby.
I tried to shuffle through all samsung models pressing the power button, but tv didn't react.

Then I tried looking at the ir led through a phone camera while pressing button and I could not see anything.
 

AShiningRay

Senior Member
Sep 1, 2021
70
30
Xiaomi Redmi Note 4
LG V20
Ok, so it seems it didn't work.
I haven't used the phone previously as a remote, but I got Asmart remote on there, and have a samsung tv in standby.
I tried to shuffle through all samsung models pressing the power button, but tv didn't react.

Then I tried looking at the ir led through a phone camera while pressing button and I could not see anything.
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.
 

xxseva44

Senior Member
The Lighthouse dev I mentioned has replied. He says that LG has proprietary blobs specifically for IR, and LeEco don't. He'd rather make it work as intended with the blob, instead of using some hacky solution.
So then it makes sense that it work on first try and possibly working normally on gamma - there is some facility already there. Why it doesn't work I can't quite fathom though.
I have looked at source, dtb, configuration... but I may have missed something. I may have to compare to stock config, at least we know it works there.
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.
 

xxseva44

Senior Member
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,184
2,630
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
70
30
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,184
2,630
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
70
30
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,184
2,630
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
70
30
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
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,184
2,630
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
132
21
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
769
84
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
70
30
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.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Re-uploaded builds due to build environment causing messed up builds.
    1
    I added VS995 and LS997 variants to the download folders.
  • 12
    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 (except v0.5 attached below)
    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.

    -----------------------
    New uploads (nov 22):
    V0.6 - Androidfilehost
    V0.7 Beta1 - Androidfilehost
    -----------------------

    Source

    Thanks to @AShiningRay
    I've put his undervolt, and tweak to schedutil in v0.7
    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
    1
    Unfortunately this app only checks if the IR blobs have been implemented and can be accessed by the phone's OS, because it reports the same info on Lineage's stock kernel where the IR doesn't work properly after sending the first signal, so that app is not a reliable way to test it. I could be wrong tho, since i would really like to test this kernel's IR by myself, but it throws me right into fastboot when flashing it on top of either LOS 18.1 or Lighthouse.
    1
    I see you have a H910 device. Anyone else have the same problem?
    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.

    And as for gamma, even the IR on that seems a bit finicky at best due to some reports on V20 Reddit also saying it doesn't work, making it even less likely to ascertain exactly "how" or "why" it works there. I am also compiling a custom kernel for the V20 based on LOS 18.1 sources and from what i saw, gamma's source has basically identical IR files, be it LIRC or IRRC, and some logging about the IR has specifically shown me that the kernel is actually issuing the signal correctly, but something breaks between the kernel and the OS, making the ConsumerIRService return error -1 right after that., which eventually led me to this as well:

    It might be something outside of the kernel, but i don't have the skills to mess around with ROMs yet and logging it is the best i can do on them.