Bug 264265 - OSD is shown when the currently playing song is about to be changed to the next song
Summary: OSD is shown when the currently playing song is about to be changed to the ne...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Notifications (show other bugs)
Version: 2.5.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 2.5
Assignee: Amarok Developers
URL:
Keywords:
: 267207 301384 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-25 17:17 UTC by akbar hidayat
Modified: 2012-08-04 18:55 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description akbar hidayat 2011-01-25 17:17:36 UTC
Version:           2.4-GIT (using KDE 4.5.5) 
OS:                Linux

this happens when the next song is about to be played. So the OSD for the currently playing song is shown for a short time. Then the next song starts to play, and ofcourse the OSD for that song is displayed.

so its like having 2 notification shown quickly for 2 consecutive songs.

Reproducible: Always



Expected Results:  
well, the notification shouldn't be shown for a song that's about to end
Comment 1 Kevin Funk 2011-01-25 20:31:08 UTC
Is this a regression, did it work for previous revisions of Amarok Git?
Comment 2 akbar hidayat 2011-01-26 00:07:56 UTC
this bug occurs when the phonon backend used is phonon-vlc. I'm currently using phonon and phonon-vlc from git.

by switching the phonon backend to phonon-xine (from git), the problem stops.

so, is this a phonon-vlc problem?
Comment 3 miguel.on.ito 2011-07-31 09:54:12 UTC
Same problem here with vlc or gstreamer backend.
Comment 4 Myriam Schweingruber 2011-08-01 08:32:07 UTC
Subscribing the Phonon developers
Comment 5 Harald Sitter 2011-08-01 10:07:33 UTC
Seems to be caused by Amarok. Also affects pgst btw.

Debug output:
void Phonon::MediaObjectPrivate::_k_aboutToFinish() 
amarok: BEGIN: void EngineController::slotAboutToFinish() 
amarok:   [EngineController] Track finished completely, updating statistics 
TagLib: MPEG::Header::parse() -- Invalid sample rate.
amarok:   [SqlRegistryP] obtained max_allowed_packet is  "1048576" 
amarok:   BEGIN: void Context::ContextView::slotMetadataChanged(Meta::TrackPtr) 
amarok:     BEGIN: bool EngineController::isStream() 
amarok:     END__: bool EngineController::isStream() [Took: 0s] 
amarok:   END__: void Context::ContextView::slotMetadataChanged(Meta::TrackPtr) [Took: 0s] 
Object::connect: No such signal Collections::MemoryQueryMakerInternal::newResultReady(Meta::DataList)
amarok:   BEGIN: void OSDWidget::show(const QString&, const QImage&) 
amarok:   END__: void OSDWidget::show(const QString&, const QImage&) [Took: 0.001s] 
amarok:   BEGIN: virtual void Playlist::Model::metadataChanged(Meta::TrackPtr) 
amarok:     BEGIN: void PlaylistInfoWidget::updateTotalPlaylistLength() 
amarok:     END__: void PlaylistInfoWidget::updateTotalPlaylistLength() [Took: 0s] 
amarok:     [Playlist::Model] Metadata updated for track "Smack My Bitch Up" 
amarok:   END__: virtual void Playlist::Model::metadataChanged(Meta::TrackPtr) [Took: 0s] 
amarok:   BEGIN: void Playlist::Actions::requestNextTrack() 
amarok:     [Playlist::Actions] so far so good! 
amarok:     BEGIN: void Playlist::Actions::play(quint64, bool) 
amarok:       BEGIN: void EngineController::setNextTrack(Meta::TrackPtr) 
amarok:         [EngineController] locking mutex 
amarok:         [EngineController] locked! 
amarok:       END__: void EngineController::setNextTrack(Meta::TrackPtr) [Took: 0s] 
amarok:     END__: void Playlist::Actions::play(quint64, bool) [Took: 0s] 
amarok:   END__: void Playlist::Actions::requestNextTrack() [Took: 0s] 
amarok: END__: void EngineController::slotAboutToFinish() [Took: 0.01s] 
amarok: [Albums] albums view data unchanged, not updating 
amarok: BEGIN: void CurrentTrack::dataUpdated(const QString&, const Plasma::DataEngine::Data&) 
amarok: END__: void CurrentTrack::dataUpdated(const QString&, const Plasma::DataEngine::Data&) [Took: 0.023s] 

backtrace in the function that calls OSD::show():
Breakpoint 1, Amarok::OSD::metadataChanged (this=0x18f79e0) at /home/me/src/git/amarok/src/widgets/Osd.cpp:756
756     {
(gdb) bt
#0  Amarok::OSD::metadataChanged (this=0x18f79e0) at /home/me/src/git/amarok/src/widgets/Osd.cpp:756
#1  0x00007ffff70b5a78 in Amarok::OSD::qt_metacall (this=0x18f79e0, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffffffaa90) at /home/me/src/git/amarok/build/src/Osd.moc:283
#2  0x00007ffff50225f8 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#3  0x00007ffff6f6a0d5 in EngineController::trackMetadataChanged (this=<value optimized out>, _t1=<value optimized out>) at /home/me/src/git/amarok/build/src/EngineController.moc:261
#4  0x00007ffff6f6afda in EngineController::metadataChanged (this=0x9559a0, track=...) at /home/me/src/git/amarok/src/EngineController.cpp:1368
#5  0x00007ffff754c31e in Meta::Track::notifyObservers (this=0x1230080) at /home/me/src/git/amarok/src/core/meta/Meta.cpp:324
#6  0x00007fffd76971bc in SqlRegistry::commitDirtyTracks (this=0xf1f7a0) at /home/me/src/git/amarok/src/core-impl/collections/db/sql/SqlRegistry.cpp:790
#7  0x00007fffd76a8cd7 in Meta::SqlTrack::commitMetaDataChanges (this=0x1230080) at /home/me/src/git/amarok/src/core-impl/collections/db/sql/SqlMeta.cpp:1028
#8  0x00007fffd76aaa3f in Meta::SqlTrack::endMetaDataUpdate (this=0x1230080) at /home/me/src/git/amarok/src/core-impl/collections/db/sql/SqlMeta.cpp:786
#9  0x00007fffd769fabb in Meta::SqlTrack::finishedPlaying (this=0x1230080, playedFraction=1) at /home/me/src/git/amarok/src/core-impl/collections/db/sql/SqlMeta.cpp:1137
#10 0x00007ffff6f6f79e in EngineController::slotAboutToFinish (this=0x9559a0) at /home/me/src/git/amarok/src/EngineController.cpp:976
#11 0x00007ffff6f7695d in EngineController::qt_metacall (this=0x9559a0, _c=QMetaObject::InvokeMetaMethod, _id=39, _a=0x7fffffffb5b0) at /home/me/src/git/amarok/build/src/EngineController.moc:204
#12 0x00007ffff50225f8 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#13 0x00007ffff1d34836 in Phonon::MediaObjectPrivate::_k_aboutToFinish (this=0x9451d0) at /home/me/src/git/p/phonon/phonon/mediaobject.cpp:584
#14 0x00007ffff1d34cbd in Phonon::MediaObject::qt_metacall (this=0x9546a0, _c=QMetaObject::InvokeMetaMethod, _id=21, _a=0x2e79060) at /home/me/src/git/p/phonon/build/phonon/moc_mediaobject.cpp:144
#15 0x00007ffff502149a in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#16 0x00007ffff59c79f4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#17 0x00007ffff59cc3ba in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#18 0x00007ffff79b0796 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#19 0x00007ffff500d49c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#20 0x00007ffff5010c25 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#21 0x00007ffff5038253 in ?? () from /usr/lib/libQtCore.so.4
#22 0x00007fffef44abcd in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007fffef44b3a8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007fffef44b639 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007ffff50383ef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#26 0x00007ffff5a714de in ?? () from /usr/lib/libQtGui.so.4
#27 0x00007ffff500c882 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#28 0x00007ffff500cabc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#29 0x00007ffff5010ecb in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#30 0x000000000040eefe in main (argc=3, argv=0x7fffffffe628) at /home/me/src/git/amarok/src/main.cpp:289

Clearly amarok itself is somehow causing a premature metadata change triggering the OSD.
Comment 6 Myriam Schweingruber 2011-08-01 10:53:23 UTC
Thank you for the feedback. I just wonder why it is not reproducible with the xine backend...
Comment 7 Harald Sitter 2011-08-01 11:36:54 UTC
No idea without looking at the internals of the Amarok functions of the backtrace.

One option would be that aboutToFinish is not emitted by xine when there are still tracks in the queue, which would seem weird because IIRC Amarok only queues once aboutToFinish is emitted. After all that is what the signal is used for -> queuing something before playback end so it just transits to the next track without having to rebuild the entire media pipeline.

Anyhow, once someone who knows their way around Amarok takes a look at it we should be able to trace the issue if there is one in Phonon.
Comment 8 Torrie Fischer 2011-08-01 15:57:05 UTC
I believe it is because metadataChanged gets emitted before the track has actually finished (and therefore the metadata has logically changed for the user).

For the longest time, I actually thought this was a feature akin to a DJ saying "And that was X by Y...". Working on a fix for phonon-gstreamer.
Comment 9 eric 2011-08-27 18:16:04 UTC
Has this anything to do with the ability of phonon-xine to have gapless playback? The last time I checked phonon-{mplayer,vlc,gstreamer} can not do gapless playback.

Anyway, this is the same bug as https://bugs.kde.org/show_bug.cgi?id=267207.
Comment 10 Myriam Schweingruber 2011-08-27 22:22:16 UTC
*** Bug 267207 has been marked as a duplicate of this bug. ***
Comment 11 Myriam Schweingruber 2012-06-07 18:10:15 UTC
*** Bug 301384 has been marked as a duplicate of this bug. ***
Comment 12 Martin Bříza 2012-07-25 13:43:32 UTC
This bug is also reported in the Red Hat Bugzilla for Fedora 17 (amarok 2.5.0) on https://bugzilla.redhat.com/show_bug.cgi?id=841944 .
Comment 13 Sam Lade 2012-08-04 18:55:34 UTC
According to comment #23 on bug 299890, and confirmed here, this was fixed by commit e1d2ea6ce3ef61af5dcd4f99db9fb407c95ccb2d by Matěj Laitl.