Re: [asterisk-users] audio glitches in conference

2010-02-26 Thread Jonathan Addleman
Jeff Brower wrote:
 Jonathan-
 
 How did you measure the gaps?  Using signal or speech analysis 
 software to display the recording?  If you measure number of
 samples between the gaps, does it correspond to multiples of RTP
 packet payload length (for example, for 8 kHz G711 multiples of
 80 samples between gaps) ?
 
 I just loaded the file into audacity and measured the gaps by
 looking at the wave form. I just went through some of the samples I
 recorded yesterday, and found that all the gaps are multiples of 8
 samples - from 8 up to 32. I guess that's because dahdi/zaptel
 ticks are 8 samples each, so if it misses one, 8 samples get lost.
 I can't imagine that RTP is involved, since this is happening with
 purely local channels (just the Playback application and the eagi
 script)
 
 Did you measure the distance between gaps?  If those distances are
 multiples of RTP payload length, then possibly a network latency
 issue is involved, but otherwise I agree with other posters, it
 sounds more like a timing and/or sampling synchronization problem.

I just did this, and oddly enough, the distance between gaps *is* 
multiples of 80 - 640, 7360, 8480 samples on the recordings that I just 
tested. I say oddly, because there is no network latency involved - 
everything is local. It's playing a local audio file into a conference 
and recording the audio through the eagi script - nothing else.

 Are you handling TDM data, for example T1/E1 or ISDN?  

I'm not sure what TDM data is, but I'm pretty sure I'm not using it. The 
only telephony thing used in my application is a handful of sip 
connections, but these problems show up even if they aren't used, as 
mentioned above.

Now I'm getting rather confused... why would I be seeing the RTP payload 
length show up up anywhere at all? Maybe asterisk uses it internally for 
something else?

-- 
Jon-o Addleman - http://www.redowl.ca

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] audio glitches in conference

2010-02-26 Thread Jeff Brower
Jonathan-

 Jeff Brower wrote:
 Jonathan-

 How did you measure the gaps?  Using signal or speech analysis
 software to display the recording?  If you measure number of
 samples between the gaps, does it correspond to multiples of RTP
 packet payload length (for example, for 8 kHz G711 multiples of
 80 samples between gaps) ?

 I just loaded the file into audacity and measured the gaps by
 looking at the wave form. I just went through some of the samples I
 recorded yesterday, and found that all the gaps are multiples of 8
 samples - from 8 up to 32. I guess that's because dahdi/zaptel
 ticks are 8 samples each, so if it misses one, 8 samples get lost.
 I can't imagine that RTP is involved, since this is happening with
 purely local channels (just the Playback application and the eagi
 script)

 Did you measure the distance between gaps?  If those distances are
 multiples of RTP payload length, then possibly a network latency
 issue is involved, but otherwise I agree with other posters, it
 sounds more like a timing and/or sampling synchronization problem.

 I just did this, and oddly enough, the distance between gaps *is*
 multiples of 80 - 640, 7360, 8480 samples on the recordings that I just
 tested. I say oddly, because there is no network latency involved -
 everything is local. It's playing a local audio file into a conference
 and recording the audio through the eagi script - nothing else.

80 samples is 10 msec of 8 kHz sampled voice.  10 msec is the default frame 
size in most voice systems.  In some
way, either via external TDM interface line clock (see comments below), or 
internally, Asterisk generates a 10 msec
clock.

 Are you handling TDM data, for example T1/E1 or ISDN?

 I'm not sure what TDM data is, but I'm pretty sure I'm not using it. The
 only telephony thing used in my application is a handful of sip
 connections, but these problems show up even if they aren't used, as
 mentioned above.

Ok, so you have no ISDN, T1/E1, FSX/FSO cards?  These are all TDM data type 
interfaces.

 Now I'm getting rather confused... why would I be seeing the RTP payload
 length show up up anywhere at all? Maybe asterisk uses it internally for
 something else?

I don't know enough about internal Asterisk timing.  But I can guess that if 
you don't have TDM interfaces then
Asterisk generates a single system clock.  I don't know specifically how it 
does this, but anything in your config
files related to clock source/generation/timing, real-time scheduling, etc is 
where I would look.

-Jeff


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] audio glitches in conference

2010-02-25 Thread marco . mouta
It looks to me that u are having clock synchronism problems due to the fact you 
are using Virtual Machine so u don't have an ISDN card generating clock. Are u 
using what was called ztdummie as clock source? Can't precise the name of it in 
chan_dahdi but u have it.

What u report isn't new and is well known due to the fact u don't have a 
precise clock source for meetme..

You need to have chan_dahdi dummie... 

Hope it helps.
Marco Mouta
Enviada do dispositivo sem fios BlackBerry®

