Core20 command format

Back with base18 using yaml from here electron/snapcraft.md at v12.0.8 · electron/electron · GitHub .

The snap builds but when i run it on rpi 4 8gb ram i get

sudo snap run kiosk.daemon
Warning: Schema “org.gnome.system.locale” has path “/system/locale/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy” has path “/system/proxy/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.http” has path “/system/proxy/http/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.https” has path “/system/proxy/https/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.ftp” has path “/system/proxy/ftp/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.socks” has path “/system/proxy/socks/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
drmPrimeFDToHandle() failed: Cannot allocate memory
Failed to create scanout resource.
drmPrimeFDToHandle() failed: Cannot allocate memory
Failed to create scanout resource.
drmPrimeFDToHandle() failed: Cannot allocate memory
Failed to create scanout resource.
drmPrimeFDToHandle() failed: Cannot allocate memory
Failed to create scanout resource.

My rpi usrcfg.txt is:

# Place "config.txt" changes (dtparam, dtoverlay, disable_overscan, etc.) in
# this file. Please refer to the README file for a description of the various
# configuration files on the boot partition.

dtoverlay=vc4-fkms-v3d

Any thoughts?

EDIT

This is the jornal log:

Jun 26 07:38:40 ubuntu sudo[3712]: pam_unix(sudo:session): session closed for user root
Jun 26 07:38:40 ubuntu mir-kiosk.daemon[2150]: error in client communication (pid 3860)
Jun 26 07:38:40 ubuntu mir-kiosk.daemon[2150]: Failed to create scanout resource.
Jun 26 07:38:40 ubuntu mir-kiosk.daemon[2150]: drmPrimeFDToHandle() failed: Cannot allocate memory
Jun 26 07:38:40 ubuntu kernel: vc4-drm gpu: swiotlb buffer is full (sz: 966656 bytes), total 32768 (slots), used 273 (slots)
Jun 26 07:38:40 ubuntu kernel: vc4-drm gpu: swiotlb buffer is full (sz: 819200 bytes), total 32768 (slots), used 381 (slots)
Jun 26 07:38:40 ubuntu kernel: ---[ end trace 9b02a72a458b10e0 ]---
Jun 26 07:38:40 ubuntu kernel:  el0_svc+0x10/0x2d4
Jun 26 07:38:40 ubuntu kernel:  el0_svc_handler+0x38/0xa0
Jun 26 07:38:40 ubuntu kernel:  el0_svc_common.constprop.0+0x84/0x218
Jun 26 07:38:40 ubuntu kernel:  __arm64_sys_ioctl+0x2c/0xa0
Jun 26 07:38:40 ubuntu kernel:  ksys_ioctl+0x88/0xb8
Jun 26 07:38:40 ubuntu kernel:  do_vfs_ioctl+0x96c/0xb68
Jun 26 07:38:40 ubuntu kernel:  drm_ioctl+0x1e4/0x448 [drm]
Jun 26 07:38:40 ubuntu kernel:  drm_ioctl_kernel+0xcc/0x120 [drm]
Jun 26 07:38:40 ubuntu kernel:  drm_prime_fd_to_handle_ioctl+0x48/0x60 [drm]
Jun 26 07:38:40 ubuntu kernel:  drm_gem_prime_fd_to_handle+0x1c4/0x1e8 [drm]
Jun 26 07:38:40 ubuntu kernel:  drm_gem_prime_import_dev+0x8c/0x148 [drm]
Jun 26 07:38:40 ubuntu kernel:  dma_buf_map_attachment+0x68/0xb8
Jun 26 07:38:40 ubuntu kernel:  drm_gem_map_dma_buf+0xfc/0x128 [drm]
Jun 26 07:38:40 ubuntu kernel:  dma_direct_map_sg+0x84/0xe8
Jun 26 07:38:40 ubuntu kernel:  dma_direct_map_page+0x14c/0x168
Jun 26 07:38:40 ubuntu kernel:  report_addr+0x4c/0xb8
Jun 26 07:38:40 ubuntu kernel: Call trace:
Jun 26 07:38:40 ubuntu kernel: x1 : 0000000000000000 x0 : 0000000000000000
Jun 26 07:38:40 ubuntu kernel: x3 : 0000000000000000 x2 : 0000000000000000
Jun 26 07:38:40 ubuntu kernel: x5 : 0000000000000000 x4 : 0000000000000000
Jun 26 07:38:40 ubuntu kernel: x7 : 0000000000000000 x6 : 0000000000000000
Jun 26 07:38:40 ubuntu kernel: x9 : ffffd96661948000 x8 : ffffd966608d86e8
Jun 26 07:38:40 ubuntu kernel: x11: 4420666f20363536 x10: 3636392b30303034
Jun 26 07:38:40 ubuntu kernel: x13: 6666666666666666 x12: 206b73616d20414d
Jun 26 07:38:40 ubuntu kernel: x15: ffff2c42d5120530 x14: 6d696c2073756220
Jun 26 07:38:40 ubuntu kernel: x17: 0000000000000000 x16: ffffd96660384d10
Jun 26 07:38:40 ubuntu kernel: x19: ffff2c433553ec10 x18: 0000000000000010
Jun 26 07:38:40 ubuntu kernel: x21: 00000000000ec000 x20: 00000000000ec000
Jun 26 07:38:40 ubuntu kernel: x23: 0000000000000000 x22: 0000000000000020
Jun 26 07:38:40 ubuntu kernel: x25: 0000000000000000 x24: ffff2c42d5120000
Jun 26 07:38:40 ubuntu kernel: x27: 000000000000000c x26: ffff2c42f7406c00
Jun 26 07:38:40 ubuntu kernel: x29: ffff800013bfba10 x28: ffff800013bfbce8
Jun 26 07:38:40 ubuntu kernel: sp : ffff800013bfba10
Jun 26 07:38:40 ubuntu kernel: lr : report_addr+0xb4/0xb8
Jun 26 07:38:40 ubuntu kernel: pc : report_addr+0x4c/0xb8
Jun 26 07:38:40 ubuntu kernel: pstate: 60400005 (nZCv daif +PAN -UAO)
Jun 26 07:38:40 ubuntu kernel: Hardware name: Raspberry Pi 4 Model B Rev 1.4 (DT)
Jun 26 07:38:40 ubuntu kernel: CPU: 3 PID: 3888 Comm: kiosk Tainted: P         C OE     5.4.0-1038-raspi #41-Ubuntu
Jun 26 07:38:40 ubuntu kernel:  syscopyarea sysfillrect sysimgblt fb_sys_fops drm crct10dif_ce snd_soc_core spidev snd_compress ac97_bus snd_pcm_dmaengine snd_pcm snd_timer snd phy_generic aes_neon_bs aes_neon_blk crypto_>
Jun 26 07:38:40 ubuntu kernel: Modules linked in: binfmt_misc veth nft_masq nft_chain_nat bridge stp llc zfs(PO) zunicode(PO) zlua(PO) zcommon(PO) znvpair(PO) zavl(PO) icp(PO) spl(O) ebtable_filter ebtables ip6table_raw i>
Jun 26 07:38:40 ubuntu kernel: WARNING: CPU: 3 PID: 3888 at kernel/dma/direct.c:34 report_addr+0x4c/0xb8
Jun 26 07:38:40 ubuntu kernel: ------------[ cut here ]------------
Jun 26 07:38:40 ubuntu kernel: vc4-drm gpu: overflow 0x0000000249f14000+966656 of DMA mask ffffffff bus limit ffffffff
Jun 26 07:38:40 ubuntu kernel: vc4-drm gpu: swiotlb buffer is full (sz: 966656 bytes), total 32768 (slots), used 273 (slots)
Jun 26 07:38:34 ubuntu kernel: audit: type=1326 audit(1624693114.409:100): auid=1000 uid=0 gid=0 ses=1 pid=3860 comm=64636F6E6620776F726B6572 exe="/snap/kiosk/x14/main/kiosk" sig=0 arch=c00000b7 syscall=274 compat=0 ip=0x>
Jun 26 07:38:34 ubuntu kernel: kauditd_printk_skb: 34 callbacks suppressed
Jun 26 07:38:34 ubuntu audit[3860]: SECCOMP auid=1000 uid=0 gid=0 ses=1 pid=3860 comm=64636F6E6620776F726B6572 exe="/snap/kiosk/x14/main/kiosk" sig=0 arch=c00000b7 syscall=274 compat=0 ip=0xffff8d9fe404 code=0x50000
Jun 26 07:38:19 ubuntu systemd[1]: tmp-snap.rootfs_s3BhlY.mount: Succeeded.

I have build the snap from here: Snapcraft Guide (Ubuntu Software Center & More) | Electron (electronjs.org) with electron quick start.

When running the snap on RPI4 with Ubuntu 20.04 arm64 it gives “Segmentation fault”.

where and how have you built it ? on the Pi itself ?

Yes, like here: Building snap packages on Ubuntu Core | Ogra’s blog (wordpress.com)

I could attach the snap file, but i can’t see any attach option.

i have admittedly not tried it in a while but you could try using:

I don’t understand what is the purpose of xwayland-kiosk-launch if on their official docs it’s without. How it works for them? Or is this RPI specific?

what exactly are you trying to build, a standalone kiosk app or a desktop app ? the tutorial you linked builds a normal desktop app in various ways and should work for that purpose …

A standalone kiosk app. I need to “output” (so to say) electronjs window to mir-kiosk.

On rpi 3 b+ i used this command but the performance when i play in electronjs window a mp4 movie is low.

command: desktop-launch xwayland-kiosk-launch "$SNAP/main/kiosk" "--no-sandbox"

I expected better performance on rpi 4 because of the hardware, but it’s actually worse.

electron (being chromium based) does not/can not make use of hardware acceleration for video playback of the Pi.

note that accelerated GLES and accelerated video playback are two completely separate things provided by different parts of the GPU and different libraries. while the GLES acceleration for drawing on screen is fully implemented, decoding video is not and would require a good amount of patching.

i think @tobias has added some Pi video playback support to the wpe-webkit-mir-kiosk snap, perhaps you’d be better off snapping your app as plain nodejs app to serve your files from localhost and use that kiosk browser snap as UI frontend …

I can’t use wpe-webkit-mir-kiosk, i need access to serial ports.

well, your app needs to access serial ports, so in the scenario i described above nodejs would need it, not the browser dispaying the web page …

that will need a good refactoring but i’ll consider it.

better test mp4 video playback in wpe-webkit-mir-kiosk first though (with a simple index.html or so), to make sure it actually accelerates video decoding :slight_smile:

1 Like

exactly my thoughts. thanks!

1 Like

I have build a snap and showing a hello world index.html with wpe.

Loaded youtube and 1080p videos are looking very good.

The only problem is that the video tag does not work, it doesn’t load the video, showing white space.

I see here Having issues with video load (#20) · Issues · glancr / WPE WebKit Mir Kiosk snap · GitLab that it made a fix in stable/2.30.5

When i try to update my snap it says it’s the latest. Why?

ubuntu@ubuntu:~$ snap list
Name                  Version        Rev    Tracking       Publisher   Notes
core18                20210611       2073   latest/stable  canonical✓  base
core20                20210429       1030   latest/stable  canonical✓  base
kiosk                 1.0.0          x5     -              -           -
lxd                   4.0.6          20330  4.0/stable/…   canonical✓  -
mir-kiosk             2.4.0-snap124  7120   latest/stable  canonical✓  -
snapd                 2.51           12164  latest/stable  canonical✓  snapd
wpe-webkit-mir-kiosk  2.26.4         45     latest/stable  glancr      -

ubuntu@ubuntu:~$ sudo snap refresh wpe-webkit-mir-kiosk
snap "wpe-webkit-mir-kiosk" has no updates available

checking https://snapcraft.io/wpe-webkit-mir-kiosk with the little pulldown menu next to the install button, it seems that only armhf and amd64 have 2.30.5 yet, seems arm64 was not yet updated …

1 Like

Thank you! I asked now if it will be available on arm64 : Having issues with video load (#20) · Issues · glancr / WPE WebKit Mir Kiosk snap · GitLab .

I say in journalctl that videos do not play because of this error:

Jun 27 14:38:58 ubuntu wpe-webkit-mir-kiosk.daemon[7245]: AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory
Jun 27 14:38:58 ubuntu wpe-webkit-mir-kiosk.daemon[7245]: ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
Jun 27 14:38:58 ubuntu wpe-webkit-mir-kiosk.daemon[7245]: ALSA lib conf.c:4120:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
Jun 27 14:38:57 ubuntu cog[7210]: <http://camendesign.com/code/video_for_everybody/test.html> Loading...
Jun 27 14:38:57 ubuntu cog[7210]: <http://camendesign.com/code/video_for_everybody/test.html> Load started.

Could it be related with the video issue?

Is there other alternative to wpe-webkit-mir-kiosk? Just to display on a mir-kiosk a local url?

well there is electron, snap your own browser or use wpe-webkit-mir-kiosk …