<div dir="ltr">Hi James,<div><br></div><div>I&#39;ve added some comments inline.<br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/28 James Mortensen <span dir="ltr">&lt;<a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Lorenzo,<div><br></div><div>Not trying to hijack the thread, but Andrea appears to be away for the next few days, and I&#39;m experiencing the same exact problem with the audio issues and want to help move us both forward.  So I can answer the questions below to get you more data. Please see below:<br>


<div class="gmail_extra"><div class="im"><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div><span style="color:rgb(34,34,34)">[May 28 11:17:40] DEBUG[16613][C-00000000] channel.c: Scheduling timer at (50 requested / 50 actual) timer tic</span><br></div><div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
That said, I&#39;m not sure what the cause of the issue could be. What ptime are the two peers using?<br>
What is the transcoding path<br>
as displayed on the Asterisk console? Does the same happen in other scenarios as well, e.g., the browser interacting with another<br>
browser, or a softphone using a different codec (e.g., speex) at different rates (e.g., 16kHz vs 8kHz)?<br>
</blockquote>
<br></div>
now I&#39;m out of office I will be able to provide this info<br>
only on Thursaday.<div><br></div></blockquote><div><br></div></div></div><div>I assume the ptime is this maxptime value we see in the SDP from the Chrome to Asterisk call leg:</div><div><br></div><div>a=rtpmap:111 opus/48000/2</div>


<div>a=maxptime:60</div><div>a=fmtp:111 maxplaybackrate=16000; stereo=0; sprop-stereo=0; useinbandfec=0</div><div class="gmail_extra"><br></div><div class="gmail_extra">If that&#39;s not the ptime, please let me know where I might find that and I&#39;ll get it for you.</div>


<div class="gmail_extra"><br></div></div></div></div></blockquote><div><br></div><div style>By ptime I mean how many milliseconds of audio are contained in a single RTP packet. Usually this is 20ms for most codecs but that&#39;s not always the case: Opus, for instance, supports a wide range of different ones, which is why in the SDP we report that the maximum ptime that is supported in the implementation is 60ms.</div>
<div style><br></div><div style>The Asterisk codec encoding/decoding infrastructure should already transparently take care of this, considering that when encoding and decoding you always know how many samples are involved, but I didn&#39;t test this intensively, and so a difference in how the two &quot;legs&quot; do this (e.g., 20 ms for the Opus leg, 10 ms for the G.729 leg) may in some cases cause hiccups.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_extra">
</div><div class="gmail_extra">And here you can see the call leg from the Chrome to Asterisk portion of the call is opus, with the other leg using ulaw.  I&#39;ve tried with g729 on the Bandwidth to Asterisk leg and still hear the same underwater-like call audio that Andrea describes.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">ip-10-188-135-200*CLI&gt; sip show channels</div><div class="gmail_extra">Peer             User/ANR         Call ID          Format           Hold     Last Message    Expiry     Peer      </div>


<div class="gmail_extra">54.X.X.X    1000            55srb9arjvh7rnv  (opus)           No       Rx: ACK                    ws-Opensip</div><div class="gmail_extra">67.231.X.X     +15036XXXXXX     48c000dd54ba525  (ulaw)           No       Tx: ACK                    BANDWIDTH </div>


<div class="gmail_extra">2 active SIP dialogs</div><div class="gmail_extra">ip-10-188-135-200*CLI&gt; </div><div><br></div><div><br></div><div>Also, here is the output from opus set debug huge:</div><div><br>
</div>
<div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 18 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 72 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>

<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 20 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 77 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 19 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 67 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 17 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 71 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 21 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 72 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 21 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 72 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 23 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 69 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 19 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 72 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 21 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 74 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 23 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 74 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 21 bytes</div><div>[Opus] [Decoder #12 (8000)] 960 samples, 75 bytes</div><div>[Opus] [Decoder #12 (8000)]   &gt;&gt; Got 160 samples, 320 bytes</div>


<div>[Opus] [Encoder #9 (8000)] 160 samples, 320 bytes</div><div>[Opus] [Encoder #9 (8000)]   &gt;&gt; Got 960 samples, 25 bytes</div></div><div class="gmail_extra"><br></div></div></div></div></blockquote><div><br></div>
<div style>The &quot;huge&quot; debug doesn&#39;t seem to report anything wrong: the encoder gets 160 samples in 320 bytes (8kHz slin) and encodes them correctly, and at the same time the decoder gets 960 samples (as in Opus the reference rate is always 48kHz) and decodes them to 160 samples/320 bytes (8kHz slin). So apparently no encoding/decoding error is reported from the library.</div>
<div style><br></div><div style>What about the transcoding path in Asterisk, though? e.g.</div><div style><br></div><div style>     core show translation paths opus</div><div style><br></div><div style>should tell you how Asterisk is going to take care of the transcoding between Opus and different codecs.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_extra">
</div>Unlike Andrea, who applied the patch to 11.3.0, I successfully applied the patch to Asterisk 11.4.0, but the issues we&#39;re both experiencing appear to be the same. If that&#39;s not the case, I can start a new thread.  Hope this helps! :)<span class=""><font color="#888888"><br clear="all">


<div><br></div></font></span></div></div></div></blockquote><div><br></div><div style>I&#39;m not sure how much those two versions of Asterisk differ from each other, so I&#39;m afraid I cannot answer you with respect to that: anyhow, I guess that there&#39;s no need to open a new thread. But just out of curiosity, did you try to replicate the same scenarios with Asterisk 11.1.2 as well? Just to understand whether or not I can focus on the latest changes to investigate what&#39;s wrong in the current Opus implementation.</div>
<div> </div><div style>Lorenzo</div><div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">
<div><div class="gmail_extra"><span class=""><font color="#888888"><div></div>-- <br>James Mortensen<br>Project Manager, VoiceCurve, Inc.<br><a href="tel:866-707-4590" value="+18667074590" target="_blank">866-707-4590</a><br>
<a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a><br>
</font></span></div></div></div>
</blockquote></div><br></div></div></div>