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

[BUG] Screen sharing on Wayland does not work #82

Open
2 tasks done
NotMephisto opened this issue Jan 9, 2025 · 10 comments
Open
2 tasks done

[BUG] Screen sharing on Wayland does not work #82

NotMephisto opened this issue Jan 9, 2025 · 10 comments

Comments

@NotMephisto
Copy link

  • I have searched and found no existing issues on the same topic
  • I have searched the wiki and found no mention of my problem

Description

Steps to Reproduce

  • Open GoofCord
  • Join any voice chat
  • Turn on screen sharing

Expected Behavior

Screen shares properly without any artifacts or black screens

Actual Behavior

Screen sharing is broken...

Artifacts, black screen

[54:0109/094945.533844:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE
[54:0109/094945.533944:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
[54:0109/094945.534098:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE
[54:0109/094945.534154:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:425 pw_thread_loop_wait()
[54:0109/094945.537680:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE
[54:0109/094945.537773:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
[54:0109/094945.537915:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE
[54:0109/094945.537960:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
[3:0109/094947.676313:ERROR:wayland_event_watcher.cc(47)] libwayland: warning: queue 0x79c02204e40 destroyed while proxies still attached:

[3:0109/094947.676387:ERROR:wayland_event_watcher.cc(47)] libwayland:   wl_shm_pool#49 still attached

Screenshots

Environment

  • Operating System (name and version): Fedora 41
  • GoofCord Version: 1.8.1
  • Way of installing: Flatpak

Additional Information

Hyprland 46.2
Mesa 24.3.2
Kernel 6.12.8-200_tkg

@Milkshiift
Copy link
Owner

This does not seem to be a bug directly in GoofCord. There are many reports about the 'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:425 pw_thread_loop_wait() error online, and it seems to be caused by system misconfiguration.
See:
https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist
https://gist.github.com/saikocat/eec498db43bc71abfee79e2990f4d8b6
SpacingBat3/WebCord#513

You can also try a native .rpm build

@NotMephisto
Copy link
Author

NotMephisto commented Jan 9, 2025

Hm, strange... All packages have been installed and all services are running smoothly

Also I tried .rpm package but with no luck. When I stream, discord doesn't transmit picture and viewers can be heard on the stream, which should not be the case.

[74561:0109/140615.316930:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
[74561:0109/140615.350281:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE
[74561:0109/140615.350355:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
[74561:0109/140615.350471:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE
[74561:0109/140615.350509:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
[74561:0109/140615.364854:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE
[74561:0109/140615.364987:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
[74561:0109/140615.365158:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE
[74561:0109/140615.365233:ERROR:gpu_channel.cc(503)] Buffer Handle is null.
Missing config parameter: windowState:main
(node:74515) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading '1')
    at Fu (file:///opt/GoofCord/resources/app.asar/ts-out/chunk-20jtf6x6.js:15:308)
    at click (file:///opt/GoofCord/resources/app.asar/ts-out/chunk-20jtf6x6.js:20:6307)
    at MenuItem.click (node:electron/js2c/browser_init:2:35295)
    at a._executeCommand (node:electron/js2c/browser_init:2:40710)
(Use `goofcord --trace-warnings ...` to show where the warning was created)
(node:74515) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
Missing config parameter: windowState:main
(node:74515) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading '1')
    at Fu (file:///opt/GoofCord/resources/app.asar/ts-out/chunk-20jtf6x6.js:15:308)
    at click (file:///opt/GoofCord/resources/app.asar/ts-out/chunk-20jtf6x6.js:20:6307)
    at MenuItem.click (node:electron/js2c/browser_init:2:35295)
    at a._executeCommand (node:electron/js2c/browser_init:2:40710)
(node:74515) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)
[arRPC > bridge] web disconnected
[74515:0109/140631.187548:ERROR:network_service_instance_impl.cc(613)] Network service crashed, restarting service.
[74515:0109/140631.203343:ERROR:gpu_process_host.cc(982)] GPU process exited unexpectedly: exit_code=15

P.S.: Obs works fine

@Milkshiift
Copy link
Owner

Milkshiift commented Jan 12, 2025

When you click the screen share button, do you first see GoofCord's screen share picker with a black "Entire screen", or your system (pipewire) screen share picker?

@Milkshiift Milkshiift changed the title [BUG] Screen sharing [BUG] Screen sharing on Wayland does not work Jan 12, 2025
@developer-iname

This comment was marked as off-topic.

@developer-iname

This comment was marked as off-topic.

@NotMephisto
Copy link
Author

When you click the screen share button, do you first see GoofCord's screen share picker with a black "Entire screen", or your system (pipewire) screen share picker?

In screen share picker I can see my desktop on thumbnails, and after I start the stream, but viewers see only a loading screen and hear sound or they see the image with some distortions, like artifacts

@MattheBrawler
Copy link

MattheBrawler commented Jan 18, 2025

I'm in the same boat of my friends only having a black screen. Also it seems that their audio doubles back on it's self too.

@NotMephisto
Copy link
Author

In the latest beta, the screen sharing doesn't work because it doesn't prompt the desktop environment to select the capture of the application via pipewire

@Milkshiift
Copy link
Owner

The 1.8.2-beta.1 did not change how GoofCord requests screen share sources. Can you check the terminal output when attempting to screen share?

Also, does screen sharing work in a chromium based browser? You can test it here: https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing

If you are talking about artifacts specifically, there is likely not much GoofCord can do, as it uses chromium's capturer with little control over it.

@NotMephisto
Copy link
Author

NotMephisto commented Jan 22, 2025

The screen sharing is working now, but it didn't work before, which is strange, as if the application was running in an X11 environment and made it possible to select specific windows in Discord itself.

Logs:

➜  ~ goofcord $
GoofCord 1.8.2-beta.1
You are using Wayland! >ᴗ<
[Timer] Electron loaded in: 1.002ms
[Message Encryption] Loaded encryption passwords
[Firewall] Firewall initialized
[Firewall] Set up CSP unstricter
[Asset Loader] Categorized files with extension .js
[Asset Loader] Categorized files with extension .css
[Window] Opening window...
[Window] Setting up window...
[Timer] GoofCord fully loaded in: 196.159ms
[Mod Loader] Downloading mod bundles for: vencord
[Mod Loader] Downloading mod bundles for: shelter
[arRPC > process] started
[arRPC > bridge] listening on 1337
[arRPC > websocket] listening on 6463
[arRPC > ipc] listening at /run/user/1000/discord-ipc-0
[2025-01-22 12:10:11.560] [venmic] [info] [patchbay] (handle) found default metadata: 39
[2025-01-22 12:10:11.560] [venmic] [info] [patchbay] (meta_update) speaker name: "alsa_output.usb-Razer_Razer_Barracuda_X-00.analog-stereo"
[2025-01-22 12:10:11.560] [venmic] [info] [patchbay] (get) running venmic 6.1.0
[Mod Loader] Bundles downloaded for: shelter
[Mod Loader] Bundles downloaded for: vencord
[arRPC > bridge] web connected
[22212:0122/121024.250350:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121024.250367:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486290179 and trying to renegotiate stream parameters
[22212:0122/121024.262215:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121024.262230:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486273795 and trying to renegotiate stream parameters
[22212:0122/121024.269559:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121024.269573:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486077187 and trying to renegotiate stream parameters
[Screenshare] Starting Venmic...
[Screenshare] Available sources: [ 'spotify', 'speech-dispatcher-dummy', 'Zen' ]
[2025-01-22 12:10:25.955] [venmic] [info] [patchbay] (create_mic) created: 165
[22212:0122/121026.002090:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121026.002114:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486290179 and trying to renegotiate stream parameters
[22212:0122/121026.014207:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121026.014225:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486273795 and trying to renegotiate stream parameters
[22212:0122/121026.021223:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121026.021240:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486077187 and trying to renegotiate stream parameters
[22212:0122/121027.529171:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121027.529187:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486290179 and trying to renegotiate stream parameters
[22212:0122/121027.541681:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121027.541696:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486273795 and trying to renegotiate stream parameters
[22212:0122/121027.548361:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121027.548375:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486077187 and trying to renegotiate stream parameters
'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:425 pw_thread_loop_wait()
[22212:0122/121027.601803:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121027.601820:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486290179 and trying to renegotiate stream parameters
[22212:0122/121027.614714:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121027.614730:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486273795 and trying to renegotiate stream parameters
[22212:0122/121027.621292:ERROR:egl_dmabuf.cc(609)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[22212:0122/121027.621307:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188486077187 and trying to renegotiate stream parameters
'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:425 pw_thread_loop_wait()
[22212:0122/121045.954022:ERROR:wayland_event_watcher.cc(47)] libwayland: warning: queue 0x115c00a54240 destroyed while proxies still attached:

[22212:0122/121045.954094:ERROR:wayland_event_watcher.cc(47)] libwayland:   wl_shm_pool#45 still attached

[1]    22212 segmentation fault (core dumped)  goofcord $
➜  ~ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants