我正在按照 Gluon Documentation 给出的步骤进行操作通过 DRM 在 Raspberry Pi 4 上运行 JavaFX。我从 here 下载了 JavaFX EA 16 版本.
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/
中加载 libgluon_drm.so
时在 getNativeWindowHandle 处失败
奇怪的是,在我运行 sudo apt install libegl* mesa* libgl*
之后,它实际上成功了,但要求我将变量 ENABLE_GLUON_COMMERCIAL_EXTENSIONS
设置为 true,我已经完成了。
但是,重新启动后,它开始显示相同的错误。
我使用的是带有 2GB RAM 的 Raspberry Pi 4 B 型。它在带有桌面的 Raspberry Pi OS 32 位上运行。
我在全新安装中执行了所有这些操作。
最佳答案
Pi4 has both vc4 for render, and v3d for 3D. You can probe the devices for their capabilities - only one should acknowledge that it has DRIVER_RENDER or DRIVER_MODESET capabilities.
JavaFX默认选择的卡是/dev/dri/card1
。在我的例子中,/dev/dri/card0
是用于渲染的,而不是 card1
。我通过使用以下运行时参数解决了这个问题:
-Degl.displayid=/dev/dri/card0
我使用的 JavaFX 版本是 16-ea+5
。
关于javafx - Gluon JavaFX 16 EA 4 上的 "getNativeWindowHandle+0x54"通过 DRM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65070705/