IsmaelMartinez / teams-for-linux

Unofficial Microsoft Teams for Linux client
GNU General Public License v3.0
2.83k stars 234 forks source link

Unable to use screen sharing on Debian 12 (bookworm) [Snap package] #624

Closed pallebone closed 1 year ago

pallebone commented 1 year ago

Describe the bug Unable to launch screen sharing from teams app

To Reproduce Join meeting, select screen share option.

Expected behavior Screen share.

Desktop (please complete the following information):

Something to do with pipewire? Error in terminal is the following: aragorn@Aragorn:~$ teams-for-linux WARNING: Kernel has no file descriptor comparison support: Operation not permitted [8250:1011/150647.658872:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed [8250:1011/150647.659113:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed [8250:1011/150647.659195:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed [8250:1011/150647.659276:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed [8250:1011/150647.659363:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed [8250:1011/150710.992873:ERROR:shared_screencast_stream.cc(402)] One of following libraries is missing on your system:

jijojosephk commented 1 year ago

@pallebone could you try running with additional flags?

teams-for-linux --appLogLevels=error,info,warn,debug

SlavikZ commented 1 year ago

I have a similar problem with the snap package on ubuntu 22.04. My log with additional flags is

[212313:1012/120111.282632:ERROR:bus.cc(562)] Failed to get the ownership of org.mpris.MediaPlayer2.chromium.instance212313: Connection ":1.576" is not allowed to own the service "org.mpris.MediaPlayer2.chromium.instance212313" due to AppArmor policy
[DEBUG] Power save is disabled.
[212459:1012/120119.301820:ERROR:socket_tcp.cc(328)] Error when reading from TCP socket: -101
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 15.000000, suggest to use other rate control modes
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 16.000000, suggest to use other rate control modes
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 16.000000, suggest to use other rate control modes
[212313:1012/120138.589913:ERROR:shared_screencast_stream.cc(402)] One of following libraries is missing on your system:
 - PipeWire (libpipewire-0.3.so.0)
 - drm (libdrm.so.2)
[212313:1012/120138.589945:ERROR:base_capturer_pipewire.cc(60)] ScreenCastPortal failed: 1
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 13.000000, suggest to use other rate control modes
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 15.000000, suggest to use other rate control modes
jijojosephk commented 1 year ago

I have a similar problem with the snap package on ubuntu 22.04. My log with additional flags is

[212313:1012/120111.282632:ERROR:bus.cc(562)] Failed to get the ownership of org.mpris.MediaPlayer2.chromium.instance212313: Connection ":1.576" is not allowed to own the service "org.mpris.MediaPlayer2.chromium.instance212313" due to AppArmor policy
[DEBUG] Power save is disabled.
[212459:1012/120119.301820:ERROR:socket_tcp.cc(328)] Error when reading from TCP socket: -101
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 15.000000, suggest to use other rate control modes
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 16.000000, suggest to use other rate control modes
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 16.000000, suggest to use other rate control modes
[212313:1012/120138.589913:ERROR:shared_screencast_stream.cc(402)] One of following libraries is missing on your system:
 - PipeWire (libpipewire-0.3.so.0)
 - drm (libdrm.so.2)
[212313:1012/120138.589945:ERROR:base_capturer_pipewire.cc(60)] ScreenCastPortal failed: 1
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 13.000000, suggest to use other rate control modes
[OpenH264] this = 0x0x369c11e12460, Warning:Actual input framerate 0.000000 is different from framerate in setting 15.000000, suggest to use other rate control modes

This one looks like AppArmor rejecting the permission.

jijojosephk commented 1 year ago

@SlavikZ can you try removing and installing again with the following command.

sudo snap install teams-for-linux --devmode just to find the cause of it.

jijojosephk commented 1 year ago

May be you can try a clean install.

sudo snap remove teams-for-linux rm -rf ~/snap/teams-for-linux sudo snap install teams-for-linux

SlavikZ commented 1 year ago

Made a clean install. AppArmor error gone, but the problem still exists. Just after my approval to share screen in the Gnome screen share dialog, the following error appear in the log:

[292064:1012/143613.264413:ERROR:shared_screencast_stream.cc(402)] One of following libraries is missing on your system:
 - PipeWire (libpipewire-0.3.so.0)
 - drm (libdrm.so.2)
[292064:1012/143613.264454:ERROR:base_capturer_pipewire.cc(60)] ScreenCastPortal failed: 1
[OpenH264] this = 0x0x1b0415fc7a80, Warning:Actual input framerate 0.000000 is different from framerate in setting 15.000000, suggest to use other rate control modes

Could it be related to the absence of libpipewire-0.3.so.0 and libdrm.so.2 libraries in the snap?

pallebone commented 1 year ago

Unsure if apparmor is related. In dmesg all I see when doing a screenshare (I did share screen twice, hence 2 messages) is the following:

[60981.778070] Lockdown: rpc-libvirtd: debugfs access is restricted; see man kernel_lockdown.7
[60984.772488] Lockdown: rpc-libvirtd: debugfs access is restricted; see man kernel_lockdown.7
[60987.780313] Lockdown: rpc-libvirtd: debugfs access is restricted; see man kernel_lockdown.7
[60989.254243] audit: type=1326 audit(1665576961.658:460): auid=1000 uid=1000 gid=1000 ses=4 subj=snap.teams-for-linux.teams-for-linux (enforce) pid=203071 comm="teams-for-linux" exe="/snap/teams-for-linux/267/teams-for-linux" sig=0 arch=c000003e syscall=330 compat=0 ip=0x7f12543174e7 code=0x50000
[60990.779517] Lockdown: rpc-libvirtd: debugfs access is restricted; see man kernel_lockdown.7
[60993.786377] Lockdown: rpc-libvirtd: debugfs access is restricted; see man kernel_lockdown.7
[60994.845604] audit: type=1326 audit(1665576967.250:461): auid=1000 uid=1000 gid=1000 ses=4 subj=snap.teams-for-linux.teams-for-linux (enforce) pid=203099 comm="teams-for-linux" exe="/snap/teams-for-linux/267/teams-for-linux" sig=0 arch=c000003e syscall=330 compat=0 ip=0x7f7ff77294e7 code=0x50000
[60996.784871] Lockdown: rpc-libvirtd: debugfs access is restricted; see man kernel_lockdown.7
[60999.784612] Lockdown: rpc-libvirtd: debugfs access is restricted; see man kernel_lockdown.7

Running with debug on:

aragorn@Aragorn:~$ teams-for-linux --appLogLevels=error,info,warn,debug
[DEBUG] configPath:,/home/aragorn/snap/teams-for-linux/267/.config/teams-for-linux
[INFO] Failed to get the config file, using default values
[DEBUG] configFile:,[object Object]
[INFO] Running under Wayland, switching to PipeWire...
[DEBUG] processArgs:,/snap/teams-for-linux/267/teams-for-linux,--appLogLevels=error,info,warn,debug,--no-sandbox
[203199:1012/081734.237883:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[203199:1012/081734.238051:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[203199:1012/081734.238111:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[203199:1012/081734.238167:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[203199:1012/081734.238225:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
WARNING: Kernel has no file descriptor comparison support: Operation not permitted
[DEBUG] did-finish-load
[DEBUG] did-finish-load
[DEBUG] Power save is disabled.
[DEBUG] Playing file: /snap/teams-for-linux/267/resources/assets/sounds/meeting_started.wav
[203199:1012/081802.926401:ERROR:shared_screencast_stream.cc(402)] One of following libraries is missing on your system:
 - PipeWire (libpipewire-0.3.so.0)
 - drm (libdrm.so.2)
[203199:1012/081802.926421:ERROR:base_capturer_pipewire.cc(60)] ScreenCastPortal failed: 1
[DEBUG] Power save is restored
[DEBUG] window close
[DEBUG] window closed
[DEBUG] before-quit
[DEBUG] will-quit
[DEBUG] quit
aragorn@Aragorn:~$ 

To me this reads as apparmor not being at fault but happy to be corrected. Normally if apparmor is preventing something I expect to see something like:

audit: type=1400 audit(1654866935.001:11322): apparmor="DENIED" operation="open" profile="snap.NameOfSnap" name="/var/lib/snapd/hostfs/usr/lib/x86_64-linux-gnu/" pid=3402935 comm="x86_64-linux-gn" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

jijojosephk commented 1 year ago

@IsmaelMartinez any clue on this one? Is pipewire properly installed @pallebone?

IsmaelMartinez commented 1 year ago

No idea but sounds more of a snap shenanigans. Can you try one of the other packages (Deb, etc) and see if it works?

SlavikZ commented 1 year ago

AppImage works without any problems.

pallebone commented 1 year ago

Hi @IsmaelMartinez,

I dont actually know how to tell if pipewire is 100% correct. I assume it is as it comes with bookworm and I have had no other issues. the pactl command indicates it is using pipewire so unsure what else to check.

When I removed the snap version and replaced with the deb version I was able to share the screen and everything seemed to work. Here are the commands I used to test with the deb version. I did not notice any problems.

I would however prefer to resolve the issue with the snap version if possible.

Kind regards Peter

aragorn@Aragorn:~$ sudo snap remove teams-for-linux 
[sudo] password for aragorn: 
teams-for-linux removed
aragorn@Aragorn:~$ cd Downloads/
aragorn@Aragorn:~/Downloads$ sudo dpkg -i teams-for-linux_1.0.45_amd64.deb 
Selecting previously unselected package teams-for-linux.
(Reading database ... 245365 files and directories currently installed.)
Preparing to unpack teams-for-linux_1.0.45_amd64.deb ...
Unpacking teams-for-linux (1.0.45) ...
Setting up teams-for-linux (1.0.45) ...
Processing triggers for mailcap (3.70+nmu1) ...
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
aragorn@Aragorn:~/Downloads$ teams-for-linux 
[454235:1013/082329.855064:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[454235:1013/082329.855240:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[454235:1013/082329.855309:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[454235:1013/082329.855354:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[454235:1013/082329.855402:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[454235:1013/082329.971568:ERROR:nss_util.cc(349)] After loading Root Certs, loaded==false: NSS error code: -8018
[454381:1013/082331.853527:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[454381:1013/082410.864048:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[454381:1013/082434.742047:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
[OpenH264] this = 0x0x29a80e8e5d40, Warning:ParamValidationExt(), eSpsPpsIdStrategy setting (2) with iUsageType (1) not supported! eSpsPpsIdStrategy adjusted to CONSTANT_ID
[OpenH264] this = 0x0x29a80e8e5d40, Warning:ParamValidation(), AdaptiveQuant(1) is not supported yet for screen content, auto turned off
[OpenH264] this = 0x0x29a80e8e5d40, Warning:ParamValidation(), BackgroundDetection(1) is not supported yet for screen content, auto turned off
[OpenH264] this = 0x0x29a80e8e5d40, Warning:[Rc] iDid = 0,iContinualSkipFrames(3) is large
[OpenH264] this = 0x0x29a80e8e5d40, Warning:Actual input framerate 0.000000 is different from framerate in setting 15.000000, suggest to use other rate control modes
[454503:1013/082614.334350:ERROR:stun_port.cc(98)] Binding request timed out from 192.168.122.x:48371 (virbr0)
[454503:1013/082614.334369:ERROR:stun_port.cc(98)] Binding request timed out from 192.168.2.x:38871 (wlo1)
[OpenH264] this = 0x0x29a815123f90, Warning:ParamValidationExt(), eSpsPpsIdStrategy setting (2) with iUsageType (1) not supported! eSpsPpsIdStrategy adjusted to CONSTANT_ID
[OpenH264] this = 0x0x29a815123f90, Warning:ParamValidation(), AdaptiveQuant(1) is not supported yet for screen content, auto turned off
[OpenH264] this = 0x0x29a815123f90, Warning:ParamValidation(), BackgroundDetection(1) is not supported yet for screen content, auto turned off
[OpenH264] this = 0x0x29a815123f90, Warning:[Rc] iDid = 0,iContinualSkipFrames(3) is large
[OpenH264] this = 0x0x29a815123f90, Warning:[Rc] iDid = 0,iContinualSkipFrames(6) is large
[OpenH264] this = 0x0x29a815123f90, Warning:[Rc] iDid = 0,iContinualSkipFrames(9) is large
[OpenH264] this = 0x0x29a815123f90, Warning:[Rc] iDid = 0,iContinualSkipFrames(12) is large
[OpenH264] this = 0x0x29a815123f90, Warning:[Rc] iDid = 0,iContinualSkipFrames(15) is large
[OpenH264] this = 0x0x29a815123f90, Warning:[Rc] iDid = 0,iContinualSkipFrames(18) is large
[OpenH264] this = 0x0x29a815123f90, Warning:Actual input framerate 0.000000 is different from framerate in setting 15.000000, suggest to use other rate control modes
aragorn@Aragorn:~/Downloads$ pactl info | grep "Server Name"
Server Name: PulseAudio (on PipeWire 0.3.59)
aragorn@Aragorn:~/Downloads$ 
IsmaelMartinez commented 1 year ago

Then is probably snap and maybe some strange permission. To test this, try to install the app with sudo. if it works that will indicate your snap installation is a bit "particular". Just a guess

IsmaelMartinez commented 1 year ago

Ignore, I just saw your previous message... Now, you should not need to install packages in snap as sudo. If they aren't working without sudo, that means something is off with the installation.

pallebone commented 1 year ago

It is normal to need to use sudo to install a snap app. If you omit sudo all that happens is the password prompt appears on the screen graphically with a prompt. You cant add or remove packages without authentication, this is the normal functioning and by design. Otherwise any user could add or remove applications on the box without rights.

https://snapcraft.io/docs/installing-snap-on-ubuntu

"To test your system, install the hello-world snap and make sure it runs correctly:

$ sudo snap install hello-world hello-world 6.4 from Canonical✓ installed $ hello-world Hello World!"

IsmaelMartinez commented 1 year ago

I am not in Linux anymore reason why I am a bit blind on this. Check if you can enable the screen share permission in the snap app. Maybe it didn't trigger in your installation.

Again, I remember snap been a pain for some people.

On Thu, 13 Oct 2022, 17:01 Peter, @.***> wrote:

It is normal to need to use sudo to install a snap app. If you omit sudo all that happens is the password prompt appears on the screen graphically with a prompt.

— Reply to this email directly, view it on GitHub https://github.com/IsmaelMartinez/teams-for-linux/issues/624#issuecomment-1277842861, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJHEAMJK7525O6WHN3KC3WDAW6BANCNFSM6AAAAAARCSX4NU . You are receiving this because you were mentioned.Message ID: @.***>

pallebone commented 1 year ago

I have tried to do this but have not been able to find a solution to the issue or enable it in any way with things like passing arguments (enable-webrtc-pipewire-capturer) or installing libraries. Still the error persists that : "One of following libraries is missing on your system:

unsure how to proceed. Nothing I try is able to resolve.

IsmaelMartinez commented 1 year ago

It must be related to your snap installation if it works using a Deb package. I suggest you try to uninstall snap and install/config it again. That is a pain tbh, so will understand if that is a no go. Check if another snap apps that share (or record) the screen works as they might give you another clue of where to look for. Sorry I can't help much more.

pallebone commented 1 year ago

Interesting. Unsure how I could have setup snap wrong as its fairly basic to install. I wonder if other users will begin to have this issue when the next version of ubuntu comes out as it pulls from debian testing.

As we dont know what to do next I will leave this issue open but wait to see if anyone else reports the issue as I imagine other people might.

You dont think it has anything to do with missing libraries as per the initial snap error? Seems rather specific.

Either way happy to wait for a while and see what happens.

murzz commented 1 year ago

I am facing exactly this on snap and Ubuntu 22.04/22.10

[10898:0303/211542.741372:ERROR:shared_screencast_stream.cc(402)] One of following libraries is missing on your system:
 - PipeWire (libpipewire-0.3.so.0)
 - drm (libdrm.so.2)
[10898:0303/211542.741424:ERROR:base_capturer_pipewire.cc(60)] ScreenCastPortal failed: 1

The libraries are available on rootfs and inside some snaps (e.g. firefox, gnome) but not in teams-for-linux snap:

$ fdfind "libdrm.so.2|libpipewire-0.3.so.0" /
/usr/lib/x86_64-linux-gnu/libdrm.so.2
/usr/lib/x86_64-linux-gnu/libpipewire-0.3.so.0
/usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0
/usr/lib/x86_64-linux-gnu/libpipewire-0.3.so.0.358.0
/snap/core22/522/usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0
/snap/core22/522/usr/lib/x86_64-linux-gnu/libdrm.so.2
/snap/gnome-3-38-2004/119/usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0
/snap/gnome-3-38-2004/119/usr/lib/x86_64-linux-gnu/libdrm.so.2
/snap/clion/222/plugins/remote-dev-server/selfcontained/lib/libdrm.so.2
/snap/firefox/2391/usr/lib/x86_64-linux-gnu/libpipewire-0.3.so.0.332.0
/snap/firefox/2391/usr/lib/x86_64-linux-gnu/libpipewire-0.3.so.0
/snap/gnome-3-34-1804/77/usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0
/snap/gnome-3-34-1804/77/usr/lib/x86_64-linux-gnu/libdrm.so.2
/snap/gnome-42-2204/56/usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0
/snap/gnome-42-2204/56/usr/lib/x86_64-linux-gnu/libdrm.so.2
/snap/codium/299/usr/lib/x86_64-linux-gnu/libdrm.so.2
/snap/codium/299/usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0
pallebone commented 1 year ago

maybe they can be added in a hope to fix the issue?

IsmaelMartinez commented 1 year ago

I have no idea how we can add that to the snap package. I thought snap will do it for you, but feels strange. Have you check you have given the right permission to the snap package?

pallebone commented 1 year ago

@IsmaelMartinez snap packages require the developer to bundle the dependencies within the snap. That is why they are larger, there is no way for the self contained snap package to avoid this as the entire idea is a snap package contains everything it needs to run in a single package.

dmurzaikins commented 1 year ago

I thought snap will do it for you

Looks like it tries to guess (but might fail?), but still require manually list packages: https://snapcraft.io/docs/build-and-staging-dependencies#heading--missing-staging I tried adding stagePackages section to package.json, but was unable to resolve build errors.

Something like following:

"stagePackages": [
  "default",
  "libpipewire-0.3-0",
  "libdrm2"
],
IsmaelMartinez commented 1 year ago

Would you be able to take a look at the 'CONTRIBUTING.md' file on the following GitHub repository: https://github.com/IsmaelMartinez/teams-for-linux/blob/develop/CONTRIBUTING.md? I am wondering if you could create a local snap package using the instructions provided in the 'snap-build' section of the file and test it to see if it works. If it does, it would be fantastic if you could create a pull request with the necessary changes. The community would be very grateful for your contribution.

pallebone commented 1 year ago

I have retested this issue on the latest teams (latest/stable: 1.0.55 2023-03-22 (300) 85MB) and it is now working so something has changed between 1.0.45 and 1.0.55 to make it work. Anyone else now have it working?

Kind regards Peter

`aragorn@Aragorn:~$ snap info teams-for-linux name: teams-for-linux summary: Teams for Linux publisher: ismael (ismaelmartinez) store-url: https://snapcraft.io/teams-for-linux contact: https://github.com/IsmaelMartinez/teams-for-linux license: unset description: | Unofficial Microsoft Teams client for Linux using Electron. It uses the Web App and wraps it as a standalone application using Electron. commands:

dmurzaikins commented 1 year ago

Not working on my end, tried 1.0.55 and 1.0.58 from edge.

pallebone commented 1 year ago

Not working on my end, tried 1.0.55 and 1.0.58 from edge.

Do you have both libraries installed? sudo apt-get install libpipewire-0.3-0 libdrm2

jijojosephk commented 1 year ago

Duplicate of #765

jijojosephk commented 1 year ago

@pallebone I tried every possible things to fix. Snap team has to fix the underlying issues. Closing this for now. If you're ok, please switch to flatpak or even any native package. If you later find some fix is available in electron or snap, please re-open this issue.

pallebone commented 1 year ago

@jijojosephk As I mentioned it was resolved already for me on latest release using debian testing. Some ubuntu users still cant use it because they have a point distribution and are not using 23.04 yet. They will need to upgrade to 23.04 or ubuntu+1 to resolve.