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 754534 - rtspsrc: Fails on Windows with 'An existing connection was forcibly closed by the remote host' b/c of NAT hole punching
rtspsrc: Fails on Windows with 'An existing connection was forcibly closed by...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Windows
: Normal normal
: 1.5.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-03 15:20 UTC by David
Modified: 2015-09-21 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
output of >gst-launch-1.0 -v -m -t rtspsrc location="rtsp://10.1.12.210/rtsp_tunnel?h26x=4&line=1&inst=1" ! rtph264depay ! decodebin ! autovideosink --gst-debug=2,*udp*:6,*rtp*:6,*rtsp*:6 (74.48 KB, text/plain)
2015-09-03 15:20 UTC, David
  Details
Wireshark Capture for gst-launch-1.0 log file (203.88 KB, application/octet-stream)
2015-09-03 15:26 UTC, David
  Details
udpsrc: Ignore G_IO_ERROR_CONNECTION_CLOSED when receiving data (1.46 KB, patch)
2015-09-04 09:03 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description David 2015-09-03 15:20:00 UTC
Created attachment 310607 [details]
output of >gst-launch-1.0 -v -m -t rtspsrc location="rtsp://10.1.12.210/rtsp_tunnel?h26x=4&line=1&inst=1" ! rtph264depay ! decodebin ! autovideosink --gst-debug=2,*udp*:6,*rtp*:6,*rtsp*:6

gstreamer version 1.5.90 x86
Windows 7 professional Service pack 1


Posted question to gstreamer-devel@lists.freedesktop.org and was directed to post a bug.

Please refer to attachment for gst-launch-1.0 

"
> This is the error here, receiving packets from the UDP socket failed 
> for whatever reason. The error message is not very helpful as UDP is 
> connection-less :) If I understand this correctly from the PCAP log, 
> the problem is that we're sending data via UDP to the server in the 
> beginning on the ports that would be used for receiving data from the 
> server... the server replies via ICMP that those ports are 
> unreachable, and then the socket fails with the above error on the 
> receiver side. Not sure what exactly we're sending to the server 
> there, it's not proper RTP and I don't think we should send anything 
> there at all at this point.

What is sent there are 5 200 byte packets with random data to open up NATs, so that we can actually receive back UDP packets for NATs that have UDP "connection" tracking.

Unfortunately the server is not listening on that port, and we're using the same socket for receiving UDP packets and sending these dummy packets... so on the next time a packet is received, the socket reports an error.

Please report this in Bugzilla? Thanks!
"
Comment 1 David 2015-09-03 15:26:32 UTC
Created attachment 310608 [details]
Wireshark Capture for gst-launch-1.0 log file
Comment 2 Sebastian Dröge (slomo) 2015-09-04 08:30:22 UTC
Not sure what we should do about this here, we could just use different sockets and bind them both to the same ports maybe. Not sure if that also works for the NAT traversal.

Related to this is also bug #750728, which seems to indicate that GSocket is not threadsafe enough on Windows for sending from one thread and receiving from another simultaneously.
Comment 3 Sebastian Dröge (slomo) 2015-09-04 09:03:05 UTC
Created attachment 310649 [details] [review]
udpsrc: Ignore G_IO_ERROR_CONNECTION_CLOSED when receiving data

This happens on Windows if we use the same socket for sending packets,
and the remote sends ICMP port/host unreachable messages.
Comment 4 Sebastian Dröge (slomo) 2015-09-04 09:03:37 UTC
Can you check if this works for you?
Comment 5 David 2015-09-08 20:45:21 UTC
I have only been working with gstreamer-1.0-x86-1.5.90.msi & gstreamer-1.0-devel-x86-1.5.90.msi binaries, and do not have the source code or projects to recompile to test these changes. 

If you could provide newly compiled DLL(s) I will definitely add it to my test bed and give you results.
Comment 6 Sebastian Dröge (slomo) 2015-09-09 06:52:04 UTC
Ok, please test 1.5.91 once it is released then :)
Comment 7 Sebastian Dröge (slomo) 2015-09-21 09:48:38 UTC
You can get the 1.5.91 binaries from here: http://lists.freedesktop.org/archives/gstreamer-devel/2015-September/054631.html

Let me know if that helps
Comment 8 David 2015-09-21 13:32:59 UTC
Yes 1.5.91 appears to have corrected issue.

Thank you for your help.