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

Runtime problems on Android #14568

Closed
mmatyas opened this issue Dec 13, 2016 · 23 comments
Closed

Runtime problems on Android #14568

mmatyas opened this issue Dec 13, 2016 · 23 comments
Labels

Comments

@mmatyas
Copy link
Contributor

@mmatyas mmatyas commented Dec 13, 2016

Now that the build works, you can run Servo on Android again after applying these patches:

When you start Servo on Android, it produces a gray screen. This is because a missing WindowProxy implementation on Android.

On any input event, the gray screen disappears, and Servo itself starts. At the moment, however, this results in a mostly white screen, with one or two elements visible occasionally. There are no errors, the main loop is running, and I don't really see anything particularly interesting in the logs either. Also some sites may throw shader compiler errors too.

Here's a screenshot of https://www.google.com, there, we only have a scrollbar, the menu button and the login button's text:

screen

@mmatyas mmatyas mentioned this issue Dec 13, 2016
5 of 5 tasks complete
@rzambre
Copy link
Contributor

@rzambre rzambre commented Jan 13, 2017

Are there certain websites that work well with Servo on Android?

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Jan 16, 2017

None at all. The best I've got is github.com, where the background image and two button rectangles load correctly.

@fabricedesre
Copy link
Contributor

@fabricedesre fabricedesre commented Feb 17, 2017

fwiw, I currently get a black screen after the gray one, and can't get any site to display.

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Feb 17, 2017

I've just tested the latest nightly build from here (with the included resources dir) on Odroid XU3 and Samsung S5; works for me on both of them. Servo launches into a gray screen, which turns into white on input/touch. It went from gray to black only once, but then turned white after waiting a few seconds and touching it again.

If the problem persist, could you tell some details about your device? Do you see anything weird using adb logcat?

By the way, it seems things got even worse, all I see now is the scrollbar (which can still be dragged horizontally), and only on certain sites.

@fabricedesre
Copy link
Contributor

@fabricedesre fabricedesre commented Feb 17, 2017

I'm using a Nexus 5 and a Sony z3c for testing. Both have an Adreno 330 GPU. I get the same behavior with the nightly builds.

Here's the logcat, starting with loading https://people-mozilla.org/~fdesre/servo/
I'm no sure how bad the fontconfig error is...

