Closed Bug 1661359 Opened 4 years ago Closed 3 years ago

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)

80 Branch
ARM64
Linux
defect

Tracking

()

RESOLVED INVALID
Tracking Status
firefox80 --- disabled
firefox81 --- disabled
firefox82 --- disabled

People

(Reporter: sk.griffinix, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: nightly-community)

Attachments

(1 file, 4 obsolete files)

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).

  1. 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

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

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

Flags: needinfo?(sk.griffinix)

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).)

Blocks: raspi
Attached file anout:support (obsolete) —
Attached file trouble shooting info (obsolete) —
Attached file troubleshoot info (obsolete) —
Attached file troubleshoot info

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?

Flags: needinfo?(jan)

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?
OS: Unspecified → Linux
Hardware: Unspecified → ARM64

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.

Flags: needinfo?(jan)
Attachment #9173211 - Attachment is obsolete: true
Attachment #9173212 - Attachment is obsolete: true
Attachment #9173213 - Attachment is obsolete: true
Attachment #9173187 - Attachment is obsolete: true

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).

Priority: -- → P3

(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.

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

(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.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Error when running firefox with MOZ_X11_EGL=1 on linux raspberry pi 4b → 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)
See Also: → 1663285

Fallback to GLES is desired behavior.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: