Pyside2 over LinuxFB/DRM
-
We are using PySide2 on our embedded Linux board, the hardware does not contain GPU (and no X11). So we have to use LinuxFB/DRM. The Qt for C++ works well. We set the correct environment variables:
export QT_QPA_FB_TSLIB=1 export QT_ROOT=/data/QT5/arm-qt export QT_QPA_FONTDIR=$QT_ROOT/fonts/truetype/freefont export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins export QT_PLUGIN_PATH=$QT_ROOT/plugins export LD_LIBRARY_PATH=$QT_ROOT/lib:$QT_ROOT/plugins/platforms export QT_QPA_PLATFORM=linuxfb export QT_QPA_FB_DRM=1
After downloading PySide2(from https://archlinuxarm.org/packages/aarch64/pyside2), we run a python sample and it complains
ImportError: /data/usr/lib/python3.9/site-packages/PySide2/QtWidgets.cpython-39-aarch64-linux-gnu.so: undefined symbol: _ZTI13QOpenGLWidget, version Qt_5
.Does it mean that PySide2 (or shiboken2) didn't use LinuxFB/DRM? Is there any way to switch to LinuxFB/DRM without recompiling PySide2?
-
Hi and welcome to devnet,
Does your Qt library come from the same source as PySide2 ?
Does your example use QOpenGLWidget ?
-
@JimJin said in Pyside2 over LinuxFB/DRM:
Does your Qt library come from the same source as PySide2 ?
No
Then you should ensure it does.
PySide2 is built against a set of libraries that provides all the classes exposed as Python classes. You seem to use a version of Qt that is lighter weight.
-
Then you should ensure it does.
Sure. We are going to do it.
You seem to use a version of Qt that is lighter weight.
Yes. We are using Qt Embedded. However, we can't find the manual of compiling PySide2 on ARM. Could you please show us a link of a porting guide to ARM?
-
What are you using to cross-compile Qt ?
-
@JimJin said in Pyside2 over LinuxFB/DRM:
Does your Qt library come from the same source as PySide2 ?
Is it possible to hack PySide2 binaries(from https://archlinuxarm.org/packages/aarch64/pyside2) which redirect OpenGL to LinuxFB?
-
You are mixing two different things. The backend plugin is not the issue.
Your issue is that you are trying to use a version of PySide2 that was built against a version of Qt with OpenGL enable and thus using the corresponding symbols with a version of Qt with OpenGL disabled as it seems.
-
Your issue is that you are trying to use a version of PySide2 that was built against a version of Qt with OpenGL enable and thus using the corresponding symbols with a version of Qt with OpenGL disabled as it seems.
Yes, exactly. So,
- Is there any hack(or workaround) to let the PySide2 of OpenGL work on QT of LinuxFB?
- Or, is there any manual (or article) to guide us to cross-compile PySide2 on embedded Linux?
-
@JimJin said in Pyside2 over LinuxFB/DRM:
Is there any hack(or workaround) to let the PySide2 of OpenGL work on QT of LinuxFB?
As I already wrote several times: your issue is unrelated to mixing OpenGL and LinuxFB
@JimJin said in Pyside2 over LinuxFB/DRM:
Or, is there any manual (or article) to guide us to cross-compile PySide2 on embedded Linux?
I am not aware of any but since it's a Qt project following the documentation:
python setup.py build --qmake=/path/to/your-cross-compiled-Qt/bin/qmake --ignore-git --parallel=8
might be enough.
-
I do not think there's anything special to do as long as you use a Qt version that was built with OpenGL disabled but that's only a guess.