New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 703903 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

"b=AS" SDP line for audio is also used for video after renegotiation

Reported by xsvengo...@gmail.com, Mar 22 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0

Steps to reproduce the problem:
I am testing with a Logitech c615 for both video and audio. This issue happens with M57 and M58. The attached logs are from a test performed between two windows of Chrome on the same machine. After renegotiating, Chrome decides to use the audio bandwidth setting for video, resulting in poor video quality. The test was performed as follows:

1. Establish a peer connection with both clients having one video stream; no audio tracks. Both clients add "b=AS:2048" under a=mid:video and "b=AS:64" under a=mid:audio in their local SDP before sending to the other client. Video looks great; available send bandwidth is at 2Mb/s for both clients.
2. Have one of the clients add an audio track to their video stream. I do this by calling webkitMediaStream with the video and audio track, remove the old stream from the peer connection, add the new stream to the peer connection. Renegotiate by having the caller send another offer. Both clients add "b=AS:2048" under a=mid:video and "b=AS:64" under a=mid:audio in their local SDP before sending to the other client. Video quality drops significantly; available send bandwidth is at 64kb/s for both clients. The 64kb/s is directly correlated to the "b=AS:64" line under "a=mid:audio".

What is the expected behavior?
Modifying the SDP by adding "b=AS" under the "a=mid:audio" and "a=mid:video" lines will set the available receive bandwidth for video and audio respectively.

What went wrong?
After renegotiation takes place, the available send bandwidth for both clients are set to their counterparts' requested audio bandwidth value.

Did this work before? Yes M56

Does this work in other browsers? N/A

Chrome version: Version 58.0.3029.19 beta (64-bit)  Channel: beta
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

There's other weirdness if I have both clients with audio+video and have one client change the video b=AS value from 2Mb/s to 1.5Mb/s. If needed I can work on creating a test page that exhibits this behavior. I just don't have anything right now that I can openly provide.
 
webrtc_internals_dump.txt
497 KB View Download
event_log.7.1
486 KB Download
event_log.13.1
542 KB Download
Cc: rbasuvula@chromium.org
Labels: TE-NeedsTriageHelp
This looks like out of scope for TE, hence adding the respective label for it to  triage further.
Components: Blink>WebRTC
Labels: -TE-NeedsTriageHelp
I am attaching a test page that exhibits this issue. Press the three buttons in order to establish a local video+audio call. The renegotiate button simply starts another offer/answer handshake; no changes to the peer connection. After the renegotiation takes place, both remote videos will be capped 64kb/s when they should be capped at 2Mb/s.
BandwidthTest.zip
40.3 KB Download
Just for the record, since Opera updated recently.
I tested the page in Opera 43:
-v43.0.2442.1144 (PGO)
-Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.1144

and in Opera 44:
-44.0.2510.857 (PGO)
-Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36 OPR/44.0.2510.857

Opera v43 (Chrome 56) did not show the problem. I updated Opera to v44 (Chrome 57) and now it shows the problem.
Cc: krajshree@chromium.org
Labels: Needs-Feedback
Tested the issue on Win-7 and Win-10 using chrome reported version #58.0.3029.19.

Attaching screen cast for reference.

Following are the steps followed to reproduce the issue.
------------
1. Downloaded the BandwidthTest.zip and extracted it.
2. Opened the index.html in the chrome browser.
3. Observed that out of three buttons only one button was enabled and the other two were disabled.

xsvengolix@ - Could you please provide any other sample html file to test this issue.

Thanks...!!
703903.mp4
1023 KB View Download
krajshree@ - I modified my test page and added more logging to see what's happening. I think it failed to find a camera and didn't continue. I made a recording of my own just so you can see the problem in action, but I'm hoping to have you reproduce it yourself.

Here are the steps I took on a Windows 7 machine:
1. Plugged in a Logitech c615. This will provide both the video and microphone needed for this test.
2. Opened the index.html in the chrome browser
3. Clicked the "Start Local Video" button.
4. Clicked Allow for both camera and microphone usage. Made sure the local video is active for both client A and client B.
5. Clicked the "Start Call" button. Made sure the remote video is active for both client A and client B.
6. Opened chrome://webrtc-internals, clicked on one of the two tabs, opened the stats graph for bweforvideo, and observed that the googAvailableSendBandwidth was at 2.0M
7. Clicked the "Renegotiate" button.
8. Observed that the googAvailableSendBandwidth drops to 64Kb and the video quality drops in client A and client B remote video.

