yashsingh1/xdaforums huggingface dataset:
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] josephww:
After a clean install from 7.0 (

After a clean install from 7.0 (8.0 before), I can feel the difference with this kernel. However, when I boot the phone with a SIM card the kernel always crashes within a few seconds or minutes after boot. Sometimes (once every 1-4 days there is a kernel crash without the SIM) I suspect these issues must be with LinageOS because the SystemUI often crashes.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
I see, does it happen with the stock lineage kernel (i.e. the one that came with the ROM, without installing any kernel on top of it)? This one is based on it, so there's a chance that both share the same issue on your phone. You could try the mk2000 kernel to see if it fixes that, else it's a problem with the ROM that doesn't seem to be playing well with your firmware for some reason.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Electrolite_XYZ:
Nice, I hope the project works out!
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Alright, with the recently released V1.09 i now deem this kernel EOL, or at least, its 3.18 version since i will now be focusing on porting 4.4 to the LG MSM8996 family of devices alongside @askermk2000, since that tree is still being actively developed by linux-stable and also contains a slew of general improvements to both security and performance over the current 3.18 source that i don't think can be further optimized or fixed. The IR is still in need of fixing, but at this point i think starting fresh from a clean source might prove more beneficial to solve it than looking around the entire kernel source again. But if any issues with that new release crop up, do tell me and i will try to provide support.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Recently found out that dynamic fsync could cause data loss when the phone rebooted abruptly or lost power without a way to safely shutdown. Built an updated kernel with that feature removed and also some voltage tweaks of my own and performance commits i cherry-picked between 1.09 and that last one but didn't think they would amount to much to warrant a new version by themselves. Should be faster and safer than previous version on both variants.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Dexterite:
Was trying to download the kernel, but no mirrors are showing up for the h910-915 stable over on androidfilehosting
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Welp you're right, thanks for warning me of that. Just accessed it myself and there's no mirrors for it and VS995. Thankfully i still have the H910 zip file here (i use the extreme variant on mine, but keep the safe one just in case). And it is interchangeable with VS995, so i merged both into one zip. There should be a mirror for it now since i found one while trying to download the zip i just uploaded. If it still has problems when you try downloading it, i can host it elsewhere but i'll have to find a good place to do it tho.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] el-sahef:
There is also no mirror for Swan-US996-Extreme.zip.

Maybe androidfilehost had problems when you uploaded the new version. This is the first time I had the no-mirror issue.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Weird, it had mirrors when i checked yesterday. I guess they're having problems as of lately in general. Either way, if you're trying to download it, i'll see if i can get the us996 extreme build back there again to force them to update the mirror for the time being.

Edit: Mirror now up and running for US996 Extreme. Other variants are working fine as of now.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] marm0tte31:
@AShiningRay thank you for your great work :)

I've tried to flash the kernel to a LOS17.1 (v20 h990n) and it tell me that only android R (11) is compatible...

Is it normal? AFAIK v1.09 should works on android 10 ?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Strange, it should be flashing on basically any android version after i disabled droidcheck a while ago. Maybe that option was removed in anykernel. In either case, i'll see if i can force it to flash all the way down to 8.0. I'll notify as soon as they're on AFH.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
All done. The script should now allow the kernel to be flashed from Android 7.1 to 11. Please report back if any other problems show up.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] marm0tte31:
It works now ! Thanks

You can mark it compatible with h990n and LOS 17.1 ;)
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
I've recently switched from Gamma kernel to this kernel, and it has been overall much better. But I had a custom built version of Gamma kernel that had the CH341 driver enabled and it worked fine with the default ramdisk for some reason. I would like to get the CH341 driver working on this kernel as well because I don't really want to go back to Gamma, but the driver doesn't work with the default ramdisk, and I've never build one, nor do I know how, would you mind instructing me (or point me to some resources) on how to complete the rest of the job (ramdisk, flash it, etc.) when I already have the zImage to get the kernel on the device? I apologize for taking up your time with this seemingly trivial matter, but any help would be greatly appreciated.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
CH341 is available on the kernel from what i've seen, i think it's just disabled to save on overhead and size so only changing the ramdisk won't help. Well, it should be relatively easy to compile a version of the kernel with it enabled, but you'll have to download the entirety of lineage's source to compile the kernel (even i find it a bit overkill, but it's what makes bluetooth work).

To download it and set things up, you'll need to follow this guide: https://wiki.lineageos.org/devices/h910/build#extract-proprietary-blobs

