Snaps to develop a Web kiosk on Ubuntu Core (using Wayland)

Slot                          Plug
chromium-mir-kiosk:x11        chromium-mir-kiosk:x11-plug
:account-control              -
:alsa                         -
:autopilot-introspection      -
:bluetooth-control            -
:broadcom-asic-control        -
:browser-support              chromium-mir-kiosk:browser-sandbox
:camera                       -
:classic-support              -
:core-support                 core:core-support-plug
:daemon-notify                -
:dcdbas-control               -
:docker-support               -
:dvb                          -
:firewall-control             -
:framebuffer                  -
:fuse-support                 -
:gpg-keys                     -
:gpg-public-keys              -
:gpio-memory-control          -
:greengrass-support           -
:hardware-observe             -
:hardware-random-control      -
:hardware-random-observe      -
:home                         -
:hostname-control             -
:io-ports-control             -
:joystick                     -
:kernel-module-control        -
:kubernetes-support           -
:kvm                          -
:log-observe                  -
:lxd-support                  -
:mount-observe                -
:netlink-audit                -
:netlink-connector            -
:network                      chromium-mir-kiosk,mir-kiosk-apps,nextcloud
:network-bind                 nextcloud
:network-control              -
:network-observe              -
:network-setup-control        -
:network-setup-observe        -
:opengl                       chromium-mir-kiosk,mir-kiosk,mir-kiosk-apps
:openvswitch-support          -
:physical-memory-control      -
:physical-memory-observe      -
:ppp                          -
:process-control              -
:raw-usb                      -
:removable-media              -
:shutdown                     -
:snapd-control                -
:ssh-keys                     -
:ssh-public-keys              -
:system-observe               -
:system-trace                 -
:time-control                 -
:timeserver-control           -
:timezone-control             -
:tpm                          -
:uhid                         -
mir-kiosk:mir                 mir-kiosk-apps
mir-kiosk:mir-libs-1604       mir-kiosk-apps
mir-kiosk:wayland             chromium-mir-kiosk
mir-kiosk:wayland-socket-dir  chromium-mir-kiosk
-                             chromium-mir-kiosk:camera
-                             chromium-mir-kiosk:cups-control
-                             chromium-mir-kiosk:desktop
-                             chromium-mir-kiosk:gsettings
-                             chromium-mir-kiosk:hardware-observe
-                             chromium-mir-kiosk:home
-                             chromium-mir-kiosk:mount-observe
-                             chromium-mir-kiosk:network-manager
-                             chromium-mir-kiosk:password-manager-service
-                             chromium-mir-kiosk:pulseaudio
-                             chromium-mir-kiosk:removable-media
-                             chromium-mir-kiosk:screen-inhibit-control
-                             htop:mount-observe
-                             htop:process-control
-                             htop:system-observe
-                             nextcloud:removable-media

Snap interfaces look perfect.

I only noticed this now - what GPU have you got in this box?

How do I find that information? On a desktop I would try lspci but on core it says command not found and I’m not sure of another way to report it.

Sorry for the newbie question, but is this working on ARM or only x86? (when on bare metal)

I’ve been looking for exactly this! :+1:

@dshimer Good question. Probably easiest option is using Classic, which gives you access to tools like lspci:

snap install classic --beta --devmode
sudo classic
(classic) lspci

Hey @madsrh ,
this works on the Raspberry Pi 2, which is ARM (and has MESA support). Any other devices with MESA support should just work fine.

But more generally, ARM devices typically have closed source GPU drivers, device-specific work is needed to enable it. Chromium may work by falling back to software rendering however, but it’ll be noticeably slower.

Contact us if you need help with enabling full GPU acceleration for web kiosks on specific ARM hardware.
-G

1 Like

from hwinfo

09: PCI 02.0: 0300 VGA compatible controller (VGA)
  [Created at pci.366]
  Unique ID: _Znp.KZeR2ZfJCB4
  SysFS ID: /devices/pci0000:00/0000:00:02.0
  SysFS BusID: 0000:00:02.0
  Hardware Class: graphics card
  Model: "Intel G33"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x29c2 "G33"
  SubVendor: pci 0x1028 "Dell"
  SubDevice: pci 0x0220 
  Revision: 0x0a
  Driver: "i915"
  Driver Modules: "drm"
  Memory Range: 0xdfe00000-0xdfe7ffff (rw,non-prefetchable)
  I/O Ports: 0xecd8-0xecdf (rw)
  Memory Range: 0xc0000000-0xcfffffff (ro,non-prefetchable)
  Memory Range: 0xdff00000-0xdfffffff (rw,non-prefetchable)
  IRQ: 26 (578778 events)
  I/O Port: 0x00 (rw)
  Module Alias: "pci:v00008086d000029C2sv00001028sd00000220bc03sc00i00"
  Driver Info #0:
    XFree86 v4 Server Module: intel
  Driver Info #1:
    XFree86 v4 Server Module: intel
    3D Support: yes
    Extensions: dri
  Config Status: cfg=new, avail=yes, need=no, active=unknown

