Unable to launch weston on linux yocto from ssh - linux

I have the error "no drm device found" as shown below.
I thinks the mail error is fatal: failed to create compoitor backend.
I have the following in my lib
desktop-shell.so drm-backend.so fbdev-backend.so fullscreen-shell.so gl-renderer.so hmi-controller.so ivi-shell.so wayland-backend.so x11-backend.so
root#salvator-x:/etc/systemd/system/multi-user.target.wants# /usr/bin/weston-launch \
-u root -- --idle-time=0 --config=/etc/xdg/weston/weston-drm-hdmi.ini $OPTARGS
Date: 2018-02-26 UTC
[21:29:08.949] weston 1.11.0
http://wayland.freedesktop.org
Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.11.0
Build: a9df8430-dirty v4l2-renderer: Fix calcluation of clip region (2017-04-13 18:25:00 +0900)
[21:29:08.949] OS: Linux, 4.9.0-yocto-standard, #1 SMP PREEMPT Mon Feb 26 17:46:03 EST 2018, aarch64
[21:29:08.949] Using config file '/etc/xdg/weston/weston-drm-hdmi.ini'
[21:29:08.950] Output repaint window is 34 ms maximum.
[21:29:08.950] Loading module '/usr/lib/weston/drm-backend.so'
[21:29:08.954] initializing drm backend
[21:29:08.954] logind: failed to get session seat
[21:29:08.954] logind: cannot setup systemd-logind helper (-61), using legacy fallback
[21:29:08.955] no drm device found
[21:29:08.955] fatal: failed to create compositor backend
failed to restore keyboard mode: Bad file descriptor
failed to set KD_TEXT mode on tty: Bad file descriptor
could not reset vt handling
How do I launch weston on linux yocto?
Here is the image:

So.. I found the answer to my question
it has three errors logind (systemd) was having trouble access the input keyboard type
second one is drm device is not found which implies that you have trouble accesing your output port. try to troubleshoot the port make it accessible to the board and then try to launch weston with correct config.
NOTE: Weston wayland wont launch if you dont have keyboard or a mouse connected preferably a usb

Related

Issue with binding platform driver to the platform device

I want to make work mt7622 soc's ethernet controller and faced with this issue. I've compiled mtk_soc_eth driver as mkt_eth module and I have an entry in mt7622-bananapi-bpi-r64.dts device tree for device, compatible with driver.
During boot this module is loaded into system automatically (I think after mounting rootfs):
[root#nixos:~]# lsmod | grep mtk_eth
mtk_eth 69632 0
dsa_core 98304 1 mtk_eth
And it seems registered as platform driver:
[root#nixos:~]# ls /sys/bus/platform/drivers/mtk_soc_eth
bind module uevent unbind
Also after boot I have an platform device:
[root#nixos:~]# ls /sys/bus/platform/devices/1b100000.ethernet
driver_override
modalias
of_node
power
subsystem
supplier:platform:10006000.power-controller
supplier:platform:10209000.apmixedsys
supplier:platform:10210000.topckgen
supplier:platform:10211000.pinctrl
supplier:platform:1b000000.syscon
supplier:platform:1b128000.sgmiisys
uevent
waiting_for_supplier
However they are not binded for some reason. Moreover, when I try to bind them manually, I get an error:
[root#nixos:~]# echo '1b100000.ethernet' > /sys/bus/platform/drivers/mtk_soc_eth/bind
-bash: echo: write error: Resource temporarily unavailable
How can I understand why ethernet device doesn't bind with driver?
Well, it seems that I figured out where is the problem. It seems that linux kernel have rich debug options) I've enabled dynamic debug to track which happens inside __driver_probe_device https://github.com/torvalds/linux/blob/master/drivers/base/dd.c#L730 function:
[root#nixos:~]# echo 'file dd.c +p'>/sys/kernel/debug/dynamic_debug/control
[root#nixos:~]# echo 'file core.c +p'>/sys/kernel/debug/dynamic_debug/control
And then tried to bind device driver and device:
[root#nixos:~]# echo '1b100000.ethernet' >/sys/bus/platform/drivers/mtk_soc_eth/bind
-bash: echo: write error: Resource temporarily unavailable
[root#nixos:~]# dmesg -T | tail
...
[Sat Jan 1 00:03:27 2000] bus: 'platform': __driver_probe_device: matched device 1b100000.ethernet with driver mtk_soc_eth
[Sat Jan 1 00:03:27 2000] platform 1b100000.ethernet: error -EPROBE_DEFER: supplier 1b000000.syscon not ready
It seems that one of the dependent devices (1b000000.syscon) is not ready (at the same time /sys/bus/platform/devices/1b100000.ethernet/waiting_for_supplier was still 0 for some reason). I need to load clk-mt7622-eth driver as well.

Cannot start J-Link GDB Server on Ubuntu

I am currently working on the ARM Cortex-M4 inside the NXP i.MX8M Mini.
I am able to compile a project for M4 on Eclipse IDE on an Ubuntu VM.
I would now like to debug on the M4 via a SEGGER Flasher ARM probe, still from Ubuntu.
My probe is well recognized by Ubuntu, and I can launch the J-Link GDB server by simply typing the command :
$ sudo ./JLinkGDBServerCLExe
However, if I type the same command without sudo, I get :
$ ./JLinkGDBServerCLExe
SEGGER J-Link GDB Server V7.58b Command Line Version
JLinkARM.dll V7.58b (DLL compiled Nov 16 2021 15:04:27)
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: yes
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: off
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: Unspecified
Target interface: JTAG
Target interface speed: 4000kHz
Target endian: little
Connecting to J-Link...
Connecting to J-Link failed. Connected correctly?
GDBServer will be closed...
Shutting down...
Could not connect to J-Link.
Please check power, connection and settings.
My problem is that when I start eclipse, I get the same result as starting the GDB server without sudo.
It seems that this is a rights issue, how can I solve it?
As #KamilCuk said, the problem came from the udev rules.
So you just have to copy the rules provided by Segger with J-Link Software on the system:
$ sudo cp 99-jlink.rules /etc/udev/rules.d
Then you have to reboot the system:
$ reboot

ROS RViz issues when starting using robot_startup

Background
I have an application that requires that I start several RViz windows in a headless ROS environment. The system is required to send image files to some locally networked dumb terminals which can barely but adequately show image files (.jpg). Therefore, I simply take screen snapshots of the RViz displays and send those. This works well, however, I need to run the RViz windows on startup.
Implementation
The ROS noetic system is running on Ubuntu 20.04. I used robot_upstart to give me a working skeleton for a systemd service and then modified the core service file to allow display_manager access
This is my working system.d service file called 'test.service'
[Unit]
Description="bringup test"
After=network.target
After=display_manager.service
Wants=display_manager.service
[Service]
Type=simple
Environment="XAUTHORITY=/run/user/1000/gdm/Xauthority"
Environment="DISPLAY=:0"
Environment="XDG_RUNTIME_DIR=/home/<my_username/catkin_ws/tmp"
Environment="/home/<my_username>" # THIS FIXED THE ISSUE
ExecStart=/usr/sbin/test-start
[Install]
WantedBy=multi-user.target
This almost works. journalctl -f -u test.service lists an error:
Jun 06 21:10:22 aoede test-start[10209]: /opt/ros/noetic/lib/rviz/rviz: line 1: 10220 Aborted (core dumped) $0 $#
Jun 06 21:10:25 aoede dbus-daemon[10259]: [session uid=1000 pid=10257] AppArmor D-Bus mediation is enabled
Jun 06 21:10:28 aoede test-start[10237]: terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
Jun 06 21:10:28 aoede test-start[10237]: what(): boost::filesystem::create_directory: Permission denied: "/.rviz"
Jun 06 21:10:28 aoede test-start[10218]: Aborted (core dumped)
It is trying to write to a directory /.rviz . When I create this directory myself with relaxed permissions it then works correctly and the RViz windows all start. This directory seems to be filled with persistence files for the RViz instances.
I have tried setting XDG_RUNTIME_DIR as above but it had no effect. What environment variable should I set, or other way, so that RViz is looking in a more rational place? Also, would appreciate any recommendations on better practices than above.
The required environment variable is $HOME
This was being set after the service was run and was therefore not available.
Environment="/home/<my_username>"
Fixed the issue

How to create an x server with Singularity

Overall, I am trying to render images using Unity on a remote cluster.
The cluster does not have an X server; I don't have sudo permissions, or can start a Docker container, but I can start a Singularity container.
My plan is to create a container that would simulate the X Server. I created the following Singularity definition file:
Bootstrap: docker
From: nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
%post
# xvfb for rendering in headless mode
apt-get update
apt-get install -y xvfb mesa-utils xorg
echo "allowed_users = anybody" > /etc/X11/Xwrapper.config
I started the container with the option --containall. From the container, I launched the command /usr/bin/X :0, but it failed with the following error:
Singularity xvfb.sif:~> /usr/bin/X :0
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
X.Org X Server 1.19.6
Release Date: 2017-12-20
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.15.0-140-generic x86_64 Ubuntu
Current Operating System: Linux cooper 5.8.0-50-generic #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.8.0-50-generic root=/dev/mapper/vgubuntu-root ro quiet splash vt.handoff=7
Build Date: 08 April 2021 01:57:21PM
xorg-server 2:1.19.6-1ubuntu4.9 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/pierre-louis/.local/share/xorg/Xorg.0.log", Time: Wed May 26 09:17:05 2021
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (No such file or directory)
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/home/pierre-louis/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
Not any /dev/tty* exist. Then I tried to launch startx, but only to get the same message error.
How can I launch an X Server using a Singularity image?
As mentioned in a separate discussion, Xvfb is not supposed to be start through startx or /usr/bin/X but rather with the supplied run script.

New device node created on host does not get reflected in Docker container when using --device flag

I'm running a container with the following options:
docker run -d --device=/dev/bus/usb:/dev/bus/usb --device=/dev/ttyS0:/dev/ttyS0 instr_img
Inside the container I have a Python code which resets a USB device that in turn causes a device file in '/dev/bus/usb/002/005' on the host to be removed and a new file (/dev/bus/usb/002/006) created in its place. The problem is that inside the container '/dev/bus/usb/002/005' still exists, and '/dev/bus/usb/002/006' is no where to be found. The directories '/dev/bus/usb/002' on the host and container are now out of sync. As a result, the code execution inside the container throws an exception because it can't talk to the USB device. I confirmed by manually creating a new device file (mknod) in the container and saw that it did not get sync'ed to the host and vice versa. Is this an unsupported feature or a bug in Docker?
>docker version
Client:
Version: 1.9.0
API version: 1.21
Go version: go1.4.2
Git commit: 76d6bc9
Built: Tue Nov 3 17:48:04 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 1.9.0
API version: 1.21
Go version: go1.4.2
Git commit: 76d6bc9
Built: Tue Nov 3 17:48:04 UTC 2015
OS/Arch: linux/amd64
>docker info
Containers: 66
Images: 313
Server Version: 1.9.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 445
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.19.0-47-generic
Operating System: Ubuntu 15.04
CPUs: 4
Total Memory: 7.69 GiB
Name:my-host-1
ID: VIT4:S2P3:Q4TY:A3I4:L4WH:HFWJ:I36U:PBTV:B3VW:NFXB:LDNM:KY7G
Username: myuser
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
>uname -a
Linux my-host-1 3.19.0-47-generic #53-Ubuntu SMP Mon Jan 18 14:02:48 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
My workaround is to issue a mknod command to create a new device file with the minor device number incremented by 1 (from the previous number) every time a device reset happens; however, this is not a clean hack since I need to put in some checks because this program is used in multiple environments outside and inside the Docker container. I could very well be not using Docker properly for this use case since I'm very green (a noob) with Docker.
Some comments/insights from some experienced Docker users would really be appreciated. It could be a deal breaker for me to dockerize this program if I can't find a clean workaround for this issue.
Thanks in advance for your comments!
From all the researches online and some experimentation with using '--device', I've found that ephemeral (hot pluggable) devices are not supported by this option. It's a shame that the Docker documentation did not state this clearly, if at all. I only read one comment online from a user which mentioned it in passing. For those who want to use '--device' for these devices, don't; use the '--privileged' & '-v ' options instead. This will avoid you having to specify the exact device file name, e.g. /dev/bus/usb/002/088, instead you can specify just /dev/bus/usb. The '--device' option requires the actual device file name to work.

Resources