yashsingh1/xdaforums huggingface dataset:
[G4 Android Development] Daniel071:
I've tried disabling and enabling the battery saving feature and it doesn't really make much of a difference. I've also tried rebooting however, the freezing still occurs. I also noticed that the freezing occurs much more frequently on Youtube Vanced, for Reddit and other apps it only freezes occasionally.
[G4 Android Development] steadfasterX:
When the freezing happens do this:

adb shell
logcat -b all -d | egrep -i "thermal|kill" > /sdcard/Download/log.txt
ps -A >> /sdcard/Download/log.txt
free -m >> /sdcard/Download/log.txt
logcat -b crash -d >> /sdcard/Download/log.txt
exit
adb pull /sdcard/Download/log.txt

Share the log.txt as an attachment of your reply (bc txt is fine for that) or as usual by a paste service
[G4 Android Development] Daniel071:
I ran the above commands when my LG G4 froze while in the launcher,

Here is the logcat:

https://gist.github.com/daniel071/27597c0290754ea671c85eb74921ccd4
[G4 Android Development] steadfasterX:
thx that helps

.-
[G4 Android Development] steadfasterX:
[MENTION=10862029]Daniel071[/MENTION] , [MENTION=2241754]bel57[/MENTION] , [MENTION=5887387]Feduz[/MENTION]

if you like pls test the following.

extract the attached file

boot to TWRP/SHRP

exec:

adb shell mount /system
adb push init.qcom.post_boot.sh /system/vendor/bin/
adb shell
chcon u:object_r:qti_init_shell_exec:s0 /system/vendor/bin/init.qcom.post_boot.sh
sync
reboot

test. if the issues occur again share the debug info again as described here
[G4 Android Development] Daniel071:
Still have the same freezing (it's worse now)

I ran the above commands, and I constantly got these warnings while running them:

linker: /system/etc/ld.config.txt:21: warning: property "namespace.default.search.paths +" redefinition
WARNING: linker: /system/etc/ld.config.txt:21: warning: property "namespace.default.search.paths +" redefinition
linker: /system/etc/ld.config.txt:25: warning: property "namespace.default.asan.search.paths +" redefinition
WARNING: linker: /system/etc/ld.config.txt:25: warning: property "namespace.default.asan.search.paths +" redefinition
linker: /system/etc/ld.config.txt:26: warning: property "namespace.default.asan.search.paths +" redefinition
WARNING: linker: /system/etc/ld.config.txt:26: warning: property "namespace.default.asan.search.paths +" redefinition
linker: /system/etc/ld.config.txt:27: warning: property "namespace.default.asan.search.paths +" redefinition
WARNING: linker: /system/etc/ld.config.txt:27: warning: property "namespace.default.asan.search.paths +" redefinition
linker: /system/etc/ld.config.txt:28: warning: property "namespace.default.asan.search.paths +" redefinition
WARNING: linker: /system/etc/ld.config.txt:28: warning: property "namespace.default.asan.search.paths +" redefinition

It seemed to be successful however, I still get constant lagging and freezing.

Here's the logcat:

(While I was running the commands, my phone froze for about 2 minutes, much longer than previously)

https://gist.github.com/daniel071/8f2d7bc6dfb5bf9eb91e71412a355bd4

EDIT:

My phone becomes very unresponsive, very frequently even after setting SELinux to permissive, should I revert the commands you gave me and if so, how?
[G4 Android Development] steadfasterX:
uhm .. which TWRP version?

-.
[G4 Android Development] Daniel071:
TWRP version 3.3.1-1

I got it from:

https://twrp.me/lg/lgg4.html
[G4 Android Development] steadfasterX:
yes that explains it. the official one is incompatible with PIE. First flash the latest preview TWRP for P and then repeat the steps above.

-.
[G4 Android Development] Daniel071:
Ok, do I flash

http://leech.binbash.rocks:8008/TWRP/P/twrp-3.3.1-PREVIEW-213_g4_P.img

with

fastboot flash recovery [I]twrp.img[/I]

then?

EDIT:

While running it, I got an error,

Sending 'recovery' (23556 KB) OKAY [ 0.803s]
Writing 'recovery' FAILED (remote: 'unknown command')
fastboot: error: Command failed

So I've just used the MM method.

EDIT 2:

Flashing using the MM method was successful, I've again ran the commands and I haven't got any warnings this time. I'll test now and see if I get the freezing and lagging.

---------- Post added at 08:32 PM ---------- Previous post was at 08:11 PM ----------

I've flashed the preview TWRP and ran the previous commands (I didn't get any warnings this time) however, the freezing and lagging issue persists and is just as bad as it was before.

Here is a logcat:

https://gist.github.com/daniel071/02381ddd4041f03fa177b6ea21a34e19
[G4 Android Development] steadfasterX:
Let it cool down a bit and test again after 10 min or so. I can see that the temperature level is quite high on yours atm due to the reboots.

.-
[G4 Android Development] Daniel071:
I've let it cool down for about 30 minutes, though I still have the same issue as before. Constant freezing and lagging, just as bad as it was before.

(I used to be on kessaras's build, which never had the freezing/lagging issues)

Here is a logcat:

https://gist.github.com/daniel071/2047b942c2c9022e0c700cde77d21bf9

EDIT:

Looking at the logcat, it seems to be constantly reporting the CPU temperature at 80C/98C even though I let it cool down, is this an issue with the temperature reporting?

EDIT 2:

My phone is now constantly locking up. When I try to load an app, it locks up and doesn't respond to anything for longer than 5 minutes. (Edit 3: But eventually, it unfreezes)

EDIT 4:

I've also let it cool down over night, it still has the same freezing issues.
[G4 Android Development] steadfasterX:
No the temperature is as it is shown. This is one major issue on this device. Could you try switching to OpenGL?

you can do so by

temporary (immediately active):

adb root (must be enabled in dev options)
adb shell setprop debug.hwui.renderer opengl
[G4 Android Development] Daniel071:
I've set it to use OpenGL with

su

setprop debug.hwui.renderer opengl

I still have freezing and lagging.

(I've also tried using ADB instead however, it still didn't fix the freezing/lagging)

Here is another log:

https://gist.github.com/daniel071/f630e149b358191f71156d3245ab82f3
[G4 Android Development] steadfasterX:
Ok great. Please dirty flash your current LOS again and let it boot and and set to OpenGL again. Does that change something to the initial behaviour?
[G4 Android Development] Daniel071:
Is the dirty flash the Regular Clean from FAQ #02?

Or is it flashing lineageos + OpenGapps without any wipe?
[G4 Android Development] steadfasterX:
Nah dirty means just flash LOS, no other actions.
[G4 Android Development] Daniel071:
Do I also need to reflash OpenGapps or just Lineageos?
[G4 Android Development] steadfasterX:
Yes afterwards Opengapps and whatever you use to root
[G4 Android Development] Daniel071:
@steadfasterX

I tried to do a dirty flash of LineageOS lineage-16.0-20200515-UNOFFICIAL-h811

My phone is no longer booting, it just stays on the LG boot screen and I never see the LineageOS boot animation. Should I do a full clean and then flash LineageOS + OpenGapps + Magisk?

Also, I tried to access the recovery but it prompted me if I wanted to factory reset my phone, do I select yes to it?
[G4 Android Development] rundumdieuhr:
Yes, go ahead and do that. Press yes twice. That's the G4 way to access the custom recovery.
[G4 Android Development] Daniel071:
I've done a full clean and then installed LineageOS + OpenGapps + Magisk.

Currently I'm setting it up again, I don't seem to be having issues with lagging and freezing.

I'll update you if I do experience it again.

EDIT:

I also believe that I'm using skiagl at the moment, not opengl.

Also those commands and the shell script that you gave me to run was also reverted I think since I did a full clean.
[G4 Android Development] steadfasterX:
Do you had flashed opengapps and magisk before booting??

The command for opengl will not persist a reboot and must be done on every boot. This way of setting opengl is just for testing. If you clean flashed and it works now it's likely not ROM related but who knows. I saw firefox eating a lot of RAM in one of your previous gists so it might be related to an app only (e.g. Firefox).

You can always test if you have skiagl or opengl active by executing:

adb shell getprop debug.hwui.renderer

If you dont get any output it means skia and otherwise you will see opengl
[G4 Android Development] Daniel071:
I did not flash OpenGapps and Magisk as I only thought I needed to flash LineageOS, that's most likely as to why it didn't boot, my bad.

(Afterwards I did a clean wipe and installed LineageOS, then OpenGapps then Magisk)

After running that command, it gave no output so I'm using skiagl right now.

Though the clean flash fixed it, it might still be a ROM related issue as 2 other people had the same issue, but I'm not sure. Maybe if they provide a logcat as well that might help?
[G4 Android Development] steadfasterX:
of course.

That's why i mentioned all those who had that issue but you were the only one answering yet..
[G4 Android Development] owlery_hk:
i also have the freezes and crashes.

but i cannot part with xposed..... so i dont think my logs will help, sorry.
[G4 Android Development] stlstl:
Make changes permanent

Hi,

I'm new to the forum and this is the first custom ROM I'm installing In my phone. Still figuring out what's the best replacement for the MM stock camera app but so far I'm impressed with the ROM in general.

There are two "bugs" I could use some help to permanently fix:

The long press not working sometimes in Chrome/Edge can be fixed with:

adb shell settings put secure long_press_timeout 250

The artifacts horizontal bar at the bottom of the contacts app can be fixed by using opengl:

adb shell setprop debug.hwui.renderer opengl

But the fixes only work until the next reboot. How can I make them permanent?

Thanks
[G4 Android Development] User_99:
Do the change for opengl directly in build.prop file and reboot
[G4 Android Development] steadfasterX:
would not hurt to try..

.-
[G4 Android Development] stlstl:
Thanks, adding debug.hwui.renderer=opengl to build.prop solved it.

Actually rebooting doesn't reset secure long_press_timeout. Although it helped, Chrome still misses some long presses. The system overall is snappier lowering the timeout.
[G4 Android Development] lgg4-user:
A friend gave me an S9+ for the price of getting the screen fixed and a crate of expensive beer. Sad to leave the G4 behind, but wow is this thing fast! I will keep checking in, and given I am not using the G4 as a day-to-day device I'm even more happy to install very experimental stuff on it.
[G4 Android Development] jjcdennis:
I have a problem I believe with the Windows driver on my Win 10 Laptop. Normally when I connect my LG H812 to a USB port I can find the phone shown in This PC (Explorer) as a drive and can open up the phone file system to copy over a new rom, or other files. After a recent update I have not been able to access the phone via This PC (explorer). The phone gives me the connection made sound and also disconnect sound when the USB is removed, but no drive shown in This PC.

In Device Manager the driver I have found showing for the phone is curiously: Acer Device > Acer ADB Interface. Driver Version 7.0.0.1 8/27/2013 File version 10.0.19041.0. I have version 4.2 - LG Mobile Device Driver installed from LG's Website.

I'm not sure what has happened, but it looks like I need the correct driver associated with the phone to fix it. Could someone please share what the device driver should be for connecting this phone? Any ideas as to what else I may have to do?
[G4 Android Development] sdembiske:
LGMobileDriver_WHQL_Ver_4.2.0.exe is the one I used to use with no issues.

The odd time Windows seems to replace the existing driver with something else.

Just re-install the LG Mobile Driver under Portable Devices in the Device Manager (

when phone is connected allowing file transfer

, not just charging), and see if it helps.

Funnily enough, Windows seems to have replaced the LG driver with one of their own on my laptop. Currently showing: a Microsoft driver, 6/21/2006, Version 10.0.19041.329 which has been working with no issues so far.

I notice a newer LG Mobile Driver version is available (4.5.0) from here:

Link: https://www.lg.com/us/support/help-library/lg-mobile-drivers-and-software-CT10000027-20150179827560
[G4 Android Development] jjcdennis:
Thanks for getting back to me. I did do the install as you describe, but for whatever reason I get the Acer device as mentioned in my note. I'm 99% sure that the 6/21/06 driver you mention is the one that worked for me prior to whatever the update did. Can you provide the description of the driver from device manager. I will try to track it down.

FYI, I installed 4.5 and I still have the same issue between PC and phone. When first connected the PC gives the connected jingle (phone is in charge mode) and when changed to File Transfer the disconnected jingle sounds.

---------- Post added at 11:27 PM ---------- Previous post was at 11:07 PM ----------

Well, I fixed this problem after I restarted the PC with the phone plugged in to the USB. I opened a software program called Driver Booster and found the "Acer Device > Acer ADB Interface" driver in the list of up to date drivers. I uninstalled it and when the uninstall was confirmed I heard the "connected" jingle from Windows. I checked in This PC and the LG G4 icon was there. The driver was shown as "Connected Devides LG H812, Current 6/21/2006. Thanks for your help sdembiske.
[G4 Android Development] Daniel071:
If you ever have USB driver issues with Windows, you could also use Linux. Linux is a free and open source alternative to Windows and it doesn't require USB drivers to transfer files between your device. I suggest you get steadfasterX 's linux distro that comes with android tools preinstalled: https://fwul.binbash.rocks/
[G4 Android Development] steadfasterX:
It's now https://maid.binbash.rocks :)

And yea exactly the above issues are the reason why it exists..
[G4 Android Development] stlstl:
For those with problems with Chrome and eventually other browsers: install the latest version of web view from the playstore and enable it in the developer options.
[G4 Android Development] falenjam:
I have some issues since I flashed the latest build. When I plug my h815 to the charger, the device starts to overheat and eventually freezes (screen remains dark after pressing power button). The only solution is to remove the battery so cannot share a logcat unfortunately...

My other problem is that after a couple days of use, the device becomes very slow. I have a logcat I grabbed after two days of use that I can share.
[G4 Android Development] Daniel071:
After I did a clean flash of LineageOS, the freezing and lagging was gone however, it is back.

It is only occasional and not as bad as it was before though.

I ran these commands for the logcat: https://xdaforums.com/showpost.php?p=82758511&postcount=1594

The logcat was harder to produce as it happened only occasionally, this was the best I could reproduce it:

https://gist.github.com/daniel071/f24f6ca873762b81cb7eca88cd1121f4

I'll update this post if I manage to get a better logcat of the occasional freezing

Also, if you see

06-17 22:47:34.723 996 7324 I ActivityManager: Killing 17895:org.mozilla.fenix.nightly:tab0/u0a109 (adj 900): remove task

That's because I manually killed the application (since it freezes), (By holding down the back button for several seconds, its an option in developer settings)

EDIT:

I got a much better log this time.

I ran these commands for the logcat: https://xdaforums.com/showpost.php?p=82758511&postcount=1594

I ran these while I was on Youtube Vanced and my phone started lagging a lot and froze. Though this only happens occasionally.

Here is the logcat:

https://gist.github.com/daniel071/dffafaeb492e55f3d07b2da423bbc4b3

Edit 2:

If the Github gist link results in a "Server error", I've also uploaded the same logcat to:

https://pastebin.com/mFG4JKu8

Edit 3:

The freezing only happens once every 1-2 days and it doesn't freeze for a very long time.
[G4 Android Development] Daniel071:
[Post removed as I accidentally sent the same post twice. Original is here]
[G4 Android Development] zwab:
Hi Steadfaster,

My apologies in taking so long to get back to you.

Unfortunately my frankenstein device started to experience some odd behaviour and performance issues before ultimately dying a death.

At this stage I can't even get an LED to turn on, let alone the screen, so unfortunately I can't get you those logs.

I've been without a mobile for a bit now since this happened, so I'm currently deciding on whether I risk getting another frankenphone off eBay (which could of course die the same way after a good few months) or to move to another phone which also has a healthy development scene around it.

Sorry we couldn't get to the bottom of my specific BT issue.

-zwab
[G4 Android Development] bedencic:
Does this rom include disabled big cores?

Or do I need flash seperate file, to disable big cores?
[G4 Android Development] steadfasterX:
You need to follow the X cores guide to create your own boot image with disabled cores.
[G4 Android Development] bedencic:
Yeah, I don't get it.

https://xdaforums.com/g4/general/guide-create-custom-x-cores-boot-image-t3718389/amp/

I only thought if there's a flashable file.

So phone wouldn't overheat so much.
[G4 Android Development] zohar_ml:
I just went the UsU way with my old G4 H815 phone, I’m supper happy to have TWRP working on it, but sadly I’m stuck on a boot loop :(

I did the UsU process, installed TWRP and booted into it twice.

Then made a full TWRP backup and copied it to my PC.

I then did the regular clean process of installing the LOS (without flashing the modem, as I did not flashed the UsU baseband package).

The system started to bootup, I see a blue-green circle (think that this is the first frame of the LOS boot animation) LED constantly purple, and then a boot loop starts.

Back to TWPR, install h815_20p_modem.zip (checked md5).

Did the full clean install (wipe system+ cache, install lineage-16.0-20200515-UNOFFICIAL-h815.zip (checked md5), reboot to recovery, reflash lineage-16.0-20200515-UNOFFICIAL-h815.zip, boot into system.

But still same boot loop with that circle and purple LED.

Even tried lineage-16.0-20200222-UNOFFICIAL-h815.zip with same result.

I read all the instructions many times but still don’t find what I’m doing wrong.
[G4 Android Development] steadfasterX:
Do you had upgraded the bootloader stack to 20p?
[G4 Android Development] Daniel071:
This time my phone froze for about a minute. After it started responding it, I noticed that the wifi and mobile signal was temporarily gone (It's working now)

I took a logcat shortly after this happened. This is much less frequent then before however, it still does happen once a day

Looking at the logcat, it seemed to have killed a bunch of applications that I never force killed, why is this happening?

Here is the logcat:

https://gist.github.com/daniel071/edcd9fb002c2cb5bf73e3a1007072d7a

Also in my previous post I took another logcat that might be useful:

https://gist.github.com/daniel071/df...7b2da423bbc4b3
[G4 Android Development] steadfasterX:
yes. so actually what happens are 2 things:

1. high temperature

Examples: https://gist.github.com/daniel071/d...23bbc4b3#file-freshbetterlogcat-txt-L130-L137

2. high memory usage

Result: https://gist.github.com/daniel071/e...72d7a#file-frozefor1minutelogcat-text-L49-L50

both alone can cause lagging as the device will throttle CPU's when 1. happens and for 2. there is a general Android behavior which kills app under specific circumstances and in a specific order.

I see both things happening from your and the other logs while the second one is the more important here.

Android's ActivityManager is watching and handling Activities (aka Apps) like a janitor: when there are too many resources in use it will start killing. It will not kill randomly but at a specified order.

Unfortunately it is still too general as you can define classes which should be killed after reaching a specified limit but not e.g. exclude specific apps etc.

The result is that in heavy cases where something is eaten up almost the complete RAM it will kill what it can to bring back the device to life again.

This is actually what you see, it kills until the janitor is satisfied and during that phase important services might get killed as well and so get restarted automatically and so cause a "freeze" or heavily slowed down device.

There is a another important thing coming into play the "adj" value which can prevent an app from killing but I hadn't had the time to find out how to adjust that value.

You can read all details here https://github.com/LGgFour/android_...mmit/dd5c512262756ce542a083809de5c55d8eb67302

What I did was to adjust theses LMK values in order to not kill to much while keeping the device not going down completely.

Next steps are either to continuing tweaking the LMK or re-enable compressed RAM even when it decreases the performance in general or finding out how the adj values can be set on important stuff (The "Android Activity Manager is responsible for assigning oom_adj/oom_score_adj values for each process at run-time.").

If you like you can tweak the LMK on-the-fly (req root):

adb shell
su
echo '2560,5120,12800,17920,25600,51200' > /sys/module/lowmemorykiller/parameters/minfree

--> that one is the last one I send for testing. Unfortunately the very last value might cause issues as it should always increase from left to right so the last value must be higher then 25600.

Here are some more values to test if you like to:

echo '10240,12800,30720,51200,30720,115200' > /sys/module/lowmemorykiller/parameters/minfree
echo '21504,31232,36096,79360,108288,115456' > /sys/module/lowmemorykiller/parameters/minfree
echo '2560,5120,30720,51200,30720,115200' > /sys/module/lowmemorykiller/parameters/minfree
echo '2560,5120,36096,79360,108288,115456' > /sys/module/lowmemorykiller/parameters/minfree

Changes will take effective immediately and will NOT survive a reboot (i.e. must be set again)

.-
[G4 Android Development] rundumdieuhr:
Isn't it [MENTION=6622407]zohar_ml[/MENTION] flashed that 20p package?:
[G4 Android Development] Daniel071:
Thanks for the detailed explanation! I've applied all of those values and so far I haven't experienced a freeze. Is there any way I can make these changes persistent (Survive a reboot)? I'm thinking of auto-running a shell script with the commands at boot, using Magisk. (https://github.com/topjohnwu/Magisk/blob/master/docs/guides.md#boot-scripts) If so, should my script be in the post-fs-data mode or the late_start service mode?
[G4 Android Development] rundumdieuhr:
Wow, thanks [MENTION=5545101]steadfasterX[/MENTION] for those comprehensive explanations, they for sure make an interesting read! As well as, once again, for all your work on the LG G4, of course!! :good:
[G4 Android Development] steadfasterX:
I dont know what that package is but it looks like JUST the modem. Thats why I am asking.

well just to be clear:

you can have only ONE of these echo commands applied. not

all

at the

same time

. that means:

1. echo command

2. test

3. next echo command

4. test

5 and so on

yes ofc you can make it permanent but thats what I would do in the next release then. there is no need for any magisk tricks etc.

if you want you can adjust the values in the init file directly as described here: https://xdaforums.com/showpost.php?p=82776203&postcount=1597

.-
[G4 Android Development] zohar_ml:
I probably only installed the modem (in TWRP installed h815_20p_modem.zip).

The phone was on Marshmallow, but I missed the difference between the modem and the bootloader, so I did not checked / did the step of Q #8. :(

I’m still at work and did not had the time to fully understand UsU FAQ #20 (many words to decipher, like KDZ & ARB)

I will look at this deeper later today.