gst-plugins-bad: avtp: error on gst_avtp_src_start:<avtpsrc0> Failed to open socket: Operation not permitted

John Rama john.rama01 at gmail.com
Thu Jul 16 19:33:39 UTC 2020


Hello Desounza,

Thanks for your input.

>> ------------------------------------------------------------------------------------------------------------
>> $gst-launch-1.0  avtpsrc ifname=enp8s0  ! avtpcvfdepay ! avdec_h264 ! fakevideosink
>>
>> (gst-launch-1.0:8639): GStreamer-WARNING **: Failed to load plugin '/home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gst-plugins-bad/ext/avtp/libgstavtp.so': /home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gst-plugins-bad/ext/avtp/../../../gstreamer/libs/gst/base/libgstbase-1.0.so.0: undefined symbol: gst_message_new_instant_rate_request
>>
>> (gst-launch-1.0:8639): GStreamer-WARNING **: Failed to load plugin '/home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gst-plugins-bad/ext/avtp/libgstavtp.so': /home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gst-plugins-bad/ext/avtp/../../../gstreamer/libs/gst/base/libgstbase-1.0.so.0: undefined symbol: gst_message_new_instant_rate_request
>>
>> (gst-launch-1.0:8639): GStreamer-WARNING **: Failed to load plugin '/home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gst-libav/ext/libav/libgstlibav.so':/home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gst-libav/ext/libav/../../../gstreamer/libs/gst/base/libgstbase-1.0.so.0: undefined symbol: gst_message_new_instant_rate_request
>>
>> (gst-launch-1.0:8639): GStreamer-WARNING **: Failed to load plugin '/home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gst-plugins-bad/gst/debugutils/libgstdebugutilsbad.so': /home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gst-plugins-bad/gst/debugutils/../../../gstreamer/libs/gst/base/libgstbase-1.0.so.0: undefined symbol: gst_message_new_instant_rate_request
> 
> This looks like something is messed up on your environment - please
> ensure that all subprojects are updated, try building from a clean
> environment, etc.
> 

I confirmed before setcap, following pipleline works.
$gst-launch-1.0 videotestsrc num-buffers=1 ! fakevideosink

Then if I do setcap, the same pipeline does not work.
$sudo setcap cap_net_raw+ep /home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gstreamer/tools/gst-launch-1.0
$gst-launch-1.0 videotestsrc num-buffers=1 ! fakevideosink
...
gst-launch-1.0: symbol lookup error: gst-launch-1.0: undefined symbol: gst_printerr

$gst-launch-1.0 videotestsrc num-buffers=1 ! fakevideosink

Then if I do remove the capability, it work again.
$sudo setcap -r /home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gstreamer/tools/gst-launch-1.0
$gst-launch-1.0 videotestsrc num-buffers=1 ! fakevideosink

So, setcap definitely affect this problem.


After investigating more, it turned out this is because of linker behavior.

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7157699

> When one is raising the privileges of an executable, the runtime loader (rtld),
> better know as ld.so will not link with libraries in untrusted paths.
> This is the way the ld.so(1) has been designed. If one needs to run such an
> executable, then you have to add that path to the trusted paths of ld.so

After adding the path of libgstreamer-1.0.so.0 to linker, it works.
$cat /etc/ld.so.conf.d/gst-test.conf 
/home/makoto/Work/src/gstreamer/gst-build-master/build/subprojects/gstreamer/gst/
$sudo ldconfig 

(In my environment, I need to do this, even LD_LIBRARY_PATH is already set to the
correct path to use gstreamer plugins by "ninja -C build devenv".)

======================================================================

So, after fixing this problem, the pipeline has no error. 
But I have another problem....
But, fakesink does not receive no data...

$gst-launch-1.0 avtpsrc ifname=enp8s0 '!' avtpcvfdepay '!' avdec_h264 '!' videoconvert '!' fakesink dump=true
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
...

Followings returns some data..
$gst-launch-1.0 avtpsrc ifname=enp8s0 '! fakesink dump=true
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
00000000 (0x7f3338003c90): 03 88 83 00 01 23 45 67 89 ab cd ef 00 00 00 00  .....#Eg........
00000010 (0x7f3338003ca0): 02 01 00 00 01 7b 20 00 16 17 89 67 5c 81 9a 6e  .....{ ....g\..n
00000020 (0x7f3338003cb0): 93 c2 1e 4c a6 04 ff 01 89 c8 c3 dd 80 10 11 8d  ...L............

But Followings does not return no data...
$gst-launch-1.0 avtpsrc ifname=enp8s0 '!' avtpcvfdepay '!' fakesink dump=true
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

Can you think of any reason why ?

(I have already confirmed that my PC enp8s0 is receiving the CVF stream with VLAN ID 2 (PCP=3).
 Do we need to do something to receive the stream with VLAN ?)

======================================================================

Another question is 

This document describes I need to put -k ptp option to gst-launch-1.0.
https://gstreamer.freedesktop.org/documentation/avtp/index.html?gi-language=c

But gst-launch-1.0 does not recognize "-k" option.
$ gst-launch-1.0 -k ptp avtpsrc ifname=enp8s0 '!' avtpcvfdepay '!' fakesink dump=true
Error initializing: Unknown option -k

$gst-launch-1.0 --version
gst-launch-1.0 version 1.17.2
GStreamer 1.17.2 (GIT)

Thanks for your help !!

John



More information about the gstreamer-devel mailing list