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 && Qt5 && play mp3 problem
Qt 6.11 is out! See what's new in the release blog

Raspberry && Qt5 && play mp3 problem

Scheduled Pinned Locked Moved Mobile and Embedded
12 Posts 5 Posters 10.2k 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.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    Hi all,
    I built Qt 5.1.0 for my Raspberry and I can build my qt applications for the board.

    Now I have some problem when trying to play mp3 with QMediaPlayer:
    @
    QMediaPlayer *player = new QMediaPlayer;
    player->setMedia(QUrl::fromLocalFile("/tmp/alarm.mp3"));
    player->setVolume(50);
    player->play();
    @

    When I execute the code I get the following message and I can't hear the sound:
    @
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
    @

    When configuring Qt 5 I get the following report:
    @
    Configure summary

    Building on: linux-g++ (i386, CPU features:)
    Building for: devices/linux-rasp-pi-g++ (arm, CPU features:)
    Platform notes:

            - Also available for Linux: linux-kcc linux-icc linux-cxx
    

    Build options:
    Configuration .......... accessibility alsa audio-backend c++11 clock-gettime clock-monotonic concurrent cross_compile egl eglfs evdev eventfd force_debug_info freetype full-config getaddrinfo getifaddrs iconv icu inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap neon nis opengl opengles2 openssl pcre png qpa qpa reduce_exports reduce_relocations release rpath shared small-config system-zlib v8 v8snapshot
    Build parts ............ libs
    Mode ................... release (with debug info)
    Using C++11 ............ yes
    Using PCH .............. no
    Target compiler supports:
    iWMMXt/Neon .......... no/yes

    Qt modules and options:
    Qt D-Bus ............... no
    Qt Concurrent .......... yes
    Qt GUI ................. yes
    Qt Widgets ............. yes
    JavaScriptCore JIT ..... yes (To be decided by JavaScriptCore)
    QML debugging .......... yes
    Use system proxies ..... no

    Support enabled for:
    Accessibility .......... yes
    ALSA ................... yes
    CUPS ................... no
    FontConfig ............. no
    Iconv .................. yes
    ICU .................... yes
    Image formats:
    GIF .................. yes (plugin, using system library)
    JPEG ................. yes (plugin, using bundled copy)
    PNG .................. yes (in QtGui, using bundled copy)
    Glib ................... no
    GStreamer .............. no
    GTK theme .............. no
    Large File ............. yes
    libudev ................ yes
    Networking:
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    OpenSSL .............. yes (loading libraries at run-time)
    NIS .................... yes
    OpenGL ................. yes (OpenGL ES 2.x)
    OpenVG ................. no
    PCRE ................... yes (bundled copy)
    pkg-config ............. yes
    PulseAudio ............. no
    QPA backends:
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. yes
    XCB .................. no
    Session management ..... yes
    SQL drivers:
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... yes (plugin, using bundled copy)
    TDS .................. no
    udev ................... yes
    xkbcommon .............. no
    zlib ................... yes (system library)
    @

    As you can see, there is:
    @
    GStreamer .............. no
    @

    and I think this is the problem but I don't know how to enable GStreamer.

    I installed all the required libraries in the Raspberry:
    @
    apt-get install 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

    @

    Can you help me?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      helthans
      wrote on last edited by
      #2

      Hi

      I see a similar issue - have you found a solution yet?

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca
        wrote on last edited by
        #3

        Hi,
        now I'm using a "workaround":
        @
        QProcess("mpg123 myfile.mp3");
        @

        1 Reply Last reply
        0
        • tomasz3dkT Offline
          tomasz3dkT Offline
          tomasz3dk
          wrote on last edited by
          #4

          Hi,
          I had same issue on my pi, but my Qt was in 5.0.2 version, and didn't find solutions to solve this problem ;/, somewhere i've read that there is a problem with gstreamer for Pi maybe it has solved. But i've lost my cross-compiled Qt for Pi, and now i have problems to cross-compile Qt for Pi. Can you provide a good tutorial for it?

          1 Reply Last reply
          0
          • H Offline
            H Offline
            helthans
            wrote on last edited by
            #5

            Hi,

            I have followed the guidelines from the following sites:
            http://creeder.com/?page=RaspberryPi
            http://qt-project.org/wiki/RaspberryPi_Beginners_guide
            http://www.ics.com/blog/building-qt-5-raspberry-pi#.Up2JksTmOao

            If you want to compile 5.1.1, remember to do a
            @git checkout v5.1.1@

            I used the patches from "bakeqtpi":git://gitorious.org/bakeqtpi/bakeqtpi.git
            and also I had to add "patch to qeglfshooks_pi.cpp":https://codereview.qt-project.org/#patch,sidebyside,65404,2,mkspecs/devices/linux-rasp-pi-g%2B%2B/qeglfshooks_pi.cpp to avoid compilation error.

            1 Reply Last reply
            0
            • H Offline
              H Offline
              helthans
              wrote on last edited by
              #6

              ... I also tried to compile gst-omx as described @ http://creeder.com/?page=RaspberryPi but without luck - have read that the branch has been renamed from raspberrypi to 0.10. If you know how to preceed from here please share :)

              1 Reply Last reply
              0
              • M Offline
                M Offline
                maatong
                wrote on last edited by
                #7

                Meet same problem here.
                Any progress?

                https://www.linkedin.com/pub/yini-guo/71/4b3/4a0

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  helthans
                  wrote on last edited by
                  #8

                  Unfortunately I havent had time to look more into this issue, so I haven't had any progress.

                  1 Reply Last reply
                  0
                  • tomasz3dkT Offline
                    tomasz3dkT Offline
                    tomasz3dk
                    wrote on last edited by
                    #9

                    Me too... ;|

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      maatong
                      wrote on last edited by
                      #10

                      [quote author="helthans" date="1398836868"]Unfortunately I havent had time to look more into this issue, so I haven't had any progress.[/quote]

                      So is there any other way to replace gstreamer?
                      I used a different ARM board, but I think it's the same situation.
                      To get the board run with audio program, I tried QSound, but there's no device in /dev/dsp, and I tried to add it back, but no way seemed to work.
                      And I also tried QMediaPlayer, and installed gstreamer on the board, didn't work either.

                      https://www.linkedin.com/pub/yini-guo/71/4b3/4a0

                      1 Reply Last reply
                      0
                      • H Offline
                        H Offline
                        helthans
                        wrote on last edited by
                        #11

                        I'm really not sure. Lately I have been working with Odroid U3 board, which is also ARM based, and for this board the situation is completely different, but not sure why. I have compiled Qt5 using the same approach as for raspberry pi but things just works here :) The gstreamer is recognized the required libs for playing video and audio are created such that QMediaPlayer can handle audio and video. So far I have been able to play mpeg, m4a and aac without problems. The only issue I have right now, is that video is not hardware decoded and hence 1080p video is not played smoothly.

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          Dinesh Ponnuswamy
                          wrote on last edited by
                          #12

                          Problem solved !

                          install the whole gstreamer 0.10 package by using,

                          sudo apt-get update
                          sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
                          sudo apt-get install gstreamer0.10*

                          this works for me..

                          1 Reply Last reply
                          0

                          • Login

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