[SOLVED] Bringing WPE to the Raspberry Pi 3

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

[SOLVED] Bringing WPE to the Raspberry Pi 3

Postby WebReflection » Tue Mar 05, 2019 1:19 pm

Hello there!

Me and Adrian Perez de Castro are trying to bring a pre built WPE, the Web Platform for Embedded, to AUR.

In case you are curious to know more about it, WPE is a 100% Hardware Accelerated version of Webkit2 that pulverizes any other browser engine for the Raspberry Pi 3 / 3+, making a Web kiosk experience based on ArchLinux ARM and RPi3 a reality never seen before.

Both packages libwpe and wpebackend-fdo has been recently flagged, and tested, as AArch64 compatible, but it won't make any sense to build from scratch Webkit2 on a Raspberry Pi.

Accordingly, we'd like to know how to build from ArchLinux something targeting the Raspberry Pi 3 and AArch64, including dependencies such libwpe, wpebackend-fdo, and also their sub dependencies like mesa, libxkbcommon, Wayland, and others, in a similar way WebKit2GTK package is built.

We have all the working pieces, and I have a powerful ArchLinux PC that can't wait to build WPE and publish it, but while I've previously published in AUR, I've no idea how to configure everything else.

Thanks in advance for any sort of hint, link, or help!
Last edited by WebReflection on Thu Mar 21, 2019 1:42 pm, edited 1 time in total.
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: Help for bringing WPE to the Raspberry Pi 3

Postby WebReflection » Wed Mar 06, 2019 6:20 pm

Plot twist: I'm basically using
Code: Select all
arch-chroot pi3-sdcard /bin/bash
after having copied
Code: Select all
cp /usr/bin/qemu-aarch64-static pi3-sdcard/usr/bin
, and that's basically it.

Dependencies needed for this:

  • qemu-user-static
  • binfmt-qemu-static

Now

Let's imagine I can create the _build folder after building wpewebkit, am I correct in thinking that's all it's needed to have a distributable AUR package?

Thanks.
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: Help for bringing WPE to the Raspberry Pi 3

Postby WebReflection » Mon Mar 18, 2019 11:37 am

So, thanks to this CDD (as in Crickets Driven Development) I've managed to answer all my questions.

I've explained how I've setup my machine: https://gist.github.com/WebReflection/f ... d6d16565aa

And I've created via current AUR wpewebkit package the one built for aarch64 (it shouldn't be RPi3 specific).

You can try it directly via:

Code: Select all
$ curl -LO archibold.io/releases/wpewebkit-aarch64-2.22.5.pkg.tar.xz
$ sudo pacman -U wpewebkit-aarch64-2.22.5.pkg.tar.xz


And top launch it you need the cog package too, and Weston.

Code: Select all
WAYLAND_DISPLAY=wpe cog -P fdo https://duckduckgo.com


However ...

I'd love to have such build directly in AUR, but I am not 100% sure if I can recycle that pkg tar through a better PKGBUILD that installs it and marks it as provides=(wpewebkit) conflicts=(wpewebkit), plus I've read in the AUR that pre-packaged/built stuff is not too welcome, but the whole point of this effort is to bring something hardly possible to built from scratch on a RPi3 (my PC has 12 cores and 16 GB of RAM and it took 2.5 hours to build this via qemu-aarch64-static)

Is anyone in here willing to help with this last step or should I keep doing CDD ? :D
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: Help for bringing WPE to the Raspberry Pi 3

Postby WebReflection » Wed Mar 20, 2019 12:56 pm

So ... wpewebkit-aarch64 landed on AUR \o/

My only concern at this point is if it makes sense to grab the tar source to extract it and re-compress it, but I wouldn't know how to install directly from such tar instead of using the `cp` command in the `package()`.

Anyway, you can install it right away, install also `wpebackend-fdo` and try to install `cog` as well, hoping the pgp key signature will be fixed soon.

At that point you can start Weston as previously mentioned.

I'll keep this open in case anybody has hints on how to speed up installation (re-packaging 64MB of WebKit takes a little while on a Pi3) otherwise I'll close this as resolved.

Special thanks to all crickets :D
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: Help for bringing WPE to the Raspberry Pi 3

Postby WebReflection » Thu Mar 21, 2019 1:41 pm

Final Update

In order to have also 2D canvas acceleration, I had to pre-build another package, called cairo-glesv2-aarch64, to enable GLESv2 HW Acceleration.

That, plus a re-built wpewebkit-gl, with cairo-gl enabled, made it possible to see this demo at more than 30FPS, while this WebGL demo goes smoothly enough at 25FPS.

Code: Select all
yay -S cairo-glesv2-aarch64 wpewebkit-gl


