Color calibration in Weston

Hi all,

hope you are all well!

We are currently investigating in how far we can modify or correct the colors of our LVDS connected custom 7" display. We are using Torizon 6.6.1 with weston-vivante 3.3.0 running on an Apalis-iMX8QM 4GB IT and a custom carrier board.

  • TorizonCore 6.6.1+build.14
  • Apalis iMX8QM 4GB
  • torizon/weston-vivante:3.3.0
  • Custom carrier board and custom display

I played around with weston.ini using color_characteristics, but I do not see any real impact on colors. I have to admit I am a beginner with weston.
I also tried to set color-management=true but this will only crash the weston container:

[09:41:02.302] color-lcms: error: color operations capability missing. Is GL-renderer not in use?
[09:41:02.302] fatal: failed to create compositor backend

Here is our weston.ini:

[core]
#backend=drm-backend.so
#gl-renderer=true
#color-management=true
#renderer=gl
idle-time=0
require-input=false
xwayland=true
#modules=cms-colord.so,screen-share.so
modules=screen-share.so
# uncomment line below to use kiosk shell
#shell=kiosk-shell.so

[shell]
background-image=/etc/xdg/weston/company.png
background-type=centered
#background-type=scale
background-color=0x00000000
panel-position=none
locking=false
allow-zap=false
num-workspaces=1

[keyboard]
vt-switching=false

[color_characteristics]
name=myDisplay
#red_x: 0.548(min) 0.598(typ) 0.648(max)
red_x = 0.648
#red_y: 0.300(min) 0.350(typ) 0.400(max)
red_y = 0.400
#green_x: 0.313(min) 0.363(typ) 0.413(max)
green_x = 0.363
#green_y: 0.511(min) 0.561(typ) 0.611(max)
green_y = 0.561
#blue_x: 0.093(min) 0.143(typ) 0.193(max)
blue_x = 0.143
#blue_y: 0.091(min) 0.141(typ) 0.191(max)
blue_y = 0.141
#white_x: 0.267(min) 0.317(typ) 0.367(max)
white_x = 0.367
#white_y: 0.304(min) 0.354(typ) 0.404(max)
white_y = 0.404
#max_luminance = 1000
#max_luminance = 380
#min_luminance = 0.1
#min_luminance = 300


# uncomment the [output] line below if you set any output configuration
[output]
# you must uncomment the "name" line and provide the name of the output interface being customized, otherwise, changes will not apply
name=LVDS-1
#brightness=1.2
#contrast=1.2
#gamma=1.5,1.0,0.9
#colorimetry-mode=
color_characteristics=myDisplay
#name=HDMI-A-1
# uncomment line below to configure screen rotation/flipping
#transform=rotate-90
# uncomment line below to redirect the output; supported by kiosk shell
#app-ids=my-app-id
# uncomment line below to turn off the output
#mode=off
# uncomment line below to set an output resolution. Run for example 'cat /sys/class/drm/card1-HDMI-A-1/modes' to list the available modes.
#mode=1680x1050@60
# or use the more detailed (mode=dotclock hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal hflag vflag)
#mode=146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
# uncomment line below to make this output a clone of another
#same-as=HDMI-A-2

#For multi-display support and other configurations, please read the article: https://developer.toradex.com/knowledge-base/working-with-weston-on-torizoncore

Do you have any suggestions or best practices on how to adjust colors in weston?

Best regards,

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


It looks like you’re trying to adjust the color characteristics of your display using Weston on TorizonCore. From your weston.ini configuration, it seems like you’ve already attempted to use the color_characteristics section and the color-management option, but encountered issues.

