Weston 未从终端运行:“未找到 drm 设备”

Weston not running from terminal: "no drm device found"

提问人:Bjørn Ironside 提问时间:10/31/2023 最后编辑:Bjørn Ironside 更新时间:11/6/2023 访问量:105

问:

我使用 Yocto/Poky (kirkstone) 构建了一个映像。我通过 SSH 在 RasPi 4B 上启动映像。我通过将以下行添加到我的构建中实现了 wayland/weston:core-image-full-cmdline/conf/local.conf

DISTRO_FEATURES:append = "wayland"
IMAGE_INSTALL:append = " qtbase qtwayland"
CORE_IMAGE_EXTRA_INSTALL += "wayland weston"

我在文件中的 SD 卡上启用了假的 KMS 驱动程序:config.txt

#Enable VC4 Graphics
dtoverlay=vc4-fkms-v3d

当我以 root 身份运行时,出现错误:weston

root@raspberrypi4:/etc/init.d# weston
Date: 2018-03-09 UTC
[14:06:18.044] weston 10.0.2
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 10.0.2
[14:06:18.045] Command line: weston
[14:06:18.045] OS: Linux, 5.15.34-v7l, #1 SMP Tue Apr 19 19:21:26 UTC 2022, armv7l
[14:06:18.045] Flight recorder: enabled
[14:06:18.046] Using config file '/etc/xdg/weston/weston.ini'
[14:06:18.046] Output repaint window is 7 ms maximum.
[14:06:18.047] Loading module '/usr/lib/libweston-10/drm-backend.so'
[14:06:18.061] initializing drm backend
[14:06:18.061] Trying libseat launcher...
[14:06:18.062] libseat: session control granted
[14:06:18.063] no drm device found
[14:06:18.065] fatal: failed to create compositor backend
Internal warning: debug scope 'drm-backend' has not been destroyed.

我的文件看起来像这样:/etc/xdg/weston/weston.ini

# configuration file for Weston

[core]
#modules=xwayland.so,cms-colord.so
#shell=desktop-shell.so
#gbm-format=xrgb2101010
require-input=false

#[shell]
#background-image=/usr/share/backgrounds/gnome/Aqua.jpg
#background-color=0xff002244
#background-type=tile
#clock-format=minutes
#panel-color=0x90ff0000
#locking=true
#animation=zoom
#startup-animation=fade
#binding-modifier=ctrl
#num-workspaces=6
#cursor-theme=whiteglass
#cursor-size=24

#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png
#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg
#animation=fade

#[launcher]
#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
#path=/usr/bin/gnome-terminal

#[launcher]
#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
#path=/usr/bin/weston-terminal

#[launcher]
#icon=/usr/share/icons/hicolor/24x24/apps/google-chrome.png
#path=/usr/bin/google-chrome

#[launcher]
#icon=/usr/share/icons/gnome/24x24/apps/arts.png
#path=/build/weston-0lEgCh/weston-1.11.0/weston-flower

#[input-method]
#path=/usr/libexec/weston-keyboard

#[output]
#name=LVDS1
#mode=1680x1050
#transform=90
#icc_profile=/usr/share/color/icc/colord/Bluish.icc

#[output]
#name=VGA1
#mode=173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
#transform=flipped

#[output]
#name=X1
#mode=1024x768
#transform=flipped-90

#[libinput]
#enable_tap=true

#[touchpad]
#constant_accel_factor = 50
#min_accel_factor = 0.16
#max_accel_factor = 1.0

[screen-share]
command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize

#[xwayland]
#path=/usr/bin/Xwayland

但是,当我构建映像时,weston 合成器可以工作,我可以在 Pi 上运行桌面和我的 Qt 应用程序。当我在 QEMU 中模拟图像时,它也可以工作。core-image-westoncore-image-full-cmdline

我需要更改某些内容以使其在 Pi 上运行吗?我的目标是,编写一个自动启动到Qt应用程序的脚本,因为我想使用Pi作为UI原型,而不想连接键盘并在每次启动后手动运行Qt应用程序。

感谢您的帮助!

QT 覆盆子-PI4 韦兰 斯顿 约克托-柯克斯通

评论


答:

1赞 Bjørn Ironside 11/6/2023 #1

我通过使用 并将变量设置为 解决了这个问题。此外,我将变量设置为 。我使用这些链接作为来源:core-image-baseXDG_RUNTIME_DIR/run/user/1000WAYLAND_DISPLAYwayland-1

https://wayland.pages.freedesktop.org/weston/toc/running-weston.html#running-weston-on-a-stand-alone-back-end

https://www.ics.com/blog/building-qt-and-qtwayland-raspberry-pi

https://docs.yoctoproject.org/dev-manual/wayland.html#using-wayland-and-weston

我在 RasPi 内部的嵌入式 Linux 操作系统中创建了这个脚本并运行:/etc/init.dupdate-rc.d weston defaults 90 10

#!/bin/sh
#
### BEGIN ININT INFO
# Provides: splashscreen
# Required-Start: weston
# Required-Stop: weston
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

if test -e /etc/default/splashscreen ; then
    . /etc/default/splashscreen
fi

killproc() {
    pid=`/bin/pidof $1`
    [ "$pid" != "" ] && kill $pid
}

read CMDLINE > /proc/cmdline
for x in $CMDLINE; do
    case $x in
    splashscreen=false)
            echo "App disabled"
            exit 0;
            ;;
    esac
done

case "$1" in 
    start)
        . /etc/profile
                
        export HOME=/home/root
        export XDG_RUNTIME_DIR=/run/user/1000
        export WAYLAND_DISPLAY=wayland-1
                
        # Start App
        splashscreen
    ;;

    stop)
        echo "Stopping App"
        
        killproc splashscreen
    ;;

    restart)
        $0 stop
        sleep 1
        $0 start
    ;;
    
    *)
        echo "usage: $0 { start | stop | restart }"
    ;;
esac

exit 0

现在,可以使用 将应用程序作为服务启动,通过将 start 替换为 或 ,可以停止或重新启动它。此外,它现在在启动 RasPi 后自动运行。service splashscreen startstoprestart

我现在必须弄清楚,它如何更快地启动,因为启动到 Qt 应用程序大约需要 30 秒。我的第一个想法是用 systemd 替换 SysVinit 管理器。

有什么建议吗?