RE: 1/2 of packets are droped - Solved

"Eren AYKOC" <[email protected]> Fri, 14 Nov 2008 09:38:04 +0200
Newsgroups gmane.comp.gnu.ccrtp.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.

--===============1129839431==
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C9462B.EE10EB7F"
Content-class: urn:content-classes:message

This is a multi-part message in MIME format.

------_=_NextPart_001_01C9462B.EE10EB7F
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,=20

=20

I've managed to solve the problem.=20

=20

One cycle in the while loop of SingleThreadRTPSession::run() was taking
nearly 60 milliseconds and therefore every 1 of 2  packets become
expired. I saw that setCancel method (which calls Thread::sleep(1)) made
the thread sleep much more than 1 millisecond. When I changed
Thread::yield() method to sleep(0) in  commoncpp\src\thread.cpp (line
1198) my problem was solved.

=20

Sincerely,

=20

Eren

=20

From: [email protected]
[mailto:[email protected]] On Behalf =
Of
Eren AYKOC
Sent: Wednesday, November 12, 2008 6:56 PM
To: [email protected]
Subject: [Ccrtp-devel] 1/2 of packets are droped=20

=20

Hi,

=20

I'm trying to build an application using ccRTP (1.6.2) and I'm having
some problems. My application is a SIP IVR application and right now I'm
using PCMU payload.=20

=20

In my -Thread and TimerPort derived- thread class's run() method, my
application is sending -30ms long (240 bytes)- audio packets to
destination and nearly for the half of the packets, my
-SingleThreadRTPSession derived- socket class's onExpireSend method is
triggered. When I sniff the network with Wireshark for UDP packets I
don't see the dropped ones and the sound is distorted on the destination
side.=20

=20

My code is nearly the same as the demo application audiotx.cpp except
the audio source mechanism.=20

=20

In the mailing list archives I've found a similar problem
(http://lists.gnu.org/archive/html/ccrtp-devel/2003-03/msg00000.html)
but the patch for this bug is already in my copy of ccRTP library.

=20

I'm using MS Visual Studio 6.0 (sp6) on a Windows XP Prof (sp3) machine.


=20

I'd be glad if you may help me.

=20

Sincerely,

=20

Eren AYKOC


------_=_NextPart_001_01C9462B.EE10EB7F
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
span.EmailStyle19
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.EmailStyle20
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span style=3D'color:#1F497D'>Hi, =
<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:#1F497D'>I&#8217;ve managed to =
solve the
problem. <o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:#1F497D'>One cycle in the =
while loop of SingleThreadRTPSession::run()
was taking nearly 60 milliseconds and therefore every 1 of 2 =
&nbsp;packets become
expired. I saw that setCancel method (which calls Thread::sleep(1)) made =
the
thread sleep much more than 1 millisecond. When I changed =
Thread::yield()
method to sleep(0) in &nbsp;commoncpp\src\thread.cpp (line 1198) my =
problem was
solved.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:#1F497D'>Sincerely,<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:#1F497D'>Eren<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt =
0cm 0cm 0cm'>

<p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span>=
</b><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
[email protected]
[mailto:[email protected]] <b>On =
Behalf Of </b>Eren
AYKOC<br>
<b>Sent:</b> Wednesday, November 12, 2008 6:56 PM<br>
<b>To:</b> [email protected]<br>
<b>Subject:</b> [Ccrtp-devel] 1/2 of packets are droped =
<o:p></o:p></span></p>

</div>

</div>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Hi,<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I&#8217;m trying to build an application using =
ccRTP (1.6.2)
and I&#8217;m having some problems. My application is a SIP IVR =
application and
right now I&#8217;m using PCMU payload. <o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>In my -Thread and TimerPort derived- thread =
class&#8217;s
run() method, my application is sending -30ms long (240 bytes)- audio =
packets
to destination and nearly for the half of the packets, my =
-SingleThreadRTPSession
derived- socket class&#8217;s onExpireSend method is triggered. When I =
sniff
the network with Wireshark for UDP packets I don&#8217;t see the dropped =
ones
and the sound is distorted on the destination side. <o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>My code is nearly the same as the demo application
audiotx.cpp except the audio source mechanism. <o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>In the mailing list archives I&#8217;ve found a =
similar
problem (<a
href=3D"http://lists.gnu.org/archive/html/ccrtp-devel/2003-03/msg00000.ht=
ml">http://lists.gnu.org/archive/html/ccrtp-devel/2003-03/msg00000.html</=
a>)
but the patch for this bug is already in my copy of ccRTP =
library.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I&#8217;m using MS Visual Studio 6.0 (sp6) on a =
Windows XP
Prof (sp3) machine. <o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I&#8217;d be glad if you may help =
me.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Sincerely,<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Eren AYKOC<o:p></o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01C9462B.EE10EB7F--



--===============1129839431==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ccrtp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccrtp-devel

--===============1129839431==--