Have you tried setting the codec-ms in the portaudio.conf.xml to 60 or 120 ms?<br>Maybe the soundcard is not able to do 20ms intervals and portaudio is doing the least common multiple and chopping it up for us.<br>I think what's happening is the timer in the module is set to the interval from the config file (20ms) and during every 60ms period there is no audio until the last ms. so in each 60 ms:<br>
<br>20ms (timeout..... flush buffer)<br>20ms (timeout..... flush buffer)<br>
20ms (get 60ms worth of audio at once [3 20ms packets] but we have already read 2 filler frames from the timeouts)<br><br>So now we have read 5 packets instead of 3 and erased some of our buffer because of perceived timeouts.<br>
The code is using the assumption that if the device will obey the chosen frame size and sample rate requests down to the interval.<br><br>If you find and edit conf/autoload_configs/portaudio.conf.xml<br><br>look for this:<br>
<br> <param name="codec-ms" value="20"/><br><br>and change 20 to 60<br><br>Setting this to 60 will change the frame size of all the packets from 320 to 960 and set the timer to clock at an interval of 60ms<br>
Since the card seems to be able to reliably produce 3 20ms packets every 60ms it should also be able to produce 1 60ms packet.<br><br>FreeSWITCH should then buffer the audio and still deliver it over SIP at 20ms if you want but you can opt to set the codec PCMU@60i to disable buffering if you are in a reliable network.<br>
<br>The same should be true for setting the codec-ms to 120<br><br><br><div class="gmail_quote">On Wed, May 7, 2008 at 3:27 AM, Sluschny, Thomas <<a href="mailto:Thomas.Sluschny@siemens.com">Thomas.Sluschny@siemens.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Hi Anthony,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">i also tested your patch with no
success.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">As i already described below, the problem with all 60ms 3
packets comes from the soundcard.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">The hardware delivers its samples all 60
ms.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Our problem is (like <font face="Times New Roman" size="3">Csaba said</font>) that we read out the buffer after 60ms, 3 times, each
with samples for 20ms, AND WITH NO DELAY!</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">So we get: 60ms wait and 3 RTP packets within <1ms to
send, and after that we already wait 60 ms for the next
samples.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">In my patch i wait appr.20 ms if last method call was no
longer than 4ms ago,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">but i think we can do better with
switch_core_timer_check<span>() method, but i don't know exactly
how.</span></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"><span></span></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"><span>You are absolutly right with your demand for a better
timing resolution under Windows,</span></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"><span>but this 60ms mystery is caused by the
soundcard.</span></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"><span></span></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"><span>Thomas</span></font></span></div><br>
<div dir="ltr" align="left" lang="de">
<hr>
<font face="Tahoma" size="2"><div class="Ih2E3d"><b>Von:</b>
<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>Im Auftrag von
</b>Zelei Csaba<br></div><b>Gesendet:</b> Dienstag, 6. Mai 2008 20:22<div><div></div><div class="Wj3C7c"><br><b>An:</b>
<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br><b>Betreff:</b> Re: [Freeswitch-users]
mod_portaudio send 3 rtppacket/60msinsteadof1 packet/20ms<br></div></div></font><br></div><div><div></div><div class="Wj3C7c">
<div></div>Yes, but it didnt help with portaudio (just together with the
patch)<br>What else do you need to test it with? Please tell me, and i will do
it for you tomorrow.<br>I also found a test code for timeBeginPeriod on this
site: <a href="http://www.geisswerks.com/ryan/FAQS/timing.html" target="_blank">http://www.geisswerks.com/ryan/FAQS/timing.html</a>
and experienced that sleep(1) is usually 2 ms long (sometimes 4)<br><br><br>
<div class="gmail_quote">2008/5/6 Anthony Minessale <<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Did
you try the trunk with no pathc since my latest email r8269? I added
code that makes the windows timer accurate to 1ms precision. If the
windows timer must be made accurate or many other things in FS will not work
right.
<div>
<div></div>
<div><br><br><br>
<div class="gmail_quote">On Tue, May 6, 2008 at 10:59 AM, Csaba Zelei <<a href="mailto:csaba.zelei@gmail.com" target="_blank">csaba.zelei@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">Hi Anthony,<br><br>I tried your
suggestions (the PCMU@30i 60i and omitting line 158 in pablio.c) but
none solve the problem.<br>I also tried the latest trunk but its the
same.<br>I reached the best performance with the latest trunk and the patch
Thomas wrote.(~20ms rtp packet delta, rarely 100+ms)<br>The only problem
with it thats FS ate up 95% cpu but I am not sure if it has to do anything
with mod_portaudio or the windows timer.<br><br>If I am correct we have 2
problem here. <br>The first is windows timer isnt very accurate. <br>The
second is that mod_portaudio dont have any delay when it can return audio
data immadiately .<br>Let me explain:<br><br>1. call for
channel_read_frame<br>2. waiting for audio data (~60ms)<br>3. got 60ms audio
data<br>4. get 20ms (remaining 40ms) audio data, return (and send rtp
frame)<br>5. call for channel_read_frame<br>6. get 20ms, return(and send rtp
frame) within ~1ms<br>7. call for channel_read_frame<br>8. get 20ms,
return(and send rtp frame) within ~1ms<br>go back to 1 and start
again<br><br>That's what I tried to solve with my patch, but because of the
windows timer it failed.<br>I hope I could help, and dont misunderstand
something.<br><br>Csaba<br><br>Anthony Minessale írta:
<div>
<div></div>
<div>
<blockquote type="cite">I added a small patch to turn up the resolution of
Sleep to 1ms.<br>Can you see if that helps?<br><br>
<div class="gmail_quote">On Tue, May 6, 2008 at 8:38 AM, Sluschny, Thomas
<<a href="mailto:Thomas.Sluschny@siemens.com" target="_blank">Thomas.Sluschny@siemens.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">i
already tried to implement such a routine, but as i remember i had
problems to compile,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">anyway this may be help you:</font></span></div>
<div dir="ltr" align="left"><span></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">//
sleep with smaller tick time, wait in µs<br>void betterSleep(long wait)
<br>{ <br> LARGE_INTEGER lElapse;<br> BOOL
succ;<br> HANDLE timerHandle = 0;<br> DWORD dwWaitResult;
</font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> __try { </font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> // return on 0<br> if (wait <
1)<br> return;</font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> // create the timer<br> timerHandle =
(HANDLE) CreateWaitableTimerA(NULL, FALSE, NULL);</font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> // set the timer<br> lElapse.QuadPart =
2500LL - (wait * 10000LL);<br> succ =
SetWaitableTimer(timerHandle, &lElapse, 0, NULL, NULL,
FALSE);</font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> if (!succ) {<br> printf( "set timer
not successful!\n" ); <br> }</font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> dwWaitResult = WaitForSingleObject(
<br> timerHandle,
<br> wait // fall back timeout with 15ms
granularity<br> );</font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> switch (dwWaitResult)
<br> {<br> // The thread got mutex
ownership.<br> case WAIT_OBJECT_0:
<br> //printf( "WAIT_OBJECT_0!\n"
);<br> break; </font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> // Cannot get mutex ownership due to
time-out.<br> case WAIT_TIMEOUT:
<br> printf( "WAIT_TIMEOUT!\n" );
<br> break;</font></span></div>
<div> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"> // Got ownership of the abandoned mutex
object.<br> case WAIT_ABANDONED:
<br> printf( "WAIT_ABANDONED!\n"
);<br> break;<br> }<br> }<br> __finally
{ <br> if (timerHandle) CloseHandle(timerHandle);<br> }
<br>}<br></font></span></div>
<div dir="ltr" align="left"><span></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">It
may be hard work but: Its cool to be cross platform - you reach all
people around</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">we
count on you ;)</font></span></div>
<div dir="ltr" align="left"><span></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Thomas</font></span></div><br>
<div dir="ltr" align="left" lang="de">
<hr>
<font face="Tahoma" size="2">
<div><b>Von:</b> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>Im
Auftrag von </b>Anthony Minessale<br></div><b>Gesendet:</b> Dienstag, 6.
Mai 2008 15:08
<div>
<div><br><b>An:</b> <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br><b>Betreff:</b>
Re: [Freeswitch-users] mod_portaudio send 3 rtp packet/60msinsteadof1
packet/20ms<br></div></div></font><br></div>
<div>
<div>if switch_yield for windows is not working properly maybe if we fix
that the code will work as planned.<br><br>switch_timer_check tells you
if the timer has ticked or not and it's based on a single timer thread
that also has the necessity to do 1ms sleeps to broadcast the time
changes to the rest of the system. so let's try using performance
counters to implement proper switch_yield and see if the code begins to
work as planned. I'll try to come up with a patch because there
are several places including the RTP code where semi-accurate 1ms sleeps
are absolutely necessary. <br><br>This is one of the many joys of being
cross platform. =D<br><br><br><br><br>
<div class="gmail_quote">On Tue, May 6, 2008 at 7:37 AM, Sluschny, Thomas
<<a href="mailto:Thomas.Sluschny@siemens.com" target="_blank">Thomas.Sluschny@siemens.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Anthony seams to be right.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I
tested around a little bit and i see:</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">-
the main problem is the soundcard (-driver), it gives 480 frames all
60 ms </font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">-
if i chose 160 (256) frames ringbuffer size i get only 160 frames all
60 ms, and it sounds really croppy (of course, there are not enough
samples ...)</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">-
i get really good results if i store the last timestamp when
</font><font face="Arial"><font color="#0000ff"><font size="2">ReadAudioStream<span>() returns, and if current timestamp is
less than 20ms from last i wait 20
ms,</span></font></font></font></span></div>
<div dir="ltr" align="left"><span><font face="Arial"><font color="#0000ff"><font size="2"><span>so the packet difference went from
60-0-0-60-0-0 ms to
20-20-20-20-20-20</span></font></font></font></span></div>
<div dir="ltr" align="left"><span><font face="Arial"><font color="#0000ff"><font size="2"><span>- i use HighPerformanceCounter to
measure the time in WinXP</span></font></font></font></span></div>
<div dir="ltr" align="left"><span><font face="Arial"><font color="#0000ff"><font size="2"><span></span></font></font></font></span> </div>
<div dir="ltr" align="left"><span><font size="-0"><font size="-0"><span><font color="#0000ff" face="Arial" size="2">I thought we could
use </font><font face="Arial"><font color="#0000ff"><font size="2">switch_core_timer_check<span>() to do that timestamp work, but
it doesn't work as
expected,</span></font></font></font></span></font></font></span></div>
<div dir="ltr" align="left"><span><font size="-0"><font size="-0"><span><font face="Arial"><font color="#0000ff"><font size="2"><span>seams we have to
synchronize to the 60ms clock from soundcard, at least at the
beginning, which means the delay
increase.</span></font></font></font></span></font></font></span></div>
<div dir="ltr" align="left"><span><font size="-0"><font size="-0"><span><font face="Arial"><font color="#0000ff"><font size="2"><span></span></font></font></font></span></font></font></span> </div>
<div dir="ltr" align="left"><span><font size="-0"><font size="-0"><span><font face="Arial"><font color="#0000ff"><font size="2"><span>Thomas</span></font></font></font></span></font></font></span></div>
<div dir="ltr" align="left"><span><font size="-0"><font size="-0"><span><font face="Arial"><font color="#0000ff"><font size="2"><span></span></font></font></font></span></font></font></span> </div>
<div dir="ltr" align="left"><span><font size="-0"><font size="-0"><span><font face="Arial"><font color="#0000ff"><font size="2"><span>PS: i attach a patch
for better
understanding </span></font></font></font></span></font></font></span></div><br>
<div dir="ltr" align="left" lang="de">
<hr>
<font face="Tahoma" size="2"><b>Von:</b> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>Im
Auftrag von </b>Anthony Minessale<br><b>Gesendet:</b> Dienstag, 6. Mai
2008 00:38
<div><br><b>An:</b> <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br></div><b>Betreff:</b>
Re: [Freeswitch-users] mod_portaudio send 3 rtp packet/60ms insteadof1
packet/20ms<br></font><br></div>
<div>
<div>This is not normal sleep it's microsecond sleep. Its done
because we are doing nonblocking read on the ringbuffer that's tied to
the hardware. Since this is voip, we must drop audio frames when
they are late and in order to do that we must have a high resolution
loop. This is only a problem when the audio device is not
sending audio at the interval we asked it to. Some cheap
hardware cannot reliably deliver audio at 20ms intervals which is why
i suggested higher value intervals in the config. The request to
remove the sleep is to confirm the proposition that sleep 1ms was
really taking 15ms.<br><br>I appreciate the suggestion and I
understand you are not trying to be a smart ass.<br><br><br><br>
<div class="gmail_quote">On Mon, May 5, 2008 at 4:35 PM, Michael Jerris
<<a href="mailto:mike@jerris.com" target="_blank">mike@jerris.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The
place this is trickiest is when you are in a loop where you
want<br>to wait for audio, AND do something every x ms or so.
You can't do a<br>blocking read, and a read with timeout tends
to be quite expensive.<br>There are some ways around this, but
sometimes its just the most<br>efficient, even if not preferred
method.<br><br>Mike<br>
<div>
<div><br><br>On May 5, 2008, at 5:26 PM, ?ukasz Zwierko
wrote:<br><br>> Hi,<br>><br>> Just a thought here: using
calls like delay(), sleep() etc. for very<br>> short amount of
time (like in this case a couple of miliseconds)<br>> should in
my opinion be really discouraged. It is often a symptom of<br>>
bad programming even in an embedded enviroment, not
mentioning<br>> platforms like Windows or Linux where you can't
really tell what<br>> priority does your task have, and will it
not be starved for a long<br>> time by other tasks. I should be
avoided whenever possible.<br>> Don't want to sound like a smart
ass here, but isn't there any other<br>> way? From what I
understood you wait until some amount of voice<br>> samples
is collected? If that's the case than perhaps you can
measure<br>> an amount of data collected not the time... If these
are PCM samples<br>> than the correlation is
straightforward.<br>> Again, sorry if I'm being a smart ass here
but I've seen some really<br>> bad code with sleep() calls and
such like, and I can tell you that it<br>> only worked fine in
specific conditions, and had a tendency to work<br>> very poorly
when for example CPU was under heavy load.<br>><br>>
Luaksz<br>><br>> 2008/5/5 Anthony Minessale <<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>>:<br>>> did
you try setting the ptime on the rtp to 30 or
60ms<br>>><br>>> when you choose a codec in your sip
settings on FS in vars.xml,<br>>> instead of<br>>> PCMU
try PCMU@30i or PCMU@60i<br>>> it may be that the other side
is doing 30 or 60 ms and not telling<br>>>
us.<br>>><br>>> also in pablio.c in the portaudio_mod
directory in ReadAudioStream<br>>> func,<br>>> there is
a sleep 1 ms too<br>>> if the windows is really sleeping a lot
longer than that, try<br>>> omitting line<br>>>
158.<br>>> This probably will consume the whole cpu but if it
fixes your<br>>> problem it<br>>> will support the
theory that the sleep on windows in
inaccurate.<br>>><br>>><br>>><br>>><br>>><br>>>
On Mon, May 5, 2008 at 11:38 AM, Csaba Zelei<br>>> <<a href="mailto:csaba.zelei@gmail.com" target="_blank">csaba.zelei@gmail.com</a>>
wrote:<br>>>><br>>>><br>>>><br>>>><br>>>>
With a little hack I can make mod_portaudio to send rtp packets
with<br>>> ~24ms, ~16ms delay alternately on linux. This
result in a constant<br>>> 4ms<br>>> jitter but its
better than the original. (diff attached)<br>>>> However on
windows the delta between rtp packets is 15-32 ms<br>>>>
randomly,<br>>> with occasionally high 70-100ms
delta.<br>>>> I also tried to tweak the windows timer
without success.<br>>>> Does anybody has any idea how to
make windows xp more accurate?<br>>>><br>>>>
Sluschny, Thomas
wrote:<br>>>><br>>>><br>>>><br>>>><br>>>>
as you can see here:<br>>>><br>>>><br>>>>
<a href="http://jira.freeswitch.org/browse/MODENDP-40" target="_blank">http://jira.freeswitch.org/browse/MODENDP-40</a><br>>>><br>>>>
i have this problem all the time (the error mentioned in
this<br>>>> issue was<br>>> only related with
this).<br>>>><br>>>> It has to do with windows
handle sleep() method, you has say<br>>>> sleep(1)
for<br>>> 1ms but on my<br>>>><br>>>>
machine it waits 15ms (it depends on your hardware, other PCs
behave<br>>> different!). So i tested around with high
performance counters.<br>>>><br>>>> For now i
ignore that problem an set jitterbuffers on other
device<br>>>> big<br>>>
enough.<br>>>><br>>>>
Thomas<br>>>><br>>>>
________________________________<br>>> Von: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a><br>>>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] Im
Auftrag<br>>> von Zelei<br>>> Csaba<br>>>>
Gesendet: Donnerstag, 24. April 2008 19:05<br>>>> An: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>>>>
Betreff: [Freeswitch-users] mod_portaudio send 3 rtp
packet/60ms<br>>>> instead<br>>> of1
packet/20ms<br>>>><br>>>> Dear
all,<br>>>><br>>>> I tried to use FS in client
mode, starting calls with<br>>>> mod_portaudio to
our<br>>> providers gateway ( a Cirpack softswitch
)<br>>>> I experienced that there is 2-3 sec delay in the
call, its choppy<br>>>> and<br>>> robot
like.<br>>>> I tested it with a softphone, and an ip phone
and everything was<br>>>> fine. I<br>>> traced back
the problem to mod_portaudio sending 3 rtp packet in
60ms<br>>> instead of 1
packet/20ms.<br>>>><br>>>> Here is an rtp
statistic from a call: (see<br>>> <a href="http://pastebin.freeswitch.org/4307" target="_blank">http://pastebin.freeswitch.org/4307</a> for the
complete list and sip<br>>>
trace)<br>>>><br>>>> Packet Sequence
Delta (ms)<br>>>> 42 26138
0.00<br>>>> 43 26139
0.02<br>>>> 46 26140
45.69<br>>>> 47 26141
0.02<br>>>> 48 26142
2.96<br>>>> 52 26143
56.31<br>>>> 53 26144
5.75<br>>>> 54 26145
0.02<br>>>> 58 26146
51.99<br>>>> 59 26147
0.03<br>>>> 60 26148
2.96<br>>>> 63 26149
42.95<br>>>> 65 26150
17.06<br>>>> 66 26151
0.02<br>>>> 67 26152
2.90<br>>>> 71 26153
56.99<br>>>> 72 26154
0.03<br>>>> 73 26155
0.02<br>>>><br>>>> Did anyone else
experience similar problems?<br>>>> Is this the desired
behaviour, because portaudio get data in 60ms<br>>>>
interval<br>>> or can I set it to 20ms
somehow?<br>>>><br>>>>
Thanks,<br>>>><br>>>> Csaba
Zelei<br>>>><br>>>><br>>>>
________________________________<br>>><br>>>>
_______________________________________________<br>>>>
Freeswitch-users mailing list<br>>>> <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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>>>><br>>>><br>>>>
Index: mod_portaudio.c<br>>>>
===================================================================<br>>>>
--- mod_portaudio.c (revision 8260)<br>>>>
+++ mod_portaudio.c (working copy)<br>>>> @@
-121,6 +121,7 @@<br>>>> int
ring_interval;<br>>>> GFLAGS
flags;<br>>>> switch_timer_t
timer;<br>>>> + switch_timer_t
sync_timer;<br>>>> }
globals;<br>>>><br>>>><br>>>> @@ -282,7
+283,15 @@<br>>>>
}<br>>>><br>>>>
switch_set_flag_locked(tech_pvt, TFLAG_IO);<br>>>>
+<br>>>> + /* Start Synchronization
Timer */<br>>>> + //Is it ok to always
use 20ms? What about the 160 sample????<br>>>> +
if (<br>>>
switch_core_timer_init(&globals.sync_timer,"soft",<br>>>
20,160,switch_core_session_get_pool(session))<br>>> !=
SWITCH_STATUS_SUCCESS)<br>>>> +
{<br>>>> +
switch_log_printf(SWITCH_CHANNEL_LOG,<br>>>>
SWITCH_LOG_DEBUG,<br>>> "Sync Timer
failed!!\n");<br>>>> +
}<br>>>><br>>>> +<br>>>>
/* Move Channel's State Machine to RING */<br>>>>
switch_channel_set_state(channel,
CS_RING);<br>>>><br>>>> @@ -412,6 +421,8
@@<br>>>>
}<br>>>><br>>>>
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"%s<br>>>> CHANNEL<br>>> HANGUP\n",<br>>>
switch_channel_get_name(switch_core_session_get_channel(session)));<br>>>>
+ /* Destroy timer */<br>>>> +
switch_core_timer_destroy(&globals.sync_timer);<br>>>><br>>>>
return SWITCH_STATUS_SUCCESS;<br>>>>
}<br>>>> @@ -542,12 +553,17 @@<br>>>>
switch_mutex_lock(globals.device_lock);<br>>>><br>>>>
get_samples:<br>>>> -<br>>>> +<br>>>>
if ((samples =
ReadAudioStream(globals.audio_stream,<br>>>
globals.read_frame.data,<br>>>><br>>>
globals.read_codec.implementation->samples_per_frame,<br>>>><br>>>
&globals.timer)) == 0) {<br>>>> +<br>>>> +
//switch_log_printf(SWITCH_CHANNEL_LOG,
SWITCH_LOG_DEBUG,<br>>>> "No data<br>>> reset
timer\n");<br>>>> +
switch_core_timer_sync(&globals.sync_timer);<br>>>>
switch_yield(1000);<br>>>>
+<br>>>> goto
get_samples;<br>>>> +<br>>>>
} else {<br>>>>
globals.read_frame.datalen = samples * 2;<br>>>>
globals.read_frame.samples = samples;<br>>>> @@ -562,7
+578,9 @@<br>>>>
status = SWITCH_STATUS_SUCCESS;<br>>>>
}<br>>>>
switch_mutex_unlock(globals.device_lock);<br>>>>
-<br>>>> +<br>>>> +
switch_core_timer_next(&globals.sync_timer);<br>>>>
+<br>>>> return
status;<br>>>><br>>>>
}<br>>>><br>>>><br>>>>
_______________________________________________<br>>>>
Freeswitch-users mailing list<br>>>> <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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>>>><br>>><br>>><br>>><br>>>
--<br>>> Anthony Minessale II<br>>><br>>>
FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>>> ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>>><br>
>>
AIM: anthm<br>>> <a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>>>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>>>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a>
#freeswitch<br>>><br>>> FreeSWITCH Developer
Conference<br>>> <a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>>> <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
>>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>>>
pstn:213-799-1400<br>>>
_______________________________________________<br>>>
Freeswitch-users mailing list<br>>> <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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>>><br>><br>>
_______________________________________________<br>>
Freeswitch-users mailing list<br>> <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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><br>_______________________________________________<br>Freeswitch-users
mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a>
#freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400
</div></div></div><br>_______________________________________________<br>Freeswitch-users
mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a>
#freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400
</div></div></div><br>_______________________________________________<br>Freeswitch-users
mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a>
#freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400
<pre><hr size="4" width="90%">
_______________________________________________
Freeswitch-users mailing list
<a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre></blockquote><br></div></div></div><br>_______________________________________________<br>Freeswitch-users
mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a>
#freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400
</div></div><br>_______________________________________________<br>Freeswitch-users
mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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><br></div></div></div>
<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><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400