Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Qt5.6 Playing .wav file

    Mobile and Embedded
    qt5 audio
    2
    3
    1350
    Loading More Posts
    • 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.
    • Y
      Yair BA last edited by

      I'm trying, without success, to use QAudio/QMediaPlayer to play .wav file on a board based on Atmel's SAMA5D2. Running Qt multimedia example 'audiooutput', just opens a GUI and print null device error to the serial console.

      The error messages are:
      If using QAudio - null device found.
      If using QMediaPlayer - no service found for - "org.qt-project.qt.mediaplayer".

      From the command-line there is no problem to play the same .wav file by using 'aplay' or 'tinyplay' command, so it's not an hardware problem.

      Technical details:
      buildroot-2016.05
      Kernel:4.9
      Qt version: 5.6.2
      Driver: wm8523
      Installed packages (among others): qt5multimedia, gstreamer, alsa

      Any suggestions how can I play a .wav file with Qt5? Maybe add phonon package?

      Yair

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        You should start your application with the QT_DEBUG_PLUGINS environment variable set to 1. That should show you what happens with the multimedia plugins.

        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 Reply Quote 0
        • Y
          Yair BA last edited by

          I re-built the file system image, this time with Buildroot-2017.02 and Qt version 5.6.2.

          I ran, on the target board, the audiooutput example that Qt provides and got a lots of pulseaudio warnings.

          Remembering the above QT_DEBUG_PLUGINS hint, I took a look inside the /usr/lib/qt/plugins/audio directory on the target board and found two plugins: libqtmedia_pulse.so and libqtaudio_alsa.so .

          Removing the libqtmedia_pulse.so plugin solved the race condition with libqtaudio_alsa.so and solved the problem.

          In addition, make sure that alsa-lib builds before qt5multimedia (commit 8d7dd837e5e from mainline Buildroot: "qt5multimedia: conditionally add alsa-lib to dependencies").

          1 Reply Last reply Reply Quote 0
          • First post
            Last post