Overshoot after DTX
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.3k
- Forks
- 808
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
we see a strange phenomenon when using dtx. In several cases there is an overshoot in the signal after a dtx period:

The only difference in the two tracks above is that in the first one, dtx is enabled for the encoder. The same input is passed in both cases. The beeps in the input are as follows: 200Hz,400Hz,600Hz,800Hz,1000Hz,1400Hz,2000Hz,3000Hz,4000Hz.
the settings for the encoder:
if (opus_encoder_ctl(encoder, OPUS_SET_BITRATE(18000)) != OPUS_OK) {
LOG_AUDIO_ERROR("Set bitrate failed");
}
if (opus_encoder_ctl(encoder, OPUS_SET_MAX_BANDWIDTH(OPUS_BANDWIDTH_MEDIUMBAND)) != OPUS_OK) {
LOG_AUDIO_ERROR("Set bitrate failed");
}
if (opus_encoder_ctl(encoder, OPUS_SET_VBR(1)) != OPUS_OK) {
LOG_AUDIO_ERROR("Set VBR failed");
}
if (opus_encoder_ctl(encoder, OPUS_SET_VBR_CONSTRAINT(1)) != OPUS_OK) {
LOG_AUDIO_ERROR("Set VBR_CONSTRAINT failed");
}
if (opus_encoder_ctl(encoder, OPUS_SET_COMPLEXITY(2)) != OPUS_OK) {
LOG_AUDIO_ERROR("Set complexity failed");
}
if (opus_encoder_ctl(encoder, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE)) != OPUS_OK) {
LOG_AUDIO_ERROR("Set signal failed");
}
if (opus_encoder_ctl(encoder, OPUS_SET_LSB_DEPTH(16)) != OPUS_OK) {
LOG_AUDIO_ERROR("Seting LSB DEPTH failed");
}
if (opus_encoder_ctl(encoder, OPUS_SET_DTX(0)) != OPUS_OK) {
LOG_AUDIO_ERROR("Setting DTX failed");
}
if (opus_encoder_ctl(encoder, OPUS_SET_INBAND_FEC(1)) != OPUS_OK) {
LOG_AUDIO_ERROR("Inband FEC");
}
if (opus_encoder_ctl(encoder, OPUS_SET_PACKET_LOSS_PERC(25)) != OPUS_OK) {
LOG_AUDIO_ERROR("Set Packet LOSS PERC Failed");
}
The issue can be reproduced with other settings as well, but here it is very easy to spot.
We tested the following configations: intel/arm, fixed/float, DISABLE_FLOAT_API set/unset (to use opus or silk dtx). In all cases the overshoot is there. We used both libopus 1.3.1 and HEAD on master.
The issue may disappear on some other bitrates and reappear on others. Disabling FEC helps but not always. Disabling dtx does always help.
Another way we could make the overshoots disappear is not to pass the NULL packets to the decoder (meaning we skip the decoder call during dtx, here we copied zeroes to the output). In this case, the output is like the one with no dtx (i.e. OK).
Thanks for the help,
Viktor
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the overshoot with libopus using the supplied encoder settings, focusing on DTX, FEC, and decoder calls for NULL packets. Compare output with DTX disabled and with NULL packets skipped, then trace the encoder/decoder DTX handling to identify the cause. Done means the overshoot is explained and a verified fix or regression test covers the affected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100