teams-for-linux icon indicating copy to clipboard operation
teams-for-linux copied to clipboard

Screen share: black screen + mouse vs Ubuntu 21.04 + Chrome

Open pablorq opened this issue 3 years ago • 83 comments

Describe the bug When sharing the screen, it shares a black screen with the mouse in it. System: Ubuntu 21.04, teams-for-linux v1.0.10

To Reproduce Steps to reproduce the behavior:

  1. Create a meeting
  2. Share the screen
  3. See a blank screen with the mouse icon

Expected behavior To see the real content of the screen.

Screenshots None

Desktop (please complete the following information):

  • OS: Ubuntu 21.04
  • Installation package: snap
  • Version: 1.0.10

Additional context Terminal output:

$ teams-for-linux
configPath = /home/user/snap/teams-for-linux/182/.config/teams-for-linux
Failed to get the config file, using default values
configFile = {}
Error org.freedesktop.DBus.Error.Failed: cannot change configuration: user declined change

(teams-for-linux:125251): Gtk-WARNING **: 12:44:55.366: Theme parsing error: gtk.css:1566:23: 'font-feature-settings' is not a valid property name

(teams-for-linux:125251): Gtk-WARNING **: 12:44:55.372: Theme parsing error: gtk.css:3618:25: 'font-feature-settings' is not a valid property name

(teams-for-linux:125251): Gtk-WARNING **: 12:44:55.373: Theme parsing error: gtk.css:4080:23: 'font-feature-settings' is not a valid property name

(teams-for-linux:125251): dbind-WARNING **: 12:44:55.481: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-JounLVnQNQ: No such file or directory
processArgs [ '/snap/teams-for-linux/182/teams-for-linux', '--no-sandbox' ]
(node:125388) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.jNd9Ic'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:125426) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.U26jRp'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
[125426:0906/124516.352732:ERROR:audio_rtp_receiver.cc(95)] AudioRtpReceiver::OnSetVolume: No audio channel exists.
[125426:0906/124517.900837:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[125426:0906/124517.900883:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[125426:0906/124517.900900:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[125426:0906/124517.900915:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[125426:0906/124517.900931:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[125426:0906/124517.900946:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[125426:0906/124517.900981:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[OpenH264] this = 0x0x35d5ada9a330, Warning:ParamValidationExt(), eSpsPpsIdStrategy setting (2) with iUsageType (1) not supported! eSpsPpsIdStrategy adjusted to CONSTANT_ID
[OpenH264] this = 0x0x35d5ada9a330, Warning:ParamValidation(), AdaptiveQuant(1) is not supported yet for screen content, auto turned off
[OpenH264] this = 0x0x35d5ada9a330, Warning:ParamValidation(), BackgroundDetection(1) is not supported yet for screen content, auto turned off
[OpenH264] this = 0x0x35d5ada9a330, Warning:bEnableFrameSkip = 0,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.
[125426:0906/124546.257367:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0

pablorq avatar Sep 06 '21 10:09 pablorq

When testing on Chrome (Ubuntu 21.04 + Chrome Version 93.0.4577.63 (Official Build) (64-bit) ) it has the same behavior, this is a black screen with the mouse.

This seems to be a problem related to Ubuntu +Chrome/Chromium.

pablorq avatar Sep 06 '21 10:09 pablorq

Thanks @pablorq Could you confirm the display server? is it x11?

jijojosephk avatar Sep 06 '21 12:09 jijojosephk

I'm using Wayland.

I know that a workaround is to switch to X11, but I don't want to. :slightly_smiling_face:

pablorq avatar Sep 06 '21 12:09 pablorq

I see, there has been issues with Wayland. I haven't used it.

jijojosephk avatar Sep 06 '21 12:09 jijojosephk

@pablorq Do you use pipewire?

micwoj92 avatar Sep 06 '21 12:09 micwoj92

Browser Comparison

After tested the same behavior on Chrome, I started to think that it might be a problem with the browser, about the way it does the screen sharing.

I stated to test Chrome vs Firefox, with interesting results.

  • Firefox 91.0.2 (64-bit)
  • Chrome Version 93.0.4577.63 (Official Build) (64-bit)

Testing Screen Sharing

The screen sharing is done by using WebRTC protocol. For test both browsers I used this web tools:

Mozilla WebRTC test Another WebRTC test

The first result was that Firefox works out of the box using the system selection for screen or window, but Chrome opened a custom (internal?) modal to select the screen (in black) or a window, but only a few windows were listed.

Something is wrong with Chrome on Wayland. It is not using the system dialog.

Mode Investigation

Looking for this problem of Chrome on Wayland, I started to read about PipeWire and how the new versions of the apps have to be adapted to Wayland and PipeWire.

There are some wrappers and tools to try to make it easy for a X11 app to move to Wayland, but it seems that nothing is perfect. And this is another case.

Solution for Chrome

At last, it seems that Chrome is doing the move to PipeWire, but not by default. It must be enabled as an experimental flag, with this in a tab address:

chrome://flags/#enable-webrtc-pipewire-capturer

After reboot Chrome, now the connection works well. Using the same test tools as before, now Chrome use the system selection window for share the screen or a window. Also Teams works well in Chrome over Wayland, and the black screen + mouse is now solved.

Final Note

I will be using this solution until you can update Teams for Linux. Please let me know about it!

pablorq avatar Sep 06 '21 12:09 pablorq

@micwoj92 pipewire and wayland are by default on Ubuntu 21.04. Also PulseAudio is still present, I imagine to help on the transition.

But pipewire isn't activated by default on Chrome. I haven't tested on Chromium. I don't know if Teams for Linux use Chromium or another one.

pablorq avatar Sep 06 '21 12:09 pablorq

Teams for Linux uses electron, which is based on Chromium.

micwoj92 avatar Sep 06 '21 13:09 micwoj92

@pablorq Ubuntu is still experimenting with Wayland. I have not tested v21. I'd try in a VM.

jijojosephk avatar Sep 06 '21 13:09 jijojosephk

@micwoj92 ok. So maybe activating this flag can help! :slightly_smiling_face:

pablorq avatar Sep 06 '21 13:09 pablorq

@jijojosephk well, that was v20. Now, on v21.04, it is the default server and works very well!

The only problem now seems to be updating the apps to work with wayland and pipewire.

:slightly_smiling_face:

pablorq avatar Sep 06 '21 13:09 pablorq

Yes, some applications are written specifically for xorg. Wayland will shine but it takes sometime to completely replace xorg. I'm on my work machine. Can't really try on a real hardware. Let us know if setting the flag works for you.

jijojosephk avatar Sep 06 '21 13:09 jijojosephk

It works using Teams over Chrome + pipewire flag enabled, as posted before.

pablorq avatar Sep 06 '21 13:09 pablorq

you can add that as a config option like the ntlmV2enabled

https://github.com/IsmaelMartinez/teams-for-linux/blob/develop/app/index.js#L12

I assume default to false

IsmaelMartinez avatar Sep 07 '21 08:09 IsmaelMartinez

@IsmaelMartinez sorry, but I don't know how to do it. :disappointed:

pablorq avatar Sep 07 '21 09:09 pablorq

@IsmaelMartinez Is it possible to find the compositor during run time in node? @pablorq could you execute this command and let us know the result? echo $XDG_SESSION_TYPE

jijojosephk avatar Sep 07 '21 10:09 jijojosephk

Of course!

$ echo $XDG_SESSION_TYPE
wayland

pablorq avatar Sep 07 '21 10:09 pablorq

Thank you @pablorq @IsmaelMartinez I think this can be used to take decision on add the extra command-line arguments to the code.

Could you get us the result of this as well ? inxi -Gxx

jijojosephk avatar Sep 07 '21 10:09 jijojosephk

@jijojosephk , inxi is not installed by default. I seems not a good idea to use it, at least on Ubuntu 21.04.

pablorq avatar Sep 07 '21 10:09 pablorq

Thanks. So I have question around this that the pipeWire and wayland are mutually dependant? 'enable-webrtc-pipewire-capturer' would always work on Wayland?

jijojosephk avatar Sep 07 '21 10:09 jijojosephk

@pablorq Could you try launching teams-for-linux from shell using this command ? teams-for-linux --enable-features=WebRTCPipeWireCapturer and let us know if screen sharing works fine or not.

jijojosephk avatar Sep 07 '21 10:09 jijojosephk

Well, it seems a more complex thing that Wayland and PipeWire are mutually dependant.

The fact is that X11 was managing a lot of things, not only the X server but also including screen sharing. Now the X server is done by Wayland and the screen sharing is done by PipeWire.

This is the base of the problem. Changing X11 by Wayland have cut the support for screen sharing. Now this task rely on PipeWire.

More info

This post from Arch wiki explains it a lot better!

By the way, there are other projects that use electron are working on this issue, as you can see in this Jitsi issue.

Finally, I've found a short list of the current status of WebRTC on Wayland/PipeWire

pablorq avatar Sep 07 '21 10:09 pablorq

@jijojosephk I'm affraid it didn't work as expected.

Now, after select to share the screen, the lower box is still shown to select a screen or window, and set the quality. But now, after select the screen or window, the system dialog is shown (this is good! I think this is the connection with pipewire) and I can select what I want to share, in the same way I do in Firefox or now in Chrome, after activate the flag.

But then nothing is shared. It tested with other user on the meeting and nothing was shared.

But I think that is a good step in the right direction!

This is the output (I tried to share the screen several times!):

$ teams-for-linux --enable-features=WebRTCPipeWireCapturer
configPath = /home/user/snap/teams-for-linux/182/.config/teams-for-linux
Failed to get the config file, using default values
configFile = {}

(teams-for-linux:58553): Gtk-WARNING **: 12:40:04.957: Theme parsing error: gtk.css:1566:23: 'font-feature-settings' is not a valid property name

(teams-for-linux:58553): Gtk-WARNING **: 12:40:04.961: Theme parsing error: gtk.css:3618:25: 'font-feature-settings' is not a valid property name

(teams-for-linux:58553): Gtk-WARNING **: 12:40:04.961: Theme parsing error: gtk.css:4080:23: 'font-feature-settings' is not a valid property name

(teams-for-linux:58553): dbind-WARNING **: 12:40:06.856: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-nNKrMmuD04: No such file or directory
processArgs [
  '/snap/teams-for-linux/182/teams-for-linux',
  '--enable-features=WebRTCPipeWireCapturer',
  '--no-sandbox'
]
(node:58805) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.VnOWWQ'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:58805) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.b0LrJU'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:58854) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.nEUCNh'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
[58854:0907/124027.902302:ERROR:audio_rtp_receiver.cc(95)] AudioRtpReceiver::OnSetVolume: No audio channel exists.
[58854:0907/124029.030734:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58854:0907/124029.030765:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58854:0907/124029.030820:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58854:0907/124029.030843:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58854:0907/124029.030861:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58854:0907/124029.030887:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58854:0907/124029.030935:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58553:0907/124039.462383:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58553:0907/124041.867157:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58854:0907/124107.905002:ERROR:stun_port.cc(96)] Binding request timed out from 172.29.2.x:49668 (vpn0)
[58553:0907/124204.218535:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58854:0907/124204.587775:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58553:0907/124214.208177:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58553:0907/124217.445059:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58553:0907/124227.500114:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58854:0907/124227.893049:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58553:0907/124238.650443:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58854:0907/124239.077164:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58553:0907/124244.769006:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58553:0907/124246.666478:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58553:0907/124318.937684:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58854:0907/124319.322064:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[58553:0907/124330.422944:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.
[58553:0907/124336.033061:ERROR:base_capturer_pipewire.cc(522)] Failed to load the PipeWire library and symbols.

pablorq avatar Sep 07 '21 10:09 pablorq

@pablorq I've raised a PR. Let us know if you can build from it. If so, please test it and let us know whether it's working.

jijojosephk avatar Sep 07 '21 11:09 jijojosephk

@jijojosephk I not able to build it.

Please have in mind that the option --enable-features=WebRTCPipeWireCapturer didn't work. :disappointed:

pablorq avatar Sep 07 '21 11:09 pablorq

@pablorq no problem. When @IsmaelMartinez approves PR. Install teams-for-linux from edge channel. sudo snap install teams-for-linux --edge

jijojosephk avatar Sep 07 '21 12:09 jijojosephk

@IsmaelMartinez @pablorq Another PR is on queue. This one seems to be working. @IsmaelMartinez review, and merge when you get free time.

jijojosephk avatar Sep 07 '21 19:09 jijojosephk

Merged, build takes 5 minutes to build and release. Then snap might take a few minutes to pick it up. Do a snap refresh and/or uninstall and install to get the newest version on the edge channel.

https://github.com/IsmaelMartinez/teams-for-linux/actions/runs/1212509706

IsmaelMartinez avatar Sep 08 '21 08:09 IsmaelMartinez

@pablorq Could you try this pre-release?

jijojosephk avatar Sep 08 '21 08:09 jijojosephk

It doesn't work. It does detect Wayland but didn't connect with PipeWire and the system window with the sharing options is not showed.

The option teams-for-linux --enable-features=WebRTCPipeWireCapturer didn't work neither.

The behavior now is the same as the start: blank screen with the mouse, and only X11compatible windows available for sharing.

:disappointed:

It seems that the ozono-platform was needed before, but now it breaks the connection with PipeWire. It was discussed in the Jitsi issue I've posted before.

This is the output:

$ sudo snap install teams-for-linux --edge
[sudo] password for user: 
teams-for-linux (edge) 1.0.11 from ismael (ismaelmartinez) installed

$ teams-for-linux --version
configPath = /home/user/snap/teams-for-linux/188/.config/teams-for-linux
Failed to get the config file, using default values
configFile = {}
1.0.11

$ teams-for-linux
configPath = /home/user/snap/teams-for-linux/188/.config/teams-for-linux
Failed to get the config file, using default values
configFile = {}
INFO: Running under Wayland, switching to PipeWire...

(teams-for-linux:101218): Gtk-WARNING **: 11:08:17.547: Theme parsing error: gtk.css:1566:23: 'font-feature-settings' is not a valid property name

(teams-for-linux:101218): Gtk-WARNING **: 11:08:17.551: Theme parsing error: gtk.css:3618:25: 'font-feature-settings' is not a valid property name

(teams-for-linux:101218): Gtk-WARNING **: 11:08:17.552: Theme parsing error: gtk.css:4080:23: 'font-feature-settings' is not a valid property name

(teams-for-linux:101218): dbind-WARNING **: 11:08:19.881: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-nNKrMmuD04: No such file or directory
processArgs [ '/snap/teams-for-linux/188/teams-for-linux', '--no-sandbox' ]
(node:101447) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.20boZv'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101479) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.tEpG65'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101529) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.kKyUBd'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101550) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.OAJF5H'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101588) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.mdjRr7'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101603) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.vagDtt'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101637) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.MMbUD6'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101657) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.eKG4RC'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101679) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.2huQQq'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
(node:101694) Electron: Loading non-context-aware native module in renderer: '/run/user/1000/snap.teams-for-linux/.org.chromium.Chromium.4jl0nK'. This is deprecated, see https://github.com/electron/electron/issues/18397.
(Use `exe --trace-warnings ...` to show where the warning was created)
did-finish-load
[101694:0908/110917.020429:ERROR:audio_rtp_receiver.cc(95)] AudioRtpReceiver::OnSetVolume: No audio channel exists.
[101694:0908/110918.220380:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[101694:0908/110918.220416:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[101694:0908/110918.220437:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[101694:0908/110918.220457:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[101694:0908/110918.220476:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[101694:0908/110918.220494:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[101694:0908/110918.220511:ERROR:webrtc_video_engine.cc(3415)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[OpenH264] this = 0x0x2c4fc0665600, Warning:ParamValidationExt(), eSpsPpsIdStrategy setting (2) with iUsageType (1) not supported! eSpsPpsIdStrategy adjusted to CONSTANT_ID
[OpenH264] this = 0x0x2c4fc0665600, Warning:ParamValidation(), AdaptiveQuant(1) is not supported yet for screen content, auto turned off
[OpenH264] this = 0x0x2c4fc0665600, Warning:ParamValidation(), BackgroundDetection(1) is not supported yet for screen content, auto turned off
[OpenH264] this = 0x0x2c4fc0665600, Warning:bEnableFrameSkip = 0,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.
window close
before-quit
window close
window closed
will-quit
quit

pablorq avatar Sep 08 '21 09:09 pablorq