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 770743 - Also look in autotools --sysconfdir path for gstomx.conf
Also look in autotools --sysconfdir path for gstomx.conf
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-omx
git master
Other Linux
: Normal enhancement
: 1.9.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-02 10:30 UTC by minfrin
Modified: 2016-09-30 07:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
omx: Also search for gstomx.conf in the autoconf --sysconfdir (2.11 KB, patch)
2016-09-12 12:10 UTC, Sebastian Dröge (slomo)
none Details | Review

Description minfrin 2016-09-02 10:30:09 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.
Comment 1 minfrin 2016-09-02 10:56:40 UTC
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
Comment 2 Sebastian Dröge (slomo) 2016-09-02 11:06:43 UTC
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".
Comment 3 minfrin 2016-09-02 11:11:06 UTC
This bug isn't about blacklisting in general, this bug is about libgstomx being blacklisted specifically, which remains a blocker.
Comment 4 minfrin 2016-09-02 11:18:08 UTC
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*
Comment 5 Sebastian Dröge (slomo) 2016-09-02 11:20:04 UTC
(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.
Comment 6 minfrin 2016-09-02 11:36:07 UTC
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.
Comment 7 Sebastian Dröge (slomo) 2016-09-02 11:51:36 UTC
There were no changes related to that since years, you probably configured --sysconfdir=/etc before.
Comment 8 minfrin 2016-09-02 11:57:05 UTC
Just checked the build script, --sysconfdir has never been specified, and still isn't.
Comment 9 Tim-Philipp Müller 2016-09-02 12:01:17 UTC
Could you check your git reflog to see from what commit you updated to git master?

And then bisect which commit caused the problem?
Comment 10 Sebastian Dröge (slomo) 2016-09-02 12:01:29 UTC
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.
Comment 11 minfrin 2016-09-10 10:11:34 UTC
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
Comment 12 Sebastian Dröge (slomo) 2016-09-10 10:15:18 UTC
(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?
Comment 13 minfrin 2016-09-10 14:00:07 UTC
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.
Comment 14 Sebastian Dröge (slomo) 2016-09-12 12:10:26 UTC
Created attachment 335361 [details] [review]
omx: Also search for gstomx.conf in the autoconf --sysconfdir
Comment 15 Sebastian Dröge (slomo) 2016-09-12 12:10:56 UTC
This should solve it, can you confirm?
Comment 16 Sebastian Dröge (slomo) 2016-09-14 09:33:51 UTC
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
Comment 17 minfrin 2016-09-16 09:38:25 UTC
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.