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

Issue 683011 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug

Blocking:
issue 581679



Sign in to add a comment

Let webrtc uses block size 512 instead of minimum block size supported by Chrome

Project Member Reported by cychiang@chromium.org, Jan 20 2017

Issue description

I have done webrtc testing on ChromeOS using samus board in  issue 667674 .
The attempt was to lower the supported block size by Chrome from 512 to 256.

I tested block size 256 samples on samus and found that all of the test failures were coming from delayed callback from client.
Sometimes it takes as long as 15 ms for client to reply, and this leads to underrun.
This can be repro in about 10 % of tests. I guess that might be network issue.

I think the best way to avoid this is to let webrtc to specify a block size it wants to use, instead of using the minimum block size supported by Chrome.
For example, media player uses 1536, youtube uses 1024, they don't use minimum block size supported by Chrome because they prefer better quality than low latency. I think webrtc should do something similar, and choose block size > 512.
That way, we can lower the supported minimum block size from 512 to 256 to let other app that actually wants latency as low as possible to take the benefit of the minimum block size, while webrtc still enjoy the higher block size for quality and stability. 
In my testing block size > 512 can pass test 100% of time without any underrun.

Hi peah@ and olka@, do you think this reasonable ?

Thanks!

 
Cc: grunell@chromium.org maxmorin@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 2 by olka@chromium.org, Jan 20 2017

Cc: jansson@chromium.org peah@chromium.org
Owner: cychiang@chromium.org
Status: Unconfirmed (was: Assigned)
WebRTC in Chrome should be using 10 ms buffers on ChromeOS as of now:
https://cs.chromium.org/chromium/src/media/base/audio_latency.cc?dr=CSs&sq=package:chromium&rcl=1484885798&l=90

Do you see it always using 256 samples instead?
Is it a release build of Chrome?
Who is the "client" here? How do you observe the delays?

**The problems you see may be caused by apprtc loopback mode, which can under-perform due to threading specifics (+jansson@ to comment on that).

Comment 3 by ajha@chromium.org, Jan 23 2017

Labels: OS-Chrome
Status: Started (was: Unconfirmed)
Hi olka,
Thanks a lot for the explanation.
Sorry! I misunderstood how webrtc choose the buffer size.
Thanks for the pointer to the code.

I thought webrtc was using the lowest value chrome supports (512), so I used --audio-buffer-size=256 args to change buffer size in the test.
Actually I should build a chrome with the change media/audio/cras/audio_manager_cras.cc

-const int kMinimumOutputBufferSize = 512;
+const int kMinimumOutputBufferSize = 256;

and see what buffer size webrtc will use.

I was using a release build chrome 55.0.2883.105 on 8872.76.0 image.

I checked cras's audio thread log to see the delay.
It logs the time cras sent the fetch request, and when that fetch request was replied. So by client I mean cras's client, which is chrome in this case.

I will check with local built chrome. It should not change webrtc's block size and behavior given that webrtc always use 10ms buffer on ChromeOS.

Thanks a lot!
Re AppRTC: AppRTC loopback using two peerconnections and mediaStream cloning is still reverted.
Status: WontFix (was: Started)
I have verified that after changing kMinimumOutputBufferSize, webrtc uses 480 block size (10 ms).
The test result looks good. I passed audio_AudioWebRTCLoopback.quality test 20 times in a row.
I think we can close this.

Thanks for the help!

Sign in to add a comment