yashsingh1/xdaforums huggingface dataset:
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] dextructor:
Since I don't play any games anymore on my phone since Clash Royale many, many years ago, the most intensive thing that I do it's occasionally video-calling via Telegram FOSS. But let me tell about my history with this V20 H990DS

I bought this device used, and the seller said that the battery needed to be replaced, and randomly it gave me green-screen reboot messages when below 30% and the thermals wasn't great because it was the end of summer here in Brazil. Since everywhere that I searched about buying new LG batteries anyone tells that it's hard to find a real original and reliable I decided to try this one from Aliexpress, and also ordered some copper shims (0.5mm and 0.6mm) to put thermal paste and improve things. And a 128GB SDcard since it was cheap now (compared to years ago... I tested with H2testw and it works perfectly)

So the battery arrived first, and even before it arrived I installed the Lineage 19 and with the new 4.X Kernel it almost never gave me more green-screen reboots, but few random reboots when below 35%.

With Lineage 18 + SwanKernel Extreme gave the most stable scenario but only one time I did try to video-call with Telegram and it went stable, but slow (probably due underclock, maybe?)

But last Friday using the new battery I tried to video-call through Telegram some relatives that live abroad, and with only 5 minutes of calling it rebooted and was warm-ish? So the copper shims arrived early that week and I decided to do the thermal mod this week.

With the 0.6mm it pressed the LCD giving a darker spot, so I decided to replace with the 0.5mm, put new thermal paste and try again... So no dark spot on the screen.

I installed Telegram on other computer and tried to call and test the V20, but it still reboots after some time, but the strange thing it never reaches 62 or higher.

I tried the CPU Throttling Test to test the thermals and it barely reaches 60 with the Extreme+Gaming or with only Extreme as well.

So after all of this, I remember that H990DS have the reputation for drawing a lot of power:

1) Even a "compatible non OEM" battery can't provide what this device demands in terms of power consumption?

2) Having a dual-sim gives me freedom in terms of separate personal-work calls etc and not having to carry 2 phones. Could a dual sim card adapter could be a better approach?

3) There's a chance that this H990DS motherboard it's problematic/defective somehow and replacing with another H990DS would fix things (or even a H990 non-DS with that dual-sim adapter)?

4) The random reboots could give some useful information somehow for you devs? And how the best way to collect it?

5) Are video-calling that demanding, even if it don't reach the same temperatures that the pure CPU stress?

6) Any tips, suggestions?

Thanks!

PS: @xxseva44 sorry I couldn't give you the logs, but the instability/problems here are taking much more time that I initially planned.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] ROMSG:
Try using smartpack kernel manager (root required) and set the CPU frequency on the big cores to 1.8ghz and 1.5ghz on the little cores. The H990DS variant in particular tends to have higher peak power draw than other variants in situations where cell reception is poor. Which can cause instability. Underclocking the CPU seems to help.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
First of all, have you checked the battery's capacity and general data through AccuBattery or another similar app? It's a good way to see if the voltages and current are right.

Charge it 5 or so times from 20% to 80% (though charging anything more than 50% should work) and see what it reports on battery health, assuming you didn't do that already of course.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] dextructor:
I did that and I couldn't tell from my type of usage that I noticed any slowdown on my device, but unfortunately didn't "solve" the issue. Underclock can help to consume less battery and I'm using the Extreme variant of this Kernel that should be undervolted , but thanks for the suggestion.

I've heard of AccuBattery in the past, but never really installed until now.

Well of all 3 batteries that I have (1 OEM and 2 from Aliexpress) only the OEM can really charge to 100%, the others varies, sometimes using chargers from LG, Samsung (that it's compatible with QC 2.0) and a plethora of cables the batteries reaches 70% to 85% and stop charging.

I installed the AccuBattery Pro and tested in different scenarios from the CPU Throttling Test consuming ~1400 and with AnTuTu Stress reaching ~2050, but after a while stabilized in ~1400.

When tested with video-call with Telegram the measure from AccuBattery was ~2300 even 2415 and dropped eventually to ~1900.

So this H990DS can't handle this type of power consumption, the battery that's the culprit? Or just "bad luck" in general?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
One way of checking if the battery is to blame is by letting AccuBattery measure its health after a few charges. A healthy battery has a capacity reading that's near its labeled capacity, and that is usually a good indicator that it can consistently supply the phone with higher levels of current.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Draknodd:
Hi,

I did more test with the safe kernel variant to avoid the bcl throttling and get good performance.

First of all I set at boot with smartpack kernel manager:

1- max CPU freq 1998mhz

2- Disabled bcl running a sh script "echo disable > /sys/devices/soc/soc:qcom,bcl/mode"

In this way the CPU clock is not constantly throttled at 1036mhz (bcl is triggered despite the battery % and the battery is a 10000mah with health at 88% measured with accubattery)

The folkowing screenshits are the result with throttling test to check if temperatures are under control and the result of geekbench 6.

Compared to other lg v20 present in the geekbench database this result is above average (and very high is you consider that the phone is underclocked)

My theory is that the bcl is not reading the battery values correctly or it is not configured properly since with this setup I don't have any kind of reboot or sign of instability.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
The weird thing is that according to qcom's documentation, the way it is currently set up should throttle the phone once the battery reaches critical levels, if it is triggering no matter what and the battery in question is confirmed to be good, i think the most sensible explanation is that bcl behavior changed in 4.4, but qcom's docs weren't updated to reflect that (you'd be surprised with the amount of times this has happened before), because bcl reads from the same sensors your apps do, so what you see there is what bcl also gets.

