Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue with periodic clicks or noise-bursts during DTX that we have seen in Chrome, AppRTC and other WebRTC clients.
Sometimes, Opus (in silk-only or hybrid mode) decides to go into DTX even though Silk considers the signal to contain activity. This is because the
decide_dtx_mode
has a different VAD than Silk.In DTX, Opus sends an encoded packet every 420 ms. This is in order to give an updated estimation of the background noise. The decoder uses comfort noise (CNG) to produce output during the DTX period.
However, when the silk layer of the "update packets" that arrive every 420 ms contain activity (type
TYPE_UNVOICED
orTYPE_VOICED
instead ofTYPE_NO_VOICE_ACTIVITY
) the decoder will instead use packet loss concealment (PLC) to produce output instead of CNG. The PLC is then faded out as CNG ramps up.In cases when several update packets contain activity, the switching back and forth between PLC and CNG will cause an audible click or noise-burst every 420 ms.
This PR fixes the issue by preventing Opus from entering DTX in hybrid or silk-only mode whenever silk considers the signal to be active. Celt-only mode is unaffected.