[snap] Chromium has Wayland support disabled

Bug #1897454 reported by Jasiek Marcinkowski
70
This bug affects 14 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Fix Released
Medium
Olivier Tilloy

Bug Description

Since v87 Chromium ships with support for Ozone/Wayland:
https://www.phoronix.com/scan.php?page=news_item&px=Chrome-87-Ozone-Try-Again.

This build flag is not disabled in dev (edge) channel build, so it should be possible to run Chromium with flags
  --enable-features=UseOzonePlatform --ozone-platform=wayland.

This does not work due to environment variable DISABLE_WAYLAND set to 1 here:
https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/tree/snapcraft.yaml?h=dev#n18.

tags: added: snap
Olivier Tilloy (osomon)
summary: - Chromium Dev Snap cuts off Wayland display
+ [snap] Chromium dev cuts off Wayland display
Revision history for this message
Olivier Tilloy (osomon) wrote : Re: [snap] Chromium dev cuts off Wayland display

I unpacked the snap from the dev channel, remove the DISABLE_WAYLAND definition, added the wayland plug, but the application still fails to display a window:

ubuntu@groovyvm:~$ chromium --enable-features=UseOzonePlatform --ozone-platform=wayland
[5042:5042:0928/181747.909095:ERROR:egl_util.cc(70)] Failed to load GLES library: libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
[5042:5042:0928/181748.000370:ERROR:viz_main_impl.cc(150)] Exiting GPU process due to errors during initialization

(chrome:4835): dbind-WARNING **: 18:17:48.525: Could not open X display

This requires more investigation and work.

Also, that phoronix news states that it's unlikely to ship soon in the stable builds.