All measurements have been made at 720p on a Raspberry Pi 3 via ArchLinuxARM on aarch64.
No specific RPi3 kernel/library has been used to build these two packages, so that theoretically (but I haven't tried it yet) these should run on any SBC with libgl and Hardware Acceleration.

The WPE has been run through Weston and XWayland, in order to use xrandr and force that 720p resolution, since at 1080p things are not as fast (at least not full screen canvas demoes).

Adding gst plugins made it possible to see Youtube videos at full screen, and with audio over HDMI (first time I hear my Pi3 saying anything through that port).

The missing piece is cog which has some outdated key, so it requires manual installation via cog-git, and after editing dependencies, since trust me, you don't want to build wpewebkit on any ARM SBC out there, unless you have infinite time to waste for that, hoping no errors would ever occur (built in over 2.5 hours on a Ryzen 2600 with 16GB DDR4).

If they don't solve the cog situation soon, I might end up creating cog-aarch64 too, but I hope that won't be necessary.

I will close this as there's pretty much nothing else I need (unless someone knows how to speedup wpewebkit installation), but happy to answer questions, if any.

TL;DR we finally have the best Web Kiosk experience ArchLinuxARM and a Raspberry Pi 3, or even others SBCs, could possibly offer \o/
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: [SOLVED] Bringing WPE to the Raspberry Pi 3

Postby WebReflection » Thu Mar 21, 2019 3:51 pm

Since I've provided a full walk through in the wpewebkit ML, I'll leave it for documentation sake in here too.

Code: Select all
# from alarm user, go root (default pass is root)
su

# update all the things
pacman-key --init
pacman-key --populate archlinuxarm
pacman -Syu

# get out from root
exit

# install sudo if you don't have already
bash <(curl -s archibold.io/install/sudo)

# install utility to deal with AUR
bash <(curl -s archibold.io/install/yay)

# install my pre-built packages
yay -S --needed --noconfirm cairo-glesv2-aarch64 wpewebkit-gl-aarch64

# install other stuff
yay -S --needed --noconfirm wpebackend-fdo weston

# install codecs for videos and stuff (note, there's also non FOSS in this list)
yay -S --needed --noconfirm gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad gstreamer-vaapi gst-libav

# try to build cog (avoid no confirm flag in case it asks to import keys)
yay -S --needed cog

# if above fails, deal with cog
yay -S --needed --noconfirm git
git clone https://aur.archlinux.org/cog
cd cog-git

# edit the PKGBUILD file and remove the following:
validpgpkeys=('5AA3BC334FD7E3369E7C77B291C559DBE4C9123B')

# build the package
makepkg -Asfc --needed --noconfirm

# install it (needs whole name, press tab, instead of *, to have it)
yay -U cog-git*

# create a launcher
echo '#!/usr/bin/env bash
WEB_PAGE=https://duckduckgo.com
WAYLAND_DISPLAY=wpe COG_PLATFORM_FDO_VIEW_FULLSCREEN=1 cog -P fdo $WEB_PAGE
'>~/wpe

# make it executable
chmod a+x ~/wpe

# prepare Weston
mkdir -p ~/.config
echo '[core]
idle-time=0

[shell]
client=/home/alarm/wpe
animation=none
locking=false
'>~/.config/weston.ini

# that's it


Now you can launch, as example, via:

Code: Select all
weston --socket=wpe --width=1280 --height=720


If you want to force another full-screen resolution, I've used XWayland for that ... and here the extra instructions:

Code: Select all
# install stuff
yay -S --needed --noconfirm xorg-server xorg-xinit xorg-xset xorg-xrandr

# prepare Xorg
echo 'xset s off -dpms
xrandr -s 1280x720
weston --socket=wpe --width=1280 --height=720'>~/.xinitrc


You also need to add xwayland=true inside ~/.config/weston.ini file, under [core] or after idle-time=0, or you can try passing the flag directly when you launch Weston in .xinitrc as in:

Code: Select all
weston --socket=wpe --xwayland --width=1280 --height=720


I haven't tried last but IIRC it should be the same.

Try XWayland typing startx, and that's it.

I hope it worked, I hope it helped. If it did, you just need to either create a systemd entry to start Weston or /usr/bin/startx automatically, or you can have automatic login and an entry in the ~/.bashrc file to run startx right away on login.

Regards.
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: [SOLVED] Bringing WPE to the Raspberry Pi 3

Postby WebReflection » Fri Mar 22, 2019 12:31 pm

So, I like automations but having conflicts with dependencies is not super simple to handle.

I had to re-package cog as cog-wpe-gl so it doesn't bother trying to rebuild wpewebkit from the scratch.

To install all packages you can simply:

Code: Select all
bash <(curl -s archibold.io/kiosk/utils/wpe-aarch64)


the content of the file is here.

If you want to install everything from scratch with one command, and low-to-little interaction (unfortunately mandatory), I've prepared a s script that does all the things for you:

Boot and login as root, type this:

Code: Select all
bash <(curl -s archibold.io/kiosk/wpe)


Follow the instructions (it will ask you from time to time to add some root or alarm password)

If everything goes fine, at the end of the script it should reboot into full screen 720p kiosk on a local page showing the IP add and info.

You can then ssh alarm@192.168.1.111 (or whatever address it shows) and change the initial page from that point on, to anything else you like.

You can change / try other demoes using a different page in /home/alarm/wpe, there are few examples there to test youtube, canvas 2d acceleration, CSS acceleration, canvas 3D (WebGL).

If you are into NodeJS you can follow these instructions:
https://medium.com/@WebReflection/nodej ... 6283f5be16

Have fun !
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: [SOLVED] Bringing WPE to the Raspberry Pi 3

Postby StuartIanNaylor » Fri May 03, 2019 12:48 am

bash <(curl -s archibold.io/kiosk/wpe)

fails with cog-wple-gl its not to do with kernel 5.x is it as my Pi seems to be throwing a wobbler and has a loadavg of 4 when idle?

I will try again on the step by step as prob me, but struggling with the automated scripts.
StuartIanNaylor
 
Posts: 11
Joined: Sun Apr 21, 2019 6:31 am


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 5 guests

cron