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'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't find any other places where the time went (path seems to be rtp_recv -> rtp_recv_data -> process_rtp -> 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"><<a href="mailto:andrew.ford@rit.edu">andrew.ford@rit.edu</a>></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'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't make a difference. I also tried changing the system UDP buffer sizes to see if that had any effect, but it doesn't seem to.<br>
<br>--Andrew<br><br><div class="gmail_quote">2010/7/27 Rhys Hawkins <span dir="ltr"><<a href="mailto:rhys.hawkins@anu.edu.au" target="_blank">rhys.hawkins@anu.edu.au</a>></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 <<a href="mailto:andrew.ford@rit.edu" target="_blank">andrew.ford@rit.edu</a>> wrote:<br>
<br>
><br>
> timeout.tv_sec = 0;<br>
> timeout.tv_usec = 10000;<br>
> for (int i = 0; i < 1000 && rtp_recv(session, &timeout, _timestamp); i ++) {<br>
><br>
><br>
> timeout.tv_sec = 0;<br>
> timeout.tv_usec = 10;<br>
><br>
> }<br>
><br>
<br>
</div>Hi Andrew,<br>
<br>
All that code is doing is a crude version of:<br>
<br>
while (elapsed_time < 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, &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'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've forgotten about.<br>
<br>
Cheers,<br>
<font color="#888888"> Rhys<br>
</font></blockquote></div></div></div><br>
</blockquote></div><br>