-Original Message-
From: Jeff Brower jbro...@signalogic.com
Date: Wed, 24 Feb 2010 18:25:07 
To: Jonathan Addlemanj...@redowl.ca
Cc: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] audio glitches in conference

Jonathan-

 I'm having a problem with conferences both meetme and app_conference,
 though I've done most of the testing with meetme.

 Essentially, I get little gaps in the audio - usually fewer than a dozen
 or so samples, though it does vary. They seem to occur at random, but I
 usually get one ever few seconds, on average. They also seem to delay
 some buffer somewhere, so that if I start recording (via eagi) after the
 conference has been established for half an hour or so, the stream
 received by the eagi script delayed by about 10 seconds.

How did you measure the gaps?  Using signal or speech analysis software to 
display the recording?  If you measure
number of samples between the gaps, does it correspond to multiples of RTP 
packet payload length (for example, for 8
kHz G711 multiples of 80 samples between gaps) ?

-Jeff

 First, the preliminaries: I'm on a debian lenny system, using the
 1:1.4.21.2~dfsg-3 asterisk package. This is a dedicated server - was
 running xen, but I've shut down all the domU's to test if they were
 interfering, so now there's no sharing going on.

 I've been testing with a simple eagi script to grab the audio from the
 conference:
 #!/bin/sh
 cat /dev/fd/3  /tmp/audio.raw

 I've been testing it using the following dialplan extensions:
 [test]
 exten = testeagi,1,Answer
 exten = testeagi,n,Wait(3)
 exten = testeagi,n,EAGI(testeagi.sh)

 exten = testmeet,1,Answer
 exten = testmeet,n,MeetMe(testconf,1qd)

 exten = testsound,1,Answer
 exten = testsound,n,Playback(testbeep-asterisk)

 (testbeep is just 30 seconds of sine wave)

 I've been trying things like this:



 originate Local/testso...@test extension teste...@test

 The recorded audio plays back fine - no glitches.
 (an example is at http://www.vecotourism.org/audio17.wav)

 originate Local/teste...@test extension testm...@test
 originate Local/testso...@test extension testm...@test

 This does have the glitches.
 (an example is at http://www.vecotourism.org/audio18.wav)

 What could be causing this? And is there anything else I could be doing
 to debug it? Thanks.

 --
 Jon-o Addleman - http://www.redowl.ca


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] audio glitches in conference

2010-02-25 Thread Marco Mouta
Thanks to Tzafrir for the above mentiong documentation.

FYI

http://docs.tzafrir.org.il/dahdi-linux/README.html

A PBX system should generally have a single clock. If you are connected to a
telephony provider via a digital interface (e.g: E1, T1) you should also
typically use the provider's clock (as you get through the interface). Hence
one important job of Asterisk is to provide timing to the PBX.

DAHDI ticks once per millisecond (1000 times per second). On each tick
every active DAHDI channel reads and 8 bytes of data. Asterisk also uses
this for timing, through a DAHDI pseudo channel it opens.

However, not all PBX systems are connected to a telephony provider via a T1
or similar connection. With an analog connection you are not synced to the
other party. And some systems don't have DAHDI hardware at all. Even a
digital card may be used for other uses or is simply not connected to a
provider. DAHDI cards are also capable of providing timing from a clock on
card. Cheap x100P clone cards are sometimes used for that purpose.

If all the above fail, you can use the module dahdi_dummy to provide timing
alone without needing any DAHDI hardware. It will work with most systems and
kernels.

You can check the DAHDI timing source with dahdi_test, which is a small
utility that is included with DAHDI. It runs in cycles. In each such cycle
it tries to read 8192 bytes, and sees how long it takes. If DAHDI is not
loaded or you don't have the device files, it will fail immediately. If you
lack a timing device it will hang forever in the first cycle. Otherwise it
will just give you in each cycle the percent of how close it was. Also try
running it with the option -v for a verbose output.

To check the clock source that is built into dahdi_dummy, you can either
look at title of its span in /proc/dahdi file for a source: in the
description. Or even run:

strings dahdi.ko | grep source:

--
Marco Mouta


On Thu, Feb 25, 2010 at 8:15 AM, marco.mo...@gmail.com wrote:

 It looks to me that u are having clock synchronism problems due to the fact
 you are using Virtual Machine so u don't have an ISDN card generating clock.
 Are u using what was called ztdummie as clock source? Can't precise the name
 of it in chan_dahdi but u have it.

 What u report isn't new and is well known due to the fact u don't have a
 precise clock source for meetme..

 You need to have chan_dahdi dummie...

 Hope it helps.
 Marco Mouta
 Enviada do dispositivo sem fios BlackBerry®

 -Original Message-
 From: Jeff Brower jbro...@signalogic.com
 Date: Wed, 24 Feb 2010 18:25:07
 To: Jonathan Addlemanj...@redowl.ca
 Cc: asterisk-users@lists.digium.com
 Subject: Re: [asterisk-users] audio glitches in conference

 Jonathan-

  I'm having a problem with conferences both meetme and app_conference,
  though I've done most of the testing with meetme.
 
  Essentially, I get little gaps in the audio - usually fewer than a dozen
  or so samples, though it does vary. They seem to occur at random, but I
  usually get one ever few seconds, on average. They also seem to delay
  some buffer somewhere, so that if I start recording (via eagi) after the
  conference has been established for half an hour or so, the stream
  received by the eagi script delayed by about 10 seconds.

 How did you measure the gaps?  Using signal or speech analysis software to
 display the recording?  If you measure
 number of samples between the gaps, does it correspond to multiples of RTP
 packet payload length (for example, for 8
 kHz G711 multiples of 80 samples between gaps) ?

 -Jeff

  First, the preliminaries: I'm on a debian lenny system, using the
  1:1.4.21.2~dfsg-3 asterisk package. This is a dedicated server - was
  running xen, but I've shut down all the domU's to test if they were
  interfering, so now there's no sharing going on.
 
  I've been testing with a simple eagi script to grab the audio from the
  conference:
  #!/bin/sh
  cat /dev/fd/3  /tmp/audio.raw
 
  I've been testing it using the following dialplan extensions:
  [test]
  exten = testeagi,1,Answer
  exten = testeagi,n,Wait(3)
  exten = testeagi,n,EAGI(testeagi.sh)
 
  exten = testmeet,1,Answer
  exten = testmeet,n,MeetMe(testconf,1qd)
 
  exten = testsound,1,Answer
  exten = testsound,n,Playback(testbeep-asterisk)
 
  (testbeep is just 30 seconds of sine wave)
 
  I've been trying things like this:
 
 
 
  originate Local/testso...@test extension teste...@test
 
  The recorded audio plays back fine - no glitches.
  (an example is at http://www.vecotourism.org/audio17.wav)
 
  originate Local/teste...@test extension testm...@test
  originate Local/testso...@test extension testm...@test
 
  This does have the glitches.
  (an example is at http://www.vecotourism.org/audio18.wav)
 
  What could be causing this? And is there anything else I could be doing
  to debug it? Thanks.
 
  --
  Jon-o Addleman - http://www.redowl.ca

Re: [asterisk-users] audio glitches in conference

2010-02-25 Thread Jonathan Addleman
marco.mo...@gmail.com wrote:
 It looks to me that u are having clock synchronism problems due to
 the fact you are using Virtual Machine so u don't have an ISDN card
 generating clock. Are u using what was called ztdummie as clock
 source? Can't precise the name of it in chan_dahdi but u have it.

zt_dummy is the timing source, yes. I saw the exact same thing happening
when I used app_conference though, without zt_dummy loaded at all.

I also checked if I could see what source zt_dummy is using, but there's
no 'source' line in /proc/zaptel/1 - just one line saying 'Span 1:
ZTDUMMY/1 ZTDUMMY/1 1 '


-- 
Jon-o Addleman - http://www.redowl.ca


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] audio glitches in conference

2010-02-25 Thread Jonathan Addleman
Jeff Brower wrote:
 How did you measure the gaps?  Using signal or speech analysis
 software to display the recording?  If you measure number of samples
 between the gaps, does it correspond to multiples of RTP packet
 payload length (for example, for 8 kHz G711 multiples of 80 samples
 between gaps) ?

I just loaded the file into audacity and measured the gaps by looking at
the wave form. I just went through some of the samples I recorded
yesterday, and found that all the gaps are multiples of 8 samples - from
8 up to 32. I guess that's because dahdi/zaptel ticks are 8 samples
each, so if it misses one, 8 samples get lost. I can't imagine that RTP
is involved, since this is happening with purely local channels (just
the Playback application and the eagi script)

-- 
Jon-o Addleman - http://www.redowl.ca



-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] audio glitches in conference

2010-02-25 Thread Jeff Brower
Jonathan-

 How did you measure the gaps?  Using signal or speech analysis
 software to display the recording?  If you measure number of samples
 between the gaps, does it correspond to multiples of RTP packet
 payload length (for example, for 8 kHz G711 multiples of 80 samples
 between gaps) ?

 I just loaded the file into audacity and measured the gaps by looking at
 the wave form. I just went through some of the samples I recorded
 yesterday, and found that all the gaps are multiples of 8 samples - from
 8 up to 32. I guess that's because dahdi/zaptel ticks are 8 samples
 each, so if it misses one, 8 samples get lost. I can't imagine that RTP
 is involved, since this is happening with purely local channels (just
 the Playback application and the eagi script)

Did you measure the distance between gaps?  If those distances are multiples of 
RTP payload length, then possibly a
network latency issue is involved, but otherwise I agree with other posters, it 
sounds more like a timing and/or
sampling synchronization problem.

Are you handling TDM data, for example T1/E1 or ISDN?  If so, then normally the 
TDM card inputs the external T1 line
clock and then provides it as a master for software handling TDM data.  If 
somehow the TDM clock is not configured
this way, or the software (Asterisk) is using another clock, then effectively 
you have two (2) different TDM clocks
and they are drifting with respect to each other.  In this way you could miss 
bursts of samples (or get incorrect
samples) as the clocks drift to be 180 out.  Then you'd be Ok again for a while 
until it happens again, and so on...

-Jeff


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] audio glitches in conference

