Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cross-compiled Qt 5.15.2 cannot find VirtualKeyboard or Multimedia plugins for Raspberry Pi 4.



  • I cross-compiled Qt 5.15.2 to my Raspberry Pi 4. I have the installation at /usr/local/qt5.15.

    I'm getting these errors when I try to run:

    using null output device, none available
    module "QtQuick.VirtualKeyboard.Plugins" is not installed
    

    I did export QML2_IMPORT_PATH="/usr/local/qt5.15/qml" so Qt can find most of the qml modules, but it still can't find the Multimedia and VirtualKeyboard.

    I pretty sure I have them installed, as I can find them when I search for them.

    pi@raspberrypi:~ $ find /usr/local/qt5.15 -name "QtMultimedia"
    /usr/local/qt5.15/qml/QtMultimedia
    /usr/local/qt5.15/include/QtMultimedia
    /usr/local/qt5.15/include/QtMultimedia/QtMultimedia
    /usr/local/qt5.15/include/QtMultimedia/5.15.2/QtMultimedia
    pi@raspberrypi:~ $ find /usr/local/qt5.15 -name "QtVirtualKeyboard"
    /usr/local/qt5.15/include/QtVirtualKeyboard
    /usr/local/qt5.15/include/QtVirtualKeyboard/5.15.2/QtVirtualKeyboard
    /usr/local/qt5.15/include/QtVirtualKeyboard/QtVirtualKeyboard
    

    I also have qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); in my code, so the VirtualKeyboard should work.

    Is there some other environment variable I have to set?


  • Lifetime Qt Champion

    Hi,

    Did you check the configure summary ?
    Does it show anything unusual related to multimedia and virtual keyboard.



  • Here's the multimedia configuration:

    Qt Multimedia:
      ALSA ................................... yes
      GStreamer 1.0 .......................... no
      GStreamer 0.10 ......................... no
      Video for Linux ........................ yes
      OpenAL ................................. no
      PulseAudio ............................. yes
      Resource Policy (libresourceqt5) ....... no
      Windows Audio Services ................. no
      DirectShow ............................. no
      Windows Media Foundation ............... no
    

    I can't find anything related to the virtual keyboard.


  • Lifetime Qt Champion

    Did you check the content of the build folder for the related libraries ?



  • I think I have them. I'm not sure exactly what I'm looking for, but here's the results for some find commands:

    pi@raspberrypi:~ $ find /usr/local/qt5.15 -iname "*multimedia*" | grep .so
    /usr/local/qt5.15/qml/QtMultimedia/libdeclarative_multimedia.so
    /usr/local/qt5.15/lib/libQt5MultimediaWidgets.so.5
    /usr/local/qt5.15/lib/libQt5MultimediaQuick.so.5
    /usr/local/qt5.15/lib/libQt5MultimediaQuick.so.5.15.2
    /usr/local/qt5.15/lib/libQt5Multimedia.so.5.15.2
    /usr/local/qt5.15/lib/libQt5MultimediaWidgets.so.5.15
    /usr/local/qt5.15/lib/libQt5MultimediaQuick.so
    /usr/local/qt5.15/lib/libQt5MultimediaWidgets.so
    /usr/local/qt5.15/lib/libQt5Multimedia.so.5
    /usr/local/qt5.15/lib/libQt5Multimedia.so
    /usr/local/qt5.15/lib/libQt5Multimedia.so.5.15
    /usr/local/qt5.15/lib/libQt5MultimediaQuick.so.5.15
    /usr/local/qt5.15/lib/libQt5MultimediaWidgets.so.5.15.2
    /usr/local/qt5.15/plugins/playlistformats/libqtmultimedia_m3u.so
    
    pi@raspberrypi:~ $ find /usr/local/qt5.15 -iname "*keyboard*" | grep .so
    /usr/local/qt5.15/qml/QtQuick/VirtualKeyboard/libqtquickvirtualkeyboardplugin.so
    /usr/local/qt5.15/qml/QtQuick/VirtualKeyboard/Styles/libqtquickvirtualkeyboardstylesplugin.so
    /usr/local/qt5.15/qml/QtQuick/VirtualKeyboard/Settings/libqtquickvirtualkeyboardsettingsplugin.so
    /usr/local/qt5.15/lib/libQt5VirtualKeyboard.so.5.15.2
    /usr/local/qt5.15/lib/libQt5VirtualKeyboard.so.5.15
    /usr/local/qt5.15/lib/libQt5VirtualKeyboard.so.5
    /usr/local/qt5.15/lib/libQt5VirtualKeyboard.so
    /usr/local/qt5.15/plugins/generic/libqevdevkeyboardplugin.so
    /usr/local/qt5.15/plugins/virtualkeyboard/libqtvirtualkeyboard_pinyin.so
    /usr/local/qt5.15/plugins/virtualkeyboard/libqtvirtualkeyboard_hangul.so
    /usr/local/qt5.15/plugins/virtualkeyboard/libqtvirtualkeyboard_openwnn.so
    /usr/local/qt5.15/plugins/virtualkeyboard/libqtvirtualkeyboard_tcime.so
    /usr/local/qt5.15/plugins/virtualkeyboard/libqtvirtualkeyboard_thai.so
    /usr/local/qt5.15/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so
    

  • Lifetime Qt Champion

    That looks good...
    Maybe a silly question but are you sure you are using the correct qmake to build your application ?



  • I think it's the correct qmake. I'm using CMake to build.

    In my Raspberry Pi kit in QtCreator I have a manual Qt version defined that's using the path: ~/pi/qt5.15/bin/qmake which is what I expect since my local cross-compile install directory is ~/pi/qt5.15.


  • Lifetime Qt Champion

    Something is not completely clear.

    Are you cross-compiling from your desktop to your Pi or directly on the Pi ?

    Usually, when cross-compiling, the Qt build shall be copied to the target in the some folder tree.



  • My cross-compiled Qt5.15.2 was built on my host machine against the Raspberry Pi libraries, and then copied over from host: ~/pi/qt5.15/ to Pi: /usr/local/qt5.15/. Both paths have the same content & folder structure.

    I'm now trying to build my program with QtCreator on my host machine, and then deploy it over to the Pi. Which is generally working. The main window shows up correctly at least.


  • Lifetime Qt Champion

    You should have these files in the same folder on your Pi.



  • I have the exact same files in those 2 locations. If I ls -l on each machine:

    fahad@fahad-ThinkPad-T490:~$ ls -l ~/pi/qt5.15/
    total 68
    drwxrwxr-x  2 fahad fahad  4096 Dec 14 10:56 bin
    drwxrwxr-x  4 fahad fahad  4096 Dec 14 10:52 doc
    drwxrwxr-x 91 fahad fahad  4096 Dec 14 10:56 include
    drwxrwxr-x  5 fahad fahad 28672 Dec 14 10:56 lib
    drwxrwxr-x 77 fahad fahad  4096 Dec 14 10:52 mkspecs
    drwxrwxr-x 29 fahad fahad  4096 Dec 14 10:55 plugins
    drwxrwxr-x 25 fahad fahad  4096 Dec 14 10:56 qml
    drwxrwxr-x  2 fahad fahad 12288 Dec 14 10:56 translations
    
    pi@raspberrypi:~ $ ls -l /usr/local/qt5.15/
    total 68
    drwxrwxr-x  2 pi pi  4096 Dec 14 10:56 bin
    drwxrwxr-x  4 pi pi  4096 Dec 14 10:52 doc
    drwxrwxr-x 91 pi pi  4096 Dec 14 10:56 include
    drwxrwxr-x  5 pi pi 28672 Dec 14 10:56 lib
    drwxrwxr-x 77 pi pi  4096 Dec 14 10:52 mkspecs
    drwxrwxr-x 29 pi pi  4096 Dec 14 10:55 plugins
    drwxrwxr-x 25 pi pi  4096 Dec 14 10:56 qml
    drwxrwxr-x  2 pi pi 12288 Dec 14 10:56 translations
    

    Or are you saying I need to exact same folder structure down to root? Like, if my files are at /usr/local/qt5.15/ on the Pi then they also need to be at /usr/local/qt5.15/ on my host?


  • Lifetime Qt Champion

    The second choice, same folder structure.