Version: unspecified (using Devel) OS: Linux With the latest versions from git, the phonon gstreamer backend causes an endless loop when playing sounds from the notification system. When playing songs from Amarok or other media players, everything works as expected. Also testing the sound for the notifications in systemsettings is going fine. However when the notification system is triggered, then the sound ends up in a loop. The console output of knotify4 is: Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "ready" 1 to "paused" 4 Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change About to finish Moving from "paused" 4 to "playing" 2 Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source knotify(8970) NotifyBySound::notify: going to play "/usr/share/sounds/KDE-Im-Irc-Event.ogg" Setting new source New source: QUrl( "file:///usr/share/sounds/KDE-Im-Irc-Event.ogg" ) Transitioning to state "playing" State change Moving from "null" 0 to "ready" 1 knotify(8970) NotifyByPopup::notify: 79 active notifications: () () State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg knotify(8970) NotifyByPopup::sendNotificationDBus: mapping knotify id to dbus id: 79 => 2 knotify(8970) KNotify::event: 79 ref= 2 Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source ^C hq000006@HQVMT4XX20:~> Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source knotify(8970) NotifyByPopup::slotDBusNotificationClosed: 2 -> 79 knotify(8970) KNotify::slotPluginFinished: 79 ref= 2 knotify(8970) KNotify::event: 80 ref= 0 Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source knotify(8970) KNotify::event: 81 ref= 0 knotify(8970) KNotify::event: 82 ref= 0 Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source State change Moving from "paused" 4 to "playing" 2 knotify(8970) KNotify::event: 83 ref= 0 Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source ^C hq000006@HQVMT4XX20:~> Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source knotify(8970) KNotify::event: 84 ref= 0 Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source State change Moving from "paused" 4 to "playing" 2 Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Moving from "ready" 1 to "paused" 4 Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source knotify(8970) KNotify::event: 85 ref= 0 Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "ready" 1 to "paused" 4 Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 State change Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg Moving from "ready" 1 to "paused" 4 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) State change Moving from "paused" 4 to "playing" 2 Finally got a source Transitioning to state "ready" State change Moving from "playing" 2 to "paused" 4 State change Moving from "paused" 4 to "ready" 1 Transitioning to state "playing" State change Stream changed to file:///usr/share/sounds/KDE-Im-Irc-Event.ogg State change Moving from "ready" 1 to "paused" 4 Moving from "paused" 4 to "playing" 2 About to finish Got next source. Waiting for end of current. New source: QUrl( "" ) Finally got a source .... And this keeps scrolling and scrolling. My last compilation from GIT was around the 10th January and then everything worked as expected. So the faulty commit must have happened after this date. Switching to the VLC backend resolves this issue Reproducible: Always Steps to Reproduce: Easiest way would be to make sure to have the latest git snapshot for phonon and phonon-gstreamer. Activate the gstreamer backend and logout/login. Start konversation and ask somebody to trigger a notification. Actual Results: The notification sounds is repeated constantly. Expected Results: The notification sound can be heard once.
Created attachment 68173 [details] Debug output from .xsession-errors with the debug variables set
Created attachment 68584 [details] patch to fix endless looping of KDE audio notifications Beginning with commit Git commit b57a018f3c6a27733954b03780ffb33e87cc1f3e by Trever Fischer. Committed on 15/01/2012 at 20:25. Pushed by tdfischer into branch 'master'. Remove needless delays, and prevent forever-replay phonon-backend-gstreamer (using phonon-4.6.0) is apparently unable to tell when the source queue contains no more sources. In particular, when using phonon-backend-gstreamer as the backend for playing KDE audio notifications, on login, it loops forever playing the KDE login jingle over and over as reported above. Because of this, phonon-backend-gstreamer from git is entirely unusable as a KDE audio backend. Looking at the commit, and specifically at gstreamer/mediaobject.cpp, it appears that Phonon sends and empty source when there is no next source, but in MediaObject::setNextSource() and MediaObject::handleAboutToFinish() this case is not handled and m_skippingEOS is always set to true, resulting in the current source being played over and over again. The attached patch works around this by detecting if Phonon has sent and empty (or invalid) source and then setting m_skippingEOS appropriately. This not be the proper way of doing this, but I hope at least that it sheads light on the issue.
This should actually have the status confirmed
Git commit 069597b087898d63485df6c849d17fe43bf321bb by Trever Fischer, on behalf of John Stanley. Committed on 10/02/2012 at 03:57. Pushed by tdfischer into branch 'master'. patch to fix endless looping of KDE audio notifications phonon-backend-gstreamer (using phonon-4.6.0) is apparently unable to tell when the source queue contains no more sources. In particular, when using phonon-backend-gstreamer as the backend for playing KDE audio notifications, on login, it loops forever playing the KDE login jingle over and over as reported above. Because of this, phonon-backend-gstreamer from git is entirely unusable as a KDE audio backend. Looking at the commit, and specifically at gstreamer/mediaobject.cpp, it appears that Phonon sends and empty source when there is no next source, but in MediaObject::setNextSource() and MediaObject::handleAboutToFinish() this case is not handled and m_skippingEOS is always set to true, resulting in the current source being played over and over again. The attached patch works around this by detecting if Phonon has sent and empty (or invalid) source and then setting m_skippingEOS appropriately. This not be the proper way of doing this, but I hope at least that it sheads light on the issue. M +18 -9 gstreamer/mediaobject.cpp http://commits.kde.org/phonon-gstreamer/069597b087898d63485df6c849d17fe43bf321bb