Jul 032013
 

That’s what we all want to see – a functioning, lightning-fast modern browser on the Raspberry Pi.

Some resources I collected on the web look pretty promising.

XWayland server

The XWayland server has already been demoed, although not released to the broad public yet. We have seen Midori (or Chromium?) and LibreOffice running on top of it. Pretty smoothly, it seems.

This SHOULD be available soon and support all “classical” X software.

The future: Webkit

The company Igalia, amongst many others, is working to allow WebKitGTK+ run on a Wayland backend.

WebKit is the base of the most modern browsers (even Opera started to use it, AFAIK. One notable exception of course is Microsoft with it’s Trident engine. I bet we will grow old to see it arrive on the Raspberry, though).

Epiphany, the default web browser of GNOME, is based on WebKit. Chromium is also based on WebKit.

Igalia has a blog, in which these two entries seem the most interesting to me:

Briefly, this post outlines why it would be a good thing to have the Core IV GPU of the Raspberry do the heavy lifting of layer-composition, instead of the CPU (which could focus on JavaScript, for instance …)

The post explains some background, has a YouTube demo video of Epiphany running under Wayland (showing off some 3D effects) and goes on to outline the current state of the work. “GTK3 is already providing a Wayland backend, WebKitGTK+ needs to use GTK3 only”.

Most notably, full screen video playback (GStreamer) and plugins may be problematic. We all can / should live without Flash by now, which will probably never get ported to GTK3. Adobe’s phasing Flash out, too. HTML5 is the way to go!

As GNOME is betting huge on Wayland, and Epiphany is its flagship browser, it is only a matter of time until Webkit-based browsers (Midori, Chromium, …) WILL be available for the Raspberry Pi.

More Information

is one of the few good collections of the current state of Wayland support. Not everything applies to the Raspberry of course, but we can “feel, see and touch the future” here. GTK+ support seems to be complete – which is quite promising for many applications. It also lists the all-important browsers. Apparently Chromium removed Wayland support?? It was added back in in a fork / patch it seems, this is already one year old.

On the Wayland mailing list it was shared, that Midori has finished preliminary support for Wayland. This is news as of the end of April 2013, and will probably take some time to come to the Raspi. Will midori be the first browser we use with Wayland?

Webkit-clutter seems to be another possible approach to Weston. (Clutter is apparently another application toolkit, an alternative to GTK+). As we all know Collabora is the company behind the Weston/Wayland software on the Pi, we may expect something from this, too. Here’s some more background info on Clutter & Webkit.

Meanwhile:

This video shows a comparison of several browsers available on the Pi. Netsurf does not run JavaScript, this is where the huge performance gains when rendering arise from. Chromium was apparently no easy task to compile for a Raspberry, but it works now – albeit quite slow. We’re not taking it for granted Winking smile

 

Gomoto’s Browser

This is an interesting light-weight WebKit-based browser. Supporting JavaScript, CSS, etc – yet the code is so short you can easily read it, modify it, and recompile it. In fact I have experimented with it tonight.

Read the following thread to obtain more information

Or go directly to Google Code Homepage of “minimal-web-browser”. Download the browser package or the source.

Installation instructions:

  • wget the omxgtk package
  • aptitude install xterm
  • dpkg –i omxgtk_0.1_rc3_armhf.deb
  • wget the web package
  • dpkg –I web_1.0-6_rc3_armhf.deb

now you can start the browser from an X session with “web”.

This browser CAN ALSO SUPPORT YOUTUBE PLAYBACK! You need to create a shell script to support this, and install youtube-dl. The author also added Radio playback.

Guenter Kreidl has built a Minimal Kiosk Browser on the base of Gomoto’s browser. Look at this Raspberry Pi forum thread to find out more. It looks quite promising, incorporating some interesting features (have a look at the README he attached to a post).

FireFox OS for Raspberry Pi

A guy called Philipp Wagner has released a FireFox-based software stack for the Raspberry Pi, which operates without using the X server! It is a mixture of Linux and OpenGL which he runs on top of.

Apparently, right now, there is no input support for mouse / keyboard, but this could be great for digital signage-class systems.

If you like his work, you can get him something nice from his Amazon wishlist Winking smile

I’ll be testing the performance of the FireFox OS after I post this, and will report back in the comments.

May 292013
 

Summary

I managed to get Weston running without compiling it from code first. Unfortunately, only the terminal was usable, X applications (midori, chromium, scratch) did not work. I spend the rest of the evening investigating, and would like to share some hints with you – information about Weston & Wayland is not easy to find.

If you want a working solution, come back in a couple of weeks – we will most probably have one for you. If you love to tinker, read on. This article will be a great starting base for exploration.

weston-on-raspberry-screenshot

Installing Weston and Wayland

The following instructions are to be executed as root:

# echo deb http://raspberrypi.collabora.com wheezy rpi >> /etc/apt/sources.list
# apt-get update
# apt-get install weston

Accept the installation without known key. (You have to expressly enter “Y” for this).

Edit your /boot/config.txt and add the following lines at the end of the file: (hint: “sudo nano /boot/config.txt “)

#Settings for Weston to work
gpu_mem=128
dispmanx_offline=1

Reboot.

Edit your /etc/weston/weston.ini

[shell]
focus-animation=dim-layer
animation=zoom

[launcher]
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
path=/usr/bin/weston-terminal

[launcher]
icon=/usr/share/icons/gnome/32x32/actions/insert-image.png
path=/usr/bin/simple-shm

[launcher]
icon=/usr/share/icons/gnome/32x32/apps/zen-icon.png
path=/usr/bin/midori

[core]
modules=xwayland.so,desktop-shell.so

The important lines are the two last ones – the launchers will unfortunately not work in my setup, as X does not work … The modules have to be loaded in EXACTLY this order – first xwayland, then desktop-shell. You also cannot omit desktop-shell – else weston will show a black screen only.

I am not sure, whether I am overriding (sensible?) defaults, as there is very little documentation on the topic as of yet.

Create a weston-starter script which will set up some variables: “ sudo nano /pi/home/weston-starter “ with the following contents:

#! /bin/bash

#export WLD="$HOME/local"
export WLD=""

export PATH="$WLD/bin:$PATH"
export LD_LIBRARY_PATH="$WLD/lib:/opt/vc/lib"
export PKG_CONFIG_PATH="$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/"
export ACLOCAL="aclocal -I $WLD/share/aclocal"
export XDG_RUNTIME_DIR="/tmp/wayland"
export XDG_CONFIG_HOME="$WLD/etc"
export XORGCONFIG="$WLD/etc/xorg-conf"

mkdir -p "$WLD/share/aclocal"
mkdir -p "$WLD/share/pkgconfig"
mkdir -p "$XDG_RUNTIME_DIR"
chmod 0700 "$XDG_RUNTIME_DIR"

#cp bcm_host.pc egl.pc glesv2.pc $WLD/share/pkgconfig/

#git clone git://anongit.freedesktop.org/wayland/wayland

weston --log=/tmp/weston.log

Again – these should very probably be adjusted, and MAY be the cause of the problem with the X-Server. I have adjusted them from a script a user used to compile weston.

The last line actually starts weston, and logs it’s output to /tmp/weston.log (normally this gets sent to the terminal, which is hidden by weston itself). Very handy to monitor from an SSH shell on a second computer.

Make it executable (chmod +x weston-starter).

 

OK. If everything goes well, you can start weston now.

pi@raspberrypi ~ $ ./weston-starter

(Be sure to start it as user pi – if you start it as root first, the temporary directory created in /tmp will not be accessible by pi. You can of course also chmod this directory to be world readable and writable /tmp/wayland )

Playing around with weston

You will be able to start multiple terminal instances, resize them and drag them around, and interact with the system via the terminals.

The second icon does not work for me. The third icon which I added to the configuration (to start Midori) neither.

Here are some nifty facts:

  • hit the Windows key to get into “expose mode”
  • hit Windows key + Tab to switch between open Windows
  • hold down Windows key and scroll the mouse to zoom into any area (this is pretty cool and pretty smooth)
  • Ctrl + Alt + Backspace terminates weston
  • Wayland has it’s own screenshot utility – it can’t be invoked from the command line, instead you have to press a shortcut (unfortunately I do not know which one). It may also be, that I disabled this screenshot utility by explicitly listing the modules to be loaded in the weston.ini

weston-zoom

Showing off the zooming feature of Weston / Wayland. This is a pretty cool, dynamic feature, to which the still picture can do no justice.

The little there is to see REALLY impressed me. It is so fluid, so fast – I was not used to this from the Raspberry Pi and GUI applications before.

X-Applications

You will NOT be able to start any X application with my instructions. I suspect, that the X-Server which is installed from the default repositories does not support wayland!

Fatal server error:
X Unrecognized option: -wayland

If you have a look at file /usr/lib/weston/xwayland.so with the text editor somewhere in the file you will see the x server being called with this –wayland option. Trying to invoke it from the command line with it will yield the error message above, but I also managed to get it out of a starting wayland server somehow.

This can be also seen in the following logexcerpt ( /tmp/weston.log which we set up in our start script )

[23:38:20.556] xserver listening on display :0
[23:38:20.557] Loading module ‘/usr/lib/weston/desktop-shell.so’
[23:38:20.560] Compositor capabilities:
               arbitrary surface rotation: no
               screen capture uses y-flip: no
[23:38:20.560] libwayland: using socket /tmp/wayland/wayland-0
[23:38:20.562] launching ‘/usr/lib/weston/weston-desktop-shell’
[23:38:24.558] forked X server, pid 4635
[23:38:24.596] libwayland: disconnect from client 0x19ad188
[23:38:24.597] xserver crashing too fast: 256

All the fun stuff (Midori, LibreOffice, Chromium, …) is unfortunately not testable …

If you try to start Midori, it will yield the following error message:

Midori - Cannot open display:

MFAQ

Mock-FAQ, as no one asked (yet).

weston-launch

There seems to be no such program on the Raspberry Pi, yet. weston-launch passes parameters to weston with the following syntax: weston-launch — –modules=xwayland.so,desktop-shell.so

Note the double double dashes. weston itself takes only single double dashes in front of modules.

man weston

A good idea if you’re stuck with any Linux command is to look at it’s manpage. Weston is no exception, it ships with one which is quite handy.

 

To be done

We need to have LibreOffice running on Raspbian hardfloat under Weston & Wayland. This probably means compiling weston & wayland, and getting a special x server compatible with them. And this in turn means setting up a crosscompiling rig.

A quote from the manpage:

XWayland requires a special X.org server to be installed. This X server will connect to a Wayland server as a Wayland client, and X clients will connect to the X server. XWayland provides backwards compatibility to X applications in a Wayland stack.

References

Optimization WordPress Plugins & Solutions by W3 EDGE