系统信息:
pi@raspberrypi:~/rpi-opengl-without-x $ uname -a
Linux raspberrypi 4.19.65-v7+ #1252 SMP Fri Aug 9 18:02:10 BST 2019 armv7l GNU/Linux
库补丁:
pi@raspberrypi:/usr/lib/arm-linux-gnueabihf $ ls -la lib*GL*
lrwxrwxrwx 1 root root 25 Aug 12 21:28 libbrcmEGL.so -> /opt/vc/lib/libbrcmEGL.so
lrwxrwxrwx 1 root root 28 Aug 12 21:28 libbrcmGLESv2.so -> /opt/vc/lib/libbrcmGLESv2.so
lrwxrwxrwx 1 root root 21 Aug 13 04:16 libEGL.so -> /opt/vc/lib/libEGL.so
lrwxrwxrwx 1 root root 21 Aug 13 04:31 libEGL.so.1.0.0 -> /opt/vc/lib/libEGL.so
lrwxrwxrwx 1 root root 21 Aug 13 04:16 libEGL.so.1.0.0_backup -> /opt/vc/lib/libEGL.so
lrwxrwxrwx 1 root root 28 Aug 13 18:01 libGLESv1_CM.so.1 -> /opt/vc/lib/libbrcmGLESv2.so
lrwxrwxrwx 1 root root 24 Aug 13 18:02 libGLESv2.so -> /opt/vc/lib/libGLESv2.so
lrwxrwxrwx 1 root root 24 Aug 13 18:02 libGLESv2.so.2.0.0 -> /opt/vc/lib/libGLESv2.so
lrwxrwxrwx 1 root root 24 Aug 13 18:03 libGLESv2.so.2.1.0 -> /opt/vc/lib/libGLESv2.so
lrwxrwxrwx 1 root root 18 Aug 10 2018 libOpenGL.so.0 -> libOpenGL.so.0.0.0
-rw-r--r-- 1 root root 165340 Aug 10 2018 libOpenGL.so.0.0.0
简单的 EGL 三角形经典示例未显示缺少的库:
pi@raspberrypi:~/rpi-opengl-without-x $ ldd ./triangle
linux-vdso.so.1 (0x7ef03000)
/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x76f14000)
libbrcmEGL.so => /opt/vc/lib/libbrcmEGL.so (0x76edb000)
libbrcmGLESv2.so => /opt/vc/lib/libbrcmGLESv2.so (0x76eb6000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76d68000)
libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x76d3f000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76cbd000)
libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x76ca7000)
libvcos.so => /opt/vc/lib/libvcos.so (0x76c8e000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76c64000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76c51000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x76c3a000)
/lib/ld-linux-armhf.so.3 (0x76f29000)
未配置 EGL 时 HDMI 看起来正常
pi@raspberrypi:~ $ /opt/vc/bin/tvservice -m DMT
Group DMT has 19 modes:
mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive
mode 5: 640x480 @ 72Hz 4:3, clock:31MHz progressive
mode 6: 640x480 @ 75Hz 4:3, clock:31MHz progressive
mode 8: 800x600 @ 56Hz 4:3, clock:36MHz progressive
mode 9: 800x600 @ 60Hz 4:3, clock:40MHz progressive
mode 10: 800x600 @ 72Hz 4:3, clock:50MHz progressive
mode 11: 800x600 @ 75Hz 4:3, clock:49MHz progressive
mode 16: 1024x768 @ 60Hz 4:3, clock:65MHz progressive
mode 17: 1024x768 @ 70Hz 4:3, clock:75MHz progressive
mode 18: 1024x768 @ 75Hz 4:3, clock:78MHz progressive
mode 21: 1152x864 @ 75Hz 4:3, clock:108MHz progressive
mode 28: 1280x800 @ 60Hz 16:10, clock:83MHz progressive
mode 32: 1280x960 @ 60Hz 4:3, clock:108MHz progressive
mode 35: 1280x1024 @ 60Hz 5:4, clock:108MHz progressive
mode 36: 1280x1024 @ 75Hz 5:4, clock:135MHz progressive
mode 47: 1440x900 @ 60Hz 16:10, clock:106MHz progressive
mode 48: 1440x900 @ 75Hz 16:10, clock:136MHz progressive
mode 51: 1600x1200 @ 60Hz 4:3, clock:162MHz progressive
mode 58: 1680x1050 @ 60Hz 16:10, clock:146MHz progressive
三角测试
pi@raspberrypi:~/rpi-opengl-without-x $ gcc -o triangle triangle.c -lbrcmEGL -lbrcmGLESv2 -L/opt/vc/lib -I/opt/vc/include
pi@raspberrypi:~/rpi-opengl-without-x $ ./triangle
Initialized EGL version: 1.4
GL Viewport size: 800x600
显示仍处于文本模式,不执行任何操作。
qt 测试
pi@raspberrypi:~/tow/src $ ./dashboard
QT Version: 5.12.4
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_emu", "eglfs_kms_egldevice", "eglfs_x11")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_emu", "eglfs_kms_egldevice", "eglfs_x11")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Failed to load EGL device integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_emu"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_emu"
[9;0]EGL library doesn't support Emulator extensions
Aborted
失败,
从 raspi-config -> 选项 -> 高级 -> GL 驱动程序 -> FULL KMS 返回 GL
pi@raspberrypi:~/rpi-opengl-without-x $ /opt/vc/bin/tvservice -m DMT
Group DMT has 0 modes:
pi@raspberrypi:~/rpi-opengl-without-x $ ./triangle
* failed to add service - already in use?
pi@raspberrypi:~/rpi-opengl-without-x $ ../dashboard
QT Version: 5.12.4
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_emu", "eglfs_kms_egldevice", "eglfs_x11")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_emu", "eglfs_kms_egldevice", "eglfs_x11")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Failed to load EGL device integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_emu"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_emu"
* failed to add service - already in use?
pi@raspberrypi:~/rpi-opengl-without-x $
任何帮助。我搜索了一天,但找不到可行的解决方案。谢谢。
或者触摸 qt 示例:
pi@raspberrypi:~/qtex/quickcontrols/controls/touch $ ./touch
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_emu", "eglfs_kms_egldevice", "eglfs_kms", "eglfs_x11")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_kms", "eglfs_emu", "eglfs_kms_egldevice", "eglfs_x11")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Failed to load EGL device integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms"
qt.qpa.eglfs.kms: New DRM/KMS via GBM integration created
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms"
qt.qpa.eglfs.kms: platformInit: Opening DRM device
qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_DRM|Device_VideoMask)
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: Using backend-provided DRM device /dev/dri/card0
qt.qpa.eglfs.kms: Creating GBM device for file descriptor 5 obtained from "/dev/dri/card0"
qt.qpa.eglfs.kms: Querying EGLDisplay
* failed to add service - already in use?
已解决:整个体验位于:
编辑于 2020 20 02
Raspbian 10 看起来正在把东西带回家
以下是最近的一篇文章:
https://redypis.org/phpBB3/viewtopic.php?f=7&t=30&sid=32c48158560f3d965e79dffb498633e6