(pretty similar to other v20 models, i use h910 as a base since it's what i have).

Then follow the steps i provided on the kernel's github page to compile the kernel version you want depending on the branch you cloned once you have the lineage's tools and your device's proprietary blobs. To enable the driver it might be as simple as adding "CONFIG_USB_SERIAL_CH341=y" to kernelroot/arch/arm64/configs/msm-perf_defconfig, but i never used that driver, so i can't guarantee it'll work as easy as that.

I would try compiling a kernel with that driver enabled and send it here, but i'm currently busy porting a 4.4 kernel to the device on my free time and it will be a while until i have the time and disk space to setup lineage's tools here. If you have any problems, do share and i'll try to help.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Do I really need to build the whole LOS? Shouldn't the kernel itself be enough? I already have the zImage with the driver enabled.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Not really, by following the instructions on lineage's website until "brunch h910", then jumping to the github instructions you should end up compiling only the kernel, but you'll still need to use lineage's source for maximum compatibility.

But just for clarification, you have a Swan ZImage of the latest version (anything 1.08 upwards should be fine, but the latest 1.09+ is ideal) with the driver already enabled? If so, it should be working right out of the gate. Flashing a ZImage from an older kernel like gamma or even lineage's stock kernel will end up breaking things since Swan has a massively updated kernel version.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Ah got it, I'll do that. After that do I just unpack the boot.img and replace the boot-image with the newly built zImage? Or do I need to generate the ramdisk, make a whole flashable zip or something else?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Actually, if you run "mka kernel" instead of making a whole bootimage, you'll get a kernel ZImage-dtb in out/product/...(don't remember where exactly, it's a lot of subfolders and depends on the model)

So you'll only need to get it and override the zimage-dtb already in the flashable zip.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
I've finally gotten some spare time on my hands and started building the image. I setup the environment as described, followed the github instructions, but I'm getting an error, pic related, it doesn't say much which is quite frustrating. I set up a VM of Uma Mint because I didn't have enough space on my main drive... Got any idea of what might be going on?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Considering how many things are in lineage's repo, it could be a lot of things. First, it could be running out of memory. The soong build step can easily get 16GB of memory (main RAM + swap) by itself near the 4 minutes mark, and sometimes even a bit more than that on my linux machine without any VM, so check if you have things setup to account for that. If you have enough resources to build it, and also assuming you have a few extra gigs of disk space to finish building the kernel, there's another thing to look at:

I would try doing a repo sync --force-sync to check if all files are ok (placing the custom kernel in the kernel folder again afterwards).

If both fail, i dunno what might be happening over there as i never faced that problem in a way that wasn't solved by either of the solutions above. Since the build is failing before reaching the kernel compilation, maybe they have some info about such errors on lineage's docs.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
>RAM

Ah, that would make sense, I have dedicated "only" 8GB of RAM to that VM. I'll set up swap.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
It finally finished compiling last evening, now I've got the following file:

out/target/product/vs995/kernel: gzip compressed data, max compression, from Unix, original size modulo 2^32 7301488

Is it the right one and I just put it into the split boot.img and then repack it and replace it in the unzipped lineage folder, then zip again and flash?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Is there a "kernel_obj" folder? You should look for a "Image.gz-dtb" file inside that folder, and it's usually on kernel_obj/arch/arm64/boot or something along those lines when compiled with lineage's tools.

After you find that image.gz-dtb file, you only need to copy it to a folder with an anykernel script, or a zip containing it for that matter, zip it up (or just replace the image.gz from another v20 kernel) and flash it.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Unfortunately 'cd ~/android/lineage/ && find . -name ^kernel_obj*' finds nothing, so I'm afraid it's not there. I ran 'mka kernel' from the kernel root directory (~/android/lineage/kernel/lge/msm8996), and it compiled successfully, should I re-run it from the lineage root directory?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Yep, usually you need to run that command from lineage's root dir.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Alright, got the dtb file, it was located at lineageroot/out/target/product/vs995/obj/KERNEL_OBJ. Now I unzipped/zipped the swan kernel with the new dtb file, but when I try to flash it via TWRP I get the error "Invalid zip file format!\n Error installing zip file /external_sd/Swan-CH341_vs995_test.zip". I zipped it with 'zip -r --compression-method=deflate Swan-CH341_vs995_test.zip swan', but it shows up differently:

Swan-CH341_vs995_test.zip: Zip archive data, at least v1.0 to extract, compression method=store
Swan-VS995-Stable.zip: Zip archive data, at least v2.0 to extract, compression method=deflate

Is there a specific protocol to follow when zipping the kernel? One more question; is there any operationally significant difference between the US996 and the VS995 kernel (besides the locked/unlocked sim status)?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
First i would look at how the files are organized in that new zip file. If they're identical to the original kernel zip, it's the compression algorithm causing problems. I have an automatized zipping script for all those variants, and that's how i zip them all:

zip -r9 ../zipname.zip * -x *placeholder (the script goes into the folder that has the anykernel files and the dtb, then runs that code to zip everything in there, and excluding anything that has a "placeholdder" appended to it). I had some problems using the store method to zip kernels before, so that might be it.

And for the second question: No, they are nearly identical as far as the kernel is concerned (same for H910 and i guess H918 and LS997 as well since i've been shuffling some vs995 and us996 roms/kernels on my h910 for testing just fine). The only difference between them is that the US996 model could be unlocked officially a while ago, so it doesn't require a kernel patch to remove some visual glitches during boot. Besides that, the majority of the V20 variants are extremely similar.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Using the 9th level compression solved that particular problem. Now I get a different error: "Unsupported device. Aborting...\n Updater process ended with ERROR 1". I'm running LOS 18.1 for the VS995 (on the F800), I am positive I compiled the kernel for the same version of LOS, when I try to flash the unmodified kernel, it works. Any idea what might I be doing wrong?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Oh so you have an F800? I see, so it's the anykernel.sh that's not allowing the kernel to be installed because it was tailored for the VS995. Your phone is probably being passed on as a F800 in recovery so that's why it fails even if the rom is from vs995.

It should be as simple as adding those lines (replacing if there's any conflicts or repeated entries for the VS995) on the anykernel.sh and then zipping it again:

device.name3=f800

device.name4=F800

device.name5=elsa

device.name6=ELSA

I just didn't compile a swan build specific to the F800 cause i didn't find anyone to test it on, sorry if it's making things a bit too complicated.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
>anykernel.sh

I'm not using any script (at least knowingly), just zip(1L). Is it necessary?

>a bit too complicated

Not at all, I should be grateful for your time.

One more question, why would the other kernel (the original Swan for vs995) work then even if I'm flashing it on the F800.

Edit: Nevermind, I'm a retard, there is an anykernel.sh script in the unzipped folder.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
To flash a kernel, you need osmosis' anykernel template. It makes things much easier and skips a bunch of steps to flash a kernel into android phones.

In that case, are you just zipping the image.gz? If that's it, it would be best if you got a zip from a swan build, extracted it into a folder, replaced the image.gz-dtb with the one you compiled, added those lines above into the anykernel script, then zipped it all up to flash. Usually, the file structure in the flashable zip should be similar to the layout on the attached image right below.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
What I'm doing:

Downloaded the original Swan for vs995

Unzipped it

Replaced the Image.gz-dtb

Edited the anykernel.sh, pic related

Zipped it again (zip -r9 swan.zip swan/*)

Flashed it via TWRP

The zip's content:

Would that be the correct procedure?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Yep, that's it. Did it flash by doing that? Cause if not, i have no idea why it's failing given the device name is correct.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
It did not flash, still the same error, unfortunately.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
That's strange. For all i know, it should be complaining because of the device string. Do you have any other kernel that can be flashed through a zip on your phone? Maybe its anykernel script (if it even has one) has a key difference that allows it to flash... or the device check was simply disabled too, although that's unsafe.

But since all the files are correct including the Image.gz, i guess you can disable it to test. Just changing the do.devicecheck line to 0 in the anykernel script should skip that device check step that seems to be causing the flash error.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Strange, when I tried to flash the original kernel, it gave me the same error just now even though it flashed fine before. I disabled the check, it flashed successfully, no idea why it's doing that. I forgot how I checked for the CH341 module, I'll report back after I do.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Alright, now there is a file in /sys/bus/usb/drivers/ called ch341. Not sure if it was there before, but would I be correct to assume that the driver is installed and active on the device?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
At the very least it's installed. The only way to truly check if it is active and working is by testing something that uses it, cause the linux kernel can show it as active, but it might not work as intended.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Finally! Success! I've tried operating my 3d printer with Octoprint through a LinuxDeploy Debian install and it worked! Thank you so much for all of your help, I hope I wasn't too big of a nuisance. If I have any more related issues, I''l mention them here. Right now the only problem I'm facing is that LinuxDeploy doesn't play well with the device being turned off and simultaneously being operated on through ssh, resulting in it being slow, having networking/permission issues, etc. I've partially solved it thanks to this and this git issue as well as this app, I might look for a more elegant solution in the future, but for now this will suffice. I've also had some issues with not being able to read/write to /dev/ttyUSB1 (the serial port of the printer) even when a member of the 'dialout' and 'tty' groups, that was solved by 'chmod a+rw /dev/ttyUSB1', again, not an elegant solution.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Glad to know it worked! The fact it functioned fine on other kernels made me assume it was just that the driver was disabled, thankfully that was it and the upstreams didn't mess anything up on it.

Alright, don't hesitate to post other problems here, i'll see if i can get a easier way to compile this kernel later and get a bit more active here in case some difficulties start to crop up, but for now my time is almost entirely eaten up by other projects.

The tty groups are quite annoying to deal with, i was debugging the kernel's IR and serial interfaces with askermk2000 a few months ago and it seems a lot of random things use them for no real reason, so they must be causing some conflicts with those read/write operations. But of course i might be forgetting something since it was long ago.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
>i'll see if i can get a easier way to compile this kernel later

I still have the environment set up in the VM and free time on my hands, if there is anything I could help with just let me know and I'll try.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Don't worry. I have some ideas of what to do to simplify the process, but i faced some random bugs with the compiled image a while ago, so it will require a bit of kernel patching on my side to make everything work fine. I'll also need to check if it won't have problems with the kernel upstream, since i started using lineage's tools all the way back on 3.18.113 and never bothered to test anything else until now, but it's overkill to download nearly 100GB of files just to compile a kernel when the rest of the tools aren't even needed.

Who knows, maybe i'll get a newer toolchain to go with the kernel and optimize it a bit more with a few thing i've been learning from messing around with 4.4.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
Yeah, I had to allocate 200GB to the VM, 20 to swap and I was left with roughly around 30GB, it needs crazy amount of space.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Okay, took some time to make a build script for the kernel, and so far it works perfectly fine. Got no random bugs like the Bluetooth not working so either the kernel upstream somehow fixed it, or i messed something up on my previous script.

The good news is that things are WAY simpler now if anyone wants to compile it from source and tweak it now that i won't be updating the kernel too regularly (i might change the toolchains to newer ones, but that's for later). The steps are also on the github page.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
I'm back with not so pleasant news. Octoprint was working fine, so I assumed the serial driver was working, but for the past 2 days I've been trying to install Klipper firmware. It requires serial communication between the printer and the device through /dev/serial/by-id/id_of_the_printer, and doesn't work with /dev/ttyUSB0 on my device like Octoprint did. I'm surprised and disappointed, I have no idea what else I can try. Does anyone have any ideas?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Since that one is very specific, i have no idea how to help sadly, as it doesn't seem to be directly related to the driver's presence and might require actual fiddling with the code in the rom's device tree and kernel layout.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] wayase8080:
I understand. I appreciate the time you've spent helping me. If I find the solution, I'll post it in here.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Preparedtobereckless:
Thank you for your work here :) You are appreciated! <3
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Preparedtobereckless:
@AShiningRay What kernel manager do you use? the two im using cannot read the kernel at all. The kernel works, but both franco and Ex cant read the frequencies or anything.

Thank you!
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
No problem, i'm pretty busy right now, but i intend to get back to V20 development in a few weeks (maybe months). Gotta get Android 12 working on it after all...

I use SmartPack-Kernel Manager to handle those, it always worked fine from what i could test. Be sure that you have root working perfectly though, it can mess things up randomly sometimes.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Preparedtobereckless:
I just got SmartPack

<3

Ill try to stay updated with your developments. I enjoy making a device last as long as possible and the V20 does EVERYTHING i need and i have a massive battery. :) Thank you!
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] xxseva44:
Check root permissions.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Preparedtobereckless:
The standard package doesnt give me issues, the extreme was just not being read well by anything. I got it running, it works awesome. Thanks everyone!
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] itt533:
with the official kernel in LOS 18.1 stereo sound for video recording is not working. I'm not sure if that is related to kernel, is it? I was notifying that sound was getting too loud when using hifi DAC. Low sound with audio recording. I have to set 400% in AudioRecorder (downloadable in f-droid.org) and yet it's weak. AFAIK for IR this kernel still has a problem with time lag after each shot and It does not add FM radio support, does it?