Bug 230005 - Phonon::MediaObject::setCurrentSource() hangs with Xine backend
Summary: Phonon::MediaObject::setCurrentSource() hangs with Xine backend
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: Xine backend (show other bugs)
Version: 4.4.0 (KDE 4.4.2)
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-08 22:24 UTC by Nikos Chantziaras
Modified: 2011-06-07 23:39 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Chantziaras 2010-03-08 22:24:23 UTC
Version:           0.2.60 (using KDE 4.4.1)
Compiler:          GCC 4.4.3 Gentoo 4.4.3 p1.0
OS:                Linux
Installed from:    Gentoo Packages

When using the Xine backend in Phonon, Phonon::MediaObject::setCurrentSource() hangs when called the second or third time (even when not calling it on the same MediaObject instance) and never returns when used in combination with a QBuffer.  The code that triggers it is this: 

Phonon::MediaObject* getMedia( const QString& fname, int pos, int size )
{
  QFile file(fname);
  file.open(QIODevice::ReadOnly);
  file.seek(pos); // A *.wav file is embedded at that
                  // position.
  Phonon::MediaObject* med = new Phonon::MediaObject(0);
  QBuffer* buf = new QBuffer(med);
  buf->setData(file.read(size)); // The embedded wav is
                                 // 'size' bytes big
  Phonon::MediaSource src(buf);

  med->setCurrentSource(src);  // <-- This hangs

  return med;
}

Most of the time, the application hangs the second time the above gets called; med->setCurrentSource(src) never returns.  When the hang occurs, there's no CPU load.

Everything works fine if I instead save file.read(size) into a new QFile and pass its fileName() to setCurrentSource().  However, in both cases, file.read(size) contains the exact same data.

Again: this only happens with the Xine backend. The GStreamer backend works fine.

I've prepared a very small example application that will trigger the bug:

  http://foss.math.aegean.gr/~realnc/qt/phonon_bug.tar.gz

The tarball includes a small data file from which the code will try to load the embedded WAV files from.  Simply "qmake; make" and then run it.  There's no GUI.


Here is a full backtrace at the moment the code hangs:

#0  0x000000300100b1fc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
No symbol table info available.
#1  0x000000300747420b in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=<value optimized out>, 
    time=<value optimized out>) at thread/qwaitcondition_unix.cpp:87
        code = <value optimized out>
#2  QWaitCondition::wait (this=<value optimized out>, mutex=<value optimized out>, time=<value optimized out>)
    at thread/qwaitcondition_unix.cpp:159
        returnValue = <value optimized out>
#3  0x00007ffff71a6de0 in Phonon::Xine::XineThread::newStream ()
    at /var/tmp/portage/media-sound/phonon-4.3.80-r1/work/phonon-4.3.80/xine/xinethread.cpp:78
        that = <value optimized out>
        locker = {{mtx = 0x7a36e1, val = 8009441}}
#4  0x00007ffff71bc669 in MediaObject (this=0x7a6d90, parent=<value optimized out>)
    at /var/tmp/portage/media-sound/phonon-4.3.80-r1/work/phonon-4.3.80/xine/mediaobject.cpp:61
No locals.
#5  0x00007ffff71c1886 in Phonon::Xine::Backend::createObject (this=<value optimized out>, c=<value optimized out>, parent=
    0x7a67b0, args=<value optimized out>)
    at /var/tmp/portage/media-sound/phonon-4.3.80-r1/work/phonon-4.3.80/xine/backend.cpp:154
No locals.
#6  0x000000301b63843f in Phonon::Factory::createMediaObject (parent=<value optimized out>)
    at /var/tmp/portage/media-sound/phonon-4.3.80-r1/work/phonon-4.3.80/phonon/factory.cpp:317
No locals.
#7  0x000000301b624e16 in Phonon::MediaObjectPrivate::createBackendObject (this=<value optimized out>)
    at /var/tmp/portage/media-sound/phonon-4.3.80-r1/work/phonon-4.3.80/phonon/mediaobject.cpp:47
No locals.
#8  0x000000301b625e7b in Phonon::MediaNodePrivate::backendObject (this=<value optimized out>)
    at /var/tmp/portage/media-sound/phonon-4.3.80-r1/work/phonon-4.3.80/phonon/medianode.cpp:63
No locals.
#9  0x000000301b623907 in Phonon::MediaObject::setCurrentSource (this=<value optimized out>, newSource=<value optimized out>)
    at /var/tmp/portage/media-sound/phonon-4.3.80-r1/work/phonon-4.3.80/phonon/mediaobject.cpp:230
        __PRETTY_FUNCTION__ = "void Phonon::MediaObject::setCurrentSource(const Phonon::MediaSource&)"
#10 0x000000000040162c in getMedia (fname=..., pos=393350, size=76844) at main.cpp:18
        file = {<QIODevice> = {<QObject> = {_vptr.QObject = 0x30078758b0, static staticMetaObject = {d = {superdata = 0x0, 
                  stringdata = 0x300760c140 "QObject", data = 0x300760c1e0, extradata = 0x300786e480}}, d_ptr = {d = 0x6d6180}, 
              static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3007614dc0 "Qt", data = 0x30076183e0, 
                  extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x300786e460, stringdata = 
    0x300761ce00 "QIODevice", data = 0x300761ce60, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 
    0x30078759c0, stringdata = 0x300761cd80 "QFile", data = 0x300761cda0, extradata = 0x0}}}
        med = 0x7a67b0
        buf = 0x7a6760
        src = {d = {d = 0x7a45b0}}
#11 0x00000000004017ca in main (argc=1, argv=0x7fffffffdba8) at main.cpp:29
        app = {<QCoreApplication> = {<QObject> = {_vptr.QObject = 0x301e61c090, static staticMetaObject = {d = {superdata = 
    0x0, stringdata = 0x300760c140 "QObject", data = 0x300760c1e0, extradata = 0x300786e480}}, d_ptr = {d = 0x605190}, 
              static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3007614dc0 "Qt", data = 0x30076183e0, 
                  extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x300786e460, stringdata = 
    0x300761df40 "QCoreApplication", data = 0x300761dfe0, extradata = 0x0}}, static self = 0x7fffffffda60}, 
          static staticMetaObject = {d = {superdata = 0x3007876980, stringdata = 0x301e2297e0 "QApplication", data = 
    0x301e229a20, extradata = 0x0}}}
Comment 1 Nikos Chantziaras 2010-03-08 22:33:43 UTC
I forgot to mention that this is on x86-64, using Qt 4.6.2 (Gentoo ebuild.)
Comment 2 Nikos Chantziaras 2010-04-02 10:16:54 UTC
Issue persists with KDE 4.4.2 and Phonon 4.4.0.
Comment 3 Frank Reininghaus 2010-05-02 16:16:58 UTC
There is a report for the Xine backend about a crash on a failed assert when calling setCurrentSource() twice: bug 196518. Maybe these issues are related.
Comment 4 Myriam Schweingruber 2010-08-14 12:20:56 UTC
Is this still valid with a recent KDE version? If yes, please provide a gdb output so we can identify the culprit. See also http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports
Comment 5 Myriam Schweingruber 2010-09-29 11:07:51 UTC
Forget my last comment, seems I didn't read correctly.

*** This bug has been marked as a duplicate of bug 196518 ***
Comment 6 Nikos Chantziaras 2010-09-29 15:44:45 UTC
This is not a crasher bug, and neither does it involve two simultaneous Phonon::MediaObject instances, so I don't think it's a duplicate of 196518.
Comment 7 Christoph Feck 2010-12-31 02:54:46 UTC
Not a duplicate. Someone from Phonon team should actually check the code sample from comment #0.
Comment 8 Nikos Chantziaras 2011-01-28 12:11:27 UTC
How can this bug still be "unconfirmed"? I provided a read-to-run tarball that triggers it.  It takes 20 seconds to download, build and run.
Comment 9 Myriam Schweingruber 2011-06-07 23:39:58 UTC
Please use another backend, the xine backend is deprecated as the upstream development is stalled. 

You can choose between the gstreamer backend or the vlc backend, both are actively developed and maintained.