Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Phonon/qmusicplayer: Play sound files failed when using decodebin2 pipe
Forum Updated to NodeBB v4.3 + New Features

Phonon/qmusicplayer: Play sound files failed when using decodebin2 pipe

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 1.9k 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.
  • X Offline
    X Offline
    xufeng
    wrote on last edited by
    #1

    Hi Qt experts,

    I'm using qt-everywhere-opensource-src-4.7.1 in my system and I find that I can't
    play sound files successfully with qmusicplayer or qmediaplayer demo, there is no
    error happens in the console.
    If I modify phonon to use "decodebin" pipe instead of the default "decodebin2",
    sound files can play successfully:

    --- qt-everywhere-opensource-src-4.7.1.orig/src/3rdparty/phonon/gstreamer/mediaobject.cpp
    +++ qt-everywhere-opensource-src-4.7.1/src/3rdparty/phonon/gstreamer/mediaobject.cpp
    @@ -495,7 +495,7 @@
    gst_object_ref (GST_OBJECT (m_pipeline));
    gst_object_sink (GST_OBJECT (m_pipeline));

    • m_decodebin = gst_element_factory_make ("decodebin2", NULL);
    • m_decodebin = gst_element_factory_make ("decodebin", NULL);
      g_signal_connect (m_decodebin, "new-decoded-pad", G_CALLBACK (&cb_newpad), this);
      g_signal_connect (m_decodebin, "unknown-type", G_CALLBACK (&cb_unknown_type), this);
      g_signal_connect (m_decodebin, "no-more-pads", G_CALLBACK (&cb_no_more_pads), this);
      ==============================================

    Moreover, I can play sound files successfully using gst-launch:

    gst-launch filesrc location=/root/Explosion.wav ! decodebin2 ! alsasink

    gst-launch filesrc location=/root/Explosion.wav ! decodebin ! alsasink

    I have little knowledge about Qt, but I think there maybe something wrong with Phonon.

    Any help is highly appreciated, thanks in advance!

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xufeng
      wrote on last edited by
      #2

      Sorry for the messy code, but the most important part keeps well.

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xufeng
        wrote on last edited by
        #3

        Below are some debug info when play the audio file failed:
        root@localhost:/> PHONON_GST_DEBUG=3 ./qmusicplayer -qws
        "PGST(2): Using GStreamer 0.10.21"
        "PGST(2): AudioOutput using alsa audio sink"
        "PGST(3): Found new audio device default (DeviceManager 0xdcd10)"
        "PGST(2): AudioOutput Using fake audio sink"
        "PGST(3): Found new audio device hw:0,0 (DeviceManager 0xdcd10)"
        "PGST(2): AudioOutput using alsa audio sink"
        "PGST(2): virtual bool Phonon::Gstreamer::AudioOutput::setOutputDevice(int)0 (AudioOutput 0xae660)"
        "PGST(2): Backend connected Phonon::Gstreamer::MediaObject to Phonon::Gstreamer::AudioOutput"
        QDesktopServices::storageLocation 4 not implemented
        "PGST(2): Begin source load (MediaObject 0x204100)"
        "PGST(2): Audio track connected (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (typefind) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (decodebin21) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (filesrc0) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (pipeline1) (MediaObject 0x204100)"
        "PGST(3): gstreamer: pipeline state set to ready (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (wavparse0) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (typefind) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (filesrc0) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (fakesink4) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (tee2) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (queue3) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (bin3) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (tee2) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (queue3) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (decodebin21) (MediaObject 0x204100)"
        "PGST(3): Bus: tag (wavparse0) (MediaObject 0x204100)"
        "PGST(2): Meta tags found (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (fakesink4) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (bin3) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (pipeline1) (MediaObject 0x204100)"
        "PGST(2): gstreamer: pipeline state set to paused (MediaObject 0x204100)"
        "PGST(2): Stream is seekable (MediaObject 0x204100)"
        "PGST(2): phonon state request: Stopped (MediaObject 0x204100)"
        "PGST(3): Bus: async-done (pipeline1) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (fakesink4) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (tee2) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (queue3) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (bin3) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (wavparse0) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (typefind) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (decodebin21) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (filesrc0) (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (pipeline1) (MediaObject 0x204100)"
        "PGST(2): Audio track connected (MediaObject 0x13f020)"
        "PGST(2): Begin source load (MediaObject 0x13f020)"
        "PGST(2): phonon state changed: Stopped (MediaObject 0x204100)"
        "PGST(3): gstreamer: pipeline state set to ready (MediaObject 0x204100)"
        "PGST(3): Bus: state-changed (typefind) (MediaObject 0x13f020)"
        "PGST(3): Bus: state-changed (decodebin20) (MediaObject 0x13f020)"
        "PGST(3): Bus: state-changed (filesrc1) (MediaObject 0x13f020)"
        "PGST(3): Bus: state-changed (pipeline0) (MediaObject 0x13f020)"
        "PGST(3): gstreamer: pipeline state set to ready (MediaObject 0x13f020)"

        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