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

In tabbed layout, multiple browser windows slow each other down. #5723

Open
crocket opened this issue Oct 6, 2020 · 19 comments
Open

In tabbed layout, multiple browser windows slow each other down. #5723

crocket opened this issue Oct 6, 2020 · 19 comments
Labels
bug Not working as intended client-compat Compatibility issues with a particular application

Comments

@crocket
Copy link

crocket commented Oct 6, 2020

  • Enter tabbed layout.
  • Open brave browser.
  • Open a new window with Ctrl+N
  • Switch focus between brave windows
  • Open a URL in a new window. Go back to the first window. You see that there is a lot of lag in rendering of brave windows.
@crocket crocket added the bug Not working as intended label Oct 6, 2020
@emersion emersion added the client-compat Compatibility issues with a particular application label Oct 9, 2020
@emersion
Copy link
Member

emersion commented Oct 9, 2020

Can you provide a WAYLAND_DEBUG=1 log of your client?

WAYLAND_DEBUG=1 your-client >client.log 2>&1
# Then reproduce the bug

This is likely a client bug.

@crocket
Copy link
Author

crocket commented Oct 9, 2020

[13939:13967:1009/170357.376818:ERROR:object_proxy.cc(621)] Failed to call method: org.freedesktop.Notifications.GetCapabilities: object_path= /org/freedesktop/Notifications: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.Notifications exited with status 1
[13939:13993:1009/170357.402296:ERROR:object_proxy.cc(621)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[13939:13993:1009/170357.402481:ERROR:object_proxy.cc(621)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[13939:13993:1009/170357.402654:ERROR:object_proxy.cc(621)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[13964:13964:1009/170357.497853:ERROR:vaapi_wrapper.cc(546)] vaInitialize failed: unknown libva error
[13964:13964:1009/170357.501124:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[13939:13939:1009/170404.440400:ERROR:CONSOLE(1)] "[Shields]: Can't request shields panel data. Error: No tab url specified", source: chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/out/brave_extension_background.bundle.js (1)
[13939:13939:1009/170404.441815:ERROR:CONSOLE(1)] "[Shields]: Can't request shields panel data. Error: No tab url specified", source: chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/out/brave_extension_background.bundle.js (1)
[13939:13939:1009/170404.442545:ERROR:CONSOLE(1)] "[Shields]: Can't request shields panel data. Error: No tab url specified", source: chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/out/brave_extension_background.bundle.js (1)
[13939:13939:1009/170404.477497:ERROR:CONSOLE(0)] "Unchecked runtime.lastError: Cannot access contents of url "chrome-extension://dpjamkmjmigaoobjbekmfgabipmfilij/empty_ntp.html". Extension manifest must request permission to access this host.", source: chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/_generated_background_page.html (0)
[13964:13964:1009/170405.357948:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 1 times!
[13964:13964:1009/170405.366445:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 2 times!
[13964:13964:1009/170405.379717:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 3 times!
Fontconfig error: Cannot load default config file: No such file: (null)
[13939:13939:1009/170419.039444:ERROR:CONSOLE(0)] "Unchecked runtime.lastError: Cannot access contents of url "chrome-extension://dpjamkmjmigaoobjbekmfgabipmfilij/empty_ntp.html". Extension manifest must request permission to access this host.", source: chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/_generated_background_page.html (0)

@emersion
Copy link
Member

emersion commented Oct 9, 2020

Eh, seems like it's using X11. I don't see anything to be done here...

@crocket
Copy link
Author

crocket commented Oct 9, 2020

This doesn't happen on i3.

@crocket
Copy link
Author

crocket commented Oct 9, 2020

I can reproduce this issue on qutebrowser, too.

@Emantor
Copy link
Contributor

Emantor commented Oct 9, 2020

Since this happens on X11 this may be related to Xwayland, can you try to reproduce this within Weston?

@crocket
Copy link
Author

crocket commented Oct 9, 2020

@Emantor This is only reproducible in tabbed layout. It is not reproducible in split layouts. Weston is not a tiling window manager.

This issue is reproducible on qutebrowser which is a Qt program when Qt backend is XCB. When Qt backend is wayland, this issue doesn't occur on qutebrowser.

@crocket
Copy link
Author

crocket commented Oct 17, 2020

I couldn't reproduce the issue in weston-launch. This issue is reproducible in tabbed layout.

@fourstepper
Copy link

This is kind of happening on GNOME as well - if I open two Chrome/Chromium/Brave windows and full screen them, there seems to be noticeable lag to either of the windows - just saying that this is quite probably an issue with XWayland and not Sway itself

@Me7426
Copy link

Me7426 commented Nov 20, 2020

Same problem at Chrome(xwayland) since version 85.

@Me7426
Copy link

Me7426 commented Nov 20, 2020

Same problem at Chrome(xwayland) since version 85.

I try to use Chrome-ozone(wayland) to avoid this issue, but it can't support IME, so sad...

@fourstepper
Copy link

@Me7426 what is IME?

@Me7426
Copy link

Me7426 commented Nov 20, 2020

@Me7426 what is IME?

Input Method :)
All of Chrome/Chromium with wayland patch can't support input method, I don't know why.

@crocket
Copy link
Author

crocket commented Nov 20, 2020

wayland input method support is still in its infancy. Don't expect it to work on wayland clients.

@crocket crocket changed the title In tabbed layout, multiple brave browser windows slow each other down. In tabbed layout, multiple browser windows slow each other down. Feb 20, 2021
@crocket
Copy link
Author

crocket commented Feb 20, 2021

This issue is also reproducible on firefox, too.

@bard
Copy link

bard commented Jul 31, 2022

Reproducible with Chromium 103:

  1. start browser window A with a YouTube video
  2. start browser window B in another Sway tab or workspace
  3. interaction in browser window ] stutters (e.g. scrolling takes 1-3 seconds to respond)
  4. focus browser window A and open an empty tab, so that the YouTube video is in the background
  5. focus browser window B, interaction is smooth

This makes me think that Chrome window A doesn't "get the message" at step 2 that it's actually in the background, and doesn't suspend page rendering.

This seems confirmed by Page Visibility API test at http://daniemon.com/tech/webapps/page-visibility/. The browser Page Visibility API tells a page when it's not visible. In the test, if you switch to another tab, video pauses, but if you switch to another WM tab or workspace, video keeps going, meaning that the page still thinks it's visible.

You might not notice this on machines with more than 2 cores (but your battery probably will).

@emersion
Copy link
Member

There is no "visibility" API in Wayland. Instead, invisible windows stop getting wl_surface.frame events and the Wayland client should stop rendering.

@bard
Copy link

bard commented Jul 31, 2022

@emersion never said there was one; I wrote: "The browser Page Visibility API tells a page when it's not visible". (https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API)

I mentioned it because it helps confirm that the browser thinks the window is still visible, more precisely than just inferring it from the slowdown. I'm not making hypotheses as to why the browser thinks so.

@jsimmons
Copy link

I have a feeling this also breaks twitch streaming. (which is broken on sway/chrome. just start a stream and switch desktops, after a minute or so it'll stop playing in the background)

The browser gets rate limited by sway because it's off screen, but never gets told it's off-screen because wayland hasn't made any progress on the surface suspension API. This means the streaming hasn't stopped rendering or adapted its rate (because it doesn't know it's off-screen), however because the window is only getting frame events at 1Hz, it stalls out the entire application causing the stream to be delayed and eventually stop rendering at all after about a minute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended client-compat Compatibility issues with a particular application
Development

No branches or pull requests

7 participants