hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.89k stars 849 forks source link

Scrensharing not working on Vesktop client #7945

Open varmisa opened 1 day ago

varmisa commented 1 day ago

Already reported ? *

Regression?

Yes

System Info and Version

NixOS 24.11 "Vicuna" with flakes, unstable nixpkgs.

Description

I occurs problems with screensharing on vesktop client of discord. My config related with pipewire and xdg-desktop-portal: 1)

{
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
  };
}
  security = {
    polkit.enable = true;
    rtkit.enable = true;
  };
}
{ pkgs
, ...
}:
{
  xdg.portal = {
    enable = true;
    config = {
      common = {
        default = "*";
      };
    };
    extraPortals = [
      pkgs.xdg-desktop-portal-hyprland
      pkgs.xdg-desktop-portal-gtk
    ];
  };
}

How to reproduce

Install vesktop client. Try to screenshare entire screen or window with sound.

Crash reports, logs, images, videos

[11425:0928/235416.465429:ERROR:ffmpeg_common.cc(965)] Unsupported pixel format: -1
[11320:0928/235425.642863:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[11320:0928/235425.642877:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188488387331 and trying to renegotiate stream parameters
[11320:0928/235425.655714:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[11320:0928/235425.655728:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188488370947 and trying to renegotiate stream parameters
[11320:0928/235425.664787:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[11320:0928/235425.664798:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188488174339 and trying to renegotiate stream parameters
'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:425 pw_thread_loop_wait()
[2024-09-28 23:54:26.819] [venmic] [info] [patchbay] (handle) found default metadata: 40
[2024-09-28 23:54:26.819] [venmic] [info] [patchbay] (meta_update) speaker name: "alsa_output.pci-0000_0c_00.4.iec958-stereo"
[2024-09-28 23:54:26.819] [venmic] [info] [patchbay] (get) running venmic 6.1.0
[2024-09-28 23:54:29.985] [venmic] [info] [patchbay] (create_mic) created: 71
[11320:0928/235430.041545:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[11320:0928/235430.041562:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188488387331 and trying to renegotiate stream parameters
[11320:0928/235430.054348:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[11320:0928/235430.054364:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188488370947 and trying to renegotiate stream parameters
[11320:0928/235430.063754:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_BAD_MATCH
[11320:0928/235430.063766:ERROR:shared_screencast_stream.cc(951)] Dropping DMA-BUF modifier: 144115188488174339 and trying to renegotiate stream parameters

image

PaideiaDilemma commented 19 hours ago

I assume you use Hyprland from nixpkgs and not from the from the flake?

I just tried vesktop and it is a bit scuffed, but it worked for me despite spamming this log: [794143:0929/142757.435965:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= YUV_420_BIPLANAR and usage=SCANOUT_CPU_READ_WRITE

Webcord works a bit better for me.

xdg-desktop-portal-hyprland got some improvements recently, so if you can try the flake on the latest commit, which includes latest xdph. (don't forgett portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;)

varmisa commented 19 hours ago

@PaideiaDilemma I'm using Hyprland from flakes. And I also tried package from Flatpak and AppImage (Same not properly work).

Here my flake file:

{
  description = "My first experience with Nix Flakes";

  inputs = {

    home-manager.url = "github:nix-community/home-manager";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    firefox-nightly.url = "github:colemickens/flake-firefox-nightly";
    catppuccin.url = "github:catppuccin/nix";

    hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";

  };

  outputs = { self, nixpkgs, home-manager, catppuccin, hyprland, ... } @inputs: {

    nixosConfigurations = {

      varmisanth = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = { inherit inputs; };

        modules = [

          inputs.home-manager.nixosModules.home-manager

          ./hardware-configuration.nix
          ./configuration.nix

          ./system-pkgs/default.nix

          ./boot/default.nix
          ./users/default.nix

          ./pipewire/default.nix
          ./bluetooth/default.nix

          ./opengl/default.nix

          ./security/default.nix

          ./gvfs/default.nix
          ./xdg-user-dirs/default.nix

          ./i18n/default.nix
          ./time/default.nix
          ./networking/default.nix

          ./fonts/default.nix

          ./env/default.nix

          ./xdg-portal/default.nix

          ./nix-config/default.nix
          ./nixpkgs-config/default.nix

          ./home.nix

          ({ config, lib, pkgs, ... }: {

            home-manager = {
              useUserPackages = true;
              useGlobalPkgs = true;
              backupFileExtension = "backup";

              users.varmisanth = {
                home.packages = with pkgs; [];

                imports = [
                  (import ./hyprland/default.nix { config = config; lib = lib; pkgs = pkgs; inputs = inputs; })
                  ./rice/default.nix
                  ./gui/wm/waybar/default.nix
                  ./gui/themes/terminals/alacritty/default.nix

                  catppuccin.homeManagerModules.catppuccin

                ];

                programs.home-manager.enable = true;
                home.stateVersion = "24.05";
                home.username = "varmisanth";
                home.homeDirectory = "/home/varmisanth";

              };
            };
          })
        ];
PaideiaDilemma commented 19 hours ago

What commit are you on then? Please nix flake lock --update-input hyprland and

don't forgett portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;

In programs.hyprland that is.

varmisa commented 18 hours ago

d73c14751ad40fd54d93baac2226f550142b0e74 commit. And i configured Hyprland via home manager, and i can't use "portalPackage", how to do it with hm?

fufexan commented 17 hours ago

@varmisa there's a PR open on Home Manager that would handle this (https://github.com/nix-community/home-manager/pull/5707).

In the meantime, you can use

    xdg.portal = let 
      cfg = config.wayland.windowManager.hyprland;
    in {
      enable = true;
      extraPortals = [ inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland ];
      configPackages = lib.mkDefault [ cfg.finalPackage ];
    };
verysillycat commented 11 hours ago

using the lastest commit of xdg-desktop-portal-hyprland doesn't solve it here on arch linux (using xdg-desktop-portal-hyprland-git)