3.9.11. Weston

Weston provides support for many displays in an extended desktop mode and the ability to drag-and-drop windows from one display to the other.

It has support for many backends. By default it will use the drm backend unless given the WAYLAND_DISPLAY environment variable. This backend will register the compositor as the controller of the KMS interface and will pick up human interface device (HID) input by using evdev.

If the WAYLAND_DISPLAY variable is present, Weston will use the wayland backend for nested composition. This is useful for development, but is normally not what you want for standard composition use. See Starting Weston manually or the upstream weston documentation for more information.

3.9.11.1. Starting Weston with Emptty

Starting with SDK 11.0, the preferred way to start Weston is with the weston user, using the display manager emptty. Emptty is a console based display manager that coordinates the loading of devices with the initialization of any specified graphical environment. By default it will automatically start weston under the weston user on device startup.

If you need to interact with this instance with any other user, then make sure that user is capable of interacting with the wayland socket. This will be wayland-1 under the weston user’s XDG_RUNTIME_DIR, /run/user/1000/. We do not recommend running graphical applications as root. See Running Weston clients for more information.

To start the systemd service manually, do the following:

# systemctl start emptty

To inspect the systemd service status, do the following:

# systemctl status emptty

3.9.11.2. Starting Weston manually

To start Weston manually with the DRM backend, do the following:

On the default display:

# weston --display=<default connector-id>

On the secondary display:

# weston --display=<secondary connector-id>

On all connected displays (LCD and HDMI):

# weston

By default, the screen saver timeout will be 300 seconds. The user can change the screen saver timeout using a command line option:

--idle-time=<number of seconds>

For example, to set timeout of 10 minutes and Weston configured to display on all connectors, use the following command:

# weston --idle-time=600

To disable the screen timeout and to configure Weston to display on all connectors, use the following command:

# weston --idle-time=0

If you face any issues with the earlier procedure, see the upstream weston documentation for troubleshooting tips.

The filesystem includes a preconfigured weston.ini file located at /etc/xdg/weston/weston.ini.

3.9.11.3. Stopping Weston

Stop all Weston clients before exiting Weston. If you have invoked Weston from the serial console, exit Weston by pressing Ctrl-C.

If Weston started automatically through the display manager, then it the following will stop it:

# systemctl stop emptty

It is also possible to start Weston from the native console, exit Weston by pressing Ctrl-Alt-Backspace.

3.9.11.4. Running Weston clients

Weston client examples can run from the command line on a serial port console or an SSH console. After launching Weston, the user should be able to use the keyboard and the mouse for various controls.

The WAYLAND_DISPLAY variable informs clients what socket they should interact with. Typically these sockets are under the XDG_RUNTIME_DIR, allowing WAYLAND_DISPLAY to be a file name. The WAYLAND_DISPLAY variable can also be a full path to the socket.

Applications stated from terminal sessions running under the Weston process will have this variable set automatically. If it is not set automatically and the process is running under the same user as Weston, then you should only have to set WAYLAND_DISPLAY to wayland-X. Here X is the session number, which should start at 1 and increment for each simultaneous instance of Weston started.

Do not set the XDG_RUNTIME_DIR variable to any other user’s runtime directory. This will cause issues with other applications. If that user can interact with another users socket, point WAYLAND_DISPLAY to the full path of the socket instead. For example WAYLAND_DISPLAY=/run/user/1000/wayland-1 allows an application to interact with user ID 1000’s session.

# /usr/bin/weston-flower
# /usr/bin/weston-clickdot
# /usr/bin/weston-cliptest
# /usr/bin/weston-dnd
# /usr/bin/weston-editor
# /usr/bin/weston-eventdemo
# /usr/bin/weston-image /usr/share/weston/terminal.png
# /usr/bin/weston-resizor
# /usr/bin/weston-simple-egl
# /usr/bin/weston-simple-shm
# /usr/bin/weston-simple-touch
# /usr/bin/weston-smoke
# /usr/bin/weston-info
# /usr/bin/weston-terminal

3.9.11.5. Running multimedia with Wayland sink

The GStreamer video sink for Wayland is the waylandsink. To use this video-sink for video playback:

# gst-launch-1.0 playbin uri=file://<path_to_file_name> video-sink=waylandsink

3.9.11.6. Using in-vehicle infotainment shell feature

The SDK also has support for configuring Weston ivi-shell. The default shell in the SDK is the desktop-shell.

To change the shell to ivi-shell, the user will have to add the following lines into the /etc/xdg/weston/weston.ini.

To switch back to the desktop-shell, comment these lines in the /etc/xdg/weston/weston.ini (comments begin with a ‘#’ at the start of line).

[core]
shell=ivi-shell.so

After the earlier configuration, we can restart Weston by running the following command:

# systemctl restart emptty

Note

When Weston starts with ivi-shell, the default background is black, this is different from the desktop-shell that brings up a window with background.

With ivi-shell configured for Weston, a central Human Machine Interface (HMI) manages Wayland client applications and they can use ivi-application protocol to interact with it.

The HMI central controller will assign clients with an unique numeric ID assuming they support the ivi_application Wayland protocol.

See the following for more information about the Weston IVI-shell: