hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
306 stars 48 forks source link

Bitdepth 10 breaks Vesktop screenshare #270

Open nnra6864 opened 1 month ago

nnra6864 commented 1 month ago

Before I start, I am well aware that following is stated in the Hyprland wiki: Some applications do not support screen capture with 10 bit enabled. However, I've been using Vesktop with bitdepth set to 10 for ~8 months now and it's always worked fine. I am on Arch, nvidia 560, just updated and using hyprland-git, as well as xdg-desktop-portal-hyprland-git. All the hyprland related stuff is git:

paru -Qs hyprland
local/hyprland-git 0.43.0.r79.d73c1475-1
    Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't
    sacrifice on its looks.
local/hyprutils-git 0.2.3.r2.g3f529343-1
    Hyprland utilities library used across the ecosystem
local/xdg-desktop-portal-hyprland-git 1.3.6.r0.g7e500e67-1
    xdg-desktop-portal backend for hyprland
paru -Qs aquamarine
local/aquamarine-git 0.4.1_r220.gb82fdaf-1
    a very light linux rendering backend library

Portal service seems to be running just fine:

systemctl --user status xdg-desktop-portal.service
● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
     Active: active (running) since Tue 2024-10-01 13:01:00 CEST; 29min ago
 Invocation: 2707585dbd5f415fbeb5029a398c6949
   Main PID: 52390 (xdg-desktop-por)
      Tasks: 5 (limit: 38113)
     Memory: 2.4M (peak: 3.3M)
        CPU: 24ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
             └─52390 /usr/lib/xdg-desktop-portal

Oct 01 13:01:00 nnra systemd[912]: Starting Portal service...
Oct 01 13:01:00 nnra xdg-desktop-por[52390]: No skeleton to export
Oct 01 13:01:00 nnra systemd[912]: Started Portal service.

My env vars should be just fine, commonly mentioned one being:

echo $XDG_CURRENT_DESKTOP
Hyprland

Lastly, this is the error message I get when I make a choice in the portal popup:

[52663:1001/130155.603218:ERROR:shared_screencast_stream.cc(215)] PipeWire stream state error: no more input formats
[52663:1001/130155.603229:ERROR:shared_screencast_stream.cc(178)] PipeWire remote error: no more input formats

Here's a video showcasing the issue. Possibly related: #229 #233 #251

TheKoTech commented 1 month ago

I'm having a similar issue. I had previously made screen share working by following the guide on the official Hyprland wiki. It is not broken and this is logged on crash:

$ vesktop 
APPIMAGE env is not defined, current application is not an AppImage
checkForUpdatesAndNotify called, downloadPromise is null
[arRPC > ipc] listening at /run/user/1000/discord-ipc-0
[arRPC > websocket] listening on 6463
[arRPC > process] started
...
[22336:1002/002053.683974:ERROR:screencast_portal.cc(367)] Failed to start the screen cast session.
[22336:1002/002053.683995:ERROR:base_capturer_pipewire.cc(81)] ScreenCastPortal failed: 3
Error during screenshare picker Failed to get sources.
(node:22336) UnhandledPromiseRejectionWarning: TypeError: Video was requested, but no video stream was provided
    at AsyncFunction.<anonymous> (VCDMain:87:5244)
(Use `vesktop --trace-warnings ...` to show where the warning was created)
(node:22336) 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: 1)
zsh: segmentation fault (core dumped)  vesktop

More info:

systemctl --user status xdg-desktop-portal-hyprland 
● xdg-desktop-portal-hyprland.service - Portal service (Hyprland implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-hyprland.service; static)
     Active: active (running) since Tue 2024-10-01 23:58:01 +05; 5min ago
 Invocation: c56b124630e3445da08f6a9fbd375412
   Main PID: 12819 (xdg-desktop-por)
      Tasks: 3 (limit: 18857)
     Memory: 5M (peak: 5.7M)
        CPU: 29ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal-hyprland.service
             └─12819 /usr/lib/xdg-desktop-portal-hyprland

Oct 01 23:58:01 welnyr systemd[606]: xdg-desktop-portal-hyprland.service: Main process exited, code=dumped, status=11/SEGV
Oct 01 23:58:01 welnyr systemd[606]: xdg-desktop-portal-hyprland.service: Failed with result 'core-dump'.
Oct 01 23:58:01 welnyr systemd[606]: xdg-desktop-portal-hyprland.service: Scheduled restart job, restart counter is at 1.
Oct 01 23:58:01 welnyr systemd[606]: Starting Portal service (Hyprland implementation)...
Oct 01 23:58:01 welnyr systemd[606]: Started Portal service (Hyprland implementation).
Oct 01 23:58:01 welnyr xdg-desktop-portal-hyprland[12819]: pw.context: 0x5ed14719cc40: no modules loaded from context.modules
Oct 01 23:58:01 welnyr xdg-desktop-portal-hyprland[12819]: pw.core: 0x5ed1471a3c50: can't find protocol 'PipeWire:Protocol:Native': Operation not supported

Specs:

OS: Arch Linux x86_64
Kernel: Linux 6.11.1-arch1-1
WM: Hyprland (Wayland)
CPU: Intel(R) Core(TM) i5-10400F (12) @ 4.30 GHz
GPU: NVIDIA GeForce GTX 1660 Ti

Packages:

