<div dir="ltr"><div>Hi Bob,</div><div><br></div>On Tue, Sep 24, 2013 at 6:30 PM, Bob Hartwig <span dir="ltr">&lt;<a href="mailto:bobjectsfreeswitch@gmail.com" target="_blank">bobjectsfreeswitch@gmail.com</a>&gt;</span> wrote:<br>
<div class="gmail_extra"><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 dir="ltr">
Looking at the source for mod_conference.c, I see that the timer_name is hard-coded to &quot;soft&quot;, i.e. the 1000 Hz. system clock.  How can this work with a T1-based FreeTDM system, where the FreeTDM channels are presumably synchronized to the T1 clock source?  </div>
</blockquote><div><br></div><div>Yeah I think something is fishy there.</div><div><br></div><div>As I see the code, it ends up being timed by the software timer on top of the hardware timer. I&#39;ve not used the conferencing module of FreeSWITCH in TDM much, but in the few instances where I used it in the past seemed to work, mind you it was a small setup with a few callers, so I may have missed the distortion problem and our customer never complained (but the issue may be lurking there).</div>
<div><br></div><div>mod_conference ends up using one main thread for mixing (for the whole conference) and then each member of the conference has 2 threads, input and output threads, the output thread is the same as the session thread, the input thread is launched when the member joins.</div>
<div><br></div><div>The input thread IO timing seems to be completely based on the endpoint read clock (in FreeTDM case, using hardware timer). The output thread on the other hand uses the soft-timer to time the calls to switch_core_session_write() (and then internally the write will be timed by the hardware timer, again).</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>I&#39;m seeing some weirdness with my FreeTDM / Dahdi system, where only FreeTDM channels are hearing distortion on conference, and I&#39;m almost certain that this is the culprit, but I have no idea how to proceed to fix it.  I&#39;m pretty new to FreeTDM, so I&#39;m hoping that I&#39;m missing something simple.  Any thoughts?</div>
</div></blockquote><div><br></div><div>What kind of distortion exactly?</div><div><br></div><div>You may want to use the &quot;ftdm trace&quot; command to record the audio read/written to the TDM endpoint and see if the audio is clean when written to the tdm endopoint. </div>
<div><br></div><div>You will have to add some debugging to see if read/write is being done at the proper times. </div><div><br></div><div>The uuid_debug_media command would have been handy for that. Unfortunately seems like that is implemented for RTP only, we would have to add some code in mod_freetdm.c to handle that command and print timing information for read/write for a given session.</div>
<div><br></div><div>What sampling rate is your conference? what packetization size? (20ms, 30ms, 40ms??) what kind of hardware are you using? <br class=""><br>Moy</div><div><br clear="all"><div><table border="0" cellspacing="0" cellpadding="0" width="648" style="width:486.3pt;border-collapse:collapse">
<tbody><tr style="height:60.55pt"><td style="border-style:dotted none none;border-top-color:rgb(128,176,214);border-top-width:1pt;padding:1.45pt 5.75pt;height:60.55pt"><p style="margin:0px;line-height:15px"><b><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(14,93,167)">Moises Silva<br>
</span></b><b><i><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Manager, Software Engineering</span></i></b><b><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(14,93,167)"></span></b></p>
<p style="margin:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)"><a href="mailto:msilva@sangoma.com" target="_blank">msilva@sangoma.com</a></span></p>
<p style="margin:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)">Sangoma Technologies</span></p><p style="margin:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)">100 Renfrew Drive, Suite 100, Markham, ON L3R 9R6 Canada</span><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(255,192,0)"></span></p>
</td><td width="187" style="width:140.45pt;border-style:dotted none none;border-top-color:rgb(128,176,214);border-top-width:1pt;padding:1.45pt 5.75pt;height:60.55pt"><p style="margin:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)"><br>
t.   +1 800 388 2475 (N. America)</span></p><p style="margin:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)">t.   +1 905 474 1990 x128</span></p>
<p style="margin:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)">f.   +1 905 474 9223</span></p><p style="margin:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(31,73,125)"> </span></p>
</td><td width="149" rowspan="2" style="width:111.55pt;border-style:dotted none;border-top-color:rgb(128,176,214);border-top-width:1pt;border-bottom-color:rgb(128,176,214);border-bottom-width:1pt;padding:1.45pt 5.75pt;height:60.55pt">
<p style="margin:0px;line-height:15px"><a href="http://www.sangoma.com/contact?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email+signatures" target="_blank"><b><span style="color:rgb(31,73,125);text-decoration:none"><img border="0" width="96" height="15"></span></b></a><span style="color:rgb(31,73,125)"></span></p>
</td></tr><tr><td width="500" colspan="2" style="width:374.75pt;border-style:none none dotted;border-bottom-color:rgb(128,176,214);border-bottom-width:1pt;padding:1.45pt 5.75pt"><p style="margin:0px;line-height:15px"><a href="http://sangoma.com/products?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Products</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://sangoma.com/solutions?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Solutions</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://sangoma.com/about_us/events?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Events</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://www.sangoma.com/contact?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Contact</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://wiki.sangoma.com/?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Wiki</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://www.facebook.com/pages/Sangoma-VoIP-Cards/43578453335?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Facebook</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://www.twitter.com/sangoma?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Twitter</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">`| | </span><a href="http://www.youtube.com/sangomatechnologies?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">YouTube</span></a><span style="font-size:8pt;line-height:12px;color:rgb(31,73,125)"></span></p>
</td></tr></tbody></table><p style="margin:0px"><br></p></div></div></div></div></div>