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

Media | Fix the size of rtpjitterbuffer considering the buffer size of wasapi2sink(playout to speacker) #56

Open
junsoopark opened this issue Jul 1, 2023 · 1 comment

Comments

@junsoopark
Copy link
Collaborator

junsoopark commented Jul 1, 2023

일반적으로 오디오 데이터의 출력 모듈은 안정적인 오디오 출력을 위해서 자체적인 버퍼를 운용하고 있다. 이로인해 rtpjitterbuffer에 예를들어 100ms의 버퍼사이즈를 설정 했더라도 오디오 출력모듈의 버퍼로 데이터가 흘러들어가기 때문에 이를 고려해서 rtpjitterbuffer의 사이즈를 설정해야 한다.

In general, an audio data output module operates its own buffer for stable audio output. Because of this, even if the buffer size of rtpjitterbuffer is set, for example, 100ms, data flows into the buffer of the audio output module, so the size of the rtpjitterbuffer should be set considering this.

@junsoopark junsoopark self-assigned this Jul 1, 2023
@junsoopark junsoopark added this to the 2 milestone Jul 1, 2023
@junsoopark
Copy link
Collaborator Author

junsoopark commented Jul 1, 2023

configurable properties

  • duration per encoded audio packet (ex. 2.5 / 5 / 10 / 20 ..) :
    • 네트워크로 전송되는 오디오 패킷의 duration을 결정하므로 end-to-end latency, number of packets buffered in rtpjitterbuffer에 영향을 준다.
    • It determines the duration of audio packets transmitted over the network, so it affects end-to-end latency, number of packets buffered in rtpjitterbuffer.

  • latency ms(buffer size) of rtpjitterbuffer :
    • 최초 receive buffer 후 설정된 시간만큼 timer를 설정해서 timeout이 되면 그때 pop and push buffer 시작.
    • Set the timer for the set time after the first receive buffer, and when timeout is reached, pop and push buffer starts.

오디오 패킷 하나의 duration이 20ms이고 rtpjitterbuffer의 latency를 100m로 설정했을 때,

  • 약 13개 내외의 rtp패킷을 수신해야 재생을 시작하는것으로 보아 100ms에 해당하는 rtp패킷 갯수는 약 13개.
  • 재생 시작 후 jitter buffer에는 약 6개의 Rrtp패킷만 유지되는것으로 보아 오디오 출력모듈(wasapi2sink low-latency=true)의 버퍼 사이즈는 약 50ms로 추정.

When the duration of one audio packet is 20ms and the latency of rtpjitterbuffer is set to 100m,

  • Considering that playback starts when about 13 rtp packets are received, the number of rtp packets corresponding to 100ms is about 13.
  • Since only about 6 Rrtp packets are maintained in the jitter buffer after playback starts, the buffer size of the audio output module (wasapi2sink low-latency=true) is estimated to be about 50 ms.

@codekistone codekistone changed the title Fix the size of rtpjitterbuffer considering the buffer size of wasapi2sink(playout to speacker) Media | Fix the size of rtpjitterbuffer considering the buffer size of wasapi2sink(playout to speacker) Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants