No input after 1 VNC session

Hello,

I am using an iMX8MP with TorizonCore 6.6.0 (build.21 monthly).
I tried to use VNC. To do so, I have the following docker-compose bundled in my torizon image:

version: "2.4"
services:
  mariadb:
    # My database service

  my-server:
    # My server service
    
  my-client:
    container_name: "flutter-client"
    restart: always
    image: company/my-flutter-client:1.0-arm64
    depends_on:
      weston:
        condition: service_healthy
      my-server:
        condition: service_healthy
    networks:
      - dbhostnet
    entrypoint: "./my_flutter_client"
    command:
      - "-f"
      - "-v"
      - "-b"
      - "../bundle/"
    device_cgroup_rules:
      - 'c 116:* rmw'
      - 'c 199:* rmw'
      - 'c 226:* rmw'
    volumes:
      - /tmp:/tmp
      - /dev/snd:/dev/snd:rw
      - /dev/dri:/dev/dri:rw
      - /dev/galcore:/dev/galcore:rw

  weston:
    container_name: "weston-backend"
    cap_add:
      - CAP_SYS_TTY_CONFIG
    device_cgroup_rules:
      - 'c 4:* rmw'
      - 'c 13:* rmw'
      - 'c 199:* rmw'
      - 'c 226:* rmw'
    environment:
      - ACCEPT_FSL_EULA=1
      - ENABLE_VNC=1
    image: torizon/weston-vivante:3
    network_mode: host
    scale: 1
    command: --tty=/dev/tty7
    healthcheck:
      test: ["CMD", "test", "-S", "/tmp/.X11-unix/X0"]
      interval: 3s
      timeout: 4s
      retries: 10
      start_period: 10s
    volumes:
      - source: /tmp
        target: /tmp
        type: bind
      - source: /dev
        target: /dev
        type: bind
      - source: /run/udev
        target: /run/udev
        type: bind
    
volumes:
  db_data:
networks:
  dbhostnet:

I can then connect with a VNC session, both on windows (TightVNC) or linux (gvncviewer or vinagre). For example, on linux using:

vinagre <target.ip>:5900

There is no performance hit and everything works perfectly. However, once I finish the session, touch on the target does not function anymore (it also does not work during the VNC session). If I reopen a VNC session, the mouse/keyboard input also does not work anymore.

To ‘fix’ this issue, I have to restart the gui client container with docker restart my-client. Touch then works again, but after 1 successful VNC session the problem reappears.

Thank you for your help.

Hello @mnano ,

Which touchscreen are you using?

Best regards,
Josep

Hello,

I am using a 7inch LVDS panel with an ili2511 touch controller.

Hello @mnano ,
I have performed a test usingthe following HW setup:

  • Verdin iMX8XMP Q 4GB WB IT V1.1A
  • Mallow carrier board V1.1A
  • Capacitive Touch Display 10.1" LVDS

and the following SW
TorizonCore 6.6.0 (build.21 monthly).

I have modified the docker-compose.yaml to enable VNC
Then I have stopped the eros-view container and stated an instance of Chromium as explained here:

Even with multiple VNC sessions I never lost the touchscreen functionality.

Best regards,
Josep

Hello,

Thank you for the help.

I forgot to add that at the moment, I am using the Dahlia Carrier Board and that the LVDS panel is connected with through the DSI-to-LVDS addon board.

Would it be possible for you to try with a flutter image? With the same weston backend service I showed in the docker-compose sample in my first post, I used a flutter-elinux compiled app that’s public on our dockerhub:

docker run --rm -d --privileged -v /tmp:/tmp -v /dev/snd:/dev/snd -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore nddrnd/flutter-colorpicker:arm64

To create the image, I cross-compile into a binary and then use this Dockerfile:

FROM --platform=linux/arm64/v8 torizon/weston-vivante:3 AS runtime

RUN mkdir -p /app/gui

RUN apt-get -y update && apt-get install -y \
	alsa-utils \
	libasound2 \
	psmisc \
	procps pciutils \
	libgstreamer1.0-0 \
	gstreamer1.0-plugins-base \
	gstreamer1.0-plugins-good \
	gstreamer1.0-plugins-bad \
	gstreamer1.0-plugins-ugly \
	gstreamer1.0-libav \
	gstreamer1.0-tools \
	gstreamer1.0-x \
	gstreamer1.0-alsa \
	gstreamer1.0-gl \
	gstreamer1.0-gtk3 \
	gstreamer1.0-pulseaudio \
	v4l-utils \
	locales

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
	locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

# Get the flutter bundle built in the build environment
ADD bundle /app/gui/bundle