Here are a few suggestions and best practices to help you adjust colors in Weston:

  1. Ensure GL Renderer is Enabled:
    The error message indicates that the GL renderer might not be in use. Ensure that the GL renderer is enabled in your weston.ini file. Uncomment and set the following lines in the [core] section:

    [core]
    backend=drm-backend.so
    gl-renderer=true
    color-management=true
    
  2. Check for Required Modules:
    Ensure that the necessary modules for color management are loaded. Uncomment the cms-colord.so module in the [core] section:

    modules=cms-colord.so,screen-share.so
    
  3. Verify Output Name:
    Make sure the output name specified in the [output] section matches the actual name of your LVDS display. You can find the correct name by running weston-info inside the Weston container.

  4. Adjust Color Characteristics:
    Ensure that the color_characteristics section is correctly referenced in the [output] section. Your configuration seems correct, but double-check the values and ensure they are within the expected range for your display.

  5. Debugging:
    If Weston still crashes, you can enable debugging to get more detailed logs. Run the Weston container with the WAYLAND_DEBUG environment variable set to 1 to get more information:

    docker run -e WAYLAND_DEBUG=1 -v /path/to/your/weston.ini:/etc/xdg/weston/weston.ini torizon/weston-vivante:3.3.0
    
  6. Consult Documentation:
    Refer to the Weston documentation and the weston.ini man page for more details on the color_characteristics and color-management options.

Here is an example of how your weston.ini file should look after making the suggested changes:

[core]
backend=drm-backend.so
gl-renderer=true
color-management=true
renderer=gl
idle-time=0
require-input=false
xwayland=true
modules=cms-colord.so,screen-share.so
# uncomment line below to use kiosk shell
#shell=kiosk-shell.so

[shell]
background-image=/etc/xdg/weston/company.png
background-type=centered
#background-type=scale
background-color=0x00000000
panel-position=none
locking=false
allow-zap=false
num-workspaces=1

[keyboard]
vt-switching=false

[color_characteristics myDisplay]
red_x = 0.648
red_y = 0.400
green_x = 0.363
green_y = 0.561
blue_x = 0.143
blue_y = 0.141
white_x = 0.367
white_y = 0.404
#max_luminance = 380
#min_luminance = 300

[output]
name=LVDS-1
color_characteristics=myDisplay
#brightness=1.2
#contrast=1.2
#gamma=1.5,1.0,0.9
#colorimetry-mode=
#mode=1680x1050@60
#same-as=HDMI-A-2

If you continue to experience issues, it might be helpful to reach out to the Toradex community or support for further assistance, as they might have more specific insights into your hardware and software configuration.

Please, also check if these links can help you solve your problem:

Boot2Qt with Apalis iMX8.

Hi @bgo !

Thanks for the details you shared!

Could you please also share a photo of the color issue you are having?

And what is the behavior of the issue? Is it simply constant? Or it comes and goes?

Have you configured your device tree according to the timings of the LVDS display you are using? You usually find the timings in the datasheet of the display/panel.

Best regards,

Hi @henrique.tx !

Thank you for your quick reply! There is no real bug or anything going on. There is only a slight shift to darker coloring and I would like to try to get the coloring a bit more brighter, so it looks more similar compared to a remote view. I tried to take a good photo, but my camera is more of budget one, so the quality is not good but should be enough to see that the navigation menu is mostly in a dark blue and we can only guess purple on the bottom:

Whereas when accessing the system via VNC we get a slightly lighter coloring and see the blue getting purple to the bottom:

Best case would be that we get a similar visual effect on the display as seen via VNC. Though VNC will be replaced by network access in the near future.

Best regards,

Hi @bgo !

Thanks for the details!

Do you know what kind of panel your display has? Is it TFT, IPS, …?

Is it possible that the angle of view is affecting the colors? This is quite possible depending on the type of panel.

Have you tried increasing the backlight intensity?

Would you be capable of connecting the module to another type of display just to check if your display is limiting the quality of the image? If you could e.g. output your application to a desktop monitor, it would be a nice benchmark.

Best regards,

Hi @henrique.tx !

I can share some general information about the LCD of our capacitive touch panel:

  • LCD Type: FFS TFT / Transmissive / Normally black
  • Size: 7.0 inch
  • LCM (W x H x D): 259.00 x 126.50 x 15.64 mm^3
  • Active Area (W x H): 154.21 x 85.92 mm^2
  • Pixel Pitch: 0.1506 x 0.1432 mm^2
  • Number of Dots: 1024 (RGB) x 600
  • Interface Type: 4-lane LVDS
  • Color Depth: 16.7M
  • Pixel Configuration: R.G.B Vertical Stripe
  • Input Voltage: 3.3 V
  • Backlight Type: 27LEDs (Built-in LED Driver)

