Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0] Extreme lag in webview apps. #181

Closed
pypcz opened this issue Nov 28, 2013 · 44 comments
Closed

[11.0] Extreme lag in webview apps. #181

pypcz opened this issue Nov 28, 2013 · 44 comments
Labels
bug

Comments

@pypcz
Copy link

@pypcz pypcz commented Nov 28, 2013

Google newsstands: https://dl.dropboxusercontent.com/u/40426219/LOGZ/webviewnewsstands.txt
Stock browser: https://dl.dropboxusercontent.com/u/40426219/LOGZ/webviewbrowser.txt
After a while browser force closed when I tapped on address field.

@mugna91

This comment has been minimized.

Copy link

@mugna91 mugna91 commented Nov 28, 2013

Hi, I have Galaxy Nexus and Xperia Arc. I can absolutely say that WebView based apps (like AOSP browser, Google Now, Google maps etc) are lagging due to this patch (merged) from gerrit cyanogenmod: http://review.cyanogenmod.org/#/c/54291/
The same problem is present on my Galaxy Nexus.
For reference, this ROM: http://forum.xda-developers.com/showthread.php?t=2525351 works very well (no lag on any WebView based apps) before the 11.20.2013 update. As you can see:

11.20.2013
Synced with CM repos
cherry-picked gpu: Refactor GpuMemoryBuffer framework for multi-process support from gerrit. Fixes webview glitches.

I think that this cause lag on all the cm11 based devices atm.

@knizmi

This comment has been minimized.

Copy link

@knizmi knizmi commented Nov 28, 2013

I can confirm this bug and also that it is present on many other devices where the devs already started releasing CM 11.

@iborisov

This comment has been minimized.

Copy link

@iborisov iborisov commented Nov 28, 2013

Confirm on Mini Pro with cm-11.0-20131128-LX-NIGHTLY-mango.

@venoma333

This comment has been minimized.

Copy link

@venoma333 venoma333 commented Nov 28, 2013

This is what I pulled from logcat, related to opening the browser

I/ActivityManager( 602): START u0 {act=com.android.systemui.recent.action.TOGGLE_RECENTS flg=0x10800000 cmp=com.android.systemui/.recent.RecentsActivity (has extras)} from pid 671
I/ActivityManager( 602): Displayed com.android.systemui/.recent.RecentsActivity: +319ms
I/ActivityManager( 602): Killing 7502:com.google.android.setupwizard/u0a22 (adj 15): empty #7
I/ActivityManager( 602): Killing 7718:com.android.dialer/u0a13 (adj 9): remove task
I/WindowState( 602): WIN DEATH: Window{41f85e30 u0 com.android.dialer/com.android.dialer.DialtactsActivity}
I/WindowManager( 602): Screenshot Window{4202cf48 u0 com.android.systemui/com.android.systemui.recent.RecentsActivity} was monochrome(ff000000)! mSurfaceLayer=21010 minLayer=21010 maxLayer=21010
I/ActivityManager( 602): Killing 7654:com.android.browser/u0a64 (adj 11): remove task
I/ActivityManager( 602): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.browser/.BrowserActivity bnds=[96,761][192,860]} from pid 820
I/ActivityManager( 602): Start proc com.android.browser for activity com.android.browser/.BrowserActivity: pid=7746 uid=10064 gids={50064, 3003, 1028, 1015}
V/WebViewChromium( 7746): Binding Chromium to the main looper Looper{4184bed8}
I/chromium( 7746): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserProcessMain( 7746): Initializing chromium process, renderers=0
W/chromium( 7746): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
D/libEGL ( 7746): loaded /system/lib/egl/libEGL_adreno200.so
D/libEGL ( 7746): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
D/libEGL ( 7746): loaded /system/lib/egl/libGLESv2_adreno200.so
I/Adreno200-EGL( 7746): <qeglDrvAPI_eglInitialize:294>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB.04.01.01.00.036_msm8960_JB_CL2644550_release_AU (CL2644550)
I/Adreno200-EGL( 7746): Build Date: 07/31/12 Tue
I/Adreno200-EGL( 7746): Local Branch:
I/Adreno200-EGL( 7746): Remote Branch: quic/master
I/Adreno200-EGL( 7746): Local Patches: NONE
I/Adreno200-EGL( 7746): Reconstruct Branch: AU_LINUX_ANDROID_JB.04.01.01.00.036 + NOTHING
D/WebViewTimersControl( 7746): onBrowserActivityResume
D/WebViewTimersControl( 7746): Resuming webview timers, view=com.android.browser.BrowserWebView{418d1da8 VFEDHVCL .F....I. 0,0-0,0}
V/NFC ( 7746): this device does not have NFC support
D/OpenGLRenderer( 7746): Enabling debug mode 0
W/AwContents( 7746): nativeOnDraw failed; clearing to background color.
W/AwContents( 7746): nativeOnDraw failed; clearing to background color.
I/ActivityManager( 602): Displayed com.android.browser/.BrowserActivity: +732ms
W/AwContents( 7746): nativeOnDraw failed; clearing to background color.
W/AwContents( 7746): nativeOnDraw failed; clearing to background color.
I/chromium( 7746): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
I/chromium( 7746): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
E/memalloc( 7746): /dev/pmem: Failed to open pmem device: Permission denied
E/memalloc( 7746): /dev/pmem: failed to initialize pmem area
W/memalloc( 7746): Falling back to ashmem
W/memalloc( 7746): Falling back to ashmem
W/memalloc( 7746): Falling back to ashmem

@mugna91

This comment has been minimized.

Copy link

@mugna91 mugna91 commented Nov 28, 2013

@mikeNG do you think that is possible to try revert back the commit i mentioned above from your git repos? Or will cause more graphic glitches?
PS I'm not a dev, I'm just thinking a simple way to solve the problem.

@knizmi

This comment has been minimized.

Copy link

@knizmi knizmi commented Dec 4, 2013

It looks like simply reverting http://review.cyanogenmod.org/#/c/54291/ is not a way to go. That patch is needed for webview to even work properly.

I've googled around and the problem seems to go much deeper. If I understand it correctly, Google has enforced Chromium webview in 4.4 and our old devices are not keeping up with it. See http://developer.android.com/about/versions/kitkat.html#44-webview.

Just google for "Chromium webview" or "enforced Chromium webview" and you will find hosts of people complaining about it.

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Dec 4, 2013

One interesting line that I saw in all logs is this:

E/memalloc( 7746): /dev/pmem: Failed to open pmem device: Permission denied

Maybe it means webview doesn't have the right permissions to /dev/pmem

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Dec 4, 2013

after chmod 777 /dev/pmem here's what I get:

E/memalloc( 3626): /dev/pmem: Failed to map pmem master fd: Out of memory
E/memalloc( 3626): /dev/pmem: failed to initialize pmem area

We probably need to allocate more pmem for webview to work...

@knizmi

This comment has been minimized.

Copy link

@knizmi knizmi commented Dec 4, 2013

Hehe, I was just going to post that I've tried chmoding /dev/pmem to 777, but the lags did not stop.

As I am no dev and there really isn't much I can do to fix it, I've tried googling if others have noticed this, but no luck so far.

@knizmi

This comment has been minimized.

Copy link

@knizmi knizmi commented Dec 6, 2013

Done some more googling around and it definitely is a pmem / old adreno libs problem. All devices that suffer from this are older phones with no proper ION support. Usually the camera in those devices is pmem only and thus the devs stick to it.
To get this to work we would probably have to use Adreno drivers v04.02.02 (realeased for Android 4.2), but these are ION only, so we are stuck at v04.01.01.