10: PCI 02.1: 0380 Display controller
  [Created at pci.366]
  Unique ID: ruGf.r++3yOyzTo9
  SysFS ID: /devices/pci0000:00/0000:00:02.1
  SysFS BusID: 0000:00:02.1
  Hardware Class: graphics card
  Model: "Intel 82G33/G31 Express Integrated Graphics Controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x29c3 "82G33/G31 Express Integrated Graphics Controller"
  SubVendor: pci 0x1028 "Dell"
  SubDevice: pci 0x0220 
  Revision: 0x0a
  Memory Range: 0xdfe80000-0xdfefffff (rw,non-prefetchable)
  Module Alias: "pci:v00008086d000029C3sv00001028sd00000220bc03sc80i00"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

Primary display adapter: #9

In this particular case it is x86. Just playing with some old hardware and experimenting with core at the same time. At some point I will play around with a Pi3 but this box was near to hand and I liked it because it had decent size disk and I wanted to test Nextcloud as well.

Model: 6.15.13 "Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz"

I was hoping to put this on my Raspberry Pi 3

Thanks for the reply :smiley:

@dshimer nice work, so you’re using the “i915” driver. Unfortunately it’s a bit on the old side.

I’m not certain about this, but I see reports that MESA for i915 either is missing or has incomplete support for OpenGL2.1.

To find this out for sure, please try a snap I use for debugging these kind of issues. Please visit
https://code.launchpad.net/~gerboland/+snap/glxgears
and download the snap corresponding to your architecture. Install with

snap install ./glxgears_0.1_amd64.snap --dangerous

Connect requires slot/plug:

snap connect glxgears:wayland-socket-dir mir-kiosk:wayland-socket-dir

Now see what version of OpenGL it reports with:

sudo snap run glxgears.glxinfo | grep “OpenGL version”

But even if it reports OpenGL 2.1, I am suspicious! I did find in the past that some essential parts of 2.1 were actually missing from the i915 MESA implementation, and in actuality only 1.4 was really there. Glamor may be similarly fussy, meaning Xwayland won’t work with OpenGL, and chromium will fail as a result.
-G

Will do. Note that the mir-kiosk-apps run fine. Are they less cumbersome than chromium would be in this case?

sudo snap run glxgears.glxinfo | grep “OpenGL version”

grep: version”: No such file or directory
glamor: EGL version 1.4 (DRI2):
Require OpenGL version 2.1 or later.
Failed to initialize glamor
Failed to initialize glamor, falling back to sw
Fontconfig error: Cannot load default config file
Fontconfig error: Cannot load default config file

@dshimer short answer: yes, because they’re simple.

Long answer: Chromium currently does not have Wayland support. To make it work on top of Mir (a Wayland server), we use an intermediary X11 server called Xwayland, that translates all X11 calls to Wayland.

Xwayland appears to require a minimum GL version of 2.1 to function. Which is a pity as Chromium can actually operate with older GL versions (works on GL1.4 at least) on plain X11, or even fall back to pure software rendering (no GPU at all, uses CPU only).

Most of the mir-kiosk-apps are quite simple, they either don’t use GL at all (render with pure software), or they operate fine with a low version of OpelGL, so they have no problem.

I expect it would be possible to get your setup working with Chromium, but would require tweaking the snap to force Xwayland and chromium to use software rendering only. But then I’m not sure how pleasant an experience you’d end up with, rendering might be slow and jerky. Only way to tell is to try…
-G

1 Like

Damn, my debug snap doesn’t work on your hardware either :frowning:

/me running low on ideas. I’ll have to ponder

Well I’ll just hang out as a specific use case that may in fact be useless. I’m willing to try anything that would help, even if it just means just failing gracefully with enough information to say it can’t be done on hardware of this spec.

I’ve an old laptop around that IIRC uses i915 (on 16.04 desktop). There are some drm bugs I worked around getting Mir working right (but stuff was showing on screen). If I get time later I can experiment with using the snaps on this hardware. It wouldn’t be surprising if Xwayland is too fussy.

I have a raspberry pie 3. Would like some help to make it work on the device. So, far I have done the tutorial with the vm and it works. But it says failed to start Service for snap mir-kiosk on raspberry pie 3. Here is the snap shot of journalctl.

image

Something went really wrong with the wrapping there, could you paste the journal output into some pastebin service?

I can just about make out the string “cannot find platform” - can I ask if you followed:
https://developer.ubuntu.com/core/get-started/raspberry-pi-2-3
and did you choose the stable or edge image?
-G

Got around to this:

  1. the mir-kiosk snap starts (but the cursor is broken due to a drm bug)
  2. chromium-mir-kiosk starts, but then it and/or miral-kiosk hangs

It is hardware from about 15 years ago, so diagnosing this failure is low on my priorities at the moment.