NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.48k stars 12.97k forks source link

Screensharing on Wayland is broken with the latest `nixpkgs` #319500

Closed SimonBrandner closed 1 day ago

SimonBrandner commented 3 weeks ago

Describe the bug

Screen sharing on Wayland does not work in any app

Steps To Reproduce

Steps to reproduce the behaviour:

  1. Update to the latest commit
  2. Try to screen share anywhere
  3. See it fail

Webcord

[38389:0612/214214.534452:ERROR:screen_capture_portal_interface.cc(48)] Failed to request session: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.portal.Desktop was not provided by any .service files
[38389:0612/214214.534467:ERROR:base_capturer_pipewire.cc(81)] ScreenCastPortal failed: 3
(node:38389) UnhandledPromiseRejectionWarning: Failed to get sources.
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:38389) 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: 4)

OBS

error: obs-data.c: [obs_data_create_from_json] Failed reading json string (1): '[' or '{' expected near end of file
error: obs-data.c: [obs_data_create_from_json] Failed reading json string (1): '[' or '{' expected near end of file
info: User added source 'Video Capture Device (PipeWire) (BETA) 2' (pipewire-camera-source) to scene 'Scene'
info: [camera-portal] Selected resolution for ''
info: [camera-portal] Selected format for ''
info: [camera-portal] selected camera ''

Expected behaviour

I expect screen sharing to work just fine

Additional context

This is not caused by Hyprland or XDPH. I am using the Hyprland flake and had to downgrade nixpkgs to fix the issue.

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.32, NixOS, 24.11 (Vicuña), 24.11.20240607.051f920`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos-23.11, nixos-unstable"`
 - nixpkgs: `/nix/store/3dr5pyja36lvvrszhzffww1jwyrx6i09-source`
luiswirth commented 2 weeks ago

EDIT: The problem no longer persists for me, after upgrading my system.

~~Screen sharing in OBS is also broken for me. I only get a black screen. This might be the same issue. I get the following terminal output from OBS~~

info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
info: [pipewire] Server version: 1.0.6
info: [pipewire] Library version: 1.0.6
info: [pipewire] Header version: 1.0.6
info: [pipewire] Created stream 0x3ff032a0
info: [pipewire] Stream 0x3ff032a0 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x3ff032a0
info: [pipewire] Stream 0x3ff032a0 state: "paused" (error: none)
info: [pipewire] Stream 0x3ff032a0 state: "error" (error: no more input formats)
error: [pipewire] Error id:2 seq:11 res:-32 (Broken pipe): no more input formats
SimonBrandner commented 1 day ago

@JohnRTitor, was this fixed?

JohnRTitor commented 1 day ago

Works for me on Vesktop (using Hyprland), and the above comment mentions that it's fixed by updating nixpkgs. I assumed that it's a issue caused by a broken commit, which got fixed later, feel free to reopen if this is still an issue with latest Nixpkgs.