local/hyprland-git 0.42.0.r126.312411fc-1
local/hyprland-git-debug 0.42.0.r126.312411fc-1
local/xdg-desktop-portal-hyprland-git 1.3.5.r0.g4880c501-1
local/xdg-desktop-portal-hyprland-git-debug 1.3.5.r0.g4880c501-1
local/nvidia 560.35.03-9
local/nvidia-utils 560.35.03-4
local/vesktop 1.5.3-4
nnra6864 commented 1 month ago

I'm having a similar issue. I had previously made screen share working by following the guide on the official Hyprland wiki.

Yeah, that should be more than enough to get the screenshare working on Hyprland.

Here is something interesting suggested by a Vesktop contributor:

sqaaakoi (certified misinformation source) — Yesterday at 13:27 Probably a chromium bug

This is quite odd, hopefully someone figures it out.

Nj0be commented 1 month ago

I have the same issue on Hyprland: with bitdepth set to 10 the screenshare doesn't work. I'm running arch linux and everything is up to date (non git version of everything).

Chasewhip8 commented 1 month ago

Same here on NixOS, was working before and recently broke.

Driver Version: 560.35.03
Hyprland: 6ae89940c761d4ed4317df0af29e8df41d472091
xdg-desktop-portal-hyprland: 1.3.6

The same error in logs in both Slack and Vesktop

[23082:1011/221903.164525:ERROR:shared_screencast_stream.cc(213)] PipeWire stream state error: no more input formats
[23082:1011/221903.164552:ERROR:shared_screencast_stream.cc(176)] PipeWire remote error: no more input formats
Eveeifyeve commented 1 month ago

I have the same issue on Hyprland: with bitdepth set to 10 the screenshare doesn't work. I'm running arch linux and everything is up to date (non git version of everything).

I've set bit depth, 8 under monitor and still not working so bitdepth is not the issue. yes it works with a simple gum test but not vesktop.

https://github.com/Eveeifyeve/Dotfiles/blob/c5340b088abc8d3ef4df1c07154f1b4f60996d11/hosts/eveeifyeve/home.nix#L25

vaxerski commented 1 month ago

maybe it's a vesktop issue then

Tobls commented 1 month ago

I have the same problem screensharing in firefox. Removing the bitdepth parameter from the config fixes the problem.

nnra6864 commented 1 month ago

I have the same problem screensharing in firefox. Removing the bitdepth parameter from the config fixes the problem.

Are you referring to specifically the Discord screenshare or something else? If yes, it could be a Discord issue, not a Vesktop one in that case. I think it also proves the Vesktop contributor's guess of it being chromium related wrong, since it's happening in Firefox?

maybe it's a vesktop issue then

Quite possibly a Discord issue actually, it's broken on Firefox and Chromium too. I just confirmed it once again with all the latest stuff on Vesktop, Firefox and Chromium. What's interesting about chromium is that I actually get the other 2 portal popups and the screenshare starts, but it's just infinitely loading.

nnra6864 commented 1 month ago

I have the same issue on Hyprland: with bitdepth set to 10 the screenshare doesn't work. I'm running arch linux and everything is up to date (non git version of everything).

I've set bit depth, 8 under monitor and still not working so bitdepth is not the issue. yes it works with a simple gum test but not vesktop.

https://github.com/Eveeifyeve/Dotfiles/blob/c5340b088abc8d3ef4df1c07154f1b4f60996d11/hosts/eveeifyeve/home.nix#L25

Odd, I never explicitly set the bitdepth to 8, I always just deleted the bitdepth part completely. I am genuinely not sure if explicitly defining it is supported in the hyprland config and if it makes a diff, but maybe try removing it.

Eveeifyeve commented 1 month ago

It's a bit depth issue. If you set to 8 then it will be fine more than that you will have issues.

Eveeifyeve commented 1 month ago

I could look into making a pr into the wiki that warns about this issue.

nnra6864 commented 1 month ago

I could look into making a pr into the wiki that warns about this issue.

It's already mentioned.

Tobls commented 1 month ago

I have the same problem screensharing in firefox. Removing the bitdepth parameter from the config fixes the problem.

Are you referring to specifically the Discord screenshare or something else? If yes, it could be a Discord issue, not a Vesktop one in that case. I think it also proves the Vesktop contributor's guess of it being chromium related wrong, since it's happening in Firefox?

No, zoom as well as other screensharing sites as well

Chasewhip8 commented 1 month ago

maybe it's a vesktop issue then

no it is a bitdepth issue, setting it to 8 on my end fixes the issue.

this worked 2-3 weeks ago just fine, not sure what changed since then though.

lapwat commented 1 month ago

On a fresh Hyprland installation, using the nuclear option described here fixed the issue.

#!/usr/bin/env bash
sleep 1
killall -e xdg-desktop-portal-hyprland
killall -e xdg-desktop-portal-wlr
killall xdg-desktop-portal
/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal &

Still investigating...

Eveeifyeve commented 1 month ago

On a fresh Hyprland installation, using the nuclear option described here fixed the issue.

#!/usr/bin/env bash
sleep 1
killall -e xdg-desktop-portal-hyprland
killall -e xdg-desktop-portal-wlr
killall xdg-desktop-portal
/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal &

Still investigating...

they still need to update that to work on nixos.

enderprism commented 1 month ago

using the flatpak instead fixed the problem for me

nnra6864 commented 1 month ago

using the flatpak instead fixed the problem for me

Fixes what tho, just Vesktop or other stuff too? People reported the same issue with other software, even tho the bug report was initially created for Vesktop.

enderprism commented 1 month ago

for vesktop only, my bad