SpacingBat3 / WebCord

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

Can't run on wayland natively #492

Closed LOSEARDES77 closed 12 months ago

LOSEARDES77 commented 1 year ago

Acknowledgements

Operating System / Platform

🐧️ Linux

Operating system architecture

x64 (64-bit Intel/AMD)

Electron version

v25.9.4

Application version

v4.5.2

Bug description

Cant get it run natively on wayland

Additional context

the tray icon shows up but cant get the window to open


[24967:1128/231153.504220:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[24967:1128/231153.504266:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[24967:1128/231153.504302:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[24967:1128/231153.504315:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[24967:1128/231153.504328:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[24967:1128/231153.504340:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[24967:1128/231153.504366:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[GPU:8704] Process left us unexpectedly!
[GPU:TIP] Rest in peace, GPU... :(
[WebSocket] Listening at port 6463.
[25012:1128/231153.593119:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[25012:1128/231153.593163:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[25012:1128/231153.593261:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[25012:1128/231153.593340:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[25012:1128/231153.593355:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[25012:1128/231153.593431:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[25012:1128/231153.593458:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[GPU:8704] Process left us unexpectedly!
[GPU:TIP] Rest in peace, GPU... :(
[25024:1128/231153.674384:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[25024:1128/231153.674469:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[25024:1128/231153.674557:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[25024:1128/231153.674613:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[25024:1128/231153.674695:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[25024:1128/231153.674710:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[25024:1128/231153.674815:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[GPU:8704] Process left us unexpectedly!
[GPU:TIP] Rest in peace, GPU... :(
[UPDATE] Application is up-to-date!
^C⏎       ```
ElectricLizzzard commented 1 year ago

Add launch argument --ozone-platform=wayland Works as expected.

ThatOneCalculator commented 1 year ago

These are the flags I use on Hyprland with an AMD 6700XT: webcord --ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer --enable-features=VaapiVideoDecoder (with Optimize the client for the current graphics card OFF in the settings)

Janrupf commented 12 months ago

I don't believe this is fixable when running with electron 25 (I did not test 26 and 27). It however seems to be fixed when running with electron 28.

EDIT: I did now test with electron 27, and it still crashes. So electron 28 is required (this probably primarily affects Wayland on NVIDIA)

(Note: I only hacked a dirty setup together, no idea if everything else works properly with electron 28. Additionally this repository already specifies electron 27 as a dependency, but for example the AUR package uses electron 25)

SpacingBat3 commented 12 months ago

Honestly, the Electron is kinda old here (v25.9.4) and I haven't noticed that before, there are also some rumours that this might be a duplicate of #433. I also don't care anymore about supporting older Electron versions, I rather focus on maintaining my app under newer versions especially in case of EOF Electron releases (since those don't get any security patches anymore and it is no longer advised to use these).

I'll just close this as duplicate…

AlexFolland commented 3 months ago

Add launch argument --ozone-platform=wayland Works as expected.

The launch argument does switch to Wayland, but its scaling keeps multiplying on itself. I have one display at 50% scaling and when the Wayland window goes onto it, it becomes half size (even though just being on the display already makes it look half size), so it's 25% of its size, and then when I move it again, it becomes half of that again (12.5% size), and then at some point, it stops because the window manager has some kind of minimum window size. But it really shouldn't be continuously multiplying its own scaling. I have other Wayland-native electron windows that don't do that, like Whatsie, and I've checked that they are Wayland-native windows using the KWin debug console (can be opened with KRunner -> search for "KWin" -> "Open KWin debug console").

So, because of this crazy scaling issue, I have to omit the --ozone-platform=wayland argument and use an X11 window instead. Should I open a new issue ticket about this?

ThatOneCalculator commented 3 months ago

This sounds like an issue with your compositor or possibly Electron (maybe different electron versions?), but that's out of scope for this repo afaik.

AlexFolland commented 3 months ago

OK, thanks. I'll make a video for the KWin devs and they might be able to solve it.

SpacingBat3 commented 3 months ago

@AlexFolland a bit lucky thing about this is that I've tried out recently KDE and stuff like the cursor going scaled out for the whole screen for a while or DE not loading on Wayland until I press mouse seemed to be a normal issues. I've also didn't notice any scaling issues after my experience with Wayland "a bit stabilized". Funny thing was that main reason why I came back to XFCE4 was that… I couldn't position tray icons. Other issues I had were purely cosmetic for me.

(Anyway this is out-of-topic stuff, I'll flag my comment as such later if I won't forgot to do so, I'm on OctoDroid/gh4a right now and it doesn't seem to support such stuff yet.)