opus icon indicating copy to clipboard operation
opus copied to clipboard

Overshoot after DTX

Open boborjan2 opened this issue 5 years ago • 0 comments

Hi,

we see a strange phenomenon when using dtx. In several cases there is an overshoot in the signal after a dtx period:

image

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

boborjan2 avatar Feb 10 '21 15:02 boborjan2