[Home]

Summary:ASTERISK-25599: [patch] SLIN Resampling Codec only 80 msec
Reporter:Alexander Traud (traud)Labels:
Date Opened:2015-12-01 07:55:33.000-0600Date Closed:2015-12-08 12:09:58.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Codecs/codec_resample
Versions:11.20.0 13.6.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) opus_resample.patch
Description:{{WARNING: translate.c:402 Out of buffer space}}

Currently, {{codecs/codec_resample.c}} uses a buffer with a fixed size of 8096 for each signed-linear resolution. Furthermore, these 8096 depend on the size of {{int16_t}} of the platform. On my machine, this results in a maximum of 4048 samples. However for example, the Opus Codec is able to create 5760 samples (6 frames a 20 milliseconds @ 48000 samples per second). Consequently, the current buffer is too small for the Opus Codec when used with a packetization time of more than 80 milliseconds, for example in chan_sip with sip.conf: {{allow=opus:120}} or {{autoframing=yes}}.

The attached patch uses the maximum of the Opus Codec (5760) as the new minimum sample amount. Therefore, the actual amount of bytes must depend on {{int16_t}} and not the other way around. This guarantees we are able to convert at least 5760 samples, regardless of the platform.
Comments:By: Alexander Traud (traud) 2015-12-08 08:37:02.893-0600

When the Opus Codec is used together with forward-error correction ([FEC|https://en.wikipedia.org/wiki/Forward_error_correction]), the amount of samples doubles to 11520, because up to two 120 msec packets are decoded to up to 48.000 kHz. Therefore, I have to reopen this issue because the previous patch was incomplete. Tested with Linphone for iOS.