Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing gstreamer1.0-plugins-base introspection files (.typelib) #26

Open
mirzak opened this issue Apr 9, 2020 · 4 comments
Open

Missing gstreamer1.0-plugins-base introspection files (.typelib) #26

mirzak opened this issue Apr 9, 2020 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mirzak
Copy link
Owner

mirzak commented Apr 9, 2020

The error typically manifests it self in something like this,

root@coral-dev:~# gst-inspect-1.0 python
Traceback (most recent call last):
  File "/usr/lib/gstreamer-1.0/python/glbox.py", line 23, in <module>
    gi.require_version('GstGL', '1.0')
  File "/usr/lib/python3.7/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GstGL not available
Traceback (most recent call last):
  File "/usr/lib/gstreamer-1.0/python/glsvgoverlaysrc.py", line 28, in <module>
    gi.require_version('GstVideo', '1.0')
  File "/usr/lib/python3.7/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GstVideo not available
Traceback (most recent call last):
  File "/usr/lib/gstreamer-1.0/python/glsvgoverlaysink.py", line 29, in <module>
    gi.require_version('GstAllocators', '1.0')
  File "/usr/lib/python3.7/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GstAllocators not available

We can also clearly see that they are missing if we try to search for them:

root@coral-dev:~# find / -name *.typelib | grep Gst                                                                   
/usr/lib/girepository-1.0/GstCheck-1.0.typelib
/usr/lib/girepository-1.0/GstBase-1.0.typelib
/usr/lib/girepository-1.0/GstController-1.0.typelib
/usr/lib/girepository-1.0/Gst-1.0.typelib
/usr/lib/girepository-1.0/GstNet-1.0.typelib

The GstGL, GstVideo and GstAllocators are typically provided by the gstreamer1.0-plugins-base package.

But we are using gstreamer1.0-plugins-base_1.14.imx which has disabled introspection due to an build error as can be seen here

Pretty much all the demo applications that relate to video streams provided by Coral rely on gstreamer introspection files.

I have looked at how this is built in Mendel OS, but it also has disabled introspection as can be seen here. So I think they only way this can work in Mendel OS is because introspection files are provided as separate package, gir1.2-gst-plugins-base-1.0.

So my conclusion is that the typelib files used in Mendel OS are not built from the gstreamer1.0-plugins-base_1.14.imx and instead are using the upstream files of the same package.

Need to figure out a workaround for this in Yocto.

@mirzak mirzak added bug Something isn't working help wanted Extra attention is needed labels Apr 9, 2020
@mbrooksx
Copy link

mbrooksx commented Apr 9, 2020

In Mendel the way it's done is that introspection is explicitly disabled in the gstreamer imx package (https://coral.googlesource.com/imx-gst-plugins-base-debian/+/refs/heads/master/debian/rules#131) and then edgetpuvision has the appropriate dependency: https://coral.googlesource.com/edgetpuvision/+/refs/heads/release-day/debian/control#14

@mirzak
Copy link
Owner Author

mirzak commented Apr 9, 2020

Thanks for the link and for confirming my suspicion :). This is not hard to solve but since there is no concept of gir packages in Yocto it would be a hack at best. I guess this will go away for the 1.16 release of gstreamer-imx which do seem to have introspection enabled.

@ftagius
Copy link
Contributor

ftagius commented Jul 25, 2020

I have (mostly) enabled introspection, and the build of GstAllocators, with this patch:

diff --git a/meta-coral-bsp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.imx.b
bappend b/meta-coral-bsp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.imx.bbap
pend
index bd11f4d..57e06fd 100644
--- a/meta-coral-bsp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.imx.bbappend
+++ b/meta-coral-bsp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.imx.bbappend
@@ -24,3 +24,20 @@ SRC_URI_append_coral-dev = " \
     file://0016-fdmem-always-map-dmabuf-with-PROT_WRITE.patch \
     file://0017-Tightly-pack-RGB-buffers-downloaded-from-GPU.patch \
 "
+# enabling introspection requires additional dependencies on native packages
+DEPENDS += " \
+       qemu-native \
+       prelink-native \
+       gobject-introspection-native \
+       "
+
+# enable introspection
+EXTRA_OECONF_append = " --enable-introspection"
+
+# add extra lib paths, including allocators, which is needed for introspection
+do_compile_prepend() {
+        export GIR_EXTRA_LIBS_PATH="${B}/gst-libs/gst/tag/.libs:${B}/gst-libs/gst/video/.libs:${B}/gst-libs/gst/audio/.libs:${B}/gst-libs/gst/rtp/.libs:${B}/gst-libs/gst/allocators/.libs"
+}
+
+# add the files generated by introspection
+FILES_${PN} += "${prefix}/share"

The only issue is the "export GIR_EXTRA_LIBS_PATH" do_compile prepend. That line in my patch is put first in the run_compile script, but immediately after it is the original "export GIR_EXTRA_LIBS_PATH" from the freescale bb recipe, overwriting my change. I have not found a way for the bbappend do_compile_prepend to be listed after the do_compile_prepend of the freescale bb recipe. I hacked around it by putting my "export GIR_EXTRA_LIBS_PATH" statement in the freescale bb.

@mirzak
Copy link
Owner Author

mirzak commented Jul 28, 2020

I have (mostly) enabled introspection, and the build of GstAllocators, with this patch:

Maybe it is actually worth sending a patch towards meta-freescale to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants