Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(882)

Issue 10820059: Not streaming packets of silence. (Closed)

Created:
8 years, 4 months ago by kxing
Modified:
8 years, 4 months ago
Reviewers:
Sergey Ulanov, Wez, garykac
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, simonmorris+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, alexeypa+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

Not streaming packets of silence. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149309

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressed comments #

Total comments: 6

Patch Set 3 : Addressed comments #

Total comments: 2

Patch Set 4 : Fixed includes #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -2 lines) Patch
M remoting/host/audio_capturer.cc View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M remoting/host/audio_capturer_win.cc View 1 2 3 5 chunks +30 lines, -1 line 1 comment Download

Messages

Total messages: 13 (0 generated)
kxing
Could someone PTAL?
8 years, 4 months ago (2012-07-27 20:22:10 UTC) #1
Sergey Ulanov
http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc File remoting/host/audio_capturer.cc (right): http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc#newcode7 remoting/host/audio_capturer.cc:7: #include <math.h> abs() is in stdlib.h http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc#newcode36 remoting/host/audio_capturer.cc:36: if ...
8 years, 4 months ago (2012-07-27 22:46:51 UTC) #2
kxing
Could someone PTAL again? http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc File remoting/host/audio_capturer.cc (right): http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc#newcode7 remoting/host/audio_capturer.cc:7: #include <math.h> On 2012/07/27 22:46:51, ...
8 years, 4 months ago (2012-07-30 16:55:17 UTC) #3
Sergey Ulanov
http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc File remoting/host/audio_capturer.cc (right): http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc#newcode36 remoting/host/audio_capturer.cc:36: if (std::abs(data[i]) > kSilenceThreshold) On 2012/07/30 16:55:18, kxing wrote: ...
8 years, 4 months ago (2012-07-30 17:53:48 UTC) #4
Sergey Ulanov
couple more comments http://codereview.chromium.org/10820059/diff/6001/remoting/host/audio_capturer_util.cc File remoting/host/audio_capturer_util.cc (right): http://codereview.chromium.org/10820059/diff/6001/remoting/host/audio_capturer_util.cc#newcode14 remoting/host/audio_capturer_util.cc:14: const int kSilenceThreshold = 2; Please ...
8 years, 4 months ago (2012-07-30 18:02:56 UTC) #5
kxing
Could someone PTAL again? http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc File remoting/host/audio_capturer.cc (right): http://codereview.chromium.org/10820059/diff/1/remoting/host/audio_capturer.cc#newcode36 remoting/host/audio_capturer.cc:36: if (std::abs(data[i]) > kSilenceThreshold) On ...
8 years, 4 months ago (2012-07-30 20:21:36 UTC) #6
Sergey Ulanov
lgtm. http://codereview.chromium.org/10820059/diff/4002/remoting/host/audio_capturer.cc File remoting/host/audio_capturer.cc (right): http://codereview.chromium.org/10820059/diff/4002/remoting/host/audio_capturer.cc#newcode7 remoting/host/audio_capturer.cc:7: #include <stdlib.h> nit: do we still need this ...
8 years, 4 months ago (2012-07-31 20:16:31 UTC) #7
kxing
I'll commit this soon, unless someone objects. http://codereview.chromium.org/10820059/diff/4002/remoting/host/audio_capturer.cc File remoting/host/audio_capturer.cc (right): http://codereview.chromium.org/10820059/diff/4002/remoting/host/audio_capturer.cc#newcode7 remoting/host/audio_capturer.cc:7: #include <stdlib.h> ...
8 years, 4 months ago (2012-07-31 20:44:11 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kxing@chromium.org/10820059/9003
8 years, 4 months ago (2012-07-31 20:57:30 UTC) #9
commit-bot: I haz the power
Change committed as 149309
8 years, 4 months ago (2012-07-31 23:10:11 UTC) #10
Wez
Is there a reason that this is implemented directly in the Windows capturer, rather than ...
8 years, 4 months ago (2012-08-07 18:01:37 UTC) #11
Sergey Ulanov
For some reason windows returns -1/1 and zeroes when there is no sound being played. ...
8 years, 4 months ago (2012-08-07 20:23:46 UTC) #12
Wez
8 years, 4 months ago (2012-08-07 20:56:56 UTC) #13
On 2012/08/07 20:23:46, sergeyu wrote:
> For some reason windows returns  -1/1 and zeroes when there is no sound being
> played. That behavior seems to be windows specific that's why this silence
> detection code is in platform-specific file.

Curious that silence isn't reliable zero on Windows; it's as though capturing
from the output pin actually resamples the analogue output...

> Yes we could have more complicated silence detection algorithm that would
detect
> constant value being played, but its not needed right now. On other platforms
we
> should be able to just compare to 0 to detect when there is nothing being
> played.

Perhaps, but that would be detected as silence by the code we've just added in
the Windows capturer, so adding a test-for-zero special-case for other platforms
makes little sense.  Checking for a consistent non-zero value with minimal
variance wouldn't be particularly complicated, given the constraints of the
samplers we currently have.

> Also note that if some app is playing silence that is different from 0 audio
> codec should be able to detect and compress it, so this case will be even less
> important after we implement compression.

In which case we don't need silence suppression at all, so having in in-built to
platform-specific capturers is still a bad idea. ;) We may reduce CPU overhead
by pre-suppressing silence, though, depending on what level codecs implement
that at.

> On 2012/08/07 18:01:37, Wez wrote:
> > Is there a reason that this is implemented directly in the Windows capturer,
> > rather than as a filtering AudioCapturer, so that it can be re-used for
other
> > platforms?
> > 
> >
>
https://chromiumcodereview.appspot.com/10820059/diff/9003/remoting/host/audio...
> > File remoting/host/audio_capturer_win.cc (right):
> > 
> >
>
https://chromiumcodereview.appspot.com/10820059/diff/9003/remoting/host/audio...
> > remoting/host/audio_capturer_win.cc:35: // -1, even when no audio is
playing.
> > This doesn't sound right; a packet of frames all of the same value will be
> > silent, regardless of the frames' absolute value.

Powered by Google App Engine
This is Rietveld 408576698