<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">after fixing attr->fec in open source edition of OPUS and applying Alexanders patch: ASTERISK-25629 (Native Packet-Loss Concealment)<br class=""><div class="">I have following results:</div><div class=""><br class=""></div><div class="">I setup 2 hosts with asterisk 13.14.0 and made dozen calls in OPUS between them.</div><div class=""><div class="">On 2nd host I've simulated packet delay and loss:</div><div class=""><pre style="margin-top: 0px; margin-bottom: 1em; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; background-color: rgb(239, 240, 241); word-wrap: normal; color: rgb(36, 39, 41);" class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;" class="">tc qdisc add dev eth0 root netem loss 20% delay 100ms 20ms distribution normal</code></pre><div class=""><br class=""></div></div><div class="">On 1st host (call origination side) all media been recorded using App_Monitor.</div><div class="">On 2nd host it was simple Playback extension with demo-instruct.sln16</div></div><div class=""><br class=""></div><div class="">Config for digium codec_opus on both was:</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(191, 191, 191); background-color: rgb(0, 0, 179);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">[opus]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(191, 191, 191); background-color: rgb(0, 0, 179);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">type=opus</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(191, 191, 191); background-color: rgb(0, 0, 179);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">packet_loss=40</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(191, 191, 191); background-color: rgb(0, 0, 179);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">max_playback_rate=48000</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(191, 191, 191); background-color: rgb(0, 0, 179);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">bitrate=24000</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(191, 191, 191); background-color: rgb(0, 0, 179);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">cbr=0</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(191, 191, 191); background-color: rgb(0, 0, 179);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">fec=1</span></div></div><div class=""><div class=""><br class=""></div><div class="">Config for open source edition of OPUS was same, but replaced values in include/asterisk/opus.h</div><div class="">(and as well I've added to <span style="font-family: Menlo; font-size: 11px; background-color: rgb(0, 166, 179);" class="">codecs/codec_opus_open_source.c </span> <span style="color: rgb(191, 191, 191); font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures;" class="">status </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures; color: rgb(230, 230, 0);" class="">=</span><span style="color: rgb(191, 191, 191); font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures;" class=""> opus_encoder_ctl</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures; color: rgb(0, 230, 230);" class="">(</span><span style="color: rgb(191, 191, 191); font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures;" class="">opvt</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures; color: rgb(230, 230, 0);" class="">-></span><span style="color: rgb(191, 191, 191); font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures;" class="">opus</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures; color: rgb(0, 230, 230);" class="">,</span><span style="color: rgb(191, 191, 191); font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures;" class=""> OPUS_SET_PACKET_LOSS_PERC</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures; color: rgb(0, 230, 230);" class="">(</span><span style="color: rgb(191, 191, 191); font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures;" class="">packet_loss</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures; color: rgb(0, 230, 230);" class="">))</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(0, 0, 179); font-variant-ligatures: no-common-ligatures; color: rgb(230, 0, 230);" class="">;)</span></div><div class=""><br class=""></div><div class="">All recorded degraded media files were compared to original (recorded with AppMonitor as well, but without any delays, losses) accordingly to ITU-T <span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">P.862 (</span><span style="color: rgb(84, 84, 84); font-family: arial, sans-serif; font-size: small; background-color: rgb(255, 255, 255);" class="">Perceptual evaluation of speech quality (PESQ))</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">: </span></div><div class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">       </span> opus_opensource-maxbitrate_24000-cbr_0-fec_1-ID1.wav<span class="Apple-tab-span" style="white-space:pre">       </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 2.840<span class="Apple-tab-span" style="white-space:pre"> </span> 2.589<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">    </span> opus_opensource-maxbitrate_24000-cbr_0-fec_1-ID2.wav<span class="Apple-tab-span" style="white-space:pre">       </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 2.507<span class="Apple-tab-span" style="white-space:pre"> </span> 2.143<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">    </span> opus_opensource-maxbitrate_24000-cbr_0-fec_1-ID3.wav<span class="Apple-tab-span" style="white-space:pre">       </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 2.379<span class="Apple-tab-span" style="white-space:pre"> </span> 1.994<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">    </span> opus_opensource-maxbitrate_24000-cbr_0-fec_1-ID4.wav<span class="Apple-tab-span" style="white-space:pre">       </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 2.472<span class="Apple-tab-span" style="white-space:pre"> </span> 2.102<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">    </span> opus_opensource-maxbitrate_24000-cbr_0-fec_1-ID5.wav<span class="Apple-tab-span" style="white-space:pre">       </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 2.413<span class="Apple-tab-span" style="white-space:pre"> </span> 2.032<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">  </span> opus_digium-maxbitrate_24000-cbr_0-fec_1-ID1.wav<span class="Apple-tab-span" style="white-space:pre">   </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 1.332<span class="Apple-tab-span" style="white-space:pre"> </span> 1.258<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">    </span> opus_digium-maxbitrate_24000-cbr_0-fec_1-ID2.wav<span class="Apple-tab-span" style="white-space:pre">   </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 0.738<span class="Apple-tab-span" style="white-space:pre"> </span> 1.110<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">    </span> opus_digium-maxbitrate_24000-cbr_0-fec_1-ID3.wav<span class="Apple-tab-span" style="white-space:pre">   </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 2.426<span class="Apple-tab-span" style="white-space:pre"> </span> 2.047<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Reading degraded file <span class="Apple-tab-span" style="white-space:pre">    </span> opus_digium-maxbitrate_24000-cbr_0-fec_1-ID4.wav<span class="Apple-tab-span" style="white-space:pre">   </span> P.862 Prediction (Raw MOS, MOS-LQO):  = 0.920<span class="Apple-tab-span" style="white-space:pre"> </span> 1.143<span class="Apple-tab-span" style="white-space:pre">      </span> 8000<span class="Apple-tab-span" style="white-space:pre">       </span>nb</span></div><div class=""><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">Reading degraded file</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""> </span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">       </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""> </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">opus_digium-maxbitrate_24000-cbr_0-fec_1-ID5.wav</span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">  </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""> P.862 Prediction (Raw MOS, MOS-LQO):</span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">  </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">= 2.680</span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">       </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""> 2.366</span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">      </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""> 8000</span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">       </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">nb</span></div><div class=""><br class=""></div><div class="">MOS on calls using open source opus higher almost twice.</div><div class="">Subjective opinion regarding audio quality: using open source codec quality almost same as in example on <a href="http://opus-codec.org/examples/" class="">http://opus-codec.org/<wbr class="">examples/</a> with 30% loss and FEC, acceptable for ears, but</div><div class="">using digium opus quality is not acceptable, a lot of spikes, interruptions.</div><div class=""><br class=""></div><div class="">I also double checked the fact before applying ASTERISK-25629 patch asterisk don't drop lately arrived RTP.</div><div class="">I've recorded UDP dump and replayed it using "<span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">bittwist" utility, without patch all RTP packets been played again, with patch all of them been ignored.</span></div><div class=""><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">Thx, Alexander :)</span></div><div class=""><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""> </div><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On 3 Apr 2017, at 18:26, Kevin Harwell <<a href="mailto:kharwell@digium.com" class="">kharwell@digium.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 31, 2017 at 6:54 PM, Yury Tsaregorodtsev <span dir="ltr" class=""><<a href="mailto:aero.1080@icloud.com" target="_blank" class="">aero.1080@icloud.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div dir="auto" class=""><div class="">Examples of OPUS with 30% of LOSS with FEC on <a href="http://opus-codec.org/examples/" target="_blank" class="">http://opus-codec.org/<wbr class="">examples/</a></div><div class="">Sounds too perfect. Why I can't achieve even similar quality on asterisk with built codec by digium?</div><div class="">To simulate 30% packet loss I use:</div><div class=""><pre class="m_-7495008588954301179code" style="margin-top:0px;margin-bottom:1.4em;padding:0.7em 1em;direction:ltr;border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;overflow:auto;word-wrap:normal;border:1px solid rgb(204,204,204)"><font face="UICTFontTextStyleBody" class=""><span style="white-space:normal;background-color:rgba(255,255,255,0)" class=""> # tc qdisc add dev eth0 root netem delay 100ms loss 30%</span></font></pre>But even with 15-20% of loss it's almost impossible to talk.</div><div class="">Tried different bitrates, result is always same. </div><div class="">If I do PESQ predicted MOS of degraded audio (recorded with packet loss) in compare to original: 1.025</div><div class="">Horrible results, horrible sound.</div><div class=""><br class=""></div><div class="">Anyone get better experience using opus with huge packet losses ?</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div></font></span></div></div></blockquote><div class=""><br class=""></div><div class="">Have you enabled FEC and made sure both sides negotiated it? If not you can enable it within "codecs.conf" by setting "fec=yes".</div><div class=""><br class=""></div><div class="">When a packet has been lost and the decoder receives a frame with FEC data (and fec is enabled) it will attempt to rebuild the lost packet (current packet minus one) from the given FEC information.</div><div class=""> </div></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><pre style="padding: 2px; border: 1px solid rgb(114, 99, 77); background-color: rgb(238, 238, 238); overflow: auto;" class="">Kevin Harwell
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: <a href="http://digium.com/" target="_blank" class="">http://digium.com</a> & <a href="http://asterisk.org/" target="_blank" class="">http://asterisk.org</a></pre></div></div>
</div></div>
-- <br class="">_____________________________________________________________________<br class="">-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com/" class="">http://www.api-digital.com</a> --<br class=""><br class="">asterisk-dev mailing list<br class="">To UNSUBSCRIBE or update options visit:<br class="">   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" class="">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></div></blockquote></div><br class=""></div></div></div></div></body></html>