Skip to content
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

Stat for audio acceleration/expand rate? #146

Closed
henbos opened this issue Jan 31, 2017 · 6 comments
Closed

Stat for audio acceleration/expand rate? #146

henbos opened this issue Jan 31, 2017 · 6 comments

Comments

@henbos
Copy link
Collaborator

henbos commented Jan 31, 2017

The non-standardized Chromium getStats contains the following stat:

// Fraction of audio samples accelerated (removed) when the jitter buffer size decreases.
ssrc.googAccelerateRate

Is this useful? Should this be standardized as double accelerationRate in RTCMediaStreamTrackStats?

When it decreases? During what time frame does this rate apply?

@alvestrand
Copy link
Contributor

alvestrand commented Jan 31, 2017

Commentary:

  1. this is a rate, which comes under the general ban on rate-valued stats.
  2. I'd perhaps go with "samplesInsertedByRateAdaption" (too long winded?), which may be positive or negative. Rate can be computed from that; we shouldn't need a sample counter to divide by, since that's derivable from time + sample rate.

@henbos
Copy link
Collaborator Author

henbos commented Feb 14, 2017

@alvestrand WRT "we shouldn't need a sample counter to divide by, since that's derivable from time + sample rate", what sample rate? There are constraints but no stat for that. Packets != samples. And actual sample rate might vary and not be current rate * time.

WRT samplesInsertedByRateAdaption being both positive or negative I don't think it flies to have a single counter, samples can both be removed (googAccelerateRate) or added (googPreemptiveExpandRate) over a period of time but the sum could be zero.

Adding @hlundin. How about?

RTCMediaStreamTrackStats.samplesInserted
RTCMediaStreamTrackStats.samplesRemoved

The number of samples that have been inserted/removed in order to slow down/speed up audio as the jitter buffer increases/decreases.

RTCMediaStreamTrackStats.sampleCount
The number of samples that have been added to the jitter buffer. This count includes both samples that have been inserted (samplesInserted) and samples that have been removed (samplesRemoved).

Or is "rate adaption" preferred over "jitter buffer"?

So googAccelerateRate ~= samplesRemoved / sampleCount and googPreemptiveExpandRate ~= samplesInserted / sampleCount if samples were to be counted over the same time period as the goog-rates.

@henbos henbos changed the title Stat for audio acceleration rate? Stat for audio acceleration/expand rate? Feb 14, 2017
@vr000m
Copy link
Contributor

vr000m commented Feb 15, 2017

Following up on the discussion:

What is it that we are trying to measure here:

  • Size of the current or average jitter buffer?

  • Did the jitter buffer increase or decrease? by how much?

  • How many samples/packets added and removed from the jitter buffer?

I have a feeling that with the samplesInserted, we'd have more samples than they were generated by the sender?

@vr000m
Copy link
Contributor

vr000m commented Feb 15, 2017

And another question about inserting and removing sample, when does this happen or under what conditions does it happen?

For example,

  • to bring audio and video in to sync?
  • when the jitterbuffer is going to underflow or overflow? I am assuming the overflow can only happen in the case of a fixed size jitter buffer or at the moment in time it cannot be expanded?
  • or when a low or high watermark in the jitter buffer is met, i.e., the application realises that it needs to slow down or speed up the processing, otherwise this will cause perceptible audio quality issues.

@vr000m
Copy link
Contributor

vr000m commented Feb 15, 2017

moving the comment to #152

@henbos
Copy link
Collaborator Author

henbos commented Feb 15, 2017

Based on offline discussions, information about jitter buffer increase and decreasing should be covered by measurements of the delay of various buffers, see #151. Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants