这是我在这里的第一篇文章。
我想保持简短...
以下问题:
我想在树莓派 2b 上使用 eglfs 后端运行 qt5/qtquickcontrols2 应用程序,当然,由 vc4 加速。理想情况下,它应该在 kiosk 模式下运行,并且它肯定需要加速 gl 功能。为了尽量减少问题,我使用以下命令进行了测试:
LD_PRELOAD="/opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so" qmlscene ./gallery.qml
其中 gallery.qml 只是来自 qt-creator 的小部件预览示例项目(遵循这些说明...)。我收到以下错误输出:
[manjaro@Loki gallery]$ LD_PRELOAD="/opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so" qmlscene ./gallery.qml
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_brcm", "eglfs_kms", "eglfs_x11")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_kms", "eglfs_x11")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_brcm"
* failed to add service - already in use?
我还测试了相同的运行交叉编译的二进制文件 - 同样的错误。除最后一行外,所有内容均来自我通过环境变量设置的 qt5 的详细调试输出,详细信息将在后面介绍。
系统/环境:
- 树莓派 2b
- qt-5.7.0
- Manjaro-ARM(基于 Arch Linux ARM)
- 所有固件、工具、引导程序、内核都已安装并且是最新的
其他设置...
[manjaro@Loki gallery]$ uname -a
Linux Loki 4.4.28-1-MANJARO-ARM #1 SMP Sat Oct 29 21:01:09 CDT 2016 armv7l GNU/Linux
我的 config.txt
dtparam=audio=on
#hdmi_drive=2
avoid_warnings=2
disable_overscan=1
disable_splash=1
boot_delay=0
# activate raspi cam
start_x=1
# tuning gpu accel and memory usage
gpu_mem=320
dtoverlay=vc4-kms-v3d
我的 cmdline.txt
root=/dev/mmcblk0p2 rw rootwait console=tty1 selinux=0 quiet plymouth.ignore-serial-consoles dwc_otg.lpm_enable=0 elevator=deadline fsck.repair=yes
printenv 给出以下内容:
XDG_SESSION_ID=c1
TERM=xterm
SHELL=/bin/bash
SSH_CLIENT=192.168.0.100 43274 22
QT_QPA_EGLFS_INTEGRATION=eglfs_brcm
OLDPWD=/home/manjaro
SSH_TTY=/dev/pts/0
USER=manjaro
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
MAIL=/var/spool/mail/manjaro
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/vc/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
PWD=/home/manjaro/opt
LANG=de_DE.UTF-8
QT_QPA_PLATFORM=eglfs
SHLVL=1
HOME=/home/manjaro
LOGNAME=manjaro
QT_LOGGING_RULES=qt.qpa.*=true
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SSH_CONNECTION=192.168.0.100 43274 192.168.0.107 22
XDG_RUNTIME_DIR=/run/user/1000
_=/usr/bin/printenv
您可以看到几个 Qt 特定的设置:调试,使用 eglfs 作为默认后端,最有趣的是:
QT_QPA_EGLFS_INTEGRATION=eglfs_brcm
这意味着应该使用 Broadcom eglfs 插件。eglfs_brcm
我也试过(eglfs_kms
只是出于好奇):
[manjaro@Loki gallery]$ export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
[manjaro@Loki gallery]$ LD_PRELOAD="/opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so" qmlscene ./gallery.qml
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_brcm", "eglfs_kms", "eglfs_x11")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_kms", "eglfs_brcm", "eglfs_x11")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms"
qt.qpa.input: udev device discovery for type QFlags(0x10)
qt.qpa.input: Found matching devices ("/dev/dri/card0")
qt.qpa.eglfs.kms: Found the following video devices: ("/dev/dri/card0")
qt.qpa.eglfs.kms: Using "/dev/dri/card0"
qt.qpa.eglfs.kms: Opening device "/dev/dri/card0"
qt.qpa.eglfs.kms: Creating GBM device for file descriptor 5 obtained from "/dev/dri/card0"
* failed to add service - already in use?
这似乎既不是视频核心的问题,也不是 manjaro-arm 的“股票”Qt 的问题。它只是说某些东西可能会被阻止,但是什么?有什么提示吗?
叠加层和驱动程序似乎可以工作,glxgears 在 xfce4 上运行时达到了 ~60FPS。以下也很有趣:
[root@Loki gallery]# vcdbg log msg|& grep -v gpioman|grep -iv hdmi
001042.905: *** Restart logging
001043.889: Read command line from file 'cmdline.txt'
root=/dev/mmcblk0p2 rw rootwait console=tty1 selinux=0 nofb dwc_otg.lpm_enable=0 elevator=deadline fsck.repair=yes
001409.425: Loading 'kernel7.img' to 0x8000 size 0x5ea25c
001413.076: Kernel trailer DTOK property says yes
001413.091: Kernel trailer DDTK property says yes
001415.514: Loading 'bcm2709-rpi-2-b.dtb' to 0x5f225c size 0x3bfc
001514.479: dtparam: audio=on
001567.591: Loaded overlay 'vc4-kms-v3d'
001836.841: Device tree loaded to 0x2effbc00 (size 0x430d)
005904.220: vchiq_core: vchiq_init_state: slot_zero = 0xd0400000, is_master = 1
005911.919: TV service:host side not connected, dropping notification 0x00000002, 0x00000001, 0x00000010
007999.619: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 32, power enable gpio = 41
008000.339: camsubs: Camera not found
008000.377: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 32, power enable gpio = 41
008001.091: camsubs: Camera not found
008001.128: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 32, power enable gpio = 41
008001.844: camsubs: Camera not found
对我来说看起来很像。
我尝试了以下事情:
我玩过 gpu_mem 拆分,尝试了 128 到 448 之间的值。检查 gpu mem 看起来符合预期,但对执行提到的应用程序没有影响。
[manjaro@Loki gallery]$ vcgencmd get_mem gpu
gpu=320M
我还创建了以下 udev 规则以修复我最初遇到的错误
[manjaro@Loki gallery]$ cat /etc/udev/rules.d/10-vchiq-permissions.rules
SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
[manjaro@Loki gallery]$ groups
wheel video storage power users
如果没有提到的 udev 规则,我会收到以下错误:
[manjaro@Loki gallery]$ LD_PRELOAD="/opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so" qmlscene ./gallery.qml
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_brcm", "eglfs_kms", "eglfs_x11")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_kms", "eglfs_x11")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_brcm"
* failed to open vchiq instance
该死的......我现在没有想法......我会很感激每一个可以帮助的小提示......
请不要:
- anser 阅读了几个文档(我已经花了很多时间)
- 建议尝试另一个发行版(这不是解决方案)
- 建议重新刷新我的 SD 卡(也不是解决方案)
谁让 Qt-5.7/qtquickcontrols2/QML 通过 EGLFS 使用 vc4 在 raspberrypi 2 上工作???非常感谢你的每一个面包屑......