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

PPP_InitializeModule returned -2 #365

Open
woutervanh opened this issue Dec 13, 2017 · 17 comments
Open

PPP_InitializeModule returned -2 #365

woutervanh opened this issue Dec 13, 2017 · 17 comments

Comments

@woutervanh
Copy link

Hello, I get following error on my system, running on ARM. I don't need audio at all, as I don't have any soundchip in it. What can I do to prevent this?

[fresh] [error] tables_open_display, glXQueryVersion returned False
[fresh] [error] tables_open_display, glXQueryVersion returned False
NOT SANDBOXED
[fresh 7118] not implemented: PPB_AudioInput(Dev);0.2
[ERROR:flash/platform/pepper/pep_module.cpp(143)] Browser does not support interface PPB_AudioInput(Dev);0.2.
[fresh] [error] NP_Initialize, PPP_InitializeModule returned -2
[fresh] [error] NP_Initialize, PPP_InitializeModule returned -2

@i-rinat
Copy link
Owner

i-rinat commented Dec 13, 2017

What version of Flash do you use? PPB_AudioInput(Dev);0.2 was removed from PPAPI headers somewhere in the 2014, maybe late 2013. And currently, there is only implementations for versions 0.3 and 0.4. Perhaps, you are trying to run very old PepperFlash version which actually required version 0.2?

@woutervanh
Copy link
Author

That is indeed possible.
The problem is that I need a pepperflash-plugin for my arm-platform. But the only binary I found is an armhf-version. And it's possible that this version which gives this error, is an older one. Do you happen to know where I can find a more recent version which is arm-compatible? (preferably not arm-hf)

@i-rinat
Copy link
Owner

i-rinat commented Dec 13, 2017

There is list of ChromeOS recovery images: https://dl.google.com/dl/edgedl/chromeos/recovery/recovery.conf. Some of them are for ARM-based Chromebooks, so they have inside them libpepflashplayer.so for ARM.

I haven't tested any of them. But my guess is that they are all for hard-float variations, since there is no sense in making a notebook with an ARM processor without hardware floating point support.

@i-rinat
Copy link
Owner

i-rinat commented Dec 13, 2017

Also it's worth to try to override implemented interface list. Something like that:

diff --git a/src/ppb_audio_input.c b/src/ppb_audio_input.c
index 6211bb7..d08205b 100644
--- a/src/ppb_audio_input.c
+++ b/src/ppb_audio_input.c
@@ -388,6 +388,7 @@ void
 __attribute__((constructor))
 constructor_ppb_audio_input(void)
 {
+    register_interface("PPB_AudioInput(Dev);0.2", &ppb_audio_input_dev_interface_0_3);
     register_interface(PPB_AUDIO_INPUT_DEV_INTERFACE_0_3, &ppb_audio_input_dev_interface_0_3);
     register_interface(PPB_AUDIO_INPUT_DEV_INTERFACE_0_4, &ppb_audio_input_dev_interface_0_4);
     register_resource(PP_RESOURCE_AUDIO_INPUT, ppb_audio_input_destroy);

But if PepperFlash tries to use that interface, it will crash.

@woutervanh
Copy link
Author

Ok, Already tried something like that, but more intensive as I added everywhere the 0.2 as copy of 0.3 :-)
But it was not compiling in the end. But I'll try to recompile my distro with hard-float first. Then I can also use a recent version of the pepperflash. Thanks for the info!

@woutervanh
Copy link
Author

Now I'm getting further. I recompiled my complete distro to hard float :-)
But I'm still getting issues. Can I ignore things? What are fatals?:
[fresh] [error] tables_open_display, glXQueryVersion returned False
[fresh] [error] tables_open_display, glXQueryVersion returned False
NOT SANDBOXED
[fresh 2561] not implemented: PPB_OpenGLES2VertexArrayObject;1.0
[fresh 2561] not implemented: PPB_OpenGLES2DrawBuffers(Dev);1.0
[fresh 2561] not implemented: PPB_BrokerTrusted;0.3
ALSA lib /opt/yocto/fsl-community-bsp_fido/build_imx53/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/pcm/pcm_direct.c:1539:(_snd_pcm_direct_get_slave_ipc_offset) Invalid value for card
[fresh 2561] [PPB] {zilch} ppb_network_monitor_update_network_list
[fresh 2561] [PPB] {zilch} ppb_flash_set_instance_always_on_top instance=11, on_top=1
[fresh] [error] ppb_graphics3d_create, glXChooseFBConfig returned NULL
[fresh] [error] ppb_graphics3d_create, glXChooseFBConfig returned NULL
[fresh] [error] [NP] caught Xlib error 3
[fresh] [error] [NP] caught Xlib error 3
[fresh] [error] [NP] caught Xlib error 3
[fresh] [error] [NP] caught Xlib error 3
[fresh] [error] [NP] caught Xlib error 3
[fresh] [error] [NP] caught Xlib error 3
[fresh 2561] not implemented: PPB_BrokerTrusted;0.3
[fresh 2561] [PPB] {zilch} ppb_network_monitor_update_network_list
[fresh 2561] [PPB] {zilch} ppb_flash_set_instance_always_on_top instance=12, on_top=1

