[Freeswitch-users] Conference timer synchronization with T1 FreeTDM - how?

Moises Silva moises.silva at gmail.com
Wed Sep 25 05:55:36 MSD 2013


Hi Bob,

On Tue, Sep 24, 2013 at 6:30 PM, Bob Hartwig
<bobjectsfreeswitch at gmail.com>wrote:

> Looking at the source for mod_conference.c, I see that the timer_name is
> hard-coded to "soft", 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?
>

Yeah I think something is fishy there.

As I see the code, it ends up being timed by the software timer on top of
the hardware timer. I'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).

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.

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).


> I'm seeing some weirdness with my FreeTDM / Dahdi system, where only
> FreeTDM channels are hearing distortion on conference, and I'm almost
> certain that this is the culprit, but I have no idea how to proceed to fix
> it.  I'm pretty new to FreeTDM, so I'm hoping that I'm missing something
> simple.  Any thoughts?
>

What kind of distortion exactly?

You may want to use the "ftdm trace" command to record the audio
read/written to the TDM endpoint and see if the audio is clean when written
to the tdm endopoint.

You will have to add some debugging to see if read/write is being done at
the proper times.

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.

What sampling rate is your conference? what packetization size? (20ms,
30ms, 40ms??) what kind of hardware are you using?

Moy

*Moises Silva
**Manager, Software Engineering***

msilva at sangoma.com

Sangoma Technologies

100 Renfrew Drive, Suite 100, Markham, ON L3R 9R6 Canada


t.   +1 800 388 2475 (N. America)

t.   +1 905 474 1990 x128

f.   +1 905 474 9223



**<http://www.sangoma.com/contact?utm_source=signature&utm_medium=email&utm_campaign=email+signatures>

Products<http://sangoma.com/products?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>
 | Solutions<http://sangoma.com/solutions?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>
 | Events<http://sangoma.com/about_us/events?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>
 | Contact<http://www.sangoma.com/contact?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>
 | Wiki<http://wiki.sangoma.com/?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>
 | Facebook<http://www.facebook.com/pages/Sangoma-VoIP-Cards/43578453335?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>
 | Twitter<http://www.twitter.com/sangoma?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>`|
| YouTube<http://www.youtube.com/sangomatechnologies?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130924/67d83604/attachment.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list