02-17 08:49:05.038 12510 13316 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.mozilla.servo/.MainActivity bnds=[540,1137][804,1486] (has extras)} from uid 10066 on display 0
02-17 08:49:05.068 12510 13312 I ActivityManager: Start proc 32668:com.mozilla.servo/u0a31 for activity com.mozilla.servo/.MainActivity
02-17 08:49:05.144 32668 32668 I ServoWrapper: Loading the NativeActivity
02-17 08:49:05.145 32668 32668 W linker  : /data/app/com.mozilla.servo-2/lib/arm/libmain.so: is missing DT_SONAME will use basename as a replacement: "libmain.so"
02-17 08:49:05.173 32668 32668 I ServoWrapper: libmain.so loaded
02-17 08:49:05.209 12510 12520 I art     : Background sticky concurrent mark sweep GC freed 49011(2MB) AllocSpace objects, 3(56KB) LOS objects, 0% free, 86MB/86MB, paused 5.457ms total 71.612ms
02-17 08:49:05.456 32668 32668 V threaded_app: Creating: 0xaa491fe0
02-17 08:49:05.460 32668 32691 V threaded_app: Config: mcc=0 mnc=0 lang=en cnt=US orien=1 touch=3 dens=480 keys=1 nav=1 keysHid=3 navHid=0 sdk=25 size=2 long=1 modetype=1 modenight=1
02-17 08:49:05.460 32668 32691 D RustAndroidGlueStdouterr: Entering android_main
02-17 08:49:05.460 32668 32691 D RustAndroidGlueStdouterr: Creating application thread
02-17 08:49:05.465 32668 32668 V threaded_app: Start: 0xaa491fe0
02-17 08:49:05.465 32668 32691 V threaded_app: activityState=10
02-17 08:49:05.474 32668 32668 V threaded_app: Resume: 0xaa491fe0
02-17 08:49:05.474 32668 32691 V threaded_app: activityState=11
02-17 08:49:05.481 32668 32668 V threaded_app: InputQueueCreated: 0xaa491fe0 -- 0xaa4921c0
02-17 08:49:05.482 32668 32691 V threaded_app: APP_CMD_INPUT_CHANGED
02-17 08:49:05.482 32668 32691 V threaded_app: Attaching input queue to looper
02-17 08:49:05.523 32668 32668 V threaded_app: NativeWindowCreated: 0xaa491fe0 -- 0xb42c9808
02-17 08:49:05.523 32668 32691 V threaded_app: APP_CMD_INIT_WINDOW
02-17 08:49:05.529 32668 32693 I Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
02-17 08:49:05.535 32668 32668 V threaded_app: WindowFocusChanged: 0xaa491fe0 -- 1
02-17 08:49:05.549 12510 12563 I ActivityManager: Displayed com.mozilla.servo/.MainActivity: +493ms
02-17 08:49:05.634 12510 12562 D BluetoothManagerService: Message: 20
02-17 08:49:05.634 12510 12562 D BluetoothManagerService: Added callback: android.bluetooth.IBluetoothManagerCallback$Stub$Proxy@5abb910:true
02-17 08:49:05.645 32668 32692 D RustAndroidGlueStdouterr: Fontconfig error: Cannot load default config file
02-17 08:49:05.666 32668 32692 D RustAndroidGlueStdouterr: WARN:constellation::frame: Frame FrameId { namespace_id: PipelineNamespaceId(0), index: FrameIndex(0) } iterated after closure.
02-17 08:49:05.666 32668 32692 D RustAndroidGlueStdouterr: WARN:constellation::frame: Frame FrameId { namespace_id: PipelineNamespaceId(0), index: FrameIndex(0) } iterated after closure.
02-17 08:49:05.706 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 51:3 Unsupported property declaration: 'width: fit-content;'
02-17 08:49:05.707 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 52:3 Unsupported property declaration: 'height: fit-content;'
02-17 08:49:05.708 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 60:1 Invalid rule: 'dialog::backdrop {'
02-17 08:49:05.708 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 69:3 Unsupported rule: 'dialog:modal {'
02-17 08:49:05.709 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 87:8 Unsupported property declaration: 'display: ruby;'
02-17 08:49:05.709 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 88:6 Unsupported property declaration: 'display: ruby-text;'
02-17 08:49:05.709 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 110:31 Unsupported property declaration: 'text-decoration: dotted underline;'
02-17 08:49:05.709 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 122:7 Unsupported property declaration: 'display-outside: break-opportunity;'
02-17 08:49:05.710 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 126:1 Invalid rule: '[dir]:dir(ltr), bdi:dir(ltr), input[type=tel]:dir(ltr) {'
02-17 08:49:05.710 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 127:1 Invalid rule: '[dir]:dir(rtl), bdi:dir(rtl) {'
02-17 08:49:05.710 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 153:1 Invalid rule: ':matches(article, aside, nav, section) h1 {'
02-17 08:49:05.710 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 154:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) h1 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 155:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 156:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 157:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 159:1 Invalid rule: ':matches(article, aside, nav, section) hgroup > h1 ~ h2 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 160:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) hgroup > h1 ~ h2 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 161:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) hgroup > h1 ~ h2 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 162:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) hgroup > h1 ~ h2 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 164:1 Invalid rule: ':matches(article, aside, nav, section) hgroup > h1 ~ h3 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 165:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) hgroup > h1 ~ h3 {'
02-17 08:49:05.711 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 166:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) hgroup > h1 ~ h3 {'
02-17 08:49:05.712 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 168:1 Invalid rule: ':matches(article, aside, nav, section) hgroup > h1 ~ h4 {'
02-17 08:49:05.712 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 169:1 Invalid rule: ':matches(article, aside, nav, section) :matches(article, aside, nav, section) hgroup > h1 ~ h4 {'
02-17 08:49:05.712 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 171:1 Invalid rule: ':matches(article, aside, nav, section) hgroup > h1 ~ h5 {'
02-17 08:49:05.712 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 179:1 Invalid rule: ':matches(dir, dl, menu, ol, ul) :matches(dir, dl, menu, ol, ul) {'
02-17 08:49:05.712 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 190:1 Invalid rule: ':matches(dir, menu, ol, ul) :matches(dir, menu, ul) {'
02-17 08:49:05.712 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 194:1 Invalid rule: ':matches(dir, menu, ol, ul) :matches(dir, menu, ol, ul) :matches(dir, menu, ul) {'
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 211:3 Unsupported property declaration: 'visibility: collapse;'
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 229:1 Invalid rule: 'table:matches(
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [rules=none i], [rules=groups i], [rules=rows i],
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [rules=cols i], [rules=all i],
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [frame=void i], [frame=above i], [frame=below i],
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [frame=hsides i], [frame=lhs i], [frame=rhs i],
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [frame=vsides i], [frame=box i], [frame=border i]
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr: ),
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr: table:matches(
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [rules=none i], [rules=groups i], [rules=rows i],
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [rules=cols i], [rules=all i]
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr: ) > tr > :matches(td, th),
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr: table:matches(
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [rules=none i], [rules=groups i], [rules=rows i],
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr:   [rules=cols i], [rules=all i]
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr: ) > :matches(thead, tbody, tfoot) > tr > :matches(td, th) {'
02-17 08:49:05.713 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 248:1 Invalid rule: ':matches(table, thead, tbody, tfoot, tr) > form {'
02-17 08:49:05.714 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 274:3 Unsupported property declaration: 'border-color: ThreeDFace;'
02-17 08:49:05.714 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 276:3 Unsupported property declaration: 'min-width: min-content;'
02-17 08:49:05.714 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 285:9 Unsupported property declaration: 'object-fit: contain;'
02-17 08:49:05.714 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 304:3 Unsupported property declaration: 'object-fit:contain;'
02-17 08:49:05.717 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 21:1 Invalid rule: 'ol[type=1], li[type=1] {'
02-17 08:49:05.718 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 24:26 Unsupported property declaration: 'list-style-type: lower-roman;'
02-17 08:49:05.718 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 25:26 Unsupported property declaration: 'list-style-type: upper-roman;'
02-17 08:49:05.718 32668 32692 D RustAndroidGlueStdouterr: INFO:style::error_reporting: 35:1 Invalid rule: ':matches(thead, tbody, tfoot, tr, td, th)[align=absmiddle i] {'
02-17 08:49:05.822 32668 32692 D RustAndroidGlueStdouterr: INFO:net::cookie_storage:  === COOKIES SENT: 
02-17 08:49:05.822 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader: GET https://people-mozilla.org/~fdesre/servo/
02-17 08:49:05.822 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - Accept: text/html, application/xhtml+xml, application/xml; q=0.9, */*; q=0.8
02-17 08:49:05.822 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - Accept-Language: en-US, en; q=0.5
02-17 08:49:05.822 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - User-Agent: Mozilla/5.0 (Android; Mobile; rv:37.0) Servo/1.0 Firefox/37.0
02-17 08:49:05.822 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - Host: people-mozilla.org
02-17 08:49:05.822 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - Accept-Encoding: gzip, deflate, br
02-17 08:49:05.822 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader: None
02-17 08:49:05.961 32668 32692 D RustAndroidGlueStdouterr: WARN:html5ever::tree_builder::actions: stop_parsing not implemented, full speed ahead!
02-17 08:49:05.962 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader: GET https://people-mozilla.org/~fdesre/servo/logo.png
02-17 08:49:05.962 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - Accept: image/png, image/svg+xml, image/*; q=0.8, */*; q=0.5
02-17 08:49:05.962 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - Accept-Language: en-US, en; q=0.5
02-17 08:49:05.962 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - User-Agent: Mozilla/5.0 (Android; Mobile; rv:37.0) Servo/1.0 Firefox/37.0
02-17 08:49:05.962 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - Host: people-mozilla.org
02-17 08:49:05.962 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader:  - Accept-Encoding: gzip, deflate, br
02-17 08:49:05.962 32668 32692 D RustAndroidGlueStdouterr: INFO:net::http_loader: None
02-17 08:49:05.963 32668 32692 D RustAndroidGlueStdouterr: INFO:script::dom::window: script: waiting on layout
02-17 08:49:08.729 32668 32691 V threaded_app: New input event: type=2
02-17 08:49:08.803 32668 32691 V threaded_app: New input event: type=2
^C

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Feb 21, 2017

Hello,

The MozVR team wants a full working Servo Android browser :) I have been debugging some of the issues on Android. This is the current status:

  • I have implemented the missing WindowProxy on Android. Now input events are not required to see anything on screen or to run requestAnimationFrame/timers. PR submitted to android-rs-glue upstream rust-windowing/android-rs-glue#127 Will submit additional PRs to servo glutin and @mmatyas' android-rs-injected-glue fork when the upstream one is merged.
  • WebGL canvas creation was crashing on Nexus 4 and Google Pixel. This PR fixes these problems: servo/surfman#83
  • Servo for Android shows a white/black screen most of the times, even with simple pages like a WebGL triangle or a html with plain images. I've done some deeper debugging to hunt down this problem because as @mmatyas said the logs didn't show anything particularly interesting and there were no errors. There seems to be a issue with the alpha clipping on Android, opened this issue with more detailed info of the problem: servo/webrender#907. We can bypass this error just setting a fixed alpha to 1.0. We can see the WebGL Triangle on the Google Pixel doing that :)


triangle

  • I'm working on fixing additional problems like a crash while changing device orientation or when the app goes to background.

  • I think that we should upgrade the current built system (ant) to gradle. We'll need to add some .aar or gradle dependencies and ant is very old do to that kind of things. Another benefit of using gradle is that we can open the project with Android Studio and run the brand new GPU debugger on any Android phone.
    I'd like to submit a PR including gradle support. Using the gradle wrapper the gradle build system is automatically downloaded on both linux and windows machines. We should move to a newer android-target too, that probably will require running android tools update on build machines. @larsbergstrom what do you think about moving to gradle? Would you like that I work on a PR?

@emilio
Copy link
Member

@emilio emilio commented Feb 21, 2017

Just wanted to say that this is awesome @MortimerGoro, thanks for looking into this :)

@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented Feb 21, 2017

@fabricedesre I thought that we didn't have support in WR for those OpenGLES platforms on the Z3C, at least the last time I tested it. I'd look there first :-)

@MortimerGoro I think that upgrading the build system would be fantastic! One thing we've struggled with in the past is that Servo's use of glutin for handling windowing events has limited our ability to do android-specific stuff (intent and event handling, in particular) as the event are largely swallowed. Now that @mmatyas has a separate copy of all that stuff, though (https://github.com/mmatyas/android-rs-injected-glue/blob/master/src/lib.rs ), we may have the ability to do a bit more with that. If he's OK with it, we could even just move that into the servo GitHub organization.

Thanks so much for taking this on :-)

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Feb 21, 2017

@larsbergstrom Totally agree. While working on this issues I had the same feeling about the limited flexibility of doing android-specific stuff, too many different repos to work and submit PRs on. It slows the development. Just adding the required combinations of cargo replaces in the cargo.toml is a time consumer. We could even move @mmatyas repo to Servo port folder or android specific folder. IMO we should find a good way to merge android_glue crate too. Right now it's a separate crate but it's totally tied to android-rs-injected-glue fork.

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Feb 22, 2017

This is awesome @MortimerGoro! I'll try your patches on our devices as soon as I can!

Yes, android-rs-injected-glue is a copy of the injected-glue part of android-rs-glue; it was moved to a separate repository to avoid the dependency on cargo-apk, android-rs-glue's custom build tool that can be used to inject the required native libraries and the window handling glue code. I've tried using cargo-apk with Servo, but I had to add so many changes that in the end, the current build system with a separate lib turned out to be cleaner.

If it'd help the development, I'm fine with moving the repository to the organization, or integrate it to the main repo. I agree that in the long term, using Gradle or Bazel would be better, if we can manage to use it with Servo. We've discussed this with @larsbergstrom previously (there should be an issue about it somewhere), but back then the priority was to just make the Android port build again after several breaking changes (#13154).

The new build system should work with all the different methods the dependencies use (autotools, pure makefile, cmake, cmake with custom toolchain, cargo projects, ...) and should remove the need of linker scripts like this. I've seen Rust addons for both Gradle/Bazel, though I'm not sure how they'd scale for such a "multicultural" project.

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Feb 24, 2017

Hmm, I've tried your patches (glue, webrender, offscreen) on Odroid XU3 and OnePlus2, but I still experience all the previous issues... Have I forgot to apply something? Do you have a Servo branch with your changes?

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Feb 24, 2017

@mmatyas You need to apply this too MortimerGoro/glutin@87d291e

And remove this lines in servo/ports/glutin/window.rs

 // WindowProxy is not implemented for android yet 
#[cfg(target_os = "android")] 
fn create_window_proxy(_: &Window) -> Option<glutin::WindowProxy> { 
    None 
} 
#[cfg(not(target_os = "android"))] 

I'll submit new PRs soon with the life cycle improvements and gradle integration.

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Feb 24, 2017

Thanks! This indeed fixed the proxy-related issues. I still have the graphical glitches (white screen + scrollbar only) on regular webpages, and WebGL crashes (eg. on get.webgl.org); I'll check Servo's test files later too.

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Feb 24, 2017

One more thing for the WebGL crashes: ./mach cargo-update -p angle (The ESSL support you added is not merged yet in upstream servo)

For the glitches: Did you add the full fix? servo/webrender#913 WebGL only uses that shader but regular webpages will use more shaders that are affected by the same sCache texture bug. I haven't tried the dummy texture fix with regular pages yet. Only tried WebGL with my alpha bypass.

Looking forward to having all those separate fixes merged upstream so we can just clone servo and test :)

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Feb 27, 2017

I've checked some of the HTML test files, but all of them had graphical problems on Odroid XU3. test_webgl_triangle.html for example segfaults, with the following warning:

WARN:canvas::webgl_paint_thread: Initial context creation failed, falling back to readback: Error creating an EGL context

I've double checked the repositories, I'm on commit ba8ce0 ("Auto merge of 913") of Webrender, 0.6.1/36feed ("Bump version") of offscreen_gl_context, 3dd494 ("Auto merge of 17") of angle, 1995be of android-rs-injected-glue and 66b4204 ("Merge pull request 127") of android-rs-glue. The glutin fix is applied too. Do I need anything else?

@emilio
Copy link
Member

@emilio emilio commented Feb 27, 2017

Do you have a backtrace of that?

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Feb 27, 2017

Try to run cargo tests from https://github.com/emilio/rust-offscreen-rendering-context on that device

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Feb 28, 2017

@emilio Here's the full logcat output: http://pastebin.com/kitKNmdw, or the shorter backtrace:

I/DEBUG   ( 2839): backtrace:
I/DEBUG   ( 2839):     #00  pc 0104b6c8  /data/app-lib/com.mozilla.servo-2/libmain.so (_$LT$script..dom..webglrenderingcontext..WebGLRenderingContext$u20$as$u20$script..dom..bindings..codegen..Bindings..WebGLRenderingContextBinding..WebGLRenderingContextBinding..WebGLRenderingContextMethods$GT$::CompileShader::hb0bf2fc47babcf62+120)
I/DEBUG   ( 2839):     #01  pc 01c599e8  /data/app-lib/com.mozilla.servo-2/libmain.so (TCompiler::Init(ShBuiltInResources const&)+132)

@MortimerGoro I'm not sure what do you mean, how should I run the rust-offscreen-rendering-context tests on Android? If you can help with that I'm fine with testing anything :)

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Feb 28, 2017

@mmatyas @emilio The backtrace points to a crash when compiling the shader using Angle transpiler. I had a simular issue but after updgrading to servo/angle@3dd4940 the problem was fixed. mmatyas is using that commit already, weird crash if that's the case.

