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

A confusing execute error #7

Closed
ber1121 opened this issue Jun 10, 2018 · 4 comments · Fixed by #16
Closed

A confusing execute error #7

ber1121 opened this issue Jun 10, 2018 · 4 comments · Fixed by #16

Comments

@ber1121
Copy link

ber1121 commented Jun 10, 2018

I get the peaq-1.0.exe via VS2015 successfully. But when I open windows cmd to execute it, like peaq --basic Rfile Tfile......it shows: "peaq element could not be instantiated - is the plugin installed correctly?"
What's up on it...and how can I solve it??? I wish your help.

@martinholters
Copy link
Member

Have you followed these steps:

gstpeaq/INSTALL.Windows

Lines 23 to 33 in 13954d1

The created gstpeaq.dll has to be placed in one of the directories where
GStreamer looks for plugins. For the GStreamer 0.10 SDK, these are
* %HOMEDRIVE%%HOMEFOLDER%\.gstreamer-0.10\plugins
* C:\gstreamer-sdk\0.10\x86\lib\gstreamer-0.10
* <location of libgstreamer-0.10-0.dll>\..\lib\gstreamer-0.10
and for GStreamer 1.0 these are
* %HOMEDRIVE%%HOMEFOLDER%\AppData\Local\gstreamer-1.0\plugins
* C:\gstreamer\1.0\x86\lib\gstreamer-1.0
in addition to the paths specified in %GST_PLUGIN_PATH%.
Alternatively, the --gst-plugin-load option may be used to explicitly specify
the location of the gstpeaq.dll.

If not, specifying --gst-plugin-load=/path/to/gstpeaq.dll might be easiest for a quick try.

@cocoademon
Copy link

cocoademon commented Apr 12, 2019

I'm having the same issue, also with VS2015, but the issue is actually because I'm using GStreamer 1.14.4.

Long story short - rename gstpeaq-1.0.dll to gstpeaq.dll and it works.

In version 1.14, GStreamer started using the filename to determine the name of the plugin description function.

Relevant section of the GStreamer release notes (https://gstreamer.freedesktop.org/releases/1.14/) (emphasis mine):

The default plugin entry point has changed. This will only affect plugins that are recompiled against new GStreamer headers. Binary plugins using the old entry point will continue to work. However, plugins that are recompiled must have matching plugin names in GST_PLUGIN_DEFINE and filenames, as the plugin entry point for shared plugins is now deduced from the plugin filename. This means you can no longer have a plugin called foo living in a file called libfoobar.so or such, the plugin filename needs to match. This might cause problems with some external third party plugin modules when they get rebuilt against GStreamer 1.14.

It appears that GStreamer will ignore the gst prefix on plugin filenames, and disregard any trailing extensions (like the .0. in gstpeaq-1.0.dll)

See below for investigation history


I've placed the plugin in the correct location, and also tried with --gst-plugin-load.

With --gst-plugin-load, I get the following output using --gst-debug-level=4:

 C:\lib\gstpeaq-0.6.1\vs\Win32\Release>peaq-1.0 --basic --gst-debug-level=4 --gst-plugin-load=C:\gstreamer\1.0\x86\lib\gstreamer-1.0\gstpeaq-1.0.dll c:\projects\research\monkey\multi\nt5.wav c:\projects\research\monkey\multi\8192\cv_8192_mag_perc45.wav
0:00:00.000866000  9072   02379080 INFO                GST_INIT gstmessage.c:127:_priv_gst_message_initialize: init messages
0:00:00.005255200  9072   02379080 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.018807100  9072   02379080 INFO      GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.045511000  9072   02379080 INFO      GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.049682200  9072   02379080 INFO      GST_PLUGIN_LOADING gstplugin.c:227:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.118183100  9072   02379080 INFO            GST_REGISTRY gstregistry.c:1727:ensure_current_registry: reading registry cache: C:\Users\cfoale\AppData\Local\Microsoft\Windows\INetCache\gstreamer-1.0\registry.i686.bin
0:00:00.136469900  9072   02379080 INFO            GST_REGISTRY gstregistrybinary.c:621:priv_gst_registry_binary_read_cache: loaded C:\Users\cfoale\AppData\Local\Microsoft\Windows\INetCache\gstreamer-1.0\registry.i686.bin in 0.013017 seconds
0:00:00.140470200  9072   02379080 INFO            GST_REGISTRY gstregistry.c:1583:scan_and_update_registry: Validating plugins from registry cache: C:\Users\cfoale\AppData\Local\Microsoft\Windows\INetCache\gstreamer-1.0\registry.i686.bin
0:00:00.261825100  9072   02379080 INFO            GST_REGISTRY gstregistry.c:1685:scan_and_update_registry: Registry cache has not changed
0:00:00.263051800  9072   02379080 INFO            GST_REGISTRY gstregistry.c:1762:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.293881200  9072   02379080 ERROR           GST_REGISTRY gstregistry.c:1507:load_plugin_func: Failed to load plugin: File "C:\gstreamer\1.0\x86\lib\gstreamer-1.0\gstpeaq-1.0.dll" is not a GStreamer plugin
0:00:00.294774000  9072   02379080 INFO                GST_INIT gst.c:807:init_post: GLib runtime version: 2.54.3
0:00:00.298125500  9072   02379080 INFO                GST_INIT gst.c:809:init_post: GLib headers version: 2.54.3
0:00:00.300189400  9072   02379080 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
0:00:00.308464400  9072   02379080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "pipeline" named "pipeline"
0:00:00.310358900  9072   02379080 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "peaq"!
Error: peaq element could not be instantiated - is the plugin installed correctly?

Note the error hidden in there:

0:00:00.293881200  9072   02379080 ERROR           GST_REGISTRY gstregistry.c:1507:load_plugin_func: Failed to load plugin: File "C:\gstreamer\1.0\x86\lib\gstreamer-1.0\gstpeaq-1.0.dll" is not a GStreamer plugin

Running gst-inspect-1.0 --gst-debug-level=5 ./gstpeaq-1.0.dll gives me (in addition to a massive bunch of gstregistrychunks debug info), the following:

0:01:59.759606700  4080   00844000 DEBUG     GST_PLUGIN_LOADING gstplugin.c:760:_priv_gst_plugin_load_file_for_registry: attempt to load plugin "./gstpeaq-1.0.dll"
0:01:59.809920000  4080   00844000 DEBUG     GST_PLUGIN_LOADING gstplugin.c:811:_priv_gst_plugin_load_file_for_registry: Could not find symbol 'gst_plugin_peaq_1_get_desc', falling back to gst_plugin_desc
0:01:59.818802200  4080   00844000 DEBUG     GST_PLUGIN_LOADING gstplugin.c:818:_priv_gst_plugin_load_file_for_registry: Could not find plugin entry point in "./gstpeaq-1.0.dll"
Could not load plugin file: File "./gstpeaq-1.0.dll" is not a GStreamer plugin

This indicates that the gst_plugin_peaq_1_get_desc function is missing. Given that the string peaq_1 only exists in the filename, this is a clue.

Additionally, an issue here: alumae/gst-kaldi-nnet2-online#67 suggests the same thing, but for linux.

The GST_PLUGIN_DEFINE macro declares a function called gst_plugin_NAME_get_desc, where NAME is passed in - in this case peaq. This has to match the function used in loading the plugin, which is derived from the filename.
Old binaries would work fine, as GST_PLUGIN_DEFINE used to declare a function called gst_plugin_desc, which 1.14 still falls back to.

@martinholters
Copy link
Member

Terrific, thanks for drilling down on that!

@cocoademon
Copy link

Thanks for the awesome library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants