NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.6k stars 13.76k forks source link

zoom-us support notice for wayland screensharing - no longer can screenshare. #322970

Closed bashfulrobot closed 1 month ago

bashfulrobot commented 3 months ago

Describe the bug

I recently updated to the latest zoom-us version, and when I try to screen share, I get a support notice stating:

Zoom Workplace Can not start share, we only support Wayland on GNOME with Ubuntu 17 and above, Fedora 25 and above, Debian 9 and above, CentOS 8 and above, OpenSUSE Leap 15 and above, Oracle Linux 8 and above, RHEL 8 and above, Mageia 7 and above,Rocky 8 and above, Arch Linux, AnterGos, Manjaro. If your 0S is not on the list, please use x11 instead.

Steps To Reproduce

Steps to reproduce the behavior:

  1. install latest
  2. join meeting
  3. try to share screen

Expected behavior

A clear and concise description of what you expected to happen.

Be able to share my screen

Screenshots

If applicable, add screenshots to help explain your problem.

Screenshot from 2024-06-27 10-03-49

Additional context

I have noticed that the app crashes when notes are opened, and the sidebar just spins saying it is loading. I can work around that, and may install again to open separate tickets.

Notify maintainers

@danbst @tadfisher

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.


 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.6, NixOS, 24.11 (Vicuna), 24.11.20240624.2893f56`
 - multi-user?: `yes`
 - sandbox: `relaxed`
 - version: `nix-env (Nix) 2.18.3`
 - nixpkgs: `/nix/store/bi5zxc0v5g6ylygdwyqzh280sccg3ykb-source`
eclairevoyant commented 3 months ago

It's closed source software; what do you believe can be done here?

bashfulrobot commented 3 months ago

I am reporting it for visibility. And I have seen other packages marked as broken - which might be an option.

eclairevoyant commented 3 months ago

Well it's not broken, nor can it be patched. At most someone might find a way to spoof the check using /etc/os-release or such, but that's not really part of the package itself.

bashfulrobot commented 3 months ago

Okay, well, what I mean by "broken" is that "there is not full functionality with this package" (through no fault of the packagers or the packaging). I fully understand there is nothing to be done other than (if the packagers decide it is a good idea) to indicate limited functionality.

Simply visibility, as others may come here looking for a solution.

hensou commented 3 months ago

I think this issue https://github.com/NixOS/nixpkgs/issues/107233 might be related. Unsetting XDG_SESSION_TYPE prevent this dialog from showing up, however it only shares a black screen.

pimeys commented 2 months ago

Yeah, broke for me too. With zoom you have to test it before every important meeting that it works with screen sharing. Of course there is a customer that requires zoom, and it worked last week and now in the middle of the meeting your demo is ruined.

Not blaming anybody on nixpkgs, it's just zoom that is really bad...

For others who need to suffer with this broken proprietary tool, here's the last working commit: https://github.com/NixOS/nixpkgs/commit/06031e8a5d9d5293c725a50acf01242193635022

And here's how I patched my system flake to take this zoom: https://git.sr.ht/~pimeys/nixos/commit/c073763966074244258ae7434faafe29cb86094f

Good luck!

RMTT commented 2 months ago

You can try zoom with native wayland, just add xwayland=false to ~/.config/zoomus.conf. If that doesn't work(share screen broken in my plasma actually Zoom will call /usr/libexec/xdg-desktop-portal when screenshare in wayland, so you can link the xdg-desktop-portal to this location), you can use web version as a workaround.

Hamled commented 2 months ago

You can try zoom with native wayland, just add xwayland=false to ~/.config/zoomus.conf. If that doesn't work(~share screen broken in my plasma actually~ Zoom will call /usr/libexec/xdg-desktop-portal when screenshare in wayland, so you can link the xdg-desktop-portal to this location), you can use web version as a workaround.

Is there any good path for handling this hard-coded shell call in the package? Would it need to be run inside a FHS type setup ala steam-run or is there something more minimal that could work?

I guess one option, since it is executing sh -c ... to run that command, would be to patch the .zoom binary and replace /usr/libexec/xdg-desktop-portal with a shell variable that gets exported in the wrapper. I don't know how common or acceptable that kind of patching is, though.

bashfulrobot commented 2 months ago

I reference files in a package path like this (just a sample - not related to this issue):

 gcalBashfulrobotApp = makeDesktopApp {
    name = "Apple Notes";
    url = "https://www.icloud.com/notes/";
    binary = "${pkgs.brave}/bin/brave";
    myStartupWMClass = "brave-www.icloud.com__notes_-Default";
    iconSizes = [ "32" "48" "64" "96" "128" "256" ];
    # iconSizes = [ "256" ]; # forcing large icon use
    iconPath = ./icons; # path to icons
  };

Note the binary path. Maybe something can be done similar.

I looked at xdg-dektop-portal on my system:

❯ exa /nix/store/g6snsx84p921m7jvg2w8ii1m89z4snjp-xdg-desktop-portal-1.18.4/libexec/
xdg-desktop-portal  xdg-desktop-portal-rewrite-launchers  xdg-desktop-portal-validate-icon  xdg-document-portal  xdg-permission-store

So I suspect you can use something like "${pkgs.xdg-desktop-portal}/libexec/xdg-desktop-portal";.

Hamled commented 2 months ago

I should clarify, I mean that the path /usr/libexec/xdg-desktop-portal is itself hard-coded within the .zoom binary that is shipped by Zoom. I'm not sure if there are any good options for making that work without requiring users of the package to separately create a symlink, or otherwise make that path valid for the Zoom process.

bashfulrobot commented 2 months ago

rebuilding as we speak with this as a test (but off to a meeting).

{ user-settings, pkgs, config, lib, ... }:
let cfg = config.apps.zoom-us;

in {
  options = {
    apps.zoom-us.enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = "Enable the zoom-us desktop.";
    };
  };

  config = lib.mkIf cfg.enable {
    environment.systemPackages = with pkgs;
      [
        zoom-us # video conferencing - broken currently
      ];

    systemd.tmpfiles.rules = [
      "L+ /usr/libexec/xdg-desktop-portal - - - - ${pkgs.xdg-desktop-portal}/libexec/xdg-desktop-portal"
    ];
    home-manager.users."${user-settings.user.username}" = {

      # force zoom to use wayland and portals
      home.file.".config/zoomus.conf".text = ''
        xwayland=false
      '';
    };
  };
}
bashfulrobot commented 2 months ago

So, I added a more extensive configuration, and the popup no longer happens. Also, no sharing happens either. And it still crashes when trying to open the notes. I will likely have to continue to use it within my browser.

RMTT commented 2 months ago

So, I added a more extensive configuration, and the popup no longer happens. Also, no sharing happens either. And it still crashes when trying to open the notes. I will likely have to continue to use it within my browser.

Maybe screenshare broken is related to your desktop environment or gpu? it works in plasma 6 with intel graphics.

And it still crashes when trying to open the notes

Try https://github.com/NixOS/nixpkgs/pull/327271

bashfulrobot commented 2 months ago

I do not believe so, because if I use the zoom web client, all works as expected.

gvolpe commented 2 months ago

Experiencing the same issue. Funny this was also the case 2 years ago:https://www.reddit.com/r/NixOS/comments/ybzcr2/zoom_screen_sharing_disabled_for_wayland_users_on/

Anyone else on NixOS + Hyprland with a fix that's not downgrading the Zoom app?

gvolpe commented 2 months ago

After downgrading, screen-sharing works but it fails to stop 😭 It seems the Zoom app upgrade left some garbage state behind that's affecting the downgraded app as well.

This is the error I get when I click on "stop sharing":

*** pw_stream_set_active called from wrong context, check thread and locking: Operation not permitted
*** impl_ext_end_proxy called from wrong context, check thread and locking: Operation not permitted
'this->recurse > 0' failed at ../src/pipewire/thread-loop.c:62 do_unlock()

According to this forum comment, it's an incompatibility with Pipewire 1.2.0 🤦🏽

Awaiting the release of 6.1.5 they promised to see if it solves anything, but until then I guess I'll have to install Chromium to share my screen, as it doesn't work on Firefox either...


EDIT: After downgrading Zoom to v6.0.2.4680 and Pipewire to v1.0.7, things are back to normal. However, I still see a Pipewire thread loop error being logged, though it's a different one and doesn't freeze the app at least:

*** pw_stream_set_active called from wrong context, check thread and locking: Operation not permitted
*** impl_ext_end_proxy called from wrong context, check thread and locking: Operation not permitted
'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:426 pw_thread_loop_wait()
gvolpe commented 2 months ago

I tried the systemd.tmpfiles.rules from https://github.com/NixOS/nixpkgs/issues/322970#issuecomment-2234036748 with the latest v6.1.5.871 and I no longer get the pop-up, but screensharing results in nothing. Here's what I see in the logs:

qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.68 ms
qt.scenegraph.general: opengl texture atlas dimensions: 1024x1024
qt.scenegraph.general: animation driver switched to timer mode
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: animation driver switched to vsync mode
ListModel2<T, Key>::getItemIndex(): key not exists!ListModel2<T, Key>::getItemIndex(): key not exists!
RMTT commented 2 months ago

I tried the systemd.tmpfiles.rules from #322970 (comment) with the latest v6.1.5.871 and I no longer get the pop-up, but screensharing results in nothing. Here's what I see in the logs:

qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.68 ms
qt.scenegraph.general: opengl texture atlas dimensions: 1024x1024
qt.scenegraph.general: animation driver switched to timer mode
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: animation driver switched to vsync mode
ListModel2<T, Key>::getItemIndex(): key not exists!ListModel2<T, Key>::getItemIndex(): key not exists!

Which xdk-desktop-portal backend you use?

RMTT commented 2 months ago

Anyway, zoom 6 is really buggy in Linux now. The best workaround that i think is the web app, it supports screenshare directly and can achieve audio sharing via qpwgraph.

gvolpe commented 2 months ago

Which xdk-desktop-portal backend you use?

As described in the comment, just the xdg-desktop-portal binary. I also tried to symlink it to xdg-desktop-portal-hyprland, but I got the pop-up message once again. I also tried adding both:

systemd.tmpfiles.rules = [
  "L+ /usr/libexec/xdg-desktop-portal - - - - ${pkgs.xdg-desktop-portal}/libexec/xdg-desktop-portal"
  "L+ /usr/libexec/xdg-desktop-portal-hyprland - - - - ${pkgs.xdg-desktop-portal-hyprland}/libexec/xdg-desktop-portal-hyprland"
];

Sill out of luck.

The best workaround that i think is the web app,

The web app is a no-op for me, I need to be able to look at the attendants while I present. Also, it doesn't work for me on Firefox (clicking on share screen results in nothing, but that's a problem for another day).

Downgrading the app + pipewire works fine for me now, so I don't plan to upgrade until they fix it in 5 years or so XD

RMTT commented 2 months ago

Which xdk-desktop-portal backend you use?

As described in the comment, just the xdg-desktop-portal binary. I also tried to symlink it to xdg-desktop-portal-hyprland, but I got the pop-up message once again. I also tried adding both:

systemd.tmpfiles.rules = [
  "L+ /usr/libexec/xdg-desktop-portal - - - - ${pkgs.xdg-desktop-portal}/libexec/xdg-desktop-portal"
  "L+ /usr/libexec/xdg-desktop-portal-hyprland - - - - ${pkgs.xdg-desktop-portal-hyprland}/libexec/xdg-desktop-portal-hyprland"
];

Sill out of luck.

Linking pkgs.xdg-desktop-portal-hyprland is unnecessary, you can think of pkgs.xdg-desktop-portal is the frontend of pkgs.xdg-desktop-portal-hyprland, so just linking pkgs.xdg-desktop-portal is enough.

The web app is a no-op for me, I need to be able to look at the attendants while I present. Also, it doesn't work for me on Firefox (clicking on share screen results in nothing, but that's a problem for another day).

I also use firefox, but it works well in screensharing, i guess it's related to DE(cause xdg-desktop-portal implementation).

nixos-discourse commented 1 month ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/zoom-us-wayland-screen-sharing-fix/50343/1

liff commented 1 month ago

Is there a way to report an issue upstream?

I suppose ideally they wouldn’t need to invoke xdg-desktop-portal if it’s already running, right?

bashfulrobot commented 1 month ago

"nixos is not supported"

sooooo, ultimately, no. I was denied.

SuperSandro2000 commented 1 month ago

So there is not much we can do to fix a proprietary app which doesn't want to be fixed.

jarjee commented 3 weeks ago

Extremely hacky, but I managed to get it working on my machine again (KDE):

{ pkgs }:

pkgs.zoom-us.overrideAttrs (attrs: {
  nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ [ pkgs.bbe ];
  postFixup = ''
    cp $out/opt/zoom/zoom .
    bbe -e 's/\0manjaro\0/\0nixos\0\0\0/' < zoom > $out/opt/zoom/zoom
  '' + (attrs.postFixup or "") + ''
    sed -i 's|Exec=|Exec=env XDG_CURRENT_DESKTOP="gnome" |' $out/share/applications/Zoom.desktop
  '';
})

Then in the settings under "Share Screen" -> Advanced, set the Screen Capture mode on Wayland to be "Pipewire Mode".

Based on an old fix for zoom

freelock commented 1 week ago

Hi,

I have an open ticket at Zoom on this issue, and someone in the Matrix room just pointed me at this issue. I have the attention of some internal Zoom developers, and I pointed them at this issue. I asked them to make the path to the xdg-desktop-portal configurable...

Is there more that needs to happen to get it working?

Cheers, John

svrana commented 1 week ago

In addition to the xdg-desktop-portal problem which I cannot comment on I do not think it is possible to run zoom w/ wayland unless you're using a supported OS. So, many of us wrap zoom and unset XDG_SESSION_TYPE and WAYLAND_DISPLAY to make sure it runs as an xwayland app (or modify the binary as @jarjee has done to include nixos in the supported OS list) (see https://github.com/NixOS/nixpkgs/issues/107233 for more details).

freelock commented 1 week ago

I'm not experiencing that -- it works fine on my NixOS unstable, with a Plasma6/Wayland desktop, aside from screen sharing.

liff commented 1 week ago

Screen sharing works for me partially in GNOME with enableWaylandShare=true in ~/.config/zoomus.conf. Partially meaning Zoom crashes when I stop the share.