GNOME Bugzilla – Bug 770743
Also look in autotools --sysconfdir path for gstomx.conf
Last modified: 2016-09-30 07:04:38 UTC
After a recent git pull, the gst-omx project goes through all the motions of a clean build, but all the omx plugins are invisible: 0:00:00.012056738 32504 0x1656400 ERROR omx gstomx.c:2681:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs (searched in: /home/pi/.config:/etc/xdg as per GST_OMX_CONFIG_DIR environment variable, the xdg user config directory (or XDG_CONFIG_HOME) and the system config directory (or XDG_CONFIG_DIRS) 0:00:00.480374486 32503 0x1330a00 ERROR GST_PIPELINE grammar.y:716:priv_gst_parse_yyparse: no element "omxmpeg2videodec" 0:00:00.480515578 32503 0x1330a00 ERROR GST_PIPELINE grammar.y:801:priv_gst_parse_yyparse: link has no sink [source=@0x1323c10] 0:00:00.481451974 32503 0x1330a00 ERROR GST_PIPELINE grammar.y:801:priv_gst_parse_yyparse: link has no source [sink=@0x13582b0] 0:00:00.505726646 32503 0x1330a00 ERROR GST_PIPELINE grammar.y:716:priv_gst_parse_yyparse: no element "omxh264enc" 0:00:00.505837061 32503 0x1330a00 ERROR GST_PIPELINE grammar.y:801:priv_gst_parse_yyparse: link has no sink [source=@0x1366518] 0:00:00.506226171 32503 0x1330a00 ERROR GST_PIPELINE grammar.y:801:priv_gst_parse_yyparse: link has no source [sink=@0x1379610] pi@towerofpi7 ~ $ gst-inspect-1.0 | grep omx pi@towerofpi7 ~ $ The message "searched in: /home/pi/.config:/etc/xdg" seems to be a clue - by default gstreamer's prefix is /usr/local, and the configuration file being scanned for is installed in /usr/local/etc/xdg, so it seems likely that paths passed into the build has regressed.
More weirdness. The plugin claims to be blacklisted: pi@towerofpi7 ~ $ gst-inspect-1.0 -b Blacklisted files: libgstomx.so Total count: 1 blacklisted file An attempt to learn why shows the plugin complaining about the config file that cannot be found: pi@towerofpi7 ~ $ gst-inspect-1.0 /usr/local/lib/gstreamer-1.0/libgstomx.so 0:00:00.173132683 1042 0x6d43c0 ERROR omx gstomx.c:2681:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs (searched in: /home/pi/.config:/etc/xdg as per GST_OMX_CONFIG_DIR environment variable, the xdg user config directory (or XDG_CONFIG_HOME) and the system config directory (or XDG_CONFIG_DIRS) Could not load plugin file: File "/usr/local/lib/gstreamer-1.0/libgstomx.so" appears to be a GStreamer plugin, but it failed to initialize Passing the XDG_CONFIG_HOME environment variable makes the plugin happy. pi@towerofpi7 ~ $ XDG_CONFIG_HOME=/usr/local/etc/xdg gst-inspect-1.0 /usr/local/lib/gstreamer-1.0/libgstomx.so Plugin Details: Name omx Description GStreamer OpenMAX Plug-ins Filename /usr/local/lib/gstreamer-1.0/libgstomx.so Version 1.9.2.1 License LGPL Source module gst-omx Source release date 2016-09-02 10:38 (UTC) Binary package GStreamer OpenMAX Plug-ins git Origin URL Unknown package origin omxmpeg2videodec: OpenMAX MPEG2 Video Decoder omxmpeg4videodec: OpenMAX MPEG4 Video Decoder omxh263dec: OpenMAX H.263 Video Decoder omxh264dec: OpenMAX H.264 Video Decoder omxtheoradec: OpenMAX Theora Video Decoder omxvp8dec: OpenMAX VP8 Video Decoder omxmjpegdec: OpenMAX MJPEG Video Decoder omxvc1dec: OpenMAX WMV Video Decoder omxh264enc: OpenMAX H.264 Video Encoder omxanalogaudiosink: OpenMAX Analog Audio Sink omxhdmiaudiosink: OpenMAX HDMI Audio Sink 11 features: +-- 11 elements When listing the plugins, the omx plugins remain blacklisted: pi@towerofpi7 ~ $ XDG_CONFIG_HOME=/usr/local/etc/xdg gst-inspect-1.0 | grep omx pi@towerofpi7 ~ $ pi@towerofpi7 ~ $ XDG_CONFIG_HOME=/usr/local/etc/xdg gst-inspect-1.0 -b Blacklisted files: libgstomx.so Total count: 1 blacklisted file
Yes, there needs to be a more clever way to remove things from the blacklist. Probably not just based on mtime but the other "plugin dependencies".
This bug isn't about blacklisting in general, this bug is about libgstomx being blacklisted specifically, which remains a blocker.
For people coming here from google, the workaround is set the following environment variable to work around the broken path: XDG_CONFIG_HOME=/usr/local/etc/xdg Then, manually delete the plugin registry: rm ~/.cache/gstreamer-1.0/registry.arm*
(In reply to minfrin from comment #3) > This bug isn't about blacklisting in general, this bug is about libgstomx > being blacklisted specifically, which remains a blocker. Well, that's not a bug: you have to provide a correct configuration file to gst-omx, otherwise it doesn't work.
The build provided the correct configuration file in the correct place automatically up until a git pull yesterday, at which point the code regressed. gst-omx installs the config file at /usr/local/etc/xdg, but tries to read the file from /etc/xdg.
There were no changes related to that since years, you probably configured --sysconfdir=/etc before.
Just checked the build script, --sysconfdir has never been specified, and still isn't.
Could you check your git reflog to see from what commit you updated to git master? And then bisect which commit caused the problem?
It would've then always installed into $prefix/etc/xdg then. But that one is indeed not added to the automatic search path, only the proper places according to the xdg-basedir spec. Might make sense to add that, in case you want to provide a patch. I still think something must've changed in your setup though, as all this code hasn't changed since years.
I reinstalled gstreamer git master from scratch on a brand new RPi3, and the same problem occurred. Unfortunately git pull doesn't seem to keep history, many of the pulls ended up being large monolithic merge commits, so it was not possible to see what changed. pi@towerofpi9:~$ gst-inspect-1.0 -b 0:00:01.556856089 18248 0x707800 ERROR omx gstomx.c:2681:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs (searched in: /home/pi/.config:/etc/xdg as per GST_OMX_CONFIG_DIR environment variable, the xdg user config directory (or XDG_CONFIG_HOME) and the system config directory (or XDG_CONFIG_DIRS) Blacklisted files: libgstomx.so Total count: 1 blacklisted file I stumbled on a significant number of mentions of this problem over the years, it appears it has existed for quite a while. I wonder if certain versions of the autotools trigger this but not others? https://devtalk.nvidia.com/default/topic/911535/gstreamer-nvvidconv-plugin-not-working/ https://devtalk.nvidia.com/default/topic/828594/gstreamer-1-0-and-omxh264enc-streaming-problem-on-tegra-tk1/ https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=6852&start=25
(In reply to minfrin from comment #11) > I reinstalled gstreamer git master from scratch on a brand new RPi3, and the > same problem occurred. Unfortunately git pull doesn't seem to keep history, > many of the pulls ended up being large monolithic merge commits, so it was > not possible to see what changed. git reflog if you didn't have a git gc in the meantime > pi@towerofpi9:~$ gst-inspect-1.0 -b > 0:00:01.556856089 18248 0x707800 ERROR omx > gstomx.c:2681:plugin_init: Failed to load configuration file: Valid key file > could not be found in search dirs (searched in: /home/pi/.config:/etc/xdg as > per GST_OMX_CONFIG_DIR environment variable, the xdg user config directory > (or XDG_CONFIG_HOME) and the system config directory (or XDG_CONFIG_DIRS) > Blacklisted files: > libgstomx.so > > Total count: 1 blacklisted file > > I stumbled on a significant number of mentions of this problem over the > years, it appears it has existed for quite a while. I wonder if certain > versions of the autotools trigger this but not others? The problem is basically that the sysconfig dir by autotools is not any of the standard XDG_CONFIG_DIRS. We would have to add it as another search patch inside gst-omx to prevent this. Want to provide a patch?
Providing a patch was the plan, then I struggled to find a clear reason for this failure, so I posted the bug here hoping you'd recognise this as a recent change. Turns out this has been around for a while. Need some time to dig into this in detail.
Created attachment 335361 [details] [review] omx: Also search for gstomx.conf in the autoconf --sysconfdir
This should solve it, can you confirm?
Merged that now, let's see if it solves everybody's problem. commit cb9078627c792bbb10b32ae46cf9d132dcfab938 Author: Sebastian Dröge <sebastian@centricular.com> Date: Mon Sep 12 14:09:46 2016 +0200 omx: Also search for gstomx.conf in the autoconf --sysconfdir https://bugzilla.gnome.org/show_bug.cgi?id=770743
Just did a clean build of the full stack, and it looks like the problem is gone: pi@towerofpi9:~/packages/gstreamer-master/gst-omx$ gst-inspect-1.0 -b Blacklisted files: Total count: 0 blacklisted files Thanks for this.