element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.14k stars 1.98k forks source link

Black screen in voip call when other side shows their webcam #20584

Open babolivier opened 2 years ago

babolivier commented 2 years ago

Steps to reproduce

  1. Create a voip video call
  2. Black screen instead of camera

Outcome

What did you expect?

The other side's camera shows up

What happened instead?

Black screen shows up

image

There's an error in the javascript console: DOMException: The fetching process for the media resource was aborted by the user agent at the user's request.

Will rageshake, and ask my friend to do it as well.

Operating system

Arch Linux

Browser information

Firefox 96.0

URL for webapp

develop.element.io

Application version

Element version: 85f6c3b21f80-react-18c82d57ae0a-js-16ca09eed811, olm version: 3.2.8

Homeserver

abolivier.bzh

Will you send logs?

Yes

SimonBrandner commented 2 years ago

Is this reproducible? Are they also on Element Web/Desktop?

babolivier commented 2 years ago

Not sure how reproducible this is. They're on Element Desktop, and have rageshaken.

callahad commented 2 years ago

Just had the same occur: @afranke couldn't see my video. I'm using Element Web Nightly on Firefox 96.

adminibt commented 2 years ago

Same problem here. We are using Element Desktop 1.9.8 (Windows). This is not reproducible. Is there any way we can help?

SimonBrandner commented 2 years ago

Are all people experiencing this on develop?

Possibly regressed by https://github.com/matrix-org/matrix-js-sdk/pull/2104, CC @dbkr

lukasIO commented 2 years ago

Experiencing the same problem Version Desktop Element: 1.9.9

dbkr commented 2 years ago

The errors in the rageshake look like ones we get often due to the fact that we pause the media element when changing the feed, so the previous play request just doesn't work and throws that exception, but then we call play again anyway, so I don't think they're relevant. I'm not sure what else it would be though: I can't really see how that change would cause it, and I can't reproduce the bug either.

dbkr commented 2 years ago

Oh, but given the range of versions above (1.9.8, 1.9.9, develop, nightly) it doesn't appear specific to develop/nightly, so not a release blocker.

SimonBrandner commented 2 years ago

The errors in the rageshake look like ones we get often due to the fact that we pause the media element when changing the feed, so the previous play request just doesn't work and throws that exception, but then we call play again anyway, so I don't think they're relevant.

Yeah, I don't think those are very relevant either.

I'm not sure what else it would be though: I can't really see how that change would cause it, and

It was more of a long shot, though I wonder what changed that people are seeing this a lot now :thinking:

I can't reproduce the bug either.

Neither can I

lukasIO commented 2 years ago

Are there any additional infos that we can provide to help you reproduce this? It's blocking our daily use on ems.host right now...

w4tsn commented 2 years ago

This is also happening to us on ems.host at the moment. Element version of me and my peer I tested with is 1.9.9, I'm using Desktop on Fedora Linux and my peer is using it on Windows. If my peer switches to Android it works while it reproduces consistently with this peer when using Desktop. Peer is on another home server though. Also happens with other colleagues from same home server but not as consistent. Seems to happen more often when I start a call. When they call me back it usually works (but not today with the peer I test with) :shrug: It does not seem to matter if the peer is on Windows or Linux I think, I've seen this problem with both

dbkr commented 2 years ago

I still can't reproduce this with any combination of desktop / chrome / firefox calling each other. If anyone feels confident doing so, I'd like to know if the side with the black screen is receiving video or not, which you can find you by going to (in chrome) chrome://webrtc-internals, finding the right tab for element's browser tab and finding the "Stats graphs for RTCInboundRTPVideoStream_xxxxxxxxxx (inbound-rtp)" (where the x's are some numbers). You should be able to tell fairly easily whether it's getting video (number of packets & frames increasing) or not, eg. here's mine getting video:

Screenshot 2022-01-27 at 11 25 54

If it is getting video, you could try right-clicking the video, choosing 'inspect', then you can refer to that video element as $0 in the console and see if telling it to play manually helps: $0.play():

Screenshot 2022-01-27 at 11 29 10

We can also try to add more debugging to track down what's going on here.

lukasIO commented 2 years ago

Just as a note: for us this is happening very consistently (=always) and is not limited to video. There's neither audio nor video. I'll try to get the webrtc insights in the next call.

dbkr commented 2 years ago

OK, if you're not getting any media at all then that's a very different problem and would want a separate issue. I assume for others this is just the video that is missing and the audio is fine both ways (or have I completely mis-interpreted this issue?)

babolivier commented 2 years ago

In my case it's indeed only the video that's missing.

afranke commented 2 years ago

Yep, with @callahad I’m getting his voice but not his video.

dbkr commented 2 years ago

Just made another call and this time my local video preview was frozen on one side. It's possible this could be the same issue. I could un-freeze it by making a new MediaStream object and adding just the video track from the old stream to the new one, then setting the new stream as the source (ie. making a new stream with no audio track).

dbkr commented 2 years ago

Have added logging in https://github.com/matrix-org/matrix-react-sdk/pull/7721 to try & catch this: once that's merged, please continue sending bug reports whenever you see this bug.

novocaine commented 2 years ago

We haven't received reports of this for a few days - are people still experiencing it?

SimonBrandner commented 2 years ago

Probably a long shot but https://github.com/matrix-org/matrix-js-sdk/pull/2157 could have had some effect?

ara4n commented 2 years ago

This could be the same bug which is causing grey tiles in matrix-video-chat (https://github.com/vector-im/matrix-video-chat/issues/211)

adminibt commented 2 years ago

We still have this problem. Using Element Desktop 1.10.1.

t3chguy commented 2 years ago

https://github.com/matrix-org/matrix-js-sdk/pull/2157 is not included in 1.10.1 given it only merged 3 days ago.

novocaine commented 2 years ago

@lukasIO are you still experiencing this?

lukasIO commented 2 years ago

Since (more or less) two days the issues have stopped showing up for me 🎉

SimonBrandner commented 2 years ago

Is anyone else seeing this, or can we close this now?

novocaine commented 2 years ago

Let's close it for now, can re-open if someone is still experiencing it

afranke commented 2 years ago

It just happened again to me with @jsparber (he could see me, but I only saw a black screen instead of their image).

babolivier commented 2 years ago

Just had this issue with @MatMaul, we're both rageshaking

image

dbkr commented 2 years ago

Again, nothing particularly informative in these logs unfortunately. Any particular things you're doing when experiencing this?

babolivier commented 2 years ago

Again, nothing particularly informative in these logs unfortunately. Any particular things you're doing when experiencing this?

Nope, just started a video call. I had a few calls with Mathieu in the past few weeks and they worked fine, but I was using a different connection, so it's probably related to some broadband providers' network configs (though Jitsi didn't have this issue). We tried terminating the call and have him call me (I initiated the first call) and the issue was still there.

dbkr commented 2 years ago

Hmm, network config is unlikely to make one stream work where the others were fine (unless it's a really, really low-bandwidth connection). If you are able to inspect the streams with webrtc-internals as above that could provide inspiration, or if there's a certain reliable way of reproducing it.

I'm going to remove the regression label as this was added when we thought it might be regressed by a certain PR, but it looks like it's not that simple.

xBelladonna commented 1 year ago

I have been experiencing this issue and perhaps a related one, but it may be the same thing. I call regularly with my friend and their webcam often starts black, but they have several cameras and toggling between them seems to fix the issue for the duration of the call. In addition, I also seem to experience the same problem, but I have no additional cameras. However, toggling the audio input device away from default and back again seems to do the trick oddly enough! Both of us see the same thing on our respective local machines: a 1:1 black square where our video previews should be, and receiving black frames from the other. I thought I'd comment here before opening a new issue both since it's possibly the same issue and also possibly fixed by Element Call. If it is indeed new, I can open another issue.