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 702819 - udpsink multicast-iface does not seem to work correctly
udpsink multicast-iface does not seem to work correctly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.0.7
Other Linux
: Normal normal
: 1.1.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-21 14:39 UTC by Paul HENRYS
Modified: 2013-06-24 20:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul HENRYS 2013-06-21 14:39:05 UTC
I was trying to use the multicast-iface property of udpsink/udpsrc elements on 2 machines with 2 network cards.
Setting this property on udpsrc worked fine but not for udpsink whereas this property is set when joining the multicast in both elements.
Here are my pipelines:

gst-launch-1.0 --gst-debug=*udp*:5 audiotestsrc ! audioconvert ! rtpL16pay ! udpsink host=239.5.5.5 port=5555 multicast-iface=eth1

gst-launch-1.0 --gst-debug=*udp*:5 udpsrc uri=udp://239.5.5.5:5555 multicast-iface=eth1 ! application/x-rtp, media=audio, clock-rate=44100, encoding-name=L16, channels=1, payload=96 ! rtpL16depay ! audioconvert ! alsasink

and my routing table:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.86.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
172.16.86.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
0.0.0.0         172.16.86.1     0.0.0.0         UG    0      0        0 eth0

udpsrc will correctly get the stream from eth1 whereas udpsink will send the stream on eth0. Of course, if I change the default gateway on eth1 or add a static route for my stream, the stream will be sent on eth1 but not using multicast-iface for udpsink.
I also tried to set the option like this:

if (sink->multi_iface)
      setsockopt (g_socket_get_fd (sink->used_socket), SOL_SOCKET, SO_BINDTODEVICE, sink->multi_iface, strlen (sink->multi_iface) * sizeof (gchar));

after creating the socket in gst_multiudpsink_start and in this case it was using the good interface.

Any idea, why it does not work like it udpsrc?

Cheers,

Paul HENRYS
Comment 1 Wim Taymans 2013-06-24 14:59:56 UTC
There is nothing in the code to bind to an interface. There is some attempt to join a multicast group on the interface but that doesn't work for senders.
Comment 2 Paul HENRYS 2013-06-24 20:51:23 UTC
Ok Wim. Thx for the answer.
Comment 3 Wim Taymans 2013-06-24 20:54:20 UTC
This should fix it:

commit 35f6e79b947dbcefc4573898b7d6f135161676c0
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Mon Jun 24 17:11:35 2013 +0200

    udpsink: bind to the given interface
    
    Actually call BINDTODEVICE to bind to the interface as given by the
    property.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702819