I'll see if i can spare some time in the coming days to take another shot at BCL, something doesn't look right.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Draknodd:
@AShiningRay Hi, I saw that you did more tweaking on the kernel (check on your github) regarding the BCL. Will there be a new beta release so that I can give some feedback?

Another thing that I noticed is that the GPU freq is stuck at 133mhz with the default governor. Setting the simple_ondemand governor with power level of 4 has reduced the animations lag and the freq now scales with the load. Do you know why this might happen?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Those BCL tweaks were pushed fairly late in the night over here (and G5+G6 only received it right now), so i didn't have time to actually build everything yet, but yes, there will be a new build soon... probably the last one before LOS 20 arrives, given how little has been changed on the kernel lately.

As for GPU frequency, that's definitely not normal, and also doesn't happen here. If it kept stuck at 133 with the default governor, it wouldn't rank on the upper echelon of msm8996 devices on 3dmark. What does happen is that msm-adreno-tz is fairly more conservative than simple_ondemand, so most UI tasks aren't enough to ramp the GPU up... we thought of increasing the minimum frequency to 214MHz in order to improve UI performance, but it didn't seem necessary for LOS-19.1 when the phone isn't bogged down by BCL, and also because the GPU is by far the most power-hungry processor on the phone, despite the CPU being the hothead.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Draknodd:
I'll keep an eye on the releases on github then.

About the GPU that's actually nice to ear, I noticed that ondemand is really power hungry. I'll check the gpu frequency while doing some benchmark then. If I find is still laggy I could just decrese the powerlevel from 6 which is the default to 5 (I have a perfine 10500mah battery so a bit more of battery drain does not really concern me).
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
06/17/2023 build is up!​

BCL should be behaving better now and random reboots will likely be far reduced in quantity (at least it is for the internal team including me), and if it isn't, there's not much else that can be done to mitigate it on the kernel, LGE's USB and power stack on stock is far too different and messy to feasibly implement on 4.4.

That BCL change will also show up on the next LOS build.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Draknodd:
Everything seems to be good with this build.

I'll stress the phone in particular when the battery is low (<30%) and report back!
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] loyukfai:
Sorry for off topic, but do you mean Los 20 will be available soon?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Nah, just that there aren't gonna be enough changes to the kernel to warrant another release before LOS 20... not that 20 is THAT far off, we're close but there's still a few minor things to iron out.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] dextructor:
I realize that when upgrading to the latest versions of Lineage there's a retention script that reinstall Magisk every time so I don't need to flash again after updates.

Did you or anyone on the team analyzed the viability of applying such methods to this custom kernel? What are the downsides?

I know that it's always a thing to balance: convenience and reliability, but I was curious about this topic.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
That's not possible on a kernel flashable for a variety of reasons. Magisk survives dirty flashes because its addon scripts aren't placed on /system or /boot, partitions that are usually overridden on a ROM update. The kernel on the other hand is that exact /boot partition once flashed.

So the only way to allow for a similar functionality for kernel zips would be to hard-code a path on /data where the flashable zip must go into, add that path into an addon.d script and make it so the script will only automatically reinstall the kernel after flashing a rom (how you would detect that a rom is being flashed and not another kernel or whatever, i don't know).

It's just too much work for little to no gain, with a risk of causing trouble for users on top of that.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] dextructor:
I've imagined that wouldn't be worth the trouble, but since the lack of technical information about this topic wasn't very clear to me.

Anyway, thanks for the clarifications as always and the good job on the kernel
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Draknodd:
Did a stress tests with 10% battery.. solid as a rock!
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] FeNo2:
I have an H918 with stock/rooted 20h firmware. Last night I did a backup (thankfully) and tried to boot after installing this kernel and it seemed to hang at the pink Tmobile boot screen. I let it sit there for a couple minutes and nothing happened. I just did a restore and I'm back in business.

