How to run a qml applicatiion with wegbl on a embedded system?
-
hi:
my hardware is beaglebone black
the Qt version on the beaglebone is 5.14.2
I wite a simple qml application and run it on my pc with -platform webgl, it can work.
then I cross compile it and run it on my beaglebone:
#qt.qpa.plugin: Could not find the Qt platform plugin "webgl" in "/usr/lib/plugins"
#This application failed to start because no Qt platform plugin could be initialized. Reinstalling the #application m.
#Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland.then I run it with -platform eglfs and -platform wayland, it can works on the LCD.
-
Hi,
You need to build the qtwebglplugin project in order to have its QPA available. I don't know whether it's doable in a cross-compilation context.
-
@SGaist
Hi:
I crosscompile the qt with -opengl es2,and copy the libqwebgl.so to my beaglebone , but still can't run the qml with webgl,
this is the log informatiaon:Found metadata in lib /opt/libqwebgl.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"webgl"
]
},
"archreq": 0,
"className": "QWebGLIntegrationPlugin",
"debug": false,
"version": 331264
}Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /usr/lib/plugins/platforms/libqlinuxfb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"linuxfb"
]
},
"archreq": 0,
"className": "QLinuxFbIntegrationPlugin",
"debug": false,
"version": 331264
}Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/lib/plugins/platforms/libqminimal.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimal"
]
},
"archreq": 0,
"className": "QMinimalIntegrationPlugin",
"debug": false,
"version": 331264
}Got keys from plugin meta data ("webgl")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/platforms" ...
Cannot load library /usr/lib/plugins/platforms/libqwebgl.so: (/usr/lib/plugins/platforms/libqwebgl.so: undefined symbol: ZNK20QPlatformIntegration28createPlatformSessionManagerERK7QStringS2, version Qt)
QLibraryPrivate::loadPlugin failed on "/usr/lib/plugins/platforms/libqwebgl.so" : "Cannot load library /usr/lib/plugins/platforms/libqwebgl.so: (/usr/lib/plugins/platforms/libqwebgl.so: undefined symbol:"
qt.qpa.plugin: Could not load the Qt platform plugin "webgl" in "/usr/lib/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, webgl.
-
Are you sure you installed the plugin ?
-
@SGaist
HI:
I just copy the libqwebgl.so to /root/usr/lib/plugins/platforms/ ,and run the qmi app with -platform webgl,:Found metadata in lib /opt/libqwebgl.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"webgl"
]
},
"archreq": 0,
"className": "QWebGLIntegrationPlugin",
"debug": false,
"version": 331264
}
Got keys from plugin meta data ("webgl")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/platforms" ...
Cannot load library /usr/lib/plugins/platforms/libqwebgl.so: (/usr/lib/plugins/platforms/libqwebgl.so: undefined symbol: ZNK20QPlatformIntegration28createPlatformSessionManagerERK7QStringS2, version Qt) -
@feixu said in How to run a qml applicatiion with wegbl on a embedded system?:
I just copy the libqwebgl.so to /root/usr/lib/plugins/platforms/
Where does that plugin come from ?
-
Which version of Qt are you using on your device ?
You seem to be putting the plugin in a system folder rather than in a dedicated Qt installation, -
- Which version of Qt are you using on your device ?
qt5.14.2
2.You seem to be putting the plugin in a system folder rather than in a dedicated Qt installation,
yes,I use ti‘s sdk . qt cannot be installed directly on the bbb,need to be cross compiled on the PC
first,and copy to the board.
I saw Qt Quick WebGL platform plugin worked on a Raspberry PI:
https://www.qt.io/blog/2017/03/24/webgl-streaming-raspberry-pi-zero-w
Is qt installed directly on Raspberry PI:?
- Which version of Qt are you using on your device ?
-
The raspbian provides Qt but it usually is a bit behind the current version and thus most people cross-compile it.
As for your use case, where exactly did you install your cross-compiled Qt ?
-
@SGaist
Thank you for your continued help, this issue has been resolved.
this time I copy the whole cross-compiled qt lib to the board ,replace the prebuilt qt lib。
now it‘s working。
running qml in the web browser is really awesome~ I don't need a touch screen anymore
-
Great !
Then please mark the thread as solved so other forum users may know a solution has been found :-)