yashsingh1/xdaforums huggingface dataset:
[LG V20 Guides, News, & Discussion] Leicxan:
Interesting, I found ls997 kernel source has both imx298 and s5k2p7 camera sensor support.

In our h990x varient source code they only support imx 298. And our h990 varient's source code is really outdated, LG release this on 2016 December and never update it.
[LG V20 Guides, News, & Discussion] :
Not asking or rushing.......can it be built into the werewolf kernel in the first post? I guess adding extra libs for camera sensor support would not harm even if not used by certain HD990 "models" (assuming there is HW difference). :highfive:
[LG V20 Guides, News, & Discussion] v0ne:
No camera issue here both two phones.

What I did:

1. Revert to 1st build firmware.

2. Factory reset.

3. Flash recovery (followed OP instructions)

4. In twrp do factory reset again.

5. Reboot to twrp recovery again

6. Flash the modified werewolf kernel for h990ds together with magisk.

5. Reboot and your good to go.

*Check if camera auto focus is working.

6. Update your build/firmware to latest using kdzwriter.

7. You can factory reset again in twrp (optional)

8. Hit OP's thanks button. :good:

*Note: Dont flash the attached kernel (both version 1 or 2). Just the modified werewolf kernel by Leicxan.

Im just sharing my experience guys, maybe can help someone :)

Anyway, xposed is working in our phone. :good:

Question. Is someone have dedloated scrip for our phone (h990ds). I have problem using TB in deleting certain lg & google apps. No idea what are the apps that can safetly remove. Thanks in advance.
[LG V20 Guides, News, & Discussion] admops:
Interesting.. do you have a link download/guide to follow? I afraid to install coz I read not stable in nougat yet.. whats your experience with the module?
[LG V20 Guides, News, & Discussion] reza_xdv:
Maybe I have found something about focus issue.

So I was on v10f and I downgraded to v10b, so I found out that the phone detects the rear camera as front camera, and the front camera as the rear camera. And when I go to camera settings I see the selfie camera is 16MP!!! and the back camera is 5MP!! :laugh:

I'm not rooted yet. I'll do a factory reset and let you know if it helps or not. Unfortunately I cannot install v10b via refurbish.

Edit 1: Factory reset just made the things worse. Camera won't open. Error: Camera error, camera unavailable. I'm downloading v10d and flashing it. Let's see what happens...

Edit 2: OK, I flashed v10d 1st December security update and the camera focus issue is fixed!!! Now I'm gonna root the device (Magisk) and install werewolf kernel.

Edit 3: I rooted my phone and unfortunately focus issue is present. As guys mentioned it's related to kernel. I hope someone release kernel fix soon. :(
[LG V20 Guides, News, & Discussion] jahlex:
Thanks for the tip. Worked like a charm. Unfortunately I have the focus issue with both werewolf and emdroidle kernels. Sounds like I will have to wait until a fix is found.
[LG V20 Guides, News, & Discussion] alliesquids:
Hopefully it is soon.. after there is a bugless camera with root this phone will be perfect
[LG V20 Guides, News, & Discussion] reza_xdv:
KDZ writer cannot upgrade my firmware, it gives this error and the system won't boot, even after reinstalling kernel.

What am I doing wrong?
[LG V20 Guides, News, & Discussion] OSaLaMiO:
Anyone knows how to know the camera model from my V20?
[LG V20 Guides, News, & Discussion] ahlok_hk:
Camera model can be checked by download and run an App called "Device Info HW"
[LG V20 Guides, News, & Discussion] jahlex:
Hum maybe I missed something but the app only gives the supported cameras. You'll get both Samsung & Sony on stock kernel. It won't tell which one is physically installed. But maybe you get further information when root ?
[LG V20 Guides, News, & Discussion] ahlok_hk:
I have no camera focus issue and see the following information under Camera. Can others who have camera focus issue help to check if the information is different?

HI553 : Front Camera

IMX219 : Back Wide Angle Camera

IMX298 : Back Main Camera
[LG V20 Guides, News, & Discussion] jahlex:
As I said : these are supported cameras. You don't have focus issue ? Lucky guy, you have Sony IMX298.

The list you have is basically the list of drivers, everyone with the root kernel will have the same list. This has nothing to do with the sensor physically present.

With stock kernel you have one more line for Samsung optic. That is what is missing in the root kernel.
[LG V20 Guides, News, & Discussion] v0ne:
Did you set the permission of kdz writer to 755?

This is what i did:

1. Push/copy the file to internal.

2. Extract and copy the kdz writer to sbin using this command "gunzip -c /kdzwriter.gz >/sbin/kdzwriter"

3. Set permission to 755. "chmod 755 /sbin/kdzwriter"

4. Reboot my phone again in twrp (optional)

5. Update the firmware using -a.

6. Flash kernel + magisk.

7. Reboot and done.

Note: double check the kdz writer in sbin. To be sure, set the permission manually (in advance / file manager / sbin -> kdzwriter then set to 755)

Hope this can help you. BTW, double check the firmware.kdz maybe its corrupted.
[LG V20 Guides, News, & Discussion] thubble:
add the "-M" (capital M) option to the command. This will prevent the preserving of kernel modules which sometimes causes problems, and just write the raw stock data to /system. Then, re-flash whatever custom kernel you use which will install the proper modules.
[LG V20 Guides, News, & Discussion] admops:
Nevermind.. got it working too.. OMG this is too sweet.. :D
[LG V20 Guides, News, & Discussion] reza_xdv:
Thank you a zillion times guys, I'll do what you said.
[LG V20 Guides, News, & Discussion] Hamodi:
Anyone got this working with 990 single sim ??
[LG V20 Guides, News, & Discussion] jahlex:
I followed what was explained. I extracted from my stock ROM what needs to be added in /system. I flashed it and s5k2p7 now appears as a supported camera in HW Device Info.

Focus is still not working because now we need a modification of the kernel. Normally, injecting the attached files in the kernel should fix the problem.

I never built a kernel myself, I don't want to mess up with something. Does anyone know how to build it surely ?
[LG V20 Guides, News, & Discussion] D4rk9009:
Do u goys knows BC where I can fine firmware before sec 1 and can I do it on my phone if I got adb or I need PC?
[LG V20 Guides, News, & Discussion] v0ne:
Hi guys, I found this v30 camera port for v20. Try to flash it and check if camera issue is gone on some. Btw, dont forget to backup your camera in system/prive-app and camera_config.xml in system/etc folders.

Heres the link for v20 ported by evilpotatoman: https://www.androidfilehost.com/?fid=673368273298984181

- tested on Tmobile but confirmed working on h990ds variant

Original theard by xpirt: https://xdaforums.com/lg-g6/themes/fulmics-rom-lg-v30-camera-graphy-t3666240

Question: Can someone have a debloted script for stock rom on v20? Thank you.
[LG V20 Guides, News, & Discussion] Redline:
If [MENTION=6984210]emdroidle[/MENTION] could merge these into his process of updating the kernel to the latest LineageOS one for the H990DS, this would be pretty damn sweet as it'd mean we'd have an updated kernel (when he's done with that side of things) with working focus, without having to flash seperate files. Using the wide angle camera is okay as a temporary fix, but I'm really starting to want the main camera focus back.

Or perhaps [MENTION=4394458]Leicxan[/MENTION] can merge these files into his Werewolf Kernel build in post #391 ?
[LG V20 Guides, News, & Discussion] jahlex:
Not gonna work to fix the focus issue. It is only the app. If the kernel doesn't provide what is necessary to make the sensor work, it will not change a thing.

Yep. I PM them yesterday. I tried to build emdroidle's v0.2 yesterday but couldn't make it and don't exactly understand what goes wrong :(
[LG V20 Guides, News, & Discussion] Leicxan:
I tried build kernel from LS997's kernel source. Build was succse, but I got kernel panic after reboot my phone.:eek: Seems LG didn't unify their kernel source.

I will try add that camera sensor from ls997's source to our h990 source later, not sure if this will succse.

Edit: I remember I saw H990DS has a specific kernel source on open source.lge.com, other variant like h990n h990tr they are share one kernel source.

Maybe I will check that when I have time.
[LG V20 Guides, News, & Discussion] jahlex:
Hi Leicxan,

the files I provided are exactly camera sensor from ls997's source. Could you try to build your kernel using these files please ? Or let me know how to build the kernel if you can't ?
[LG V20 Guides, News, & Discussion] Leicxan:
I tried to merge those file to our kernel today, build was success, but got kernel panic after reboot again.

If you want to build your self you can check my git. Thanks to ehem for his modem hack code.

There are tons of tutorial tell you how to build kernel from source on xda, use search to find it.
[LG V20 Guides, News, & Discussion] jahlex:
Thanks [MENTION=4394458]Leicxan[/MENTION]

Got build succes and kernel panic with your sources too (branch android-7.0-security) but it sounds like there were some changes since the kernel you released. Do you have the sources used to build the kernel you provided here : https://xdaforums.com/showpost.php?p=73294716&postcount=391

I'd like to try to modify [MENTION=6984210]emdroidle[/MENTION]'s sources but I can't compile it (branch v0.2-branch-BUILD) . Any idea why ? (Attached log). Specific toolchain ? Tried linaro 4.9 and Last android NDK...

drivers/bluetooth/bluetooth-pm.o:(.bss+0xd0): multiple definition of `sleep_dir'
drivers/bluetooth/msm_bt_sleep.o:(.bss+0x48): first defined here
drivers/bluetooth/bluetooth-pm.o: In function `bluetooth_pm_resume':
/home/alex/android_kernel_lge_msm8996-0.2-branch-BUILD/build/../drivers/bluetooth/bluetooth-pm.c:907: multiple definition of `sleep_workqueue'
drivers/bluetooth/msm_bt_sleep.o:/home/alex/android_kernel_lge_msm8996-0.2-branch-BUILD/build/../drivers/bluetooth/bluesleep.c:704: first defined here
drivers/bluetooth/bluetooth-pm.o: In function `bluetooth_pm_sleep_stop':
/home/alex/android_kernel_lge_msm8996-0.2-branch-BUILD/build/../drivers/bluetooth/bluetooth-pm.c:567: multiple definition of `bluetooth_dir'
drivers/bluetooth/msm_bt_sleep.o:/home/alex/android_kernel_lge_msm8996-0.2-branch-BUILD/build/../drivers/bluetooth/bluesleep.c:709: first defined here
../scripts/Makefile.build:336: recipe for target 'drivers/bluetooth/built-in.o' failed
make[3]: *** [drivers/bluetooth/built-in.o] Error 1
../scripts/Makefile.build:402: recipe for target 'drivers/bluetooth' failed
make[2]: *** [drivers/bluetooth] Error 2
/home/alex/android_kernel_lge_msm8996-0.2-branch-BUILD/Makefile:948: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2

../kernel/cpuset.c: In function 'cpuset_allow_attach':
../kernel/cpuset.c:2069:17: error: request for member 'val' in something not a structure or union
cred->euid.val != tcred->uid.val && cred->euid.val != tcred->suid.val)
^
../kernel/cpuset.c:2069:35: error: request for member 'val' in something not a structure or union
cred->euid.val != tcred->uid.val && cred->euid.val != tcred->suid.val)
^
../kernel/cpuset.c:2069:53: error: request for member 'val' in something not a structure or union
cred->euid.val != tcred->uid.val && cred->euid.val != tcred->suid.val)
^
../kernel/cpuset.c:2069:72: error: request for member 'val' in something not a structure or union
cred->euid.val != tcred->uid.val && cred->euid.val != tcred->suid.val)
^
../scripts/Makefile.build:257: recipe for target 'kernel/cpuset.o' failed
make[2]: *** [kernel/cpuset.o] Error 1
/home/alex/android_kernel_lge_msm8996-0.2-branch-BUILD/Makefile:948: recipe for target 'kernel' failed
make[1]: *** [kernel] Error 2
[LG V20 Guides, News, & Discussion] Leicxan:
It seems bluetooth dirver has problem, which defconfig did you use?
[LG V20 Guides, News, & Discussion] jahlex:
Used lineageos_h990_defconfig

To me it sounds like pure C syntax issues. If these are the exact sources used to build the v0.2 kernel provided, then I would suspect a matter of interpretation by the compiler that's why I was suspecting the toolchain.

Do you successfully build the branch v0.2-branch-BUILD of emdroidle ?

PS : and don't miss my other question :

Thanks ;)
[LG V20 Guides, News, & Discussion] Leicxan:
No, I didn't build his v0.2-branch, but I successfully built his v0.1 branch in July, you should try use this defconfig: elsa_global_com-vanilla_defconfig

And for my modified werewolf kernel source, I cloned from that kernel's stock branch, link here, I didn't fork it.
[LG V20 Guides, News, & Discussion] jahlex:
OK guys, I think I got it. Working on my H990DS root and focus working with s5k2p7 sensor.

This is nothing more than the v0.2 kernel of emdroidle + s5k2p7 drivers.

Need some beta testers here, just use this kernel instead of emdroidle's.

EDIT : updated v0.2b with texfat

EDIT 2 : updated v0.2d with cam & power drivers from LS997
[LG V20 Guides, News, & Discussion] farwish:
Hey man, can I say I love you ？

Thanks so much
[LG V20 Guides, News, & Discussion] Redline:
Confirmed working on my H990DS. This is huge. Thanks so much!

On a side note, after rebooting, flashing and rebooting again, my SD Card came up as corrupted in Android. Not sure if this was related to any changes in [MENTION=6984210]emdroidle[/MENTION] 's kernel as opposed to the stock one I was using, but just something to note.
[LG V20 Guides, News, & Discussion] Leicxan:
Hi jahlex,

please rename exfat.ko to texfat.ko in your zip file.

I think your SD Card format should be exfat, jahlex's kernel has this model, but lg use tuxera's exfat model in their stock kernel, so that exfat.ko file should rename to texfat.ko
[LG V20 Guides, News, & Discussion] Redline:
It already was. I remember reading through commits on Em's Github and seeing some stuff about changing filesystems to work better, that might be it. Anyway, TWRP and Windows can both still read it fine, so I'll just copy everything off it, format and then copy back.
[LG V20 Guides, News, & Discussion] ahmedyar91:
Thank Buddy :):):):)

I Will test it right away
[LG V20 Guides, News, & Discussion] emdroidle:
There haven't been any reports, but this is likely to work with any H990 variant. Until someone with a single-SIM device tries, and reports success or failure, we won't know.

The one thing I know is for the H990TR there is a problem due to the earliest KDZ file being from January, 10a was needed, but only 10b was found. This is risky, but there is a good chance a H990DS or any other H990* KDZ file will work on a H990TR. If LGUP is willing to install the Australian 10d or Taiwan 10c, then you're golden (I suggest these two as they're bloatware free).

If normal LGUP is unwilling to install those on a H990TR, then I suspect a technique analogous to the one used for updated H910s will work. The only difference is to install a H990 December KDZ. This is very risky.

Note: VoLTE support is very poor for the Taiwan KDZ, an Australian KDZ is likely better. I believe the Singapore and Korean (H990N) KDZs will have better VoLTE, but quite a lot of bloatware.

Where did those files come from? There is no Copyright notice. I suspect they may originate from LGE based on the code, but I'm curious which channel they came through. Oh, they come from the post you linked to, hrmm, now to ask there. Sounds like you managed to complete the kernel build, congratulations!

I believe all the H990* variants share their kernel source, it is merely the US models which have a different kernel. The annoying bit is when looking at http://opensource.lge.com/ they make it rather non-obvious that those are all copies of the same file.

Hey! Wait-a-minute there! Heathen! :)

[MENTION=4394458]Leicxan[/MENTION] was giving you the solution to this. My kernel source builds/ships with the "exfat-nofuse" module for handling the ExFAT filesystem. Trick is "exfat-nofuse" builds as the module "exfat.ko", but LG's Android image expects to load "texfat.ko" instead.

With /system mounted read-write simply run `mv /system/lib/modules/exfat.ko /system/lib/modules/texfat.ko` and this will be solved for you.

I'd like to know the source of those files before I build a kernel with them. I've got some pretty obvious guesses as to where they came from, but that will take a bit to confirm. They mostly look pretty sane and nothing jumps out at me as being malicious, but caution is the better part of valor...

Though even the mere filenames are highly valuable since that tells me which precise files are where the problem is (there are 232 files in drivers/media/platform/msm/camera_v2, while this narrows it down to 3 files).

I'm inclined to try grabbing the equivalent files from pure LGE source and use those instead.
[LG V20 Guides, News, & Discussion] jody2k:
Good work guys love it, could anyone post me a "safe" procedure to root my phone from scratch with this kernel? Im following the process in thia thread since 1 week my phone is still stock atm :)
[LG V20 Guides, News, & Discussion] admops:
Thank you for your fix is working about camera focus ? but I had another issue now about recording video.. after boot up and I take vid record (screen not off) its doing fine... but after screen is off and I left it about a minute and try record again, the vid become freeze.. could you check ot out? thanks..
[LG V20 Guides, News, & Discussion] jahlex:
Done here (v0.2b) : https://xdaforums.com/showpost.php?p=73770419&postcount=648

---------- Post added at 09:18 AM ---------- Previous post was at 09:11 AM ----------

Coming from here actually : https://github.com/SaintZ13/schwift...ivers/media/platform/msm/camera_v2/sensor/ois

---------- Post added at 09:37 AM ---------- Previous post was at 09:18 AM ----------

Just tried and couldn't reproduce the issue :confused:

---------- Post added at 09:42 AM ---------- Previous post was at 09:37 AM ----------

Just follow the procedure in 1st post and :

- at step #16, instead of typing "fastboot reboot" just unplug the USB cable and remove the battery. Then continue to follow the procedure.

- at step #17, use my modified version of emdroidle's v0.2 kernel

But keep in mind that nothing is safe in this world...
[LG V20 Guides, News, & Discussion] Mars104:
You did it! Cheers. Now we have the perfect phone. It was worth the wait ?
[LG V20 Guides, News, & Discussion] jody2k:
Thank you for the explanation should i use the new 0.2B for my 990ds? Or just the previous modified 0.2?
[LG V20 Guides, News, & Discussion] jahlex:
0.2b. I removed the previous one (exfat story).
[LG V20 Guides, News, & Discussion] shivaagarwal1:
Does this solve the video issue as well? Actually I was not having any camera focus issue but just the video recording problem.
[LG V20 Guides, News, & Discussion] jahlex:
If you don't have focus issue then there is no reason why this kernel would solve anything for you.

What is exactly the recording issue you are talking about ?
[LG V20 Guides, News, & Discussion] shivaagarwal1:
Whenever I record a video, it only records sound and the first frame of the video as video. It's like a still photo with audio.
[LG V20 Guides, News, & Discussion] jahlex:
Oh right, I have the same issue. It sounds like only the last frame of the video is recorded. :mad:

No idea how to fix that for now... :confused:
[LG V20 Guides, News, & Discussion] admops:
Yes that is exactly what Im having.. but mine just happen if screen off more than 1 minute.. well thank God Im not the only one.. the screen just freeze like taking a pic but the sound still record it..
[LG V20 Guides, News, & Discussion] shivaagarwal1:
Yes same issue.
[LG V20 Guides, News, & Discussion] ahmedyar91:
Did you try this.? for people that only have static video recording issue flashed this and got it working

https://xdaforums.com/showpost.php?p=73294716&postcount=391

[MENTION=1657835]jahlex[/MENTION] Can you try and build Leicxan kernel + s5k2p7 drivers .?

I think you should contact [MENTION=5103965]Omar-Avelar[/MENTION] may be he can help us, because he has fixed all camera issues in all variant of us996
[LG V20 Guides, News, & Discussion] shivaagarwal1:
Yes the video is fixed after flashing this kernel. Thanks mate. I don't think there are any other issues with my phone now.
[LG V20 Guides, News, & Discussion] Ryrzy:
hello friends, i have problem with flash TWRP in H990DS, all steps are ok, but at the end (after fastboot flashing recovery), after reboot screen is fuc*d up :) i think it is boot problem, but hot to fix it ?
[LG V20 Guides, News, & Discussion] ahmedyar91:
Great :):) press thanks if it was helpful

Yeah, most of the people have faced STATIC Screen after flashing TWRP. it is because the TWRP is not flashed prorperly

Try to reflash TWRP with the same command in fastboot mode,
[LG V20 Guides, News, & Discussion] admops:
Did you try camera focus working or not?
[LG V20 Guides, News, & Discussion] Ryrzy:
not static screen... it have loot of colors etc. nothing see on it, but phone is normaly booted...
[LG V20 Guides, News, & Discussion] ahmedyar91:
like this .?
[LG V20 Guides, News, & Discussion] jahlex:
I can try but not sure of the sources I have to use. [MENTION=4394458]Leicxan[/MENTION] : I understood that the basis is this : https://github.com/USA-RedDragon/kernel_lge_v20/tree/stock (branch "stock" right ?). And then what did you merge extactly from emdroidle's sources ?

I will also probably try to build another version of emdroidle's kernel including all the cam drivers from LS997 sources. It seems that s5k2p7 drivers are not the only difference. We'll see.
[LG V20 Guides, News, & Discussion] shivaagarwal1:
Yes working
[LG V20 Guides, News, & Discussion] jahlex:
Correct me if I'm wrong but you did not have focus issue with emdroidle's kernel, right ? Meaning that you don't have Samsung sensor but Sony's. So for you it works... but not for people with Samsung sensor.
[LG V20 Guides, News, & Discussion] shivaagarwal1:
Nope no issue with camera focus with his kernel. How do I check if I have samsung sensor or sony?
[LG V20 Guides, News, & Discussion] jahlex:
You can't but if you don't have focus issue with emdroidle's kernel, you have Sony, no doubt.
[LG V20 Guides, News, & Discussion] jody2k:
Managed to install the kernel and unlock my bootloader and install TWRP jeej ;)

Camera focus working fine which we are grateful !

One little question: As the only way to unlock my phone and root was downgrade my firmware on a old one from december 2016

Is there any way to upgrade the firmware without losing root, twrp and the custom kernel for the H990DS?
[LG V20 Guides, News, & Discussion] admops:
Glad if its working out for you.. but mine not.. so now I had to choose kernel between recording or just taking a pic.. :crying:
[LG V20 Guides, News, & Discussion] jahlex:
Link on the 1st post : https://xdaforums.com/v20/development/tool-kdz-writer-t3649818
[LG V20 Guides, News, & Discussion] shivaagarwal1:
Yes kdzwriter.. refer OP
[LG V20 Guides, News, & Discussion] jahlex:
If you manage to take at least 24 pics by second, then you'll have your video ! :good:
[LG V20 Guides, News, & Discussion] Redline:
On a sidenote, I've noticed that since flashing this kernel over the stock one you get from KDZs, fast charging no longer appears to work (or at least the notification for it no longer comes up). Any idea why this might be? Have tested with both the OEM charger and cable and a third party one.
[LG V20 Guides, News, & Discussion] shivaagarwal1:
Working fine for me.
[LG V20 Guides, News, & Discussion] alliesquids:
A restart with the new kernel seems to make video recording work, so it is a slight annoyance but not impossible to live with.

Glad to finally have auto focus with root finally :)
[LG V20 Guides, News, & Discussion] Ryrzy:
yes, exactly
[LG V20 Guides, News, & Discussion] Leicxan:
Yes, stock branch.

Then cherry pick those commit from emdroidle's source.

"Implementation of DirtySanta "smem" cleanup code"

"Add support for reading modem/SIM information from command-line"

Those two are Dirty Santa modem hack. And you also need add his defconfig change for Dirty Santa.