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

Snap on Ubuntu RPi3 fails to render on Wayland #39

Open
AlanGriffiths opened this issue Mar 18, 2021 · 2 comments
Open

Snap on Ubuntu RPi3 fails to render on Wayland #39

AlanGriffiths opened this issue Mar 18, 2021 · 2 comments

Comments

@AlanGriffiths
Copy link

This can be reproduced on Ubuntu Core 20 and Ubuntu Server 20.04

Steps to Reproduce

On desktop

With the demo app and the snapcraft YAML below:

snapcraft remote-build --launchpad-accept-public-upload
scp super-cool-app_0.1.0_arm64.snap <the RPi>:~

on the RPi

If you are reproducing on Ubuntu Server, you need to add kms support. E.g.

sudo echo "dtoverlay=vc4-kms-v3d" >> /boot/firmware/usercfg.txt
sudo reboot
sudo snap install mir-kiosk
sudo snap set mir-kiosk daemon=true # not needed on Core
unsquashfs -d super-cool-app_0.1.0_arm64 super-cool-app_0.1.0_arm64.snap
sudo snap try super-cool-app_0.1.0_arm64
sudo snap set super-cool-app daemon=true # not needed on Core

Expected results: The demo displays correctly
Actual results: Only the decorations display

Additional details:

Something goes wrong using the vc4_dri.so driver on ARM64/RPi3

There's a relevant log line:

2021-03-17T17:00:41Z -[16793]: Failed to start Flutter renderer: Unable to create a GL context

Logs can be accessed with:

sudo snap logs super-cool-app

Additional logging can be obtained by editing super-cool-app_0.1.0_arm64/bin/wayland-launch and adding export EGL_LOG_LEVEL=debug before the final exec command.

The problem can be hidden by adding export LIBGL_ALWAYS_SOFTWARE=true in the same place.

snapcraft.yaml
name: super-cool-app
version: 0.1.0
summary: Super Cool App
description: Super Cool App that does everything!

architectures:
  - build-on: amd64
  - build-on: arm64

confinement: strict
base: core18
grade: stable

apps:
  daemon:
    daemon: simple
    restart-condition: always
    command-chain:
      - bin/run-daemon
      - bin/wayland-launch
    command: bin/flutterdemo
    extensions: [flutter-master] # Where "master" defines which Flutter channel to use for the build

  super-cool-app:
    command-chain:
      - bin/wayland-launch
    command: flutterdemo
    extensions: [flutter-master] # Where "master" defines which Flutter channel to use for the build

parts:
  super-cool-app:
    plugin: flutter
    source: flutterdemo
    flutter-target: lib/main.dart # The main entry-point file of the application

  mir-kiosk-snap-launch:
    plugin: dump
    source: https://github.com/MirServer/mir-kiosk-snap-launch.git
    override-build:  $SNAPCRAFT_PART_BUILD/build-with-plugs.sh opengl pulseaudio wayland
    stage-packages:
      - inotify-tools

  assets:
    plugin: nil
    stage-packages:
      - dmz-cursor-theme
      - fonts-dejavu
      - fonts-freefont-ttf
      - fonts-ubuntu

layout:
  /usr/share/fonts:
    bind: $SNAP/usr/share/fonts
  /etc/fonts:
    bind: $SNAP/etc/fonts
  /usr/share/icons:
    bind: $SNAP/usr/share/icons
@christiancfifi
Copy link

flutter/flutter#76178 (comment)
I had this problem also, and I think it is caused by a small issue that we were looking into on the flutter engine github ^

In env.sh LIBGL_DRIVERS_PATH is set to /usr/... instead of $SNAP/usr/...

@MarcusTomlinson MarcusTomlinson changed the title Snap on Ubuntu RPi3 fails to render Snap on Ubuntu RPi3 fails to render on Wayland Apr 13, 2021
@MarcusTomlinson
Copy link
Contributor

flutter/flutter#76178 (comment)
I had this problem also, and I think it is caused by a small issue that we were looking into on the flutter engine github ^

In env.sh LIBGL_DRIVERS_PATH is set to /usr/... instead of $SNAP/usr/...

This issue is Wayland-specific. I've commented on the linked bug though.

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

3 participants