# The .so libraries (notably libflutter_engine.so) must be in the library path
ADD bundle/lib /lib/

WORKDIR /app/gui/bundle/
ENV PATH="/app/gui:${PATH}"

ENTRYPOINT ["./flutter_colorpicker"]
CMD ["-f", "-b", "../bundle/"]

I have tried with chromium but then I get no mouse input in VNC. Touch does keep working though. However, the mouse input functions with VNC on just the weston-backend. I launched it with:

docker run -d --rm --name=chromium -v /tmp:/tmp -v /var/run/dbus:/var/run/dbus -v /dev/galcore:/dev/galcore --device-cgroup-rule='c 199:* rmw' --security-opt seccomp=unconfined --shm-size 256mb torizon/chromium:$CT_TAG_CHROMIUM --virtual-keyboard https://www.toradex.com

I kept the weston-backend same as in my docker-compose.

Best regards,

Hello,

I have tried again with the Mallow carrier board. Thus, my 7inch LVDS panel is connected directly. The device-tree is the exact same as for the 10inch which can be found on your repository. The only change is the compatible for the touchscreen node and the panel timing.

  1. On the device, I stop every container that we provision with our custom image.
  2. I launch a weston container:
docker run -e ACCEPT_FSL_EULA=1 -e ENABLE_VNC=1 -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ --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-vivante:$CT_TAG_WESTON_VIVANTE --developer --tty=/dev/tty7 
  1. At this point, I can launch a VNC session from my host machine to the target and touch still function. I can stop and relaunch the session without issue.
  2. I then launch a flutter container:
docker run -d --rm --name=flutter -v /tmp:/tmp -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' nddrnd/flutter-colorpicker:arm64
  1. At this point, touch work without issue.
  2. On my host pc, I launch a VNC session with the target device. Touch on the target does not work anymore while the session is on. Once I stop the VNC session, touch still does not work. If I relaunch a VNC session, then input does not work anymore.
  3. If I restart the flutter container with docker restart flutter then touch work again. So we are back at step 5. Same thing as step 6 will happen if I reopen a VNC session.
  4. I stop the flutter container with docker stop flutter and launch chromium:
docker run -d --rm --name=chromium -v /tmp:/tmp -v /var/run/dbus:/var/run/dbus -v /dev/galcore:/dev/galcore --device-cgroup-rule='c 199:* rmw' --security-opt seccomp=unconfined --shm-size 256mb torizon/chromium:$CT_TAG_CHROMIUM --virtual-keyboard https://www.toradex.com
  1. At this point, touch work without issue.
  2. I open a VNC session. I have no mouse input but touch still functions (as opposed to flutter where the first vnc session works but touch does not). Same if I stop and relaunch the VNC session.

As far as my torizon image, it uses an overlay identical to the 10inch lvds for the mallow carrier board (except touchscreen compatible and panel timings) and it has a /usr/etc/udev/rules.d/touchscreen.rules overlay for touchscreen calibration:

# Create a symlink to any touchscreen input device
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="6.977289 0.007994 -0.006862 -0.233142 6.751203 0.012331"

Best regards,

Hello @mnano ,
I hve been able to reproduce your issue and asked internally for advice.
One suggestion that I received is to switch to another compositor, such as Sway.
https://swaywm.org/

Best regards,
Josep

Hello,

Based on Weston RDP/VNC no mouse input - Technical Support - Toradex Community + looking at the flutter-embedded-linux repository, I am pretty sure that this is the same problem.
Essentially, flutter-elinux only accepts 1 source input at a time. And based on the code for managing wayland seats, it assign a seat initially for touch but the VNC session takes it. Then, upon closing the VNC session, the wayland seat is deallocated. Thus, you have to restart the flutter app to get a new seat.

For my issue with chromium, I am not sure. This might be the same issue?

I have been working on another project in the meantime but I will look at switching to another compositor whenever I have time. Is there a docker image or Dockerfile to follow for using sway?

I am not sure if I should mark this as solution or not? After all, I don’t think there is much that can be done from Toradex’s side. Unless someone knows how to patch flutter-embedded-linux to support multiple wayland seats.

Best regards,

Hello @mnano ,

I seems to be related to this issue
https://issues.chromium.org/issues/40814308

So far I don’t think we can do much about it, but I will ask just in case.

Best regards,
Josep

Hello,

Thank you for your support.

There is also an issue similar to that in flutter-embedded-linux repo ( Can’t interact with the application when using RDP on Weston · Issue #341 · sony/flutter-embedded-linux (github.com)). I opened another but it is a duplicate anyway.

Nothing to be done but wait. I will report in case there is any change, or if I have time to investigate a solution myself.