Torizon set resolution failed

I have HDMI display with resolution 800x600
Torizon set resolution much higher

To change resolution I follow

then

I run weston-terminal

apt update && apt install libdrm-tests

then

modetest -M imx-drm

I find there

Encoders:

id    crtcs    type
53    34    TMDS
55    41    none

Connectors:

id   encoder    name
54    53     HDMI-A-1

CRTCs:

id    FB    pos    size
34    57    0,0    1280x720
41    60    0,0    800x480

To draw a Testpattern I need connector_id, crtc_id, mode. Where to get it?

By instruction I run

I try systemctl stop weston - weston service could not be found
If I run this not from container, but from ssh then

sudo systemctl stop weston

Failed to stop weston.service:
Unit weston.service not loaded.

Then from weston-terminal

modetest -M imx-drm -s 54@41:800x600-60.32

failed to set mode: permission denied

How to test and set resolution?

Greetings @Juzujka,

The recommended way to set a persistent resolution would be to provide the details in the weston.ini file as described here: Display Output, Resolution and Timings (Linux) | Toradex Developer Center

By default we provide an initial weston.ini in our weston containers as shown here: debian-docker-images/weston at buster · toradex/debian-docker-images · GitHub

You can replace this weston.ini at runtime with either a bindmount to overwrite it or rebuild the container with your weston.ini instead.

As for the modetest how did you start the weston container? Perhaps try adding the --privileged flag to the run command. This should resolve any permission issues.

Best Regards,
Jeremias

I try Display Output, Resolution and Timings (Linux) | Toradex Developer Center before. But

!$ ls /etc/xdg/
systemd

there is no weston directory. Should I create directory and file weston.ini ? Or where can I find /etc/xdg/weston/ ?

A container’s file system is separate from the host system’s filesystem. You want to look in the container’s filesystem since that is where the entire weston stack is hosted. You must be looking in the host system’s filesystem which won’t have the weston.ini file.

Best Regards,
Jeremias

I try with --privileged

on desktop:

ssh torizon@alapis-on-ixora

in ssh:

docker run --privileged -it --name test_display_w -v /var/run/dbus:/var/run/dbus -v /dev:/dev torizon/weston:2 bash

in the new container:

## apt update && apt install libdrm-tests

## modetest -M imx-drm
Encoders:
id	crtc	type	possible crtcs	possible clones	
53	34	TMDS	0x0000000f	0x00000000
55	41	none	0x00000002	0xffffffff

Connectors:
id	encoder	status		name		size (mm)	modes	encoders
54	53	connected	HDMI-A-1       	220x140		9	53
  modes:
	index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  #0 1280x800 59.81 1280 1352 1480 1680 800 803 809 831 83500 flags: phsync, pvsync; type: preferred, driver
 ...
  #4 800x600 60.32 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver

## apt-get install systemctl
## systemctl stop weston
ERROR:systemctl:Unit weston.service could not be found.

## modetest -M imx-drm -s 54@41:800x600-60.32
setting mode 800x600-60.32Hz on connectors 54, crtc 41
failed to set mode: Permission denied

about systemctl stop weston
in the

$ ssh torizon@alapis-on-ixora

run

## sudo systemctl stop weston
Failed to stop weston.service: Unit weston.service not loaded.

Hello, Jeremias

I have check the filesystem on the host:

ssh torizon@alapis-on-ixora

$ du -a /etc/xdg/
0	/etc/xdg/systemd/user
4	/etc/xdg/systemd
8	/etc/xdg/

The weston.ini file is in the container filesystem not on the host filesystem. You want to copy your weston.ini file onto host with your changes for HDMI. Then when you run the weston container have a bindmount like so -v <path to your weston.ini on host>:/etc/xdg/weston/weston.ini. The method can be seen on this post here: How to rotate weston in torizon core - Technical Support - Toradex Community

If forcing the resolution doesn’t work via the weston.ini then perhaps the only reasonable way to force another resolution would be to inject an EDID binary. As described here: Display Output, Resolution and Timings (Linux) | Toradex Developer Center

Best Regards,
Jeremias

It seems this method won’t work in the container. Please try the weston.ini method I detailed in my other comment.

I have started with running torizon_portainer_1. Others were stopped. No signal on the monitor after stopping the torizon_weston_1 container from the raw Torizon.

I follow Qt on Torizon OS | Toradex Developer Center and add your recommendation to bindmount -v <path to your weston.ini on host>:/etc/xdg/weston/weston.ini.

It was very useful to add “-it” (or use docker logs weston)

docker run -it --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ -v /home/torizon/weston.ini:/etc/xdg/weston-dev/weston.ini --device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' torizon/weston:$CT_TAG_WESTON --developer weston-launch --tty=/dev/tty7 --user=torizon

Log appears in the terminal, it says

Using config file
‘/etc/xdg/weston-dev//weston.ini’

I have bindmount to ‘/etc/xdg/weston-dev//weston.ini’

docker run --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ -v /home/torizon/weston.ini:/etc/xdg/weston-dev/weston.ini --device-cgroup-rule=‘c 4:* rmw’ --device-cgroup-rule=‘c 13:* rmw’ --device-cgroup-rule=‘c 199:* rmw’ --device-cgroup-rule=‘c 226:* rmw’ torizon/weston:$CT_TAG_WESTON --developer weston-launch --tty=/dev/tty7 --user=torizon

Image changes.

Now I need to understand when weston look into /etc/xdg/weston-dev/weston.ini and when into /etc/xdg/weston/weston.ini ?

Now I need to understand when weston look into /etc/xdg/weston-dev/weston.ini and when into /etc/xdg/weston/weston.ini ?

The weston.ini path that is used depends on whether the --developer flag is passed during docker run. For example in the command you used you have torizon/weston:$CT_TAG_WESTON --developer. So the /etc/xdg/weston-dev/weston.ini path was used.

Best Regards,
Jeremias

Thank you, Jeremias!

I’ll use it later

You’re welcome!