The interesting thing is that according to Google the new Webview is based on Chrome 30.0 (Chromium to be exact). You would expect the standalone Chrome downloaded from Play Store to be laggy as hell too, but Chrome is working just fine (it uses its own rendering core and does not depend on Webview, that's why Chromium is so large compared to other browsers).

There are two (three) resolutions of this that come into my mind:

  1. Google updates webview in future releases (4.4.1 blink, blink) and the problem just goes away
  2. Somebody starts a webview-legacy project
  3. Well, laggy webview for older devices forever
@mugna91

This comment has been minimized.

Copy link

@mugna91 mugna91 commented Dec 6, 2013

On maguro device for example, if I'm not wrong, ION memory allocation should be 100% functional. But unfortunately this device suffers the same problems regarding WebView rendering. No problems on Chrome here as well, I agree with you regarding this point.
I think that the only option left is the second. :/

@knizmi

This comment has been minimized.

Copy link

@knizmi knizmi commented Dec 6, 2013

Well, it's not as much about ion/pmem, but rather about recent enough drivers. TI surely hasn't published any for some time...
But again, this is pure speculation on my side, nobody knows for sure what exactly has to be done to get this working right.

@cajhin

This comment has been minimized.

Copy link

@cajhin cajhin commented Dec 8, 2013

I traced memory usage with 'adb shell dumpsys meminfo'
Patterns I'm seeing...

  1. browser and Chrome use ashmem; no other apps so far do that. Reason is probably because pmem allocation fails
  2. something graphicBuffer fails because of wrong argument? Error -22 is all over my logcat when I run browser:

11:52:01.890 E/libgenlock(14713): perform_lock_unlock_operation: GENLOCK_IOC_DREADLOCK failed (lockType0x1,err=Connection timed out fd=141)
11:52:01.905 E/gralloc (14713): gralloc_lock: genlock_lock_buffer (lockType=0x2) failed
11:52:01.905 W/GraphicBufferMapper(14713): lock(...) failed -22 (Invalid argument)
****** ALWAYS 1 s PAUSE - HANGS? ****
11:52:02.890 E/libgenlock(14713): perform_lock_unlock_operation: GENLOCK_IOC_DREADLOCK failed (lockType0x1,err=Connection timed out fd=133)

  1. SurfaceFlinger seems to use a lot less memory than in JB. My 'standard' test used 15MB max instead of 25.
    We may be able to go back to lower pmem; but this is only my first impression. Needs more testing.
@cajhin

This comment has been minimized.

Copy link

@cajhin cajhin commented Dec 8, 2013

@mikeNG
I tested a kernel with very high pmem (doubled to 0x50..)
It does not make any difference for the browser.

@mugna91

This comment has been minimized.

Copy link

@mugna91 mugna91 commented Dec 9, 2013

@knizmi Maybe the option 1) has been realized. With official build cm11-20131208 for maguro the problem is fixed. Maybe with next build will be fixed on xperia too.

@talentprince

This comment has been minimized.

Copy link

@talentprince talentprince commented Dec 9, 2013

@mugna91 i try to cherry pick that patch you told to my project, but it seems the crash still happening. stack like @venoma333

@Dazzozo

This comment has been minimized.

Copy link

@Dazzozo Dazzozo commented Dec 9, 2013

Happening on ION msm7x27a too. Same error pretty much.

E/libgenlock( 2281): perform_lock_unlock_operation: GENLOCK_IOC_DREADLOCK failed (lockType0x1,err=Connection timed out fd=115)
E/gralloc ( 2281): gralloc_lock: genlock_lock_buffer (lockType=0x2) failed

With AU_LINUX_ANDROID_JB_REL_2.0.3.04.01.01.21.010 Adreno blobs.

@galaxyfreak

This comment has been minimized.

Copy link

@galaxyfreak galaxyfreak commented Dec 11, 2013

PMEM MSM7x27 device here, same thing.

@Dazzozo I was getting that error even when not in browser. Seems to be disappeared by updating genlock from CAF

@Geil

This comment has been minimized.

Copy link

@Geil Geil commented Dec 15, 2013

I can confirm the same bug on smultron and urushi. Extremely laggs and FC apps (browsers). Wifi and network works correctly.
When we may have fix for this issue?
What may be linked to this problem?

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Dec 15, 2013

The problem is probably in the kernel.
We will have the fix when we have a new kernel.

For now, there's no easy solution

@dinoomanovic

This comment has been minimized.

Copy link

@dinoomanovic dinoomanovic commented Dec 15, 2013

this guy opened a project kernel-3.10 for msm devices
https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/
I found a project on this thread
http://forum.xda-developers.com/showthread.php?t=2532394&page=2

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Dec 15, 2013

I think it's a waste of time for now since there are more important things to fix than porting 3.10. We don't even have a stable 3.4 kernel and not even 1 device runs 3.10 on kitkat yet.

@s-kostyuk

This comment has been minimized.

Copy link

@s-kostyuk s-kostyuk commented Dec 16, 2013

The same problem with a Pocket: freezes and crashes while reading of saved articles.
Log: http://pastebin.com/7hmJaU7b
Build cm-11.0-20131211-LX-NIGHTLY-haida with kernel from archive.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Dec 21, 2013

Fix Here is what you need Thanks @galaxyfreak
Google in 4.4 introduced Chromium Webview, instead of "Classic" one.
I took kk-2.7 libwebcore from CAF, some patches to allow using of classic webview and voila fixed:

https://www.codeaurora.org/cgit/quic/la/platform/external/webkit/log/?h=kk_2.7_rb1.16
https://gerrit.omnirom.org/#/c/1432/ (enable with TARGET_FORCE_CPU_UPLOAD := true)
https://gerrit.omnirom.org/#/c/2386/
http://review.androidarmv6.org/#/c/6180/
androidarmv6/android_device_lge_msm7x27-common@efc870e
https://github.com/PicoKat/cm11-device-pico/blob/master/pico.mk#L270

@galaxyfreak

This comment has been minimized.

Copy link

@galaxyfreak galaxyfreak commented Dec 21, 2013

LOL you atleast could delete tags when copying :P

@galaxyfreak

This comment has been minimized.

Copy link

@galaxyfreak galaxyfreak commented Dec 22, 2013

Switched to ION to try chromium webview. No glitches, but it crashes after some time browsing. Getting this in logcat

http://hastebin.com/yinalilade.coffee

512MB RAM (409 userspace)

@dinoomanovic

This comment has been minimized.

Copy link

@dinoomanovic dinoomanovic commented Dec 23, 2013

I was reading a log and this is clear what caused crash, because I think that chromium webview is a little heavy for our devices, and memory gets full after opening some websites that are, for example, full of flash ads. At least it's working.
12-22 15:08:27.880 W/System.err(1402): java.lang.OutOfMemoryError

@mid-kid

This comment has been minimized.

Copy link

@mid-kid mid-kid commented Dec 26, 2013

Any news regarding this problem?
Did it get fixed in yesterday's build?

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Dec 26, 2013

No.
general rule: if it's not mentioned in the changelog it's not fixed.

@dinoomanovic

This comment has been minimized.

Copy link

@dinoomanovic dinoomanovic commented Dec 29, 2013

Mike, I tried to build kernel using your sources and in nAa defconfig I included ION support. Kernel builds without problem, boot.img is in out folder, but after flashing, phone just vibrates and stays on blank screen. Size was around 8400kB, just a little bigger than kernel from your last build. I included maybe XFree86 drm support (both in Graphics driver section), but nothing more and it is compiled in kernel. Have you tried it yet and is it any better without ion included?

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Dec 30, 2013

Board file is not configured for ion support. I didn't have the chance to work on the new kernel I'm preparing yet

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Dec 31, 2013

@mikeNG why to port from scratch can't we try switching from Pmem to Ion kernel ..?

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Jan 2, 2014

@rebelos no because the current kernel we're using is outdated & missing a lot of new things from CAF. For proper support we need a new kernel from scratch

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jan 8, 2014

@mikeNG i started a inital work on hybrid ion kernel u can take a look www.github.com/rebel-x/msm7x30-3.4.x-nAa
please if u can take a look at it .. so we all can have 99% ION kernel . branch=cm-11.0

i edited deconfigs and board semc_mogami.c

@mokkin

This comment has been minimized.

Copy link

@mokkin mokkin commented Jan 12, 2014

I can confirm this bug for Nightly build 20140111 - cm-11.0 on Xperia Arc (anzu). Since this nightly it lags not anymore and is relatively fluent. But therefore we have a new bug which tiles the screen.
screenshot_2014-01-12-13-10-18

@zeule

This comment has been minimized.

Copy link

@zeule zeule commented Jan 12, 2014

Can confirm the same problem on haida. Webview is distorted.
screenshot_2014-01-12-14-11-20

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Jan 12, 2014

try adding persist.webview.provider=classic in your build.prop and see if it has any effect

@pypcz

This comment has been minimized.

Copy link
Author

@pypcz pypcz commented Jan 12, 2014

After editing built.prop it's exactly the same as before.

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Jan 12, 2014

provide some logcats then

@pypcz

This comment has been minimized.

Copy link
Author

@pypcz pypcz commented Jan 12, 2014

https://dl.dropboxusercontent.com/u/40426219/LOGZ/browser.txt
https://dl.dropboxusercontent.com/u/40426219/LOGZ/browserroot.txt
https://dl.dropboxusercontent.com/u/40426219/LOGZ/playnewstandsroot.txt
Edit: at first when you open a web page it looks like it was cropped into squares and shuffled around and after rotating phone its rendered properly but obscured with black squares like in screenshots above.

@AndrossGuile

This comment has been minimized.

Copy link

@AndrossGuile AndrossGuile commented Jan 14, 2014

For a little context: I picked iyokan because, as someone with sight impairment, hardware keyboards are easier for me to deal with than touchscreen ones. The classic webview does not report nearly as much information to the accessibility stack as Chromium's engine does, and as a result, all apps with webviews have become a great deal more useable in Kitkat for blind people thanks to this change. Apart from this, optimizations for low-mem devices (which Mike has also disabled, for the moment at least) and ART (which doesn't appear to make much difference either way on mogami boards) there's little in 4.4 that interests me. So, if the "solution" ends up being a reversion to classic web views, I will most likely switch to CM10.2 for greater stability. I'm not trying to be difficult, but if I do not add this perspective, it will be lost.

@AndrossGuile

This comment has been minimized.

Copy link

@AndrossGuile AndrossGuile commented Jan 14, 2014

However! I'd like to add that the browser is a great deal more fluid in the latest nightly (2014-01-13) the browser is a lot less laggy than before. It's still a bit sluggish, but a huge improovement from the unuseable mess it was at previously. Thanks very much for that.

@pypcz

This comment has been minimized.

Copy link
Author

@pypcz pypcz commented Jan 14, 2014

Reverting to old webview is a temporary solution and it's even described as a "hack" in a changelog. Mike is working on a ION memory allocator for 3.4 kernel that will allow him to use new up to date GPU drivers. This will fix graphical glitches, kitkat webview, flickering in google maps. He is basically updating his kernel to modern android standards for full compatibility. For more info read this https://github.com/LegacyXperia/Wiki/wiki/What-is-ION%3F

@mikeNG

This comment has been minimized.

Copy link
Member

@mikeNG mikeNG commented Jan 14, 2014

Closing this issue, at least for now.

@mikeNG mikeNG closed this Jan 14, 2014
BOOTMGR added a commit to BOOTMGR/android_device_lge_victor-common that referenced this issue Dec 31, 2014
for more info refer to LegacyXperia/local_manifests#181

Signed-off-by: BOOTMGR <panchal.harsh18@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.