2010-02-24 Thread Jonathan Addleman
I'm having a problem with conferences both meetme and app_conference, 
though I've done most of the testing with meetme.

Essentially, I get little gaps in the audio - usually fewer than a dozen 
or so samples, though it does vary. They seem to occur at random, but I 
usually get one ever few seconds, on average. They also seem to delay 
some buffer somewhere, so that if I start recording (via eagi) after the 
conference has been established for half an hour or so, the stream 
received by the eagi script delayed by about 10 seconds.

First, the preliminaries: I'm on a debian lenny system, using the 
1:1.4.21.2~dfsg-3 asterisk package. This is a dedicated server - was 
running xen, but I've shut down all the domU's to test if they were 
interfering, so now there's no sharing going on.

I've been testing with a simple eagi script to grab the audio from the 
conference:
#!/bin/sh
cat /dev/fd/3  /tmp/audio.raw

I've been testing it using the following dialplan extensions:
[test]
exten = testeagi,1,Answer
exten = testeagi,n,Wait(3)
exten = testeagi,n,EAGI(testeagi.sh)

exten = testmeet,1,Answer
exten = testmeet,n,MeetMe(testconf,1qd)

exten = testsound,1,Answer
exten = testsound,n,Playback(testbeep-asterisk)

(testbeep is just 30 seconds of sine wave)

