Bug 292411 - Sounds from the notification systems are repeated in a loop endlessly.
Summary: Sounds from the notification systems are repeated in a loop endlessly.
Status: RESOLVED FIXED
Alias: None
Product: phonon-backend-gstreamer
Classification: Unclassified
Component: general (show other bugs)
Version: 4.6-git
Platform: openSUSE RPMs Linux
: NOR normal (vote)
Target Milestone: 4.6.1
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 20:38 UTC by Raymond Wooninck
Modified: 2012-02-10 02:56 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Debug output from .xsession-errors with the debug variables set (146.21 KB, application/octet-stream)
2012-01-25 21:08 UTC, Raymond Wooninck
Details
patch to fix endless looping of KDE audio notifications (2.12 KB, patch)
2012-02-07 04:21 UTC, John Stanley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Wooninck 2012-01-25 20:38:30 UTC
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.
Comment 1 Raymond Wooninck 2012-01-25 21:08:44 UTC
Created attachment 68173 [details]
Debug output from .xsession-errors with the debug variables set
Comment 2 John Stanley 2012-02-07 04:21:20 UTC
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.
Comment 3 Myriam Schweingruber 2012-02-09 17:22:22 UTC
This should actually have the status confirmed
Comment 4 Torrie Fischer 2012-02-10 02:56:30 UTC
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