&引用;getNativeWindowHandle+;0x54“;通过DRM在Gluon JavaFX 16 EA 4上

&引用;getNativeWindowHandle+;0x54“;通过DRM在Gluon JavaFX 16 EA 4上,javafx,raspberry-pi,gluon,raspberry-pi4,egl,Javafx,Raspberry Pi,Gluon,Raspberry Pi4,Egl,我按照在中给出的步骤通过DRM在Raspberry Pi 4上运行JavaFX。我从下载了JavaFXEA16版本 javafx.properties文件: javafx.version=16-internal javafx.runtime.version=16-internal+28-2020-11-10-180413 javafx.runtime.build=28 克隆包含hellofx的示例存储库后,我通过javac(按照步骤)编译了它,然后运行以下命令,使用DRM运行它: sudo -

我按照在中给出的步骤通过DRM在Raspberry Pi 4上运行JavaFX。我从下载了JavaFXEA16版本

javafx.properties
文件:

javafx.version=16-internal
javafx.runtime.version=16-internal+28-2020-11-10-180413
javafx.runtime.build=28
克隆包含hellofx的示例存储库后,我通过javac(按照步骤)编译了它,然后运行以下命令,使用DRM运行它:

sudo -E java -Dmonocle.platform=EGL -Djava.library.path=/opt/arm32hfb-sdk/lib -Dmonocle.egl.lib=/opt/arm32fb-sdk/lib/libgluon_drm.so --module-path /opt/arm32fb-sdk/lib --add-modules javafx.controls -cp dist/. hellofx.HelloFX
但是,这导致了以下错误:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x9c3314dc, pid=734, tid=746

#
# JRE version: OpenJDK Runtime Environment (11.0.9+11) (build 11.0.9+11-post-Raspbian-1deb10u1)
# Java VM: OpenJDK Server VM (11.0.9+11-post-Raspbian-1deb10u1, mixed mode, serial gc, linux-)
# Problematic frame:
# C  [libgluon_drm.so+0x14dc]  getNativeWindowHandle+0x54
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/pi/samples/CommandLine/Modular/CLI/hellofx/hs_err_pid734.log
#
# If you would like to submit a bug report, please visit:
#   Unknown
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted
似乎在
JavaFXSDK/lib/
中加载
libglion\u drm.so时,getNativeWindowHandle会失败

奇怪的是,在我运行了
sudo apt install libegl*mesa*libgl*
之后,它实际上成功了,但要求我将变量
ENABLE\u glion\u COMMERCIAL\u EXTENSIONS
设置为true,我已经这样做了

但是,重新启动后,它开始显示相同的错误

我使用的是带2GB内存的Raspberry Pi 4型号B。它运行在Raspberry Pi OS 32位桌面上

我在一个干净的装置上完成了所有这些

Pi4具有用于渲染的vc4和用于3D的v3d。您可以探测设备的功能-只有一个设备应该确认它具有DRIVER_RENDER或DRIVER_MODESET功能

JavaFX默认选择的卡是
/dev/dri/card1
。在我的例子中,用于渲染的是
/dev/dri/card0
,而不是
card1
。我使用以下运行时参数解决了此问题:

-Degl.displayid=/dev/dri/card0


我使用的JavaFX版本在第一次运行时是
16 ea+5

,看起来
/dev/card1
还没有准备好,但它从第二次开始就可以工作了(这将在即将发布的新版本中修复)。关于该标志,您必须将其添加到
.bashrc
,以便在每次启动时加载它。@JoséPereda如何准备好
/dev/card1
?如果我听起来很傻,我很抱歉,但我完全不知道这一点。@JoséPereda事情是,即使在第二次,它也不起作用。当我再次运行它时,它再次失败。这是它唯一有效的一次。@JoséPereda事实证明/dev/dri/card0在我的情况下是有效的。我使用了johanvos提到的
-Degl.displayid=/dev/dri/card0
。在我的情况下,card0和card1似乎是互换的。根据Raspberry Pi工程师6by9的说法,“Pi0-3您只有vc4驱动程序,因此渲染是通过/dev/dri/card0进行的。Pi4具有vc4 for render和v3d for 3D。您可以探测设备的功能-只有一个人应该承认它具有driver_render或driver_MODESET功能。”非常适合您。也许你可以把它贴出来作为答案?