@mmatyas About running cargo tests on android there isn't much documentation, I did some research and the easy way is to use https://github.com/snipsco/dinghy

First install
cargo install dinghy

Then on rust-offscreen-rendering-context folder run:
cargo dinghy test

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Feb 28, 2017

Thanks, but unfortunately dinghy fails with a No such file or directory (os error 2) error. It doesn't tell me what it tried to open even with the debug messages turned on. I guess I'll have to dig through the source...

By the way, we have just tested this build on a OnePlus2 too, and it crashes on launch: https://gist.github.com/dati91/c29cdedf7cc21f2c95ba1a35074a7f71

@emilio
Copy link
Member

@emilio emilio commented Feb 28, 2017

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Feb 28, 2017

After rebasing upstream I get the same shader compilation crash, only on release builds.

@MortimerGoro
Copy link
Contributor

@MortimerGoro MortimerGoro commented Feb 28, 2017

@mmatyas @larsbergstrom PR with Gradle integration and life cycle improvements ready here: #15773

bors-servo added a commit that referenced this issue Mar 11, 2017
Android life cycle improvements and Gradle integration

This PR includes Android life cycle Improvements and Gradle integration for android packaging.

Android life cycle improvements are implemented in both the new [MainActivity](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-f43708b102e98272c2af7454b8846927) and native code in this related PR: servo/glutin#117
- Properly handle the life cycle of the Android Activity: manage EGLContext lost & restore, and animation loop pause/resume when the app goes to background/foreground or orientation changes. In the current upstream Servo crashes when the app goes to background, activity stops or changes orientation
- Handle event loop awake for Servo Animation loop
- Handle screen resize & orientation events
- Implement new keep_screen_on preference which keeps Android device's screen from ever going to sleep: very useful for games or WebVR
- Implement a full screen mode enabled by preference: very useful for games or WebVR
- Implement new shell.native-orientation preference which allows to lock the Activity to a specific orientation
- Automatically sync new android assets to sdcard when the Android version code is changed.  In the current upstream only the existence of the folder is check but resources are not updated

ofscreen_gl_context is updated to fix this: servo/surfman#83

This PR integrates Gradle build system for android packaging. Most of the code is implemented in this [build.gradle](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-89cdb9324addb994cdba0a158b209547) . We can get rid of [build-apk](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-40f5a7cf22f94aad059b2c1795347f5e) and manual jar dependency copying in the [package_commands.py](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-0d425b142c8d10ae6ac1f3711fb5c23a). The correct version of gradle is automatically downloaded using the gradlew wrapper.

Some improvements:
- Allows to include more complex android dependencies/SDKs like AARs, manifest auto-merging and more.
- Improved packaging process: The gradle project is always in the same folder, it uses relative paths for everything (assets, native libraries) and outputs the apk into the correct target folder in servo. In the current upstream, ant/python build system copies the manifest, project, resources and jars each time so you end with multiple copies of the same files.
- Improved dependency declaration. We do not have to manually copy jar dependencies in the python script anymore. The gradle build scripts itself is able to search for the dependencies in the correct servo target folder.
- Supports packaging apks with different architectures: armeabi, armeabi-v7a, aarch64. We still need to fix some native servo compilation issues with armeabi-v7a, aarch64 due to dependencies which use `make`. I'll push this changes in a separate PR of the python build files but the gradle file is already ready to handle that.
- We can easily create product flavors for different versions of Servo. For example a default browser, a WebVR browser with additional dependencies or a Servo android Webview component
- Fixes minor.major.52 build error when blurdroid cargo dependency is compiled using java8 (the default in new Linux machines). The gradle build file enables the new Jack compiler which supports Java8 dependencies.
- The project can be opened with Android Studio and run the brand new GPU debugger on any Android phone. I'll add some docs in the Wiki about this.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14568 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15773)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Mar 13, 2017
Android life cycle improvements and Gradle integration

This PR includes Android life cycle Improvements and Gradle integration for android packaging.

Android life cycle improvements are implemented in both the new [MainActivity](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-f43708b102e98272c2af7454b8846927) and native code in this related PR: servo/glutin#117
- Properly handle the life cycle of the Android Activity: manage EGLContext lost & restore, and animation loop pause/resume when the app goes to background/foreground or orientation changes. In the current upstream Servo crashes when the app goes to background, activity stops or changes orientation
- Handle event loop awake for Servo Animation loop
- Handle screen resize & orientation events
- Implement new keep_screen_on preference which keeps Android device's screen from ever going to sleep: very useful for games or WebVR
- Implement a full screen mode enabled by preference: very useful for games or WebVR
- Implement new shell.native-orientation preference which allows to lock the Activity to a specific orientation
- Automatically sync new android assets to sdcard when the Android version code is changed.  In the current upstream only the existence of the folder is check but resources are not updated

ofscreen_gl_context is updated to fix this: servo/surfman#83

This PR integrates Gradle build system for android packaging. Most of the code is implemented in this [build.gradle](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-89cdb9324addb994cdba0a158b209547) . We can get rid of [build-apk](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-40f5a7cf22f94aad059b2c1795347f5e) and manual jar dependency copying in the [package_commands.py](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-0d425b142c8d10ae6ac1f3711fb5c23a). The correct version of gradle is automatically downloaded using the gradlew wrapper.

Some improvements:
- Allows to include more complex android dependencies/SDKs like AARs, manifest auto-merging and more.
- Improved packaging process: The gradle project is always in the same folder, it uses relative paths for everything (assets, native libraries) and outputs the apk into the correct target folder in servo. In the current upstream, ant/python build system copies the manifest, project, resources and jars each time so you end with multiple copies of the same files.
- Improved dependency declaration. We do not have to manually copy jar dependencies in the python script anymore. The gradle build scripts itself is able to search for the dependencies in the correct servo target folder.
- Supports packaging apks with different architectures: armeabi, armeabi-v7a, aarch64. We still need to fix some native servo compilation issues with armeabi-v7a, aarch64 due to dependencies which use `make`. I'll push this changes in a separate PR of the python build files but the gradle file is already ready to handle that.
- We can easily create product flavors for different versions of Servo. For example a default browser, a WebVR browser with additional dependencies or a Servo android Webview component
- Fixes minor.major.52 build error when blurdroid cargo dependency is compiled using java8 (the default in new Linux machines). The gradle build file enables the new Jack compiler which supports Java8 dependencies.
- The project can be opened with Android Studio and run the brand new GPU debugger on any Android phone. I'll add some docs in the Wiki about this.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14568 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15773)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Apr 12, 2017
…trom,fabricedesre

Android life cycle improvements and Gradle integration

This PR includes Android life cycle Improvements and Gradle integration for android packaging.

Android life cycle improvements are implemented in both the new [MainActivity](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-f43708b102e98272c2af7454b8846927) and native code in this related PR: servo/glutin#117
- Properly handle the life cycle of the Android Activity: manage EGLContext lost & restore, and animation loop pause/resume when the app goes to background/foreground or orientation changes. In the current upstream Servo crashes when the app goes to background, activity stops or changes orientation
- Handle event loop awake for Servo Animation loop
- Handle screen resize & orientation events
- Implement new keep_screen_on preference which keeps Android device's screen from ever going to sleep: very useful for games or WebVR
- Implement a full screen mode enabled by preference: very useful for games or WebVR
- Implement new shell.native-orientation preference which allows to lock the Activity to a specific orientation
- Automatically sync new android assets to sdcard when the Android version code is changed.  In the current upstream only the existence of the folder is check but resources are not updated

ofscreen_gl_context is updated to fix this: servo/surfman#83

This PR integrates Gradle build system for android packaging. Most of the code is implemented in this [build.gradle](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-89cdb9324addb994cdba0a158b209547) . We can get rid of [build-apk](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-40f5a7cf22f94aad059b2c1795347f5e) and manual jar dependency copying in the [package_commands.py](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-0d425b142c8d10ae6ac1f3711fb5c23a). The correct version of gradle is automatically downloaded using the gradlew wrapper.

