Error when running firefox with MOZ_X11_EGL=1 on linux raspberry pi 4b (EGL falls back from OGL 2.1 to GLES 3.1)
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
People
(Reporter: sk.griffinix, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: nightly-community)
Attachments
(1 file, 4 obsolete files)
18.66 KB,
text/plain
|
Details |
User Agent: Mozilla/5.0 (X11; Linux aarch64; rv:80.0) Gecko/20100101 Firefox/80.0
Steps to reproduce:
Trying to get hardware accelerated video on raspberry pi in firefox (which is essentially needed as playback stutters a lot with software decoding).
- Run 'MOZ_X11_EGL=1 firefox' in terminal
Actual results:
Following error is displayed:
"Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to create EGLContext!: 0x3009 (t=2.15434) [GFX1-]: Failed to create EGLContext!: 0x3009"
Also firefox window has visual artifacts and video playback shows error:
"Failed to create scanout resource.
drmPrimeFDToHandle() failed: Cannot allocate memory"
Expected results:
Firefox should launch properly without visual artifacts
Comment hidden (obsolete) |
Updated•4 years ago
|
I am not able to replicate the issue. I've tried on: 18.04.3 LTS , it may be specific for linux raspberry pi.
I did not mention that I had webrender enabled and was also using media.ffvpx.enabled as false. Webrender needs to be enabled for hardware video acceleration to work.
Can you try this on the latest version of nightly. You can download it from here: https://nightly.mozilla.org/
I don't think there is option to download aarch64 builds for linux from this page. I thought most distros complied their own versions of firefox for use in arm devices. In my case, I am using one from arch
Comment 3•4 years ago
•
|
||
Please open about:support in Firefox on Raspi, click on "copy text to clipboard" and paste it here.
I don't think DMABUF works on raspi. VAAPI hardware video decoding definitely not.
EGL works, but requires GLES 3.1. 3.0 is not enough for WebRender. Therfore, only the previous "OpenGL" compositor worked on my 3b+.
(This weekend I tested Nightly on my Raspi 3b+ using the new Aarch64 raspbian image (bug 1661946).)
Sorry for multiple entries. Page was showing an error message but apparently uploading the attachment
(This weekend I tested Nightly on my Raspi 3b+ using the new Aarch64 raspbian image (bug 1661946).)
How does one install nightly? Do I have to build it from source each time?
Comment 10•4 years ago
|
||
Thanks!
- Can you disable media.ffmpeg.vaapi.enabled, widget.dmabuf-webgl.enabled (this one is enabled by default) and any other dmabuf pref you might have enabled, restart Firefox and check if that fixes the "Failed to create EGLContext!" error?
- You only need gfx.webrender.all=true (internally it means gfx.webrender.enabled + layers.acceleration.force-enabled). gfx.webrender.compositor is not supported yet (bug 1617498).
- How does Firefox perform with WebRender from your perception? Better than software rendering ("Compositing: Basic"), about the same or worse?
Comment 11•4 years ago
•
|
||
At the moment, there are no Nightlies, but you can download Arm64 Linux builds directly from Firefox' CI (bug 1661946 comment 3) which are per-push test builds (autoland) before the actual Nightlies (mozilla-central) are built. They look like Nightly, but are not part of any update channel, so you would have to download the next one manually. Just download the target.tar.bz2 linked there, if you want, it's from saturday.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Following error is displayed:
"Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to create EGLContext!: 0x3009 (t=2.15434) [GFX1-]: Failed to create EGLContext!: 0x3009"
That's EGL_BAD_MATCH. Should be fixed by Bug 1650583.
Also firefox window has visual artifacts and video playback shows error:
"Failed to create scanout resource.
drmPrimeFDToHandle() failed: Cannot allocate memory"
Let's see if Bug 1650583 fixes that. drm is not used in Firefox itself when HW acceleration is disabled (the "Failed to create EGLContext!" message).
Reporter | ||
Comment 13•4 years ago
|
||
(In reply to Darkspirit, Servo QA from comment #10)
- Can you disable media.ffmpeg.vaapi.enabled, widget.dmabuf-webgl.enabled (this one is enabled by default) and any other dmabuf pref you might have enabled, restart Firefox and check if that fixes the "Failed to create EGLContext!" error?
the above entries do not affect the error
- You only need gfx.webrender.all=true (internally it means gfx.webrender.enabled + layers.acceleration.force-enabled). gfx.webrender.compositor is not supported yet (bug 1617498).
Disabling gfx.webrender.all stops the error. Specifically gfx.webrender.enabled
- How does Firefox perform with WebRender from your perception? Better than software rendering ("Compositing: Basic"), about the same or worse?
Performance seems to take hit with webrender. It is less smooth and less snappy, and feels as if frames are being dropped in tasks such as scrolling, opening menus etc. Video when webrender and hardware video acceleration is enabled is as if a green semitransparent frame has been overlaid over the video with inverted colours, and changes in frame can be seen, but they are in no way smooth.
Reporter | ||
Comment 14•4 years ago
|
||
I tried nightly, i get
Can't find symbol 'eglGetNativeClientBufferANDROID'.
Can't find symbol 'eglQuerySurfacePointerANGLE'.
Can't find symbol 'eglCreateStreamKHR'.
Can't find symbol 'eglDestroyStreamKHR'.
Can't find symbol 'eglQueryStreamKHR'.
Can't find symbol 'eglStreamConsumerGLTextureExternalKHR'.
Can't find symbol 'eglStreamConsumerAcquireKHR'.
Can't find symbol 'eglStreamConsumerReleaseKHR'.
Can't find symbol 'eglStreamConsumerGLTextureExternalAttribsNV'.
Can't find symbol 'eglCreateStreamProducerD3DTextureANGLE'.
Can't find symbol 'eglStreamPostD3DTextureANGLE'.
[GFX1-]: Failed to create EGLContext!: 0x3009
[GFX1-]: Failed to create EGLContext!: 0x3009
[GFX1-]: Failed to create EGLContext!: 0x3009
Comment 15•4 years ago
•
|
||
(In reply to Leo_sk from comment #14)
Then I think it's harmless and the desired behavior: EGL/OGL 2.1 is not enough (bug 1474281), so it falls back to EGL/GLES 3.1 (bug 1654700):
https://www.raspberrypi.org/blog/vc4-and-v3d-opengl-drivers-for-raspberry-pi-an-update/
At present, the V3D driver exposes OpenGL ES 3.0 and OpenGL 2.1. As I mentioned above, the VideoCore VI GPU can do OpenGL ES 3.2, but it can’t do OpenGL 3.0, so future feature work will focus on OpenGL ES.
The other big piece of work we have been tackling, and that we are very excited about, is OpenGL ES 3.1, which will bring Compute Shaders to Raspberry Pi 4! Credit for this goes to Eric Anholt, who did all the implementation work before leaving
In comparison, GLX is not capable of falling back to something else, therefore I assume you can't get WebRender without MOZ_X11_EGL=1.
These "can't find symbol" errors are unrelated to Raspberry Pi.
Can you file a separate bug about Raspberry PI 4 WebRender performance? Thanks!
(In reply to Martin Stránský [:stransky] from comment #12)
Also firefox window has visual artifacts and video playback shows error:
"Failed to create scanout resource.
drmPrimeFDToHandle() failed: Cannot allocate memory"Let's see if Bug 1650583 fixes that. drm is not used in Firefox itself when HW acceleration is disabled (the "Failed to create EGLContext!" message).
WebRender is working fine according to about:support. Raspberry Pi doesn't support VAAPI.
- https://trac.ffmpeg.org/wiki/HWAccelIntro Google: "Raspi DMABUF MMAL" - It's something on top of Video4Linux (?), but it sounds like V4L2 could be used directly on Raspi4, I don't know. Let's file a new bug about hw video decoding on Raspi.
- drmPrimeFDToHandle would be used as well, but "GBM is broken right now on RPI4 v3d video drivers": https://github.com/lgsvl/meta-lgsvl-browser/commit/282c2b24b604b7ab88c1904eafb17aff75e9ccac
Comment 16•3 years ago
•
|
||
Fallback to GLES is desired behavior.
Description
•