I used H918_v0.1-BETA8-Swan2000-Safe.zip
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] ROMSG:
this kernel is for custom roms, Stock is not supported
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Black6spdZ:
Not sure it its OS or kernel related but the past few 19.1 builds and now even 20 has charging issues.. Anyone else noticed this?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] dextructor:
Didn't have any charging issues on my H990N on both Lineage 19 and Lineage 20 using the Extreme version for months. (And this dual-sim uses more battery than other variants and it's more sensible to battery issues)

The only issue was when using some 3rd party battery that couldn't charge above 67% or 70% and other bad behaviors below 40%. So I returned this piece of junk and acquired a reliable Perfine battery that didn't give me any troubles.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Black6spdZ:
also using extreme with a perfine battery.. when the voltage gets low it looks like fast charging or maybe all charging is disabled.. 8.03 stopped charging with screen off
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] dextructor:
I must confess that my Oneplus 3 made me a little spoiled in regards to the charging technology, because it's more constant and reliable, and quick charge can be really picky on how it's activated and other times won't work, but it's usually for safety reasons.

I use AccuBattery and when I'm chargjng, I avoid doing heavy use of the device, to ensure the best scenario of my battery health overall.

But even so I watch videos while charging and keeping an eye on the monitor, and sometimes it drops to 0, but doesn't keep it for less than 30 seconds and resumes the usual charging speeds.

What exactly are you having trouble?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] dextructor:
Well, I try my best but couldn't make the Bluetooth work on Lineage OS 20, even on a clean install. Otherwise all functions that I daily need are fully working

So @AShiningRay how can I proper report it?

Thanks!
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Black6spdZ:
now that you mention it I'm also unable to use BT
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
No need to report anything, i already know what the issue is (especially if BT works with lineage's own kernel): Swan2000 needs a new release, we changed the bluetooth drivers since the last release and that made it into Lineage's kernel, but there has been no Swan2000 release with that just yet... partly because it won't work on LOS 19.1 and also because i'm in the last stages of setting up everything for the DAC overhaul.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
08/28/2023 build is up!​

Ayy, time for another one... that took a while, but it's here to (kinda) celebrate the LOS 20 release! And what better way to celebrate than with a ton of changes under the hood?

Quick Summary:

We're now using Link-Time Optimization alongside the latest GCC releases, resulting in an even smaller and more optimized kernel.​

This new release now fully supports LOS 20, and that includes Bluetooth.​

It now runs on the latest MSM8998 tag from lineage's repos, with a bunch of fixes on top.​
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
And since our V20 is the special one, it has a major feature of its own arriving soon: A completely revamped Quad-DAC Panel, including many options never seen before in any other LG device to date! (or any other device sporting an ESS DAC as far as i can tell)

Screenshots of a bleeding edge build, courtesy of @xxseva44:

I've been busy those last few days alongside him in order to pack all those features into the panel, and, so far, everything works miles better than on LOS 19.1 and the current DAC implementation on LOS 20, so stay tuned!
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] taketwicedailey:
I am very excited for this! I hope there will be some documentation somewhere, where people like me who are into good audio, but don't necessarily know what all of this options mean, can learn about what they do.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] taketwicedailey:
I am experiencing a crash whenever I play music from Spotify at max volume using the built-in speaker. One notch below max volume is fine, but once you hit max, instant crash and reboot.

I don't know if this is related to LineageOS 20 or just this kernel.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Can't say i had that on my H910 with either. Strange...

Since it's rather easy to replicate on your end, try getting a ramoops file right after it restarts. Just hold the button combo to enter factory reset, go into recovery, enable ADB, run "adb shell" on a terminal then "adb cat /sys/fs/pstore/console-ramoops-0", and send the last 300 or so lines here.

Assuming you get a ramoops of course, cause if you don't, it probably won't be a bug in the kernel.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] taketwicedailey:
It seems I did not get a ramoops.

But the problem has now gone away with the latest release of LOS20, so I assume that was the culprit.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] andruyd:
@AShiningRay Were there any change for stuff related to bluetooth between the first two kernel releases and the third (current) one? I'm troubleshooting an issue I have with a bluetooth device that I have. It wouldn't work with stock LOS20 or any combination of Swan Kernel releases. It only works with stock LOS19 or any combination of Swan Kernel on the first two releases. My other (headphones/speakers) bluetooth gear works in all cases.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] dextructor:
You can read part of the discussion of the improvement and what you can expect and why.

And of course the datasheet of our V20's DAC ES9218P that can help understand some modes and tweaks implemented, but that's not the end of your search.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Yeah, from the last two versions to this one, and from LOS 19.1 to 20, just about the whole Bluetooth stack changed, we even swapped kernel drivers, going from BRCM V4L2 (supports FM but just wasn't cutting it for Android 13) to BCM43xx, which was what we were using on LOS 18.1 and earlier if i'm not mistaken, but now with some updates.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] andruyd:
When you say Bluetooth stack changed, do you mean to Gabeldorsche? Thanks BTW, at least I've got an idea where things could be going wrong.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] Black6spdZ:
Im seeing amazing battery life with LOS20 and this kernel
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
No, i mean everything that does actually make a major difference on bluetooth functionality, that being kernel drivers and bluetooth firmwares.

The only Google-centric BT changes came in with Android 13, which has a BT subsystem that's a lot stricter at enforcing capability compliance in order to simply turn it on, and it's also why we had to shuffle some BT firmwares around... just so our bluetooth firmwares and drivers weren't as much of a mess as they were before LOS 20.

Edit: So what i'm saying is, if you're having trouble with some of your devices on anything besides LOS 19, that could very well be because we changed from BCM43xx to BRCM V4L2 from LOS 18.1 to 19.1, then back to BCM43xx on LOS 20, which is the only one that works for now.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Good source. In fact, those coefficients from the custom filter are based entirely on the documentation inside that datasheet. Figured we could just expose the supported simmetries, shapes and Stage 2 coefficients to get most of the benefits without needing to explode the UI with 142 knobs to account for both stage 1's 128 coefficients and stage 2's 16. We ended up with 14 knobs since the last two Stage 2 coefficients must remain as 0 at all times.

In short, exposing only Stage 2 coefficients allows us to give users a "default" Finite Impulse Response format provided by the pre-set Stage 1 coefficients inside the kernel driver (which are identical to the "sine phase fast roll-off" filter), while giving them the option to tune that curve for enhanced clarity, bass, mids, or a mix of those by tweaking the weights (or emphasis) the filter lays over the frequency ranges.

By default the Stage 2 coefficients are all zeroed, so it won't apply any tweaks to the original impulse response provided by stage 1, so it will sound different from sine phase fast roll-off, which has preset values for Stage 2.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] andruyd:
After a few skip releases, I tried LOS20 and Swan Kernel for LOS20 again today but my non-audio devices still won't work. These devices worked fine until LOS20. Do you know of any work a rounds?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
Nope. The only thing i can think of is that the reworked BT stack broke that functionality (although mine still connects to pretty much everything i have over BT), and if that's the case, we're out of luck because going back to V4L2 is not viable at this point.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] andruyd:
I saw a post on the main LOS20 thread about switching a file called BCM43xx.hcd. Is there an equivalent file I can copy from LOS19 to LOS20?
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] andruyd:
Let me correct myself, it doesn't work for this wearable. I haven't tried to pair it with a keyboard. I only have bluetooth audio speakers and headphones to test with.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
It won't work, that hcd relates to the BCM firmwares we were shuffling around in order to get BT to work at all on some models, it either works, or BT won't even turn on if you have the wrong firmware, it shouldn't fix specific connections to any device in any way. If it worked on LOS 19, you won't be able to drop anything BT related from it to LOS 20 because LOS 19 uses the BRCM V4L2 stack for BT (which includes support for FM Radio), not BCM43xx.

If anything, that issue should be located somewhere on the rom side of things and not the firmware, unless it fails on LOS 18.1 or older which also uses BCM43xx. I'd check with @xxseva44 or @ROMSG to see if that is a possibility, since i don't have any wearables to test.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] andruyd:
This wearable wasn't able to pair in LOS20. It worked in all previous LOS for LG V20.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] xxseva44:
The issue seems to be in FW. The only devices experiencing the issue are devices using the BCM4345C0 firmware, aka h990. I tested my v20 which uses the BCM4358A3 fw and my pixel watch worked just fine. The issue seems to be isolated to just the BCM4345C0 FW. Solution? No clue. Given the newer, more strict stack being used, it'll be an interesting challenge to try and pin point the issue, and add some sort of bypass, since we can't source newer fw.
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] AShiningRay:
So it's yet another issue exclusive to H990? Amazing, we should make a list at this point...
[LG V20 ROMs, Kernels, Recoveries, & Other Developm] xxseva44:
We probably should.