It has a rather thick cover glass of 2 mm with AG coating.

It has the following electro-optical characteristics (typ.):

  • Contrast ratio: 800
  • Luminance uniformity: 80
  • Surface luminance: 380
  • Viewing angle range: 85 deg
  • CIE (x,y):
    – red_x: 0.598
    – red_y: 0.350
    – green_x: 0.363
    – green_y: 0.561
    – blue_x: 0.143
    – blue_y: 0.141
    – white_x: 0.317
    – white_y: 0.354
  • NTSC: 45.9 %

This is the device tree overlay I use:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright 2020-2021 Toradex
 */

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pwm/pwm.h>

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,apalis-imx8",
				 "toradex,apalis-imx8qm";
};

&backlight {
	//compatible = "pwm-backlight";
	brightness-levels = <0 4 8 16 32 64 128 255>;
	num-interpolated-steps = <4>;
	default-brightness-level = <28>;
	enable-gpios = <&lsio_gpio1 4 GPIO_ACTIVE_HIGH>; /* Apalis BKL1_ON */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gpio_bkl_on>;
	pwms = <&pwm_lvds1 0 5000000 0>;
	status = "okay";
};

&{/panel-lvds} {
	compatible = "panel-lvds";
	backlight = <&backlight>;

	status = "okay";

	data-mapping = "vesa-24";
	width-mm = <154>;
	height-mm = <86>;

	panel-timing {
		clock-frequency = <54000000>;
		hactive = <1024>;
		vactive = <600>;
		hback-porch = <160>;
		hfront-porch = <160>;
		vback-porch = <23>;
		vfront-porch = <12>;
		hsync-len = <70>;
		vsync-len = <5>;
	};

	port {
		panel_lvds1_in: endpoint {
			remote-endpoint = <&lvds1_out>;
		};
	};
};

&ldb2 {
	status = "okay";

	lvds-channel@0 {
		status = "okay";

		fsl,data-mapping = "spwg";
		fsl,data-width = <24>;

		port@1 {
			reg = <1>;

			lvds1_out: endpoint {
				remote-endpoint = <&panel_lvds1_in>;
			};
		};
	};
};

&ldb2_phy {
	status = "okay";
};

&panel_lvds {
	status = "okay";
};

&pwm_lvds1 {
	status = "okay";
};

&i2c2 {
	touchscreen@41 {
		compatible = "sotax,ili2511";
		reg = <0x41>;
		interrupt-parent = <&lsio_gpio0>;
		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
		reset-gpios = <&lsio_gpio0 8 GPIO_ACTIVE_LOW>;
	};
};

The display brightness is already configured to max brightness value. We may go with a brighter color palette in the UI - but it will not change the fact that it looks different via VNC and I would really like to know if there is a way to adjust colors, contrast, … in short “configure” the display from Torizon OS?

Thanks in advance!

Best regards,

Hi @bgo !

After asking internally, I was informed that color management was integrated into Weston not long ago. Seems like Weston 10 (the version available for Torizon OS 6) have “some of it”.

But it is experimental and we have no experience with it… so currently we can’t help much.

Maybe if you try a display with wider color range it could help your case?

Also, maybe you could get in touch with your display provider to get some tips about color? They could tell you what the display is capable of color-wise.

Best regards,

Hi @henrique.tx !

Thank you for the information. I will have a look into Weston 10 and we will also contact our display manufacturer regarding options color-wise. I just checked the display datasheet of a display we already have in production and that one scored 58.6% NTSC. So this kind of explains the difference.

It will take some time to elaborate. If I do not forget it, I will post the outcome here.

Best regards,

Hi @bgo !

It will be great to get to know the outcome. It can even help other community members!

Looking forward to the update :slight_smile:

Best regards,