[Freeswitch-users] Choopy one-way noise (FreeTDM)

John freeswitch at earthspike.net
Thu Mar 1 22:14:52 MSK 2012


Christian,

I have a similar problem with a Sangoma B700 card (I think the ISDN part 
is similar, though) and have a Sangoma ticket open (#1310).  It's 
intermittent and relies on the outside party reporting the quality being 
poor, so I am waiting for another occasion to arise when I can grab some 
more detailed traces.

Your sample is quiet, which makes it hard to see what is going on.  I 
have generated a test tones file which I use as a voicemail outgoing 
message on a test extension which allows me to clearly see what is 
happening to the voice.  It uses sox and goes like this:

#!/bin/bash

sox -r 8000 -n out300_0_2.wav synth 2 sine 300
sox -r 8000 -n out500_0_2.wav synth 2 sine 500
sox -r 8000 -n out1000_0_2.wav synth 2 sine 1000
sox -r 8000 -n out2000_0_2.wav synth 2 sine 2000
sox -r 8000 -n out3000_0_2.wav synth 2 sine 3000

sox -r 8000 -n out300-3400_0_3.wav synth 3 sine 300-3400
sox -r 8000 -n out1-4000_0_5.wav synth 5 sine 1-4000

sox -r 8000 -n out1000_0_5.wav synth 5 sine 1000
sox -r 8000 -n out1000_-6_5.wav synth 5 sine 1000 gain -6
sox -r 8000 -n out1000_-12_5.wav synth 5 sine 1000 gain -12

sox -r 8000 -n outwn_0_5.wav synth 5 noise
sox -r 8000 -n outwn_-6_5.wav synth 5 noise gain -6
sox -r 8000 -n outwn_-12_5.wav synth 5 noise gain -12

sox -r 8000 -n outsilence_2.wav synth 2 sine 300 vol 0 amplitude

sox out300_0_2.wav outsilence_2.wav out500_0_2.wav outsilence_2.wav 
out1000_0_2.wav outsilence_2.wav out2000_0_2.wav outsilence_2.wav 
out3000_0_2.wav outsilence_2.wav out300-3400_0_3.wav outsilence_2.wav 
out1-4000_0_5.wav outsilence_2.wav out1000_0_5.wav outsilence_2.wav 
out1000_-6_5.wav outsilence_2.wav out1000_-12_5.wav outsilence_2.wav 
outwn_0_5.wav outsilence_2.wav outwn_-6_5.wav outsilence_2.wav 
outwn_-12_5.wav  testtones.wav

You may find something similar useful, or you can download this from 
http://www.earthspike.net/FreeSWITCH/testtones.wav (2.2MB on my domestic 
broadband).

This is what I have recorded so far (using another FreeSWITCH server on 
the PSTN side): http://www.earthspike.net/FreeSWITCH/choppy_voice.wav 
(3.3MB on domestic broadband). You will notice that the outgoing IVR 
message is perfectly clear, and the voicemail outgoing message (test 
tones) gets messed with.  Both are 8kHz WAV, so there is no transcoding 
or anything like that going on.  Sometimes hold music goes choppy, 
sometimes not, sometimes the IVR message goes choppy as well.  Sometimes 
the choppiness persists until I restart FreeSWITCH; other times it is 
for just one call.

I have also written a script to capture 15s of the voice legs, using 
capture commands outlined by Sangoma support to include stuff around the 
echo canceller. You may also find this useful:

#!/bin/bash

echo "Starting diagnostics"
DIR_PREFIX=/usr/local/freeswitch/recordings/diagnostics
FILE_PREFIX=${DIR_PREFIX}/`date +%Y%m%d-%H%M%S`
FS_CLI_X="/usr/local/freeswitch/bin/fs_cli -x"
WAN_EC_C=/usr/sbin/wan_ec_client

SPAN=`${FS_CLI_X} 'show channels' | sed -e 
'/FreeTDM/!d;s|.*FreeTDM/\([0-9]\):\([0-9]\)/.*|\1|;'`
CHNL=`${FS_CLI_X} 'show channels' | sed -e 
'/FreeTDM/!d;s|.*FreeTDM/\([0-9]\):\([0-9]\)/.*|\2|;'`

echo Diagnostic capture utility
echo ==========================
echo Detected call on ${SPAN}:${CHNL}
echo Setting up trace on span wp${SPAN}
${FS_CLI_X} "ftdm trace ${FILE_PREFIX} ${SPAN}"

pushd ${DIR_PREFIX}
echo Recording 15s EC sample on ${SPAN}:${CHNL}
${WAN_EC_C} wanpipe${SPAN} monitor ${CHNL}
popd

echo Stopping trace
${FS_CLI_X} "ftdm notrace ${SPAN}"

echo Done.

The script relies on there only being one channel active when you want 
to record the call, so you may have to tune this for your requirements.  
I have created a folder recordings/diagnostics for the captured output.  
The non-profit I do this for has low enough traffic to make the single 
call assumption usually valid.  If I am near an ssh session, though, I 
would work out the SPAN/CHNL variables manually in case more than one 
was active.

If you get anywhere with this, let me or the list know.

Note for devs: I haven't opened a FreeSWITCH JIRA on this because it is 
only calls involving my Sangoma card that are affected.  If the deeper 
tracing that Sangoma have requested show that it is not in their card, 
then it will go to the FreeSWITCH JIRA.  If you wish, I can open a JIRA 
but I'm not sure it's a good thing to have 2 separate fixes going on.

John

On 01/03/12 16:45, Moises Silva wrote:
> On Thu, Mar 1, 2012 at 9:45 AM, Christian Benke <benkokakao at gmail.com 
> <mailto:benkokakao at gmail.com>> wrote:
>
>
>     Sangoma's Support appears to be clueless as well, they didn't have
>     effective suggestions so far(Opened a ticket 2 weeks). Since i don't
>     have this problem with identical hardware without
>     Sangoma-Cards(SIP-Trunk instead), my first assumption was the card.
>     Probably an interrupt issue?
>
>
> Another test you can try to pinpoint the issue and determine once for 
> all if the problem is below FreeSWITCH is to use the "ftdm trace" 
> command. This command
> will create an input an output file (in the directory you specify) 
> that contains the raw audio as it is read and written from/to the 
> wanpipe device.
>
> Type "ftdm trace" to see the command syntax. Run the command whenever 
> you reproduce the problem (can be run in the middle of the call) then 
> stop the trace with "ftdm notrace" when you're
> done capturing. Note that the tracing will not stop automatically when 
> the call is hung up, the trace is a raw I/O trace and has no knowledge 
> of calls starting or being hung up.
>
> The audio format will be alaw (because is a BRI line), you can convert 
> that to a wav (with sox for example) and see if the audio issue is 
> there. If it is, we can start thinking on lower-level troubleshooting.
>
>
> *Moises Silva
> **/Manager, Software Engineering/***
>
> msilva at sangoma.com <mailto: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/20120301/49e79c41/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list