<p dir="ltr">Also, what if you cross connect the conferences with sip channels instead of loopback?</p>
<p dir="ltr">200 or 300 channels causing that much cpu usage may indicate an underpowered box.</p>
<div class="gmail_quote">On Feb 4, 2014 7:16 AM, &quot;Michael Jerris&quot; &lt;<a href="mailto:mike@jerris.com">mike@jerris.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">There is nothing at all in freeswitch with a buffer big enough to account for those massive delays, so a timer issue would not explain this issue.  Could it be possible that your nic driver is actually holding packets that long.  How does the pcap look as far as that delay, try local pcap and remote and compare.  What type of nic is it?<div>
<br></div><div>Mike</div><div><br><div><div>On Feb 4, 2014, at 5:08 AM, Markus von Arx &lt;<a href="mailto:mkvonarx@gmail.com" target="_blank">mkvonarx@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr">
<div class="gmail_default"><div class="gmail_default"><font face="arial, helvetica, sans-serif">Hi</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default">

<font face="arial, helvetica, sans-serif">I&#39;ve got a nasty problem with FreeSwitch conferences: after some time, I observe that audio that goes through FreeSwitch conferences gets more and more delayed (by the FreeSwitch conferences). Sometimes it&#39;s only 2 seconds, but I have also observerd audio delays up to 5:30 minutes. Audio is never missing, only delayed, and even transmitted correctly after many minutes of delays.</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">More details:</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">- FreeSwitch 1.2.17, 64bit</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">- OS: Windows Server 2012 64bit and Windows 7 64bit (observed on both platforms)</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">- audio codec: G.711 alaw only</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">- external channels: only SIP channels (mod_sofia), RTP with 20ms packets, G.711 alaw, all SIP endpoints in the local LAN on the same Ethernet switch.</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">- dialplan: very very simple; only two actions: answer and connect every incoming/outgoing SIP channel directly to its private conference (mod_conference); and I set and export the following variables on all channels: rtp_disable_vad_in=true, rtp_disable_vad_out=true, send_silence_when_idle=-1, bridge_generate_comfort_noise=-1, suppress_cng=true</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">- my own application: does some logic over mod_event_socket (on localhost); basically connects/disconnects these conferences using loopback channels (mod_loopback)</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">        </span>-&gt; simple example: two SIP channels from SIP users 1001 and 1002, dialplan creates two conferences 1001c and 1002c, my application connectes 1001c and 1002c with a loopback channel, audio from SIP user 1001 travels through SIP channel to FreeSwitch conference 1001c, then through loopback channel to conference 1002c, then through SIP channel to SIP user 1002. The audio delay I&#39;m talking about is that what user 1001 speaks into his phone arrives at user 1002 N seconds later instead of almost immediately.</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">- mod_conference config: rate=8000, interval=20, max-members=99, energy-level=0, *-sound=&quot;&quot;, comfort-noise=0, conference-flags=audio-always</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">- mod_sofia: rtp-timer-name=soft, suppress-cng=true, vad=none</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">- timer: soft timer (no other available on Windows)</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Usage scenarios:</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">- failing scenario 1 (low load): 34 SIP channels, 34 conferences, 97 loopback channels, 228 FreeSwitch channel objects (34 + 2*97)</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">        </span>-&gt; ~24% CPU load</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">        </span>-&gt; audio delays only sometimes, a bit unpredictable, mostly none, but sometimes in the region of 2-3 seconds</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">- failing scenario 2 (medium load): ...</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">        </span>-&gt; ~51% CPU load</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">        </span>-&gt; audio delays start slowly, in the region of 2-10 seconds, grow slowly with time while keeping channels and conferences alive</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">- failing scenario 3 (high load): 66 SIP channels, 66 conferences, 385 loopback channels, 836 FreeSwitch channel objects (66 + 2*385)</font></div><div class="gmail_default">

<font face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">        </span>-&gt; ~74% CPU load</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">        </span>-&gt; audio delays start almost immediately: 18 seconds delay after 15 minutes, 41 seconds delay after 3 hours, 5:30 minutes delay after 19 hours.</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">=&gt; My guess: it could be that under heavy CPU load, the (soft) timers that are responsible for the RTP audio streams don&#39;t get fired reliably anymore but sometimes (often) too late.Theoretically this should not cause an ever increasing delay, as the next timer event after the delayed one should be queued a bit earlier. But still somehow the delay happens and it looks like </font><span style="font-family:arial,helvetica,sans-serif">the mixed RTP packets from the conferences are sent later and later and the delay is never recovered.</span></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">=&gt; Any ideas? Is this a known issue? Maybe some combination of Windows, soft timers, high CPU load, loopback channels, disabled CNG/VAD, long running conferences? Maybe a FreeSwitch (timer) bug? Any help would be appreciated!</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Thanks and best regards,</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Markus</font></div>

</div></div></blockquote></div><br></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div>