SpacingBat3 / WebCord

A Discord and SpaceBar :electron:-based client implemented without Discord API.
MIT License
1.88k stars 93 forks source link

Screen share is more laggy on Webcord than Discord #434

Open mak448a opened 1 year ago

mak448a commented 1 year ago

Aknowledgements

Operating System / Platform

🐧️ Linux

Operating system architecture

x64 (64-bit Intel/AMD)

Electron version

24.0.0

Application version

4.2.0

Bug description

Whenever I screenshare to a Direct Message channel, my friend says that it lags a lot. But when I use the official Discord on Xorg, he says it's a lot smoother.

Additional context

Wayland, Intel Iris Xe GPU

My friend is using the official Discord desktop client.

SpacingBat3 commented 1 year ago

One of possible cases:

  1. There's no GPU acceleration. There's a little you can do about it, you might mess with Chromium flags, try optimize setting that sets some of the flags automatically or use another Electron build with WebCord (it should be fine using versions as old as 23, maybe even 22).

  2. Differences in Discord WebRTC design described briefly in this comment and on Discord blog.

  3. A bug with Wayland, Chromium has these a lot.


There's very little I can do on my end for all of these cases:

  1. As discussed several times, there's no magical button nor switch that I could use to make GPU acceleration guaranteed on specific hardware; it all depends on Chromium, OS and driver support to happen. Currently WebCord has an option that triggers a bunch of flags that might help, but it can also make things worse or don't make any difference.
Handling GPU acceleration in Chromium be like:
  1. WebCord won't integrate with any of Discord's native modules for a lot of reasons (e.g. ARM support, legal use), but once I'll be done with making another Discord client / rewritting WebCord it might be possible for the community to do it for me without trashing or modifying the current implementation instead thanks to modular design.

  2. I do not work on Chromium engine, so don't expect me to fix this.


Also, due you did not provided the information if this issue was tested on X for WebCord as well, I'll add a Wayland label to indicate this might be a Wayland-specific issue. Feel free to comment on that to make this change, optionally also providing the information if XWayland or native Wayland was used.

mak448a commented 1 year ago

Ok, thanks

SpookySkeletons commented 1 year ago

I believe I know exactly what this is. Pipewire capture cross-GPU appears to lag something heavy, even OBS is affected if you happen to use your laptop dGPU to encode but your desktop session on the iGPU.

One of two things must be fixed, the Chromium engine should select the iGPU render node instead of the dGPU. Or pipewire screen capture on wayland needs cross-GPU performance addressed.

SpookySkeletons commented 7 months ago

Nope, I think it's just missing GPU accel overall

https://chromium-review.googlesource.com/c/chromium/src/+/3646633

SpookySkeletons commented 7 months ago

Reports of fully working wayland VAAPI incoming https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165

Amdarin commented 6 months ago

I don't know if this is a error Knowledge or not but I have this issue on performance in the last release in debian 12. I tried with discord and it works better than it. I want use webcord because full screen sharing in wayland is fully supported but the performance on it is awful, too much laggy. Could I help on it sending logs or similar? I downgrade two previous release even the colleage has indicated v4.6.1 and this one works a little bit better but not optimus.

mak448a commented 6 months ago

@Amdarin Have you tried xwaylandvideobridge for screensharing on the official client?

ruineka commented 1 month ago

@Amdarin Have you tried xwaylandvideobridge for screensharing on the official client?

I've done this and it crashes xwayland entirely when selecting new windows, such as games. When this happens your game, steam, and anything else running under xwayland will suddenly close.

mak448a commented 1 month ago

What is your distro and desktop environment? I’m using KDE.

ruineka commented 1 month ago

What is your distro and desktop environment? I’m using KDE.

EndeavourOS and Im using KDE 6.1.

mak448a commented 1 month ago

I just tried recently, and it seems like I can't share. Just a grey screen. No crashing though.

You should probably just use the web version discord.com/app instead, since browsers usually have better Wayland support.