Changed in chromium-browser (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Jasiek Marcinkowski (jasiekmarc) wrote :

Good point. I did not go that far.

I can only attest that it should work when packaged correctly. This comment is being written from (Google branded) Chrome Unstable with these flags and it runs pure Wayland.

Revision history for this message
Alberto Donato (ack) wrote :

I did a quick test by unpacking the current stable snap (87.0.4280.88, rev. 1421)

After removing DISABLE_WAYLAND, adding wayland plug, I copied missing /usr/lib/x86_64-linux-gnu/libEGL* and /usr/lib/x86_64-linux-gnu/libGLESv2* to the unpacked snap.

I now get the following errors:

[1709538:1709538:1207/111235.153734:ERROR:gl_surface_egl.cc(1297)] EGL display query failed with error EGL_BAD_PARAMETER
[1709538:1709538:1207/111235.153855:ERROR:gl_surface_egl.cc(1322)] eglInitialize Default failed with error EGL_BAD_DISPLAY
[1709538:1709538:1207/111235.154551:ERROR:gl_ozone_egl.cc(20)] GLSurfaceEGL::InitializeOneOff failed.
[1709538:1709538:1207/111235.170003:ERROR:viz_main_impl.cc(150)] Exiting GPU process due to errors during initialization
[1709560:1709560:1207/111235.252396:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.

The process doesn't die and it seems it creates an invisible window (it shows in the app switcher), but nothing shows on screen

Changed in chromium-browser (Ubuntu):
importance: Medium → Low
Revision history for this message
Olivier Tilloy (osomon) wrote :

Alberto, please note that the snap already has libEGL.so and libGLESv2.so, they live in /snap/chromium/current/usr/lib/chromium-browser/.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Even in Chrome where Wayland does seem to work (manually), it warns that gnome-shell/mutter is missing zwp_linux_explicit_synchronization_v1. I wonder if that explains the laggy feeling?

summary: - [snap] Chromium dev cuts off Wayland display
+ [snap] Chromium has Wayland support disabled
Revision history for this message
Alex Murray (alexmurray) wrote :

The priority of this bug is Low but since Wayland is now the default session this means chromium runs via XWayland and then when doing window/screen sharing on say Google Meet I can only share windows which are also using XWayland, not native ones - which is the majority of the rest of the desktop. Any chance this can get given higher priority so we don't regress too much for Jammy?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Before assuming that enabling Wayland would fix the screen sharing issues, please verify that it actually does:

  chromium --enable-features=UseOzonePlatform --ozone-platform=wayland

Revision history for this message
Luis Alberto Pabón (copong) wrote :

It still fails to start (sway 1.7):

~ chromium --enable-features=UseOzonePlatform --ozone-platform=wayland
[278662:278662:0310/100635.924517:ERROR:wayland_connection.cc(209)] Failed to connect to Wayland display
[278662:278662:0310/100635.924552:ERROR:ozone_platform_wayland.cc(226)] Failed to initialize Wayland platform
[278662:278662:0310/100635.924557:ERROR:env.cc(225)] The platform failed to initialize. Exiting.

Revision history for this message
Luis Alberto Pabón (copong) wrote :

Forgot to add. Chromium is from the edge channel, at version 101.0.4919.0

Revision history for this message
Alexander Browne (elcste) wrote :

You could test an upstream build of Chromium: https://download-chromium.appspot.com/

Since this version is unconfined, it doesn't share config data with the snap, so it's safe to use alongside the snap for testing.

Revision history for this message
Alberto Donato (ack) wrote :

This still fails with Chromium 100.0.4896.127 (snap 1967) on 22.04:

$ chromium --enable-features=UseOzonePlatform --ozone-platform=wayland
[261783:261783:0425/123646.322058:ERROR:wayland_connection.cc(209)] Failed to connect to Wayland display
[261783:261783:0425/123646.322098:ERROR:ozone_platform_wayland.cc(226)] Failed to initialize Wayland platform
[261783:261783:0425/123646.322105:ERROR:env.cc(225)] The platform failed to initialize. Exiting.

Revision history for this message
Olivier Tilloy (osomon) wrote :

This should be fixed with https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/commit/?id=a4f41b5c065e14e954bc81d2d3e2b0c7fc26fc4d.

With the next builds that pick up this change, chromium will still default to XWayland, but users can change this setting at chrome://flags/#ozone-platform-hint to try out native Wayland support.

Changed in chromium-browser (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
status: Confirmed → Fix Committed
importance: Low → Medium
tags: added: wayland wayland-session
Revision history for this message
Alexander Browne (elcste) wrote :

I can confirm wayland works for the version 102.0.5005.40 snap just built and released in the beta channel. Thanks!

Revision history for this message
Luis Alberto Pabón (copong) wrote :

It works for me on 102.0.5005.40 (latest/beta channel) but with the following GPU error messages:

```
[2005781:2005781:0506/130903.210912:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is egl, ANGLE is
WARNING: Kernel has no file descriptor comparison support: Operation not permitted
[2005575:2005810:0506/130906.160463:ERROR:udev_watcher.cc(98)] Failed to begin udev enumeration.
```

And thousands of

```
[2008866:20:0506/131316.160676:ERROR:client_native_pixmap_dmabuf.cc(227)] Failed to mmap dmabuf: Permission denied (13)
```

Revision history for this message
Luis Alberto Pabón (copong) wrote :

It feels pretty sluggish to use. Not sure if it's a packaging issue or chromium issue.

Revision history for this message
Alexander Browne (elcste) wrote :

@copong Wayland for Chromium is definitely still experimental, but is under active development, helped because ChromeOS is/will use it.

I'd suggest you compare with an upstream build: https://download-chromium.appspot.com/

Just download, unpack and run the chromium binary. Since the snap's config is all in ~/snap/chromium, and this version just uses ~/ directly, it's easy to use along side.

Olivier Tilloy (osomon)
Changed in chromium-browser (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Now you can enable Wayland in chrome://flags with

  Preferred Ozone platform = Wayland

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Or as Olivier mentioned... chrome://flags/#ozone-platform-hint

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.