After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 675444 - UDP multicast packet loss
UDP multicast packet loss
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.36
Other Windows
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-04 13:45 UTC by Maria Giovanna Chiossa
Modified: 2015-02-24 12:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Temporary patch (1.64 KB, patch)
2012-05-04 13:48 UTC, Maria Giovanna Chiossa
none Details | Review
poll everytime (521 bytes, patch)
2012-05-14 08:43 UTC, Maria Giovanna Chiossa
none Details | Review

Description Maria Giovanna Chiossa 2012-05-04 13:45:35 UTC
I have noticed that playing many instances of a rtsp/rtp multicast video from a same source,
some streams lose packets that others receive.
This happens both playing from the same process or using separated processes, so you can verify this behaviour starting this pipeline:

gst-launch-0.10 rtspsrc location=rtsp://... udp-buffer-size=524288 ! queue ! rtph264depay ! ffdec_h264 ! d3dvideosink

On average, playing 25 instances for 20’ I have 220 packets lost.

I attached a log with jitterbuffer and udpsrc debug enabled;
in gst_udpsrc_create I added the sequence number log after having performed the recvfrom call, I added also a log when 
the ioctlsocket after the select fails (see the attached log for mode details).

You can see that sometime some udpsrc instances lose a packet that other udpsrc instances receive.
For instance, at line 3059, udpsrc12 lost packet #294 that was received from other udpsrc instances before that line and after that line
If we check the history of udpsrc12, we see that at line 3050 it received packet #293 (it read all 1414 bytes available),
but the next recvfrom receives packet #295.
We can verify that between the two read it got error on ioctlsocket.

I guess that calling ioctlsocket after the select leads to some strange behaviour on socket.
(indeed there are 2 calls of ioctlsocket, but seems that only the second, after the select, give troubles)

I tried to remove it allocating a fixed 64k buffer: after the select I call directly the recvfrom,
that sometimes fails with WSAEWOULDBLOCK error. I manage this error going to "retry" and the next recvfrom succedes. 
This way, playing 25 instances for 50’ I've lost no packets.

Maybe it is not the better solution, but I'm attaching it anyway if you want to take a look at it.
Thank you
Comment 1 Maria Giovanna Chiossa 2012-05-04 13:48:48 UTC
Created attachment 213441 [details] [review]
Temporary patch
Comment 2 Wim Taymans 2012-05-09 13:29:52 UTC
This patch makes things busy wait AFAICS. Can you check if going to poll in all cases improves things?
Comment 3 Maria Giovanna Chiossa 2012-05-14 08:43:57 UTC
Created attachment 213987 [details] [review]
poll everytime

I'm not sure if it is what you mean, but I added the change in attachment, and it seems to be good, I don't see any WSAEWOULDBLOCK error this way.
Comment 4 Tim-Philipp Müller 2013-02-10 22:51:14 UTC
Is this still needed in 1.0 / git master?
Comment 5 Tim-Philipp Müller 2015-02-24 12:11:34 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!