Hope this helps!
BandwidthTest2.zip
40.3 KB Download
recording.mp4
8.6 MB View Download
Project Member

Comment 7 by sheriffbot@chromium.org, Mar 23 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: ligim...@chromium.org
Labels: Needs-Bisect Needs-Triage-M58
Labels: -Pri-2 -Needs-Bisect -Needs-Triage-M58 hasbisect-per-revision M-57 ReleaseBlock-Stable OS-Linux OS-Mac Pri-1
Owner: hbos@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce the issue on Windows 10, mac 10.12.3 and Ubuntu 14.04 using chrome reported version #58.0.3029.19 and latest canary #59.0.3050.0.

Bisect Information:
=====================
Good build: 57.0.2938.0   Revision(435514)

Bad Build : 57.0.2939.0   Revision(435817)

Change Log URL: 
https://chromium.googlesource.com/chromium/src/+log/df48f17f5512fa5a727e63290aded588bc776751..a3baa5f8c33d60a57fc98d211da1d168c093ae52

From the above change log suspecting below change

Review url: https://codereview.chromium.org/2545763002

hbos@ - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Note: Adding label ReleaseBlock-Stable, as it seems to be a recent regression.

Thanks...!!
Cc: -rbasuvula@chromium.org pbomm...@chromium.org gov...@chromium.org

Comment 11 by hbos@chromium.org, Mar 24 2017

Cc: pthatcher@chromium.org hbos@chromium.org deadbeef@chromium.org hta@chromium.org
Owner: sprang@chromium.org
From the roll, +sprang's CL https://codereview.webrtc.org/2531383002/ looks suspicious. Can you take a look?

+hta for SDP goodness; is this unexpected behavior? b=AS bitrate limiting both audio and video...

cc +pthatcher, +deadbeef for network layers.

Comment 12 by hta@chromium.org, Mar 24 2017

This is certainly a bug.

The definition is in https://tools.ietf.org/html/rfc4566#section-5.8 - AS means "the application's concept of bandwidth", and if it's a per-media entry, one m= section shouldn't affect other m= sections.

Severity seems to be a bit high, since (according to the description)
1) It only affects systems that add "b=as" to the SDP
2) It only affects cases of renegotiation
So number of affected users isn't going to be tremendously high, but the users affected will be quite affected (crappy video quality).

A workaround is to not add the "b=AS" line to the audio.
I believe the issue was introduced in this CL, FYI: https://codereview.webrtc.org/2534173002

Comment 14 by hbos@chromium.org, Mar 24 2017

Cc: holmer@chromium.org
+holmer for suspected https://codereview.webrtc.org/2534173002
Cc: abdulsyed@chromium.org anan...@chromium.org
Thank you everyone. We're planning to cut RC today for next week Stable refresh release. Please note M57 Stable has been out since 03/09 for small percentage of Win/Mac users and 100% Linux users. 

As number of affected users isn't going to be tremendously high, I'm leaning towards NOT to block M57 Stable release for this unless CL listed at #14 is super safe to revert. 

+ abdulsyed@ & + anantha@ to take their input as wel..

I agree that this is a regression. I think it's a bit unclear how this should work, since b=AS affects the max bitrate of the bandwidth estimator, and the two m= sections share the same bandwidth estimator in Chrome.

IMO the change needed to revert to old behavior is trivial, so I have uploaded a CL which does that here: https://codereview.webrtc.org/2774123002/
Verified the fix in a ToT Chrome build.
Thank you holmer@.
Could you please land the revert on trunk, verify it on Canary and then request a merge to M57 and M58?

Comment 19 by hbos@chromium.org, Mar 27 2017

Cc: sprang@chromium.org
Owner: holmer@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 20 by bugdroid1@chromium.org, Mar 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/external/webrtc.git/+/1ccf73f830fd3f4ca75b0e4fd15adc784991edaa

commit 1ccf73f830fd3f4ca75b0e4fd15adc784991edaa
Author: stefan <stefan@webrtc.org>
Date: Mon Mar 27 10:51:18 2017

Fix issue with conflicting behavior if setting a max BW with b=AS on both audio and video.

