Raspberry Pi 5 - WebGL issues

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Add instant cinematic glow and atmosphere to your 2D scenes.
  • I am loading a video. It plays fine on my computer, but causes other images on the screen to disappear on a Raspberry Pi 5.

    When video gets loaded on the Pi, I get the following errors:

    Video_mp4 is playing!

    c3runtime.js:1208 [Construct] WebGL context lost

    c3runtime.js:1213 [Construct] Suspending

    main.js:48 WebGL context restored

    c3runtime.js:1213 [Construct] Resuming

    c3runtime.js:1208 [Construct] WebGL context restored

    The video plays but any images that were on the screen disappears - only a grey screen remains.

    Buttons that were on the screen remain visible.

    Since all the images got destroyed when the video loads, I thought to create the images again after the context got restored, but it is now so screwed up - nothing new seems to be created.

    Video_mp4 is playing! << console message from Video_mp4 Is playing

    In Video Is playing, I create new image objects.

    When running on Raspberry Pi 5, new images are not created.

    Other notes:

    From what I've read, Raspberry Pi 5 can play MP4 H.265 video, but MP4 H.265 does not even load in Pi 4 or 5.

    I have this same context lost issue with Webm AV1, VP8 and VP9 in the Pi 5.

    Webm AV1, VP8 and VP9 loads fine the Pi 4.

    When running on my computer browser or on Raspberry Pi 4, new images are created as expected.

    MP4 H.264 video is 1MB. Same issues if I load a 250kb video.

  • I'd guess it's either running out of memory (check the project image memory usage, or try reducing the resolution of the video if it is very high), or it's a system graphics driver bug (an unfortunate but relatively common glitch that is particularly likely on Linux-based systems like Raspberry Pi). If you're confident it's not running out of memory, you might have to report it to the Raspberry Pi developers as a possible graphics driver problem. Another workaround might be to try a different codec for the video, e.g. WebM VP9 instead of MP4.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ask Claude..

    After running command line memory test >> On your 8 GB Pi, 6.7 GiB is still available, and the 5.1 GiB of swap hasn’t been touched.

    Pasted webGL chromium error >> That error is the real symptom: the WebGL context was lost, and Construct 3 then failed to create any textures because there was no context left. It means Chromium’s GPU process crashed or was reset, or the driver dropped the context. It does not mean the Pi ran out of system RAM, which fits your earlier output. So the video-to-GPU frame path is broken in this setup, and it’s the likely cause of both the choppiness and the lost context. It also fits the earlier finding that system RAM and CMA were healthy.

    The line at the very top, InitializeSandbox() called with multiple threads in process gpu-process, is logged when the GPU process starts. That suggests the GPU process had just (re)started before these errors. I can’t tell what killed the previous one from this snippet. chrome://crashes and dmesg right after a failure would show it.

    Your command line has two flags that look responsible, and I’d test them one at a time:

    Add --disable-accelerated-video-decode. I suggested this earlier for Pi 5, and your first chrome://gpu screenshot still showed Video Decode as hardware accelerated, so it wasn’t applied. It forces decoding down a simpler, more predictable path.

    Remove --enable-zero-copy. It appears in your renderer command lines. It makes Chromium use GPU-memory-buffer-backed images, and this log shows that backing failing for video frames. I can’t be certain it’s the trigger, but it’s the first thing I’d remove.

    nano ~/.config/chromium-flags.conf << this was blank

    Added flags which Claude suggested:

    --disable-gpu-memory-buffer-video-frames --disable-accelerated-video-decode --use-angle=gles --ignore-gpu-blocklist --ozone-platform=x11

    Running again - Video plays - no WebGL context lost error.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)