Video playing does not work on android webview on emulator with swiftshader, but works in Chrome
Reported by
edwardra...@gmail.com,
Jun 14 2017
|
||||||||
Issue descriptionExample URL: Any video url Steps to reproduce the problem: 1. Install android emulator image from android studio, i've tested API 24 and 25 images, choose Graphics->Software GLES2.0 to use swiftshader. 2. Open arbitrary video website in webview, e.g. http://xw.qq.com/nba/20170614053660/NBA2017061405366002 (android emulator comes with a webview browser tester) 3. Click play on the video What is the expected behavior? Video starts to play like opening it in chrome What went wrong? Video element stays black in webview, time progress's advancing but no video output. However in chrome all videos plays fine Did this work before? N/A Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? N/A Chrome version: 55.0.2883.87 Channel: n/a OS Version: 7.1.1 Flash Version: Contents of chrome://gpu: Can't paste from emulator, type some key parts in GL_VENDOR: Google Inc GL_RENDER: Google SwiftShader GL_VERSION: OpenGL ES 2.0 SwiftShader 3.3.0.0 Machine model name: Android SDK built for x86
,
Jun 14 2017
,
Jun 14 2017
,
Jun 15 2017
IIRC we don't really support the Android Emulator in WebView, but I might be wrong. Torne, do you have any thoughts on this? Setting this as P3 since the WebView version is 55.
,
Jun 15 2017
,
Jun 15 2017
I don't know what the swiftshader-based GPU emulation on the emulator is capable of, but for full graphics functionality in WebView we require either: 1) that the GL implementation supports the robustness extension 2) or that the reset strategy is nonzero These are both displayed in chrome://gpu but you didn't screenshot those parts :) If the emulator in this configuration still doesn't have one or both of those things, then WebView's graphics support is still going to be limited, and it may affect video (as well as WebGL). Also, in general we don't recommend testing WebView functionality on the emulator at all: the emulator doesn't have an updatable version of WebView and so you're using an outdated version that doesn't reflect what the majority of users on real devices actually have, plus the graphics incompatibilities mean that the functionality and performance is not the same. We have a minimal set of workarounds to make sure WebView can function at all on the emulator, but that's about all we do.
,
Jun 16 2017
Hi: Thanks for the reply. I'm adding some additional screenshots on GL_EXTENSIONS and (reset notification strategy?) What make me confused is Chrome works fine but webview didnt get video rendered. Is this an expected behavior? Thanks.
,
Jun 16 2017
Torne, I'm gonna assign this to you since you know what to look for in chrome://gpu, feel free to re/un-assign :)
,
Jun 28 2017
There's no robustness extension and the reset strategy is 0, so yes, this is unfortunately working as intended - the emulator with swiftshader is still not good enough. Chrome doesn't have this restriction because it has a separate graphics context for rendering and so doesn't need the guarantees of robustness. WebView shares its graphics context with your app. Use real devices for webview testing.
,
Jun 28 2017
Actually, this is probably the emulator check: https://cs.chromium.org/chromium/src/android_webview/java/src/org/chromium/android_webview/AwContents.java?rcl=219666dbe44bdadde0dc0edb2c03c5647ba1f1bb&l=121 On regular devices (with in-process gpu), only webgl depends on robustness extension. other things like video shouldn't depend on robustness.
,
Jun 28 2017
Ah, sorry. I guess the swiftshader mode in the emulator might need yet more special case handling here then, if we expect it to work? The general level of support looks like it might be enough, even if we still can't enable webgl for lack of robustness.. Do we think it's worth doing that?
,
Jun 28 2017
I've _heard_ swiftshader is good enough for everything (except webgl I guess, due to robustness extension). So in theory, I'd like to just remove that line altogether. But emulator folks requested that line being added, and has not requested that line being modified or removed. I don't even know what emulators and what builds of those emulators are out there, so no idea how to test this. Probably should ask the emulator people..
,
Jun 29 2017
Note that as of Chrome M59 we've fully integrated SwiftShader into Chrome on Windows and Linux desktop for seamless WebGL fallback support. We're also running ClusterFuzz tests now, as well as ASan, MSan, TSan, and UBSan builds in various places. So we have good confidence in its stability. That said, we're still adhering to garbage-in-garbage-out, meaning that if you pass in a bad pointer or insufficient memory has been allocated to perform a certain operation, things may crash (e.g. crbug.com/734245 ). However, it's the command buffer's responsibility to validate these things. I'm not sure if WebView uses the command buffer? If it does then it should be quite safe to use SwiftShader despite the current lack of GL_EXT_robustness extension support. SwiftShader actually already implements all of the entry functions of the GL_EXT_robustness extension (which I was a co-author of). The one thing that keeps us from claiming full support for this extension is that we don't yet guarantee not to crash the application. It could probably be done by using a signal handler though, and then putting the context in a lost state just like with a physical device. So let me know if that's something you'd like me to look into.
,
Jun 29 2017
for integrating into chrome: how does that integration work on desktop chrome? just have webgl run in swiftshader but still have compositing in GL, so need a upload in between? or compositing has to be in software as well? asking because chrome on android doesn't have a software compositor also how's the general performance? I imagine puny mobile processors probably can't handle workload meant for the gpu very well, certainly not as well as desktop for implementing it for emulator, I guess that's a question for emulator people how much they care about having webgl in webview working in emulator
,
Jun 30 2017
Using SwiftShader for WebGL on desktop Chrome currently disables all uses of the GPU. We're hoping to change that, especially for WebGL 2 where lots of blacklisted GPUs are still perfectly capable of doing compositing and perhaps rasterization. Anyway, I merely mentioned this integration to highlight SwiftShader's stability. We're passing the full WebGL 1.0.4 conformance test suite now too. On the Android Emulator, SwiftShader can take the role of the system's graphics driver. Chrome isn't even aware that it's not running on a physical GPU. So the lack of specialized CPU compositing isn't a problem. Chrome desktop can also run on SwiftShader this way, but it currently requires a command line flag or substituting with ANGLE's libraries. Either way there's several options to get everything running. Performance is quite good. On a powerful CPU but a low-end integrated GPU we're getting as close as 50% of performance, and we're not even using AVX2 (or the recent AVX-512) extensions. ARM support is in development for Android Things, and I'm curious to see how that will perform. Back on topic, I don't see any major reason why WebView shouldn't be fully featured when running on SwiftShader. Robustness against program termination is also the command buffer's responsibility, and we're plugging the holes as we speak. If you're strict about requiring EXT_robustness to enable WebGL support and there's enough demand for this, then we can look into implementing that.
,
Jun 30 2017
Ok, so swiftshader isn't really ready for direct integration in to chrome android yet. Again, I'd defer the emulator part of the question to emulator people. Fwiw, webview requires robustness for webgl because it always runs gpu in-process, so it's not possible to just kill the gpu process if there's a runaway shader or something. Chrome runs gpu out of process for devices with at least 1G of ram (dunno the exact cutoff), and if that's the case, then chrome doesn't require robustness extension to enable webgl. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by rsgav...@chromium.org
, Jun 14 2017Status: Assigned (was: Unconfirmed)