Hi,<br><br>After some further investigating (mostly timing rtp_recv, rtp_recv_data and process_rtp) it seems like there is some correlation between the time udp_select takes and the frame delay (though it&#39;s not completely consistent). Confusingly, if I set the timeout to 0 rtp_recv predictably takes very little time but the frame delay is still there, and I couldn&#39;t find any other places where the time went (path seems to be rtp_recv -&gt; rtp_recv_data -&gt; process_rtp -&gt; callback). Is anyone familiar with performance issues related to select(), or how any other applications do fast UDP reading?<br>

<br>Thanks,<br>--Andrew<br><br><div class="gmail_quote">2010/7/28 Andrew Ford <span dir="ltr">&lt;<a href="mailto:andrew.ford@rit.edu">andrew.ford@rit.edu</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi Rhys,<br><br>I&#39;ve tried calling rtp_recv once with both 10ms and 1ms timeout times (as well as no timeout at all) and it looks like it doesn&#39;t make a difference. I also tried changing the system UDP buffer sizes to see if that had any effect, but it doesn&#39;t seem to.<br>


<br>--Andrew<br><br><div class="gmail_quote">2010/7/27 Rhys Hawkins <span dir="ltr">&lt;<a href="mailto:rhys.hawkins@anu.edu.au" target="_blank">rhys.hawkins@anu.edu.au</a>&gt;</span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div>On Tue, 27 Jul 2010 14:12:37 -0400<br>
Andrew Ford &lt;<a href="mailto:andrew.ford@rit.edu" target="_blank">andrew.ford@rit.edu</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt;   timeout.tv_sec = 0;<br>
&gt;   timeout.tv_usec = 10000;<br>
&gt;   for (int i = 0; i &lt; 1000 &amp;&amp; rtp_recv(session, &amp;timeout, _timestamp); i ++) {<br>
&gt;<br>
&gt;<br>
&gt;     timeout.tv_sec = 0;<br>
&gt;     timeout.tv_usec = 10;<br>
&gt;<br>
&gt;   }<br>
&gt;<br>
<br>
</div>Hi Andrew,<br>
<br>
All that code is doing is a crude version of:<br>
<br>
  while (elapsed_time &lt; 10ms) {<br>
    process incoming packets<br>
  }<br>
<br>
You could try and replace the for loop with just one call to the rtp_recv<br>
function, ie:<br>
<div><br>
  timeout.tv_sec = 0;<br>
  timeout.tv_usec = 10000;<br>
</div><div>  rtp_recv(session, &amp;timeout, _timestamp);<br>
<br>
</div>and see if that fixes your problem.<br>
<br>
The code above was to handle an issue with DV decoding in that decoding an<br>
entire frame of DV took a certain length of time and during that time the<br>
UDP buffer (kernel side) could overflow causing loss of data. I don&#39;t think<br>
it should be the cause of your problems, but things are pretty foggy that<br>
far back in time so it may have other ramifications I&#39;ve forgotten about.<br>
<br>
Cheers,<br>
<font color="#888888">    Rhys<br>
</font></blockquote></div></div></div><br>
</blockquote></div><br>