I've been trying things like this:



originate Local/testso...@test extension teste...@test

The recorded audio plays back fine - no glitches.
(an example is at http://www.vecotourism.org/audio17.wav)

originate Local/teste...@test extension testm...@test
originate Local/testso...@test extension testm...@test

This does have the glitches.
(an example is at http://www.vecotourism.org/audio18.wav)

What could be causing this? And is there anything else I could be doing 
to debug it? Thanks.

-- 
Jon-o Addleman - http://www.redowl.ca

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] audio glitches in conference

2010-02-24 Thread Jeff Brower
Jonathan-

 I'm having a problem with conferences both meetme and app_conference,
 though I've done most of the testing with meetme.

 Essentially, I get little gaps in the audio - usually fewer than a dozen
 or so samples, though it does vary. They seem to occur at random, but I
 usually get one ever few seconds, on average. They also seem to delay
 some buffer somewhere, so that if I start recording (via eagi) after the
 conference has been established for half an hour or so, the stream
 received by the eagi script delayed by about 10 seconds.

How did you measure the gaps?  Using signal or speech analysis software to 
display the recording?  If you measure
number of samples between the gaps, does it correspond to multiples of RTP 
packet payload length (for example, for 8
kHz G711 multiples of 80 samples between gaps) ?

-Jeff

 First, the preliminaries: I'm on a debian lenny system, using the
 1:1.4.21.2~dfsg-3 asterisk package. This is a dedicated server - was
 running xen, but I've shut down all the domU's to test if they were
 interfering, so now there's no sharing going on.

 I've been testing with a simple eagi script to grab the audio from the
 conference:
 #!/bin/sh
 cat /dev/fd/3  /tmp/audio.raw

 I've been testing it using the following dialplan extensions:
 [test]
 exten = testeagi,1,Answer
 exten = testeagi,n,Wait(3)
 exten = testeagi,n,EAGI(testeagi.sh)

 exten = testmeet,1,Answer
 exten = testmeet,n,MeetMe(testconf,1qd)

 exten = testsound,1,Answer
 exten = testsound,n,Playback(testbeep-asterisk)

 (testbeep is just 30 seconds of sine wave)

 I've been trying things like this:



 originate Local/testso...@test extension teste...@test

 The recorded audio plays back fine - no glitches.
 (an example is at http://www.vecotourism.org/audio17.wav)

 originate Local/teste...@test extension testm...@test
 originate Local/testso...@test extension testm...@test

 This does have the glitches.
 (an example is at http://www.vecotourism.org/audio18.wav)

 What could be causing this? And is there anything else I could be doing
 to debug it? Thanks.

 --
 Jon-o Addleman - http://www.redowl.ca


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] audio glitches in conference

2010-02-24 Thread Sean Brady
 I'm having a problem with conferences both meetme and app_conference, 
 though I've done most of the testing with meetme.


What version of DAHDI are you running?

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users