Some improvements:
- Allows to include more complex android dependencies/SDKs like AARs, manifest auto-merging and more.
- Improved packaging process: The gradle project is always in the same folder, it uses relative paths for everything (assets, native libraries) and outputs the apk into the correct target folder in servo. In the current upstream, ant/python build system copies the manifest, project, resources and jars each time so you end with multiple copies of the same files.
- Improved dependency declaration. We do not have to manually copy jar dependencies in the python script anymore. The gradle build scripts itself is able to search for the dependencies in the correct servo target folder.
- Supports packaging apks with different architectures: armeabi, armeabi-v7a, aarch64. We still need to fix some native servo compilation issues with armeabi-v7a, aarch64 due to dependencies which use `make`. I'll push this changes in a separate PR of the python build files but the gradle file is already ready to handle that.
- We can easily create product flavors for different versions of Servo. For example a default browser, a WebVR browser with additional dependencies or a Servo android Webview component
- Fixes minor.major.52 build error when blurdroid cargo dependency is compiled using java8 (the default in new Linux machines). The gradle build file enables the new Jack compiler which supports Java8 dependencies.
- The project can be opened with Android Studio and run the brand new GPU debugger on any Android phone. I'll add some docs in the Wiki about this.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14568 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15773)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Apr 21, 2017
…trom,fabricedesre

Android life cycle improvements and Gradle integration

This PR includes Android life cycle Improvements and Gradle integration for android packaging.

Android life cycle improvements are implemented in both the new [MainActivity](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-f43708b102e98272c2af7454b8846927) and native code in this related PR: servo/glutin#117
- Properly handle the life cycle of the Android Activity: manage EGLContext lost & restore, and animation loop pause/resume when the app goes to background/foreground or orientation changes. In the current upstream Servo crashes when the app goes to background, activity stops or changes orientation
- Handle event loop awake for Servo Animation loop
- Handle screen resize & orientation events
- Implement new keep_screen_on preference which keeps Android device's screen from ever going to sleep: very useful for games or WebVR
- Implement a full screen mode enabled by preference: very useful for games or WebVR
- Implement new shell.native-orientation preference which allows to lock the Activity to a specific orientation
- Automatically sync new android assets to sdcard when the Android version code is changed.  In the current upstream only the existence of the folder is check but resources are not updated

ofscreen_gl_context is updated to fix this: servo/surfman#83

This PR integrates Gradle build system for android packaging. Most of the code is implemented in this [build.gradle](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-89cdb9324addb994cdba0a158b209547) . We can get rid of [build-apk](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-40f5a7cf22f94aad059b2c1795347f5e) and manual jar dependency copying in the [package_commands.py](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-0d425b142c8d10ae6ac1f3711fb5c23a). The correct version of gradle is automatically downloaded using the gradlew wrapper.

Some improvements:
- Allows to include more complex android dependencies/SDKs like AARs, manifest auto-merging and more.
- Improved packaging process: The gradle project is always in the same folder, it uses relative paths for everything (assets, native libraries) and outputs the apk into the correct target folder in servo. In the current upstream, ant/python build system copies the manifest, project, resources and jars each time so you end with multiple copies of the same files.
- Improved dependency declaration. We do not have to manually copy jar dependencies in the python script anymore. The gradle build scripts itself is able to search for the dependencies in the correct servo target folder.
- Supports packaging apks with different architectures: armeabi, armeabi-v7a, aarch64. We still need to fix some native servo compilation issues with armeabi-v7a, aarch64 due to dependencies which use `make`. I'll push this changes in a separate PR of the python build files but the gradle file is already ready to handle that.
- We can easily create product flavors for different versions of Servo. For example a default browser, a WebVR browser with additional dependencies or a Servo android Webview component
- Fixes minor.major.52 build error when blurdroid cargo dependency is compiled using java8 (the default in new Linux machines). The gradle build file enables the new Jack compiler which supports Java8 dependencies.
- The project can be opened with Android Studio and run the brand new GPU debugger on any Android phone. I'll add some docs in the Wiki about this.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14568 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15773)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

7 participants
You can’t perform that action at this time.