This reverts to previous behavior where b=AS only affects the codec bitrate for audio streams, and not the max bandwidth estimate.

BUG= chromium:703903 

Review-Url: https://codereview.webrtc.org/2774123002
Cr-Commit-Position: refs/heads/master@{#17386}

[modify] https://crrev.com/1ccf73f830fd3f4ca75b0e4fd15adc784991edaa/webrtc/media/engine/webrtcvoiceengine.cc
[modify] https://crrev.com/1ccf73f830fd3f4ca75b0e4fd15adc784991edaa/webrtc/media/engine/webrtcvoiceengine.h
[modify] https://crrev.com/1ccf73f830fd3f4ca75b0e4fd15adc784991edaa/webrtc/media/engine/webrtcvoiceengine_unittest.cc

Labels: Merge-Request-57 Merge-Request-58 M-58

Comment 22 by blum@chromium.org, Mar 27 2017

Cc: blum@chromium.org
It's most likely possible to work around this issue by instead of using b=AS for the audio m section, use the Opus fmtp parameter "maxaveragebitrate" https://tools.ietf.org/html/rfc7587#section-6.1. 

Example:
a=rtpmap:101 opus/48000/2
a=fmtp:101 maxaveragebitrate=64000;

For other codecs (if there are any other ones that support setting a max bitrate), it can be worked around for now by simply removing b=AS for the audio m section. It's not the ideal solution, but should help avoiding bad video quality.

Based on this I think we should consider only merging this to M-58.
Note also that the fmtp parameter "maxaveragebitrate" is the recommended solution for setting a max bitrate for opus.
Cc: mflodman@chromium.org
Labels: -Merge-Request-57 Merge-Rejected-57
Based on comment #23, rejecting merge to M57.

Please update the bug with Canary result. If change looks good in Canary, we will approve merge to M58. Thank you.
Labels: -M-57
Project Member

Comment 28 by sheriffbot@chromium.org, Mar 28 2017

Labels: -Merge-Request-58 Hotlist-Merge-Approved Merge-Approved-58
Your change meets the bar and is auto-approved for M58. Please go ahead and merge the CL to branch 3029 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), bhthompson@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Your change is approved for M58. Please ensure to verify the fix, if all looks good merge ASAP so that it will be picked up for next Beta Release, RC cut today (Tuesday-03/28) at 4.00 PM PST.
Project Member

Comment 30 by bugdroid1@chromium.org, Mar 28 2017

Labels: merge-merged-58
The following revision refers to this bug:
  https://chromium.googlesource.com/external/webrtc.git/+/0e43e9d0d6a2f8472c4f47c6fead5415d5472bf1

commit 0e43e9d0d6a2f8472c4f47c6fead5415d5472bf1
Author: Stefan Holmer <stefan@webrtc.org>
Date: Tue Mar 28 20:26:45 2017

Fix issue with conflicting behavior if setting a max BW with b=AS on both audio and video.

This reverts to previous behavior where b=AS only affects the codec bitrate for audio streams, and not the max bandwidth estimate.

BUG= chromium:703903 
TBR=minyue@webrtc.org

Review-Url: https://codereview.webrtc.org/2774123002
Cr-Original-Commit-Position: refs/heads/master@{#17386}
Review-Url: https://codereview.webrtc.org/2780783004 .
Cr-Commit-Position: refs/branch-heads/58@{#9}
Cr-Branched-From: f31969a584bcafe9406c214a9d4c3afb49d19650-refs/heads/master@{#16937}

[modify] https://crrev.com/0e43e9d0d6a2f8472c4f47c6fead5415d5472bf1/webrtc/media/engine/webrtcvoiceengine.cc
[modify] https://crrev.com/0e43e9d0d6a2f8472c4f47c6fead5415d5472bf1/webrtc/media/engine/webrtcvoiceengine.h
[modify] https://crrev.com/0e43e9d0d6a2f8472c4f47c6fead5415d5472bf1/webrtc/media/engine/webrtcvoiceengine_unittest.cc

Project Member

Comment 31 by sheriffbot@chromium.org, Mar 31 2017

This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Hotlist-Merge-Approved -ReleaseBlock-Stable -Merge-Approved-58
Status: Fixed (was: Started)

Sign in to add a comment