-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome screensharing "eats" the quality of concurrent video track #1306
Comments
Adding as well that this was previously submitted to Twilio support with ticket # 5500109. |
Hi @steffentchr , Sorry for the delayed response. I have created an internal JIRA ticket to track this work. I'll keep you posted. Thanks, Manjesh |
Hello all, Has there been any movement on this issue? Thanks, Jason |
Hey @jayphawk , thanks for the ping! We don't have any updates on this one as of now due to other higher priority items we have on the roadmap. We already have an internal tracker filed and it will be reviewed for prioritization. Thank you, |
Thanks for the update @charliesantos. I'm disappointed it's not a higher priority since it is greatly affecting us, but I understand. |
@charliesantos Any news on the prioritization of this issue? |
@steffentchr I bumped this up internally and we'll consider in the next planning session. Meanwhile, are you able to observe the same issue in our reference react app? https://github.com/twilio/twilio-video-app-react |
To be frank, I spent time on providing the cleanest possible reproduction case rather than debugging the example app ;) @jayphawk may be able to add additional information around how he's observing the problem. |
Unfortunately, I can really only offer an end-user prospective right now through a program called Switcher Studio. We’ve done testing comparing the experience when screensharing is used versus when it’s not used, as well as starting screensharing and then stopping it to see whether the video recovers, which it does. It’s an issue we’re watching closely because of the way we’re utilizing Switcher Studio and the screensharing functionality. There’s a significantly noticeable difference in video quality shortly after screensharing is initiated. Once screensharing is stopped, the video quality returns to high quality after a bit of time. I’ve reported the issue to the Switcher Studio team, so I’ll see if I can get more information from them on what they see. |
@charliesantos Any news on the prioritization of this issue? @Bumbolio, would you mind looking into this issue from your end to see if you can replicate it? We are still experiencing this issue in Switcher Studio and it is seriously impacting our use of the platform. |
Hi @jayphawk , thanks for the ping.
Per your comment above, please confirm that the issue is no longer reproducible if we remove that check. See below: if (maxBitrate === null || maxBitrate === 0) {
removeMaxBitrate(params);
} else {
setMaxBitrate(params, maxBitrate);
} We have to investigate and do some testing to make sure removing that check will not cause any other issues. |
Thanks for the reply, @charliesantos. That seems to be the case from what I can tell, but I cannot take credit for the testing and documentation that @steffentchr provided. Thanks. |
@steffentchr please confirm. |
@charliesantos Yes, modifying the check resolves the problem. I have just retested this the For full visibility, some notes on the testing:
After this I used the Current master exhibits the problem: |
Thanks @steffentchr! @charliesantos, what else is needed to move this fix along? It would be brilliant to see this resolved after hovering for so long! |
@jayphawk We're not currently setting a max bitrate for the screen sharing tracks, so the solution above would not have any impact. If we start setting a max bitrate, it could allow for more bandwidth for other video tracks, but it would reduce the quality of the screen-sharing track. Twilio allows a maximum of 4Mbps of data for all video and audio tracks being received, so it's a careful balance between screen sharing and other video tracks. Currently, we set the screen-sharing track as having the highest priority, without the bitrate cap I could see this using up all the available bandwidth and reducing the quality of the other video tracks. We'll look into this fix and experiment with setting a max bitrate. I have concerns that removing the JSDK-2557 patch could cause some users to not be able to do screen sharing at all in Chrome unless this bug has been fixed in Chromium. |
What did come of the experiment with setting a max bitrate @Bumbolio? |
Hi Everyone, we are still evaluating the right way to fix this. While @steffentchr 's suggestion may work, we're afraid it will re-introduce some of the old issues. We are also addressing other higher priority items right now while working through this. Please bear with is in the meantime. |
@charliesantos Appreciate the answer on status, and as customers we certainly feel the pain of other issues. Having said that, this is a confirmed issue affecting production use across your customers, which was originally reported against 2.8.x. We're now at 2.18.x and a year later, so would cherish any action taken to move us forward. |
actually is also happen in ION SFU SDK |
@makarandp0 I see that considerable work was done on adaptive streaming and network management at 86924be. Is it about time to review this one again? Or at least to do away with the |
@charliesantos @makarandp0 For good measure I retested the bug and reproduction case linked above, and the problem remains: |
Thanks for the ping @steffentchr . What version of the sdk did you perform your most recent testing? |
@charliesantos The testing is with the 2.20.0 version directly from the CDN. I don't know if this adds additional clarity to the issues, but this is a quick recap of throughput before, during, and after a screen sharing track is added: We see this issue in monitoring across customers with We did some additional testing today, and potentially the bug isn't present on a wired network connection (we tested and saw the problem on multiple wifi connections; but couldn't reproduce on the single ethernet connection available, so take with a grain of salt). It isn't limited to a few network though, as we have seen the problem across thousands of Twilio rooms since the initial report. Crucially, we also tested the same pattern (adding a video and a screen sharing track) with Google Meet did not see a quality decline under the same network conditions. Just let me know if you need any additional information; as you can tell, I'm anxious to have this issue resolved. |
Thanks @steffentchr . Another question, are you seeing this issue on both group and P2P rooms? |
I the original issue report, I noted that this was only the case for group room, not p2p. But hang on, and I'll quickly confirm this.... |
@steffentchr please post the room sids here as well. Thank you! |
Okay, I have just run a quick test in The short version is that the problem doesn't show up on the p2p room. The video bandwidth dipped a few percent while the screen sharing track was on, but nothing near what we see in the group room -- and throughout the |
For the fun of it, I did a quick reproduction in a group room, |
@steffentchr we didn't see any participant joined the p2p room in your example RMaf53102f1286e6d387294b84143596a4 |
I've run a few tests, but to make sure there's a participant joining in the p2p room the code is slightly more complex that the repro case linked above. For control, I ran a group room ( I draw two conclusions from the tests:
I'm attaching similar visualization to above to keep everything slightly comparable. |
Hi @steffentchr thanks for providing more details. I spent some more time tracking this down but unfortunately, I'm not able to reproduce the issue. Looking at the room sids you provided, video sdk is still at 2.18.3, chrome is at version 86, and there are no participants in the p2p room. I understand it is harder for you to test participants joining a p2p room due to the complexity of your setup as you've mentioned, but it will really help us narrow down the issue if we can get logs for both p2p and group rooms with participants joining. I will summarize my requests. Please provide as much as possible.
|
Alright, I've spent some time compiling everything for comparison. These charts are drawn up using nothing but the reproduction code now available from https://github.com/steffentchr/twilio-issue-1306. Code is vanilla against the 2.20.0 SDK. Please refer to the code to be able to consistently reproduce this as well. For this overview, I've focused on How I read the findings:
I also tested with Firefox broadcasting in a group room on wifi ( The bandwidth remains stable while the screen sharing track is present, for example here at 5.66M two minutes after it's been added: Finally, I tested with in Chrome with only a single screensharing track. In a group room on wifi ( To summarize: Something is off in Chrome+group room+wifi when a screen sharing track is added. Quality plummets while the screen sharing track is on, and recovers after the screen track is removed. |
Thanks @steffentchr for the detailed information. We'll investigate further. |
Hi @steffentchr , the data you provided and how you presented it really helped a lot! Thanks so much! For each test, please use the same configuration you have with some minor changes. All using group rooms and ignore p2p rooms. Test 1) same test with simulcast turned off, also collect the available incoming bitrate from the receiver (subscriber) side |
@steffentchr , can you also please submit a support ticket and mention this github issue? We might need some account related information from you. |
@charliesantos No problem, certainly reproduction is easy. This issue was filed support on December 4th 2020, ticket id #5500109. This should cover the suggested test cases. Note that all the tests above are with This is also reflected in the test, with the issue present in all four test cases: I know it's clear from the description above that the problem here is specifically present when a screen sharing track is added. In fact, if I add two video track, the available bandwidth goes up: |
Another way of showing the same effect on how this bug is explicitly related to handling of Chrome screensharing, is to pipe the screensharing through an OffscreenCanvas -- and see how the problem magically disappears, with the same content and conditions: The second example on the illustration above adds a
|
Hello, We have exactly the same problem. In our app the user can have up to two video feeds and one screen share. When only one or two of the video feeds are active everything seems OK, but when the screen share track is added then the quality of the video feeds drops significantly. We are using group rooms without bandwidth profile and without simulcast. We've implemented the proposed workaround but it seems that it has no effect. Should we have to put maxVideoBitrate on connect for workaround to take effect or should set the bitrate only for the screen share track and how? |
Thanks @steffentchr for the detailed results! We're still reviewing and we'll update this space once we have more information. @IvanKalachev , thanks for the report. We're still investigating this issue. |
@steffentchr I'm trying to repro your scenario but I'm not able to. Any chance you could share a full WebRTC internals dump with us? It would be fantastic if you could also enable Chrome's logging like so (I can email you directly if you are not comfortable sharing those here) |
@nicopernas Of course, I'm surprised though that reproduction is proving elusive -- anyways screenshot and Chrome log attached for Chrome debug log: https://we.tl/t-ZAUKt8ERT3 |
@steffentchr would it be possible to attach the full dump though? You can get it from here |
Hi Nicolás -- great to hear that were able to reproduce, and it's quite fascinating if there's a different in packet loss on the two different feeds, going over the same connection. From the write-up is that I agree with the assumption that this is related to network congestion, but it's worth adding that I don't believe it to be my network -- rather this is pretty common. We log webrtc stats from rooms every ten seconds and I looked at the last ~600k reports:
Anyways, great that you have the data -- so please keep us updated as you work the problem. |
@steffentchr have you got a testing account with us? I'd like to enable something in the backend for you to test. Could I use the same account behind room |
Hi Nicolás -- please use |
@steffentchr can you please re-test the same scenario using the |
I don't know @nicopernas -- I think our test account has an extremely aggressive congestion control algo turned on, which makes everything pretty erratic. Any chance of turned it off for me to run a clean test? For reference, these are the results in |
Any news @nicopernas ? 😄 |
Apologies for the silence. What you are seeing there is the browser's congestion control going haywire. If you look at the browser debug logs, you'll see Chrome's probing mechanism "saying that it can't seem to receive that much bandwidth", thus causing the bw estimation to drop. This seems to happen only when a screen share track is published along with a "normal" video track. Note though that the original repro you got was using the "legacy" congestion control algorithm (that runs on the receiver) that we are currently trying to phase out, so even if we fixed that scenario it won't be of a lot of help. Hope that makes sense. Since this seems to be happening only with Chrome, we are reaching out to their team so they can help us understand what's going on. I'll keep you posted. |
@nicopernas or @makarandp0, is there any update from Chrome on this problem? Is there a bug opened with them where we might be able to track progress or see similar complaints from other folks doing screen sharing over WebRTC in Chrome? |
Hey @xtianjohns here's a chrome bug related to this issue https://bugs.chromium.org/p/webrtc/issues/detail?id=14051 |
@charliesantos Great to see that this is being escalated and being looked at. The conversation on the chrome bug is ~6 weeks old by now though and seems to be pointing to Twilio configurations rather than something within the Chrome code base. What's the next step? Anything we can do to help this along? |
Thanks for the ping @steffentchr . We're currently looking at this. We'll let you know if we need additional information. |
OVERVIEW
Since switching to using Twilio's group room feature, we've seen egregious webcam video quality while screen sharing in Chrome. We're using the 2.18.x version in production, but this happens on the 2.20.0 branch as well.
CAUSE
The problem initially seems to be caused by this exception for Chrome screen sharing made in connection with this previous issue. Skipping this exception resolves the problem in full.
REPRODUCTION CASE
https://gist.github.com/steffentchr/3f7ad9f24c4d2b825b2fbdd300718967
For reference, I have also made a recording of the full session available here:
https://training.twentythree.net/secret/65434556/cdd955e541389dec18f9ac5c9a7ea8c8 (direct download).
DETAILS
Our problem is that the webcam track drops to very low bitrates and extremely poor quality whenever screen sharing is started Chrome within a group room. In our testing, we have been using this configuration:
mode
options were tested with the same, disheartening result.)The webcam video track quality stalls within 10-20s of screen sharing starting. The quality stays lowed and erratic even after screen sharing is stopped. It can take multiple minutes from when the screen sharing track is removed before video quality recovers.
In the reproduction code linked above, the code will create a high priority video track on start. Two minutes later it adds a low priority screen sharing track. Another two minutes later it removes the screen sharing track again.
During this process, there's the video quality drops from 2.3M initially to 300K after the screensharing track is added. As you can see from the chart, the lowered quality persists for a siginificant time even after the track is removed again.
When running the same code in a Twilio P2P room, the problem is gone:
As mentioned in the overview above, the problem seems to happens because of an exception in the library made for Chrome screen sharing tracks. When this exception is removed and the bitrate prefrence is correctly applied, the broadcast quality for the video track stays at the expected rate:
As an aside, we have seen production cases on p2p similar to what's reported in JSDK-2557 where Chrome's screen sharing would send 0 bytes from the encoder/the encoder wouldn't start. The upsides of the solution as implemented however do not seem to match the severe consequences on video quality reported here.
The text was updated successfully, but these errors were encountered: