Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Raspberry pi + QtMultimedia + Alsa
Forum Updated to NodeBB v4.3 + New Features

Raspberry pi + QtMultimedia + Alsa

Scheduled Pinned Locked Moved Solved Mobile and Embedded
17 Posts 5 Posters 9.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arthux
    wrote on 3 Mar 2017, 14:07 last edited by
    #1

    Hi !

    I do this tutorial for crosscompiling Qt5.8 for my raspberry pi : https://wiki.qt.io/Raspberry_Pi_Beginners_Guide . Every thing it's ok. But when I cross compile for QtMultimedia, I get this :

    ~/opt/qt5/qtmultimedia$ /usr/local/qt5pi/bin/qmake 
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Qt Multimedia:
      ALSA ................................... no
      GStreamer 1.0 .......................... no
      GStreamer 0.10 ......................... no
      Video for Linux ........................ yes
      OpenAL ................................. no
      PulseAudio ............................. no
      Resource Policy (libresourceqt5) ....... no
      DirectShow ............................. no
      Windows Media Foundation ............... no
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, you must run 'make install'.
    Qt will be installed into '/mnt/rasp-pi-rootfs/usr/local/qt5pi'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    I'd like to use the USB microphone with QAudioInput library, but Qt doesn"t detect the microphone.

    I can see the USB microphone in alsamixer program and work well with audacity.

    I think the problem is "ALSA ...... no" when I qmake QtMultimedia. And I don't know how to switch to "yes" the line "ALSA".

    So my question, how can I pass ALSA to Yes ?

    Thank a lot for your help and sorry for my english.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TioRoy
      wrote on 3 Mar 2017, 14:25 last edited by TioRoy 3 Mar 2017, 14:26
      #2

      You need to install the dev dependencies.

      I don't like the method to mount an image to make the crosscompiling.
      I prefer to boot the PI, install all dev dependencies on it. rsync files to my linux (to a sysroot dir).

      This guide describes the steps. But note this guide compiles Qt with no X11.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TioRoy
        wrote on 3 Mar 2017, 14:33 last edited by TioRoy 3 Mar 2017, 14:33
        #3

        Some time ago I've cross compile the Qt to my PI (Jessie)

        I installed this dev deps. My Idea was to compile ALL Qt modules and plugins.

        sudo apt-get install libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad libraspberrypi-dev libpulse-dev libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev libiodbc2-dev libmysqlclient-dev firebird-dev libpng12-dev libjpeg9-dev libgst-dev libxext-dev libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync1-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxi-dev libdrm-dev

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Arthux
          wrote on 3 Mar 2017, 15:10 last edited by Arthux 3 Mar 2017, 15:31
          #4

          This installation must be done on the raspberry ? Because I installed what you told me on my raspberry to remake my image.

          It gives the same thing ...

          1 Reply Last reply
          0
          • T Offline
            T Offline
            TioRoy
            wrote on 3 Mar 2017, 19:41 last edited by
            #5

            Hum... I'll try to reproduce here.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Arthux
              wrote on 6 Mar 2017, 10:57 last edited by
              #6

              It'is in the host pc. Alsa is detected in my virtual 32bits machine, but not in my 64bits machine.

              I have an error when i compile qtmultimedia :

              make[3] : on entre dans le répertoire « /home/user/opt/qt5/qtmultimedia/src/plugins/alsa »
              /home/user/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -D_REENTRANT -fPIC -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../../../include/QtMultimedia/5.8.1 -I../../../include/QtMultimedia/5.8.1/QtMultimedia -I../../../include -I../../../include/QtMultimedia -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtGui/5.8.1 -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtGui/5.8.1/QtGui -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtGui -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtCore/5.8.1 -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtCore/5.8.1/QtCore -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtNetwork -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtCore -I.moc -I/mnt/rasp-pi-rootfs/opt/vc/include -I/mnt/rasp-pi-rootfs/opt/vc/include/interface/vcos/pthreads -I/mnt/rasp-pi-rootfs/opt/vc/include/interface/vmcs_host/linux -I/usr/local/qt5pi/mkspecs/devices/linux-rasp-pi-g++ -o .obj/qalsaplugin.o qalsaplugin.cpp
              In file included from qalsaplugin.cpp:41:0:
              qalsaaudiodeviceinfo.h:55:28: fatal error: alsa/asoundlib.h: Aucun fichier ou dossier de ce type
              compilation terminated.
              Makefile:850 : la recette pour la cible « .obj/qalsaplugin.o » a échouée
              make[3]: *** [.obj/qalsaplugin.o] Erreur 1
              make[3] : on quitte le répertoire « /home/user/opt/qt5/qtmultimedia/src/plugins/alsa »
              Makefile:94 : la recette pour la cible « sub-alsa-make_first » a échouée
              make[2]: *** [sub-alsa-make_first] Erreur 2
              make[2] : on quitte le répertoire « /home/user/opt/qt5/qtmultimedia/src/plugins »
              Makefile:95 : la recette pour la cible « sub-plugins-make_first » a échouée
              make[1]: *** [sub-plugins-make_first] Erreur 2
              make[1] : on quitte le répertoire « /home/user/opt/qt5/qtmultimedia/src »
              Makefile:44 : la recette pour la cible « sub-src-make_first » a échouée
              make: *** [sub-src-make_first] Erreur 2
              
              

              But libasound2-dev is already installed ...

              Do you know what can I do ?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 6 Mar 2017, 23:20 last edited by SGaist 3 Jun 2017, 23:21
                #7

                Hi and welcome to devnet,

                Did you install the ALSA development package for your target ?

                [edit: corrected question SGaist]

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  Chrizzy87
                  wrote on 7 Mar 2017, 20:14 last edited by
                  #8

                  Hi everyone! I got the same issues. I'm a beginner in crosscompiling and just followed the tutorial: https://wiki.qt.io/RaspberryPi2EGLFS ; Now i want to capture Audio Data via USB Audio Adapter (ALSA) but cannot use the QtMultimedia library. Would appreciate it very much, if anyone can help and post a little tutorial about the steps which are different to the tutorial for enabling QtMultimedia. Thanks a lot!

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 7 Mar 2017, 20:27 last edited by
                    #9

                    Hi and welcome to devnet,

                    The same question applies: did you install the ALSA dev packages on your target ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Arthux
                      wrote on 9 Mar 2017, 07:25 last edited by
                      #10

                      Install alsa dev on target and 32bits host machine and it work well. But I don't know for 64bits host machine ...

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 9 Mar 2017, 07:42 last edited by
                        #11

                        It should apply the same for a 64bit host.

                        Do you mean you have it working properly now or is it still failing ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          Arthux
                          wrote on 9 Mar 2017, 08:42 last edited by
                          #12

                          It's working with a 32bits virtual machine, I try the same thing with a 64bits machine

                          jsulmJ 1 Reply Last reply 9 Mar 2017, 09:13
                          0
                          • A Arthux
                            9 Mar 2017, 08:42

                            It's working with a 32bits virtual machine, I try the same thing with a 64bits machine

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 9 Mar 2017, 09:13 last edited by
                            #13

                            @Arthux And what is the problem with 64bit machine? You just need to do the same as on 32bit.

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              Arthux
                              wrote on 9 Mar 2017, 10:12 last edited by
                              #14

                              When I do qmake to qtmultimedia folder, QMake doesn't re-check alsa library. So it mark "no" to alsa plugin ...

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                Arthux
                                wrote on 9 Mar 2017, 17:18 last edited by
                                #15

                                So, I finally do this tutorial : https://wiki.qt.io/RaspberryPi2EGLFS

                                It's perfect on 64bits host machine !

                                You must to install this libraries on the target (and purhaps on host machine) for alsa support on QtMultimedia before to do the tutorial :

                                sudo apt-get install libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev \
                                libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad libraspberrypi-dev libpulse-dev \
                                libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev libiodbc2-dev libmysqlclient-dev firebird-dev libpng12-dev libjpeg9-dev libgst-dev libxext-dev libxcb1 \
                                libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev \
                                libxcb-sync0 libxcb-sync1-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxi-dev libdrm-dev gstreamer0.10-alsa
                                

                                I prefert to download all Qt Libraries with this repo :

                                git clone git://code.qt.io/qt/qt5.git
                                cd qt5
                                ./init-repository
                                

                                And I had a little problem with icu and linaro toolchain. You can solve this with add "-no-icu" to configure the qt library.

                                And thank a lot, men, for your help !

                                1 Reply Last reply
                                0
                                • C Offline
                                  C Offline
                                  Chrizzy87
                                  wrote on 11 Mar 2017, 18:37 last edited by Chrizzy87 3 Nov 2017, 18:38
                                  #16

                                  Hey, thanks for your answers! I made some progress. I installed the dependencies and cloned the repository, Arthux posted. Configured it like described in the tutorial, but now I'm stuck at "sudo make install".

                                  Ich get the following error message, saying that stdc-predef could not be found:

                                  In file included from <command-line>:0:0:
                                  /home/chrizzy/raspi/sysroot/usr/include/stdc-predef.h:59:1: error: one or more PCH files were found, but they were invalid
                                   #endif
                                   ^
                                  /home/chrizzy/raspi/sysroot/usr/include/stdc-predef.h:59:1: error: use -Winvalid-pch for more information
                                  /home/chrizzy/raspi/sysroot/usr/include/stdc-predef.h:59:1: fatal error: .pch/Qt5Multimedia: Datei oder Verzeichnis nicht gefunden
                                  compilation terminated.
                                  Makefile:15672: die Regel für Ziel „.obj/qmediacontrol.o“ scheiterte
                                  make[3]: *** [.obj/qmediacontrol.o] Fehler 1
                                  make[3]: Verzeichnis „/home/chrizzy/raspi/qt5complete/qtmultimedia/src/multimedia“ wird verlassen
                                  Makefile:58: die Regel für Ziel „sub-multimedia-install_subtargets“ scheiterte
                                  make[2]: *** [sub-multimedia-install_subtargets] Fehler 2
                                  make[2]: Verzeichnis „/home/chrizzy/raspi/qt5complete/qtmultimedia/src“ wird verlassen
                                  Makefile:56: die Regel für Ziel „sub-src-install_subtargets“ scheiterte
                                  make[1]: *** [sub-src-install_subtargets] Fehler 2
                                  make[1]: Verzeichnis „/home/chrizzy/raspi/qt5complete/qtmultimedia“ wird verlassen
                                  Makefile:633: die Regel für Ziel „module-qtmultimedia-install_subtargets“ scheiterte
                                  make: *** [module-qtmultimedia-install_subtargets] Fehler 2
                                  

                                  Has anyone an idea how to solve this? Thanks a lot in advance!

                                  1 Reply Last reply
                                  0
                                  • C Offline
                                    C Offline
                                    Chrizzy87
                                    wrote on 14 Mar 2017, 20:29 last edited by
                                    #17

                                    Solved it by adding the following argument to the ./configure call:

                                    -no-pch
                                    
                                    1 Reply Last reply
                                    0

                                    1/17

                                    3 Mar 2017, 14:07

                                    • Login

                                    • Login or register to search.
                                    1 out of 17
                                    • First post
                                      1/17
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Users
                                    • Groups
                                    • Search
                                    • Get Qt Extensions
                                    • Unsolved