[SOLVED] QT program with ALSA lib won't compile : ALSA development package not found



  • Hi,

    I am new to QT and I have just installed QT5 on a DEBIAN 7.5 contained in a VirtualBox on my MAC. QT creator runs fine and I can compile the PAINTING example project and run it.

    The problem I have is trying to compile the project Virtual MIDI Piano Keyboard : "VMPK":http://sourceforge.net/projects/vmpk/
    I get a message saying "ALSA development package not found"

    I installed the following Debian package
    aptitude install alsa-base alsa-utils alsa-tools libasound2 libasound2-dev
    --> The build problem was still there

    I did download the following package from !http://www.alsa-project.org/main/index.php/Main_Page()! :

    • alsa-lib-1.0.27.2
    • alsa-tools-1.0.27
    • alsa-oss-1.0.25
      compiled and installed them
      --> The build problem was still there

    tryed to build and install

    • alsa-utils-1.0.27.2
      but when running ./configure && make
      I got : amixer.c:559: undefined reference to 'snd_pcm_chmap_name'

    The problem seem to come from the installation of the ALSA (dev ?) environment but maybe the problem does not come from ALSA install but from no installing a component in QT ?

    Thanks in advance for your help.

    ERIC


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You need to install the alsa dev package which name is IIRC libasound2-dev

    On a side note it's Qt QT stands for Apple QuickTime



  • Thanks for the tip. Glad to be here.

    I think I have already done the install with this command :
    aptitude install alsa-base alsa-utils alsa-tools libasound2 libasound2-dev

    But maybe it is not installed properly. I will check this evening by uninstalling and installing again.

    I'll just say a few more things about what I am trying to do (might interest somebody).
    I am in the process of migrating a MIDI project (The MidyAX) that I did on ARDUINO/4D uVGA to the LINUX world. So I need to access MIDI through ALSA and have a graphic environnement too. Qt seem the best choice since the project will also run on RPi or BBB boards. Here the link to demo videos of the current version of the project :
    https://www.youtube.com/watch?v=sRJMb4RNuwo
    So it's project centered on piloting a MIDI device (AXE-FX). The aim is to use the BCR2000 MIDI control surface to do that in the best possible way.



  • I have run : dpkg-query -l 'alsa' and get
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name Version Architecture Description
    +++-==============-============-============-=================================
    un alsa <none> (no description available)
    ii alsa-base 1.0.25+3~deb all ALSA driver configuration files
    ii alsa-oss 1.0.25-1 i386 ALSA wrapper for OSS applications
    ii alsa-tools 1.0.25-2 i386 Console based ALSA utilities for
    ii alsa-utils 1.0.25-4 i386 Utilities for configuring and usi
    ii bluez-alsa:i38 4.99-2 i386 Bluetooth ALSA support
    un gstreamer0.10- <none> (no description available)
    un libesd-alsa0 <none> (no description available)
    un libsdl1.2debia <none> (no description available)
    ii libwine-alsa:i 1.4.1-4 i386 Windows API implementation - ALSA

    I ran : dpkg-query -l 'sound' and got :
    +++-==============-============-============-=================================
    un freedesktop-so <none> (no description available)
    un libasound-dev <none> (no description available)
    ii libasound2:i38 1.0.25-4 i386 shared library for ALSA applicati
    ii libasound2-dev 1.0.25-4 i386 shared library for ALSA applicati
    un libasound2-doc <none> (no description available)
    un libasound2-plu <none> (no description available)
    ii libasound2-plu 1.0.25-2 i386 ALSA library additional plugins
    ii libsoundtouch0 1.6.0-3 i386 Sound stretching library
    un linux-sound-ba <none> (no description available)
    ii sound-juicer 3.4.0-3 i386 GNOME CD Ripper
    ii sound-theme-fr 0.7.pristine all freedesktop.org sound theme

    Looks like ALSA deveopment is installed.


  • Lifetime Qt Champion

    Can you run your configure script with the -v option ? It will show you what fails when trying to detect ALSA dev packages



  • Thanks for the support and helping me with my problem that's cool. I feel less alone.

    Sorry but you mean the configure script of the ALSA installation package or a configure script for QT ?

    Running ./configure -v && make for ALSA-LIB, I got :
    @Making all in doc
    make[1]: Entering directory /usr/src/alsa-lib-1.0.27.2/doc' Making all in pictures make[2]: Entering directory/usr/src/alsa-lib-1.0.27.2/doc/pictures'
    make[2]: Nothing to be done for all'. make[2]: Leaving directory/usr/src/alsa-lib-1.0.27.2/doc/pictures'
    ......
    ...
    ....
    Making all in simple
    make[3]: Entering directory /usr/src/alsa-lib-1.0.27.2/modules/mixer/simple' CC sbase.lo CCLD smixer-sbase.la CC ac97.lo CC sbasedl.lo CCLD smixer-ac97.la CC hda.lo CCLD smixer-hda.la make[3]: Leaving directory/usr/src/alsa-lib-1.0.27.2/modules/mixer/simple'
    make[3]: Entering directory /usr/src/alsa-lib-1.0.27.2/modules/mixer' make[3]: Nothing to be done forall-am'.
    ...
    ...
    ...
    @
    Aparantly no errors

    I ran ./configure -v && make for ALSA-UTILS
    @root@debian32wheezy:/usr/src/alsa-utils-1.0.27.2# ./configure -v && make > alsa-utils-configure.log
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... no
    ...
    ...
    ...

    checking for special C compiler options needed for large files... no
    checking for _FILE_OFFSET_BITS value needed for large files... 64
    ./configure: line 9002: --variable=systemdsystemunitdir: command not found
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating alsactl/Makefile
    config.status: creating alsactl/init/Makefile
    config.status: creating alsamixer/Makefile
    config.status: creating amidi/Makefile
    config.status: creating amixer/Makefile
    config.status: creating m4/Makefile
    config.status: creating po/Makefile.in
    config.status: creating alsaconf/alsaconf
    config.status: creating alsaconf/Makefile
    config.status: creating alsaconf/po/Makefile
    config.status: WARNING: 'alsaconf/po/Makefile.in' seems to ignore the --datarootdir setting
    config.status: creating alsaucm/Makefile
    config.status: creating aplay/Makefile
    ...
    ...
    ...
    amixer.o: In function decode_tlv': /usr/src/alsa-utils-1.0.27.2/amixer/amixer.c:559: undefined reference tosnd_pcm_chmap_name'
    collect2: error: ld returned 1 exit status
    make[1]: *** [amixer] Error 1
    make: *** [all-recursive] Error 1
    @
    not sure what the errors means

    I ran the following commands
    root@debian32wheezy:/usr/src/alsa-lib-1.0.27.2# amidi -l
    Dir Device Name
    IO hw:1,0,0 AXE-FX II MIDI 1

    I ran a MIDI when
    amidi -p hw:1,0,0 -d
    and displayed the SYSEX received from the AXE-FX in the terminal window

    So ALSA MIDI works. It's the dev part that is not installed properly


  • Lifetime Qt Champion

    You might be linking the system libasound2 rather that the one you just created.

    What I suggested is to run Qt's configure with the -v option so you can see exactly what failure you have for ALSA.



  • Solved it by removing the line :

       PKGCONFIG += alsa
    

    from the project file vmpk.pro in the "linux*:!simulator" section.

    and changed
    LIBS += -lpthread
    to
    LIBS += -lpthread -lasound

    Then there was a compile error on this line :

       QDir dir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
    

    and I changed it to :

        QDir dir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
    

    This is due to a changes in the Qt API for version 5.

    It is now working and receiving MIDI input from an external MIDI keyboard. Super.

    Thanks SGaist for the help.



  • Two more thing.

    At one point I had the message "cannot find -lGL".

    Solved it by installing : sudo apt-get install libglu1-mesa-dev -y

    Running in debug mode, I get these messages :
    Starting /home/eric/Downloads/build-vmpk-Desktop_Qt_5_3_0_GCC_32bit-Debug/vmpk...
    file "/home/eric/Downloads/build-vmpk-Desktop_Qt_5_3_0_GCC_32bit-Debug/../share/vmpk/gmgsxg.ins" not readable.
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: glXGetFBConfigAttrib for 0x96e1e40, failed to get XVisualInfo
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: glXGetFBConfigAttrib for 0x96e1e40, failed to get XVisualInfo
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: glXGetFBConfigAttrib for 0x96e1e40, failed to get XVisualInfo
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: glXGetFBConfigAttrib for 0x96e1e40, failed to get XVisualInfo
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: glXGetFBConfigAttrib for 0x96e1e40, failed to get XVisualInfo
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: glXGetFBConfigAttrib for 0x96e1e40, failed to get XVisualInfo
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: glXGetFBConfigAttrib for 0x96e1e40, failed to get XVisualInfo
    OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x96e1e40
    OpenGL Warning: Retry with 0x8002 returned 0 visuals
    OpenGL Warning: glXGetFBConfigAttrib for 0x96e1e40, failed to get XVisualInfo

    .... I'll have to investigate that.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.