@i-rinat
Copy link
Owner

i-rinat commented Dec 14, 2017

Something wrong with GLX context. OpenGL support code required GLX while only EGL may be present. Try to disable using of OpenGL by adding enable_3d = 0 to ~/.config/freshwrapper.conf.

@woutervanh
Copy link
Author

yes, possibly, it's an nxp imx53, so only opengles available.
enable_3d does not change at thing...

@i-rinat
Copy link
Owner

i-rinat commented Dec 14, 2017

I've read again and noticed there errors from ALSA lib. They are probably should be fixed somehow, but I don't know how. And even what's wrong.

If you don't need audio at all, you can throw away code that tries ALSA, here:

if (audio_alsa.available())
return &audio_alsa;
. By default, it tries JACK, PulseAudio, ALSA, and if they are all not available, uses special "noaudio" implementation.

Also, I forgot a quirk that PepperFlash from ChromeOS had. It requires 3d, and won't work at all if 3d is not available. So, enable_3d=0 setting won't help.

By default, OpenGL|ES 2 is emulated via OpenGL 2.0 and the shader translator from ANGLE. But since you probably have no full OpenGL 2.0 implementation, it's worth to try WITH_GLES2=1 build option (cmake -DWITH_GLES2=1 .. and so on).

You still need working GLX, as there is no code for EGL.

@woutervanh
Copy link
Author

woutervanh commented Dec 14, 2017 via email

@i-rinat
Copy link
Owner

i-rinat commented Dec 14, 2017

I don't know. On my machine there are also glTexImage2D in both gl2.h and gl.h, but they do not conflict. At least, compilation is fine.

@woutervanh
Copy link
Author

woutervanh commented Dec 14, 2017 via email

@woutervanh
Copy link
Author

woutervanh commented Dec 15, 2017 via email

@woutervanh
Copy link
Author

Now it works. I took another swf to try with, or rebooted, don't know what did it in the end, error 3 meant invalid window or something.
However, it's very slow and consumes about 85% of my CPU. I wonder if I can take it to hardware? Following errors:
[fresh 5900] not implemented: PPB_OpenGLES2VertexArrayObject;1.0
[fresh 5900] not implemented: PPB_OpenGLES2DrawBuffers(Dev);1.0
Tell me it wants to access opengles2 drawing functions, but they are not implemented? Is that correct? Would that improve the performance? Would it be a lot of work to do?

@i-rinat
Copy link
Owner

i-rinat commented Dec 16, 2017

However, it's very slow and consumes about 85% of my CPU. I wonder if I can take it to hardware?

Try running perf top to find out what actually uses CPU. There are two possibilities. First, it's just OpenGL ES 2 implemented in software. Then if you find how make it use hardware acceleration, it will become better. Second is that all CPU time is eaten by Flash runtime itself. Then there is nothing you can do.

As I said before, try to use profiler. perf top should be already available on any (somewhat) recent Linux system.

Tell me it wants to access opengles2 drawing functions, but they are not implemented? Is that correct?

They are not implemented, indeed. But those two are extensions, and they are not required. Main interface, "PPB_OpenGLES2;1.0" is implemented.

Would that improve the performance?

A bit, perhaps. Current implementation of "PPB_OpenGLES2;1.0" in FreshPlayerPlugin is synchronous, and in-process. It could be those extensions help when PepperFlash is sandboxed in another process and every call requires passing data between processes. Probably, command buffering should help performance, but I didn't look into that.

@woutervanh
Copy link
Author

woutervanh commented Dec 19, 2017 via email

@i-rinat
Copy link
Owner

i-rinat commented Dec 20, 2017

perf top output tends to underestimate time spent in a various modules because multiple entries could be related to a single module. So having imx_drv.so is at the top means a lot of time is spent in neon_memcpy function. Two next entries are related to copying between user space and kernel space. I can guess that some non-optimized code path is triggered in video driver. Perhaps, it doesn't like XCopyArea() or something like that.

I've never had an experience with that particular driver or any ARM platform at all. However, I've once tried to run freshplayerplugin on Atom N270 with 945GSE chipset. Mesa reported OpenGL 2.0 supported there, but since there were no fragment shaders support in hardware, they were emulated on CPU. It was very CPU-consuming and sluggish. It wasn't exactly like your case, since perf top immediately showed shader emulation code at the top of the report. But somehow I feel there is something similar.

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

No branches or pull requests

2 participants