3.6.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.6.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.

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.6.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.6.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.6.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.

# /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.6.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.6.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: