Bug 281961

Summary: knotify4 locks the sound device
Product: [Unmaintained] kdelibs Reporter: Tristan Miller <psychonaut>
Component: knotifyAssignee: Olivier Goffart <ogoffart>
Status: RESOLVED WORKSFORME    
Severity: normal CC: andrew.crouthamel, cfeck, deefster, Enrico_m, martin.sandsmark, myriam, nicklas, romain.perier, scarpino, sitter
Priority: NOR Keywords: investigated, triaged
Version: 4.7   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tristan Miller 2011-09-13 19:14:20 UTC
Version:           4.6 (using KDE 4.6.0) 
OS:                Linux

knotify4 locks the audio device, preventing all other applications from using it.  The computer can't produce any sound until knotify4 is killed.


Reproducible: Always

Steps to Reproduce:
I'm not sure exactly what triggers this, though it happens consistently after using KDE for a few minutes.  Perhaps the locking occurs the first time an audio system notification is played.

Actual Results:  
[psy@ferret:/dev/snd]$ fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  psy       28788 F.... kded4
                     psy       28952 F.... pulseaudio
/dev/snd/pcmC0D0p:   psy       28803 F...m knotify4
/dev/snd/timer:      psy       28803 f.... knotify4

Expected Results:  
knotify4 should not lock the audio device.

This problem has also been reported with KDE 4.6 by Arch and Gentoo users:

http://forum.kde.org/viewtopic.php?f=19&t=95872
http://forums.gentoo.org/viewtopic-t-884684-start-0.html
https://bbs.archlinux.org/viewtopic.php?id=122138
Comment 1 Christoph Feck 2011-09-14 21:49:17 UTC
Does the lock go automatically away when not using sound notifications for more than one minute?
Comment 2 Tristan Miller 2011-09-15 18:45:14 UTC
No, the lock does not automatically go away.  It stays indefinitely, as far as I can tell.
Comment 3 Christoph Feck 2011-09-17 11:42:45 UTC
Merci, then maybe Phonon developers know why the devices are kept open.
Comment 4 Harald Sitter 2011-09-17 11:57:05 UTC
If Phonon is configured to use the hardware device (rather than the software mixing device) the result will be exclusive access to the first app that gets to play something. In this case knotify4. 

To resolve this issue you could either try different device priority ordering (though software mixing should stick out from the list of possible devices, so that should be an easy fix really), or you can install pulseaudio.

Anyhow, this is more of a topic for a support forum or mailing list, thanks nevertheless.
Comment 5 Tristan Miller 2011-09-17 14:50:49 UTC
Harald, pulseaudio is already installed and running.  And it is not the case that only the first application gets exclusive access to device; I can have as many different applications as I want all playing sound simultaneously.  The problem with the sound device being locked is unique to knotify4.
Comment 6 Harald Sitter 2011-09-17 15:23:41 UTC
Then something must be broken elsewhere, certainly not Phonon. Knotify like most other kde apps uses Phonon, so if other stuff works, there is absolutely no reason why knotify would hog the device.
Comment 7 Tristan Miller 2011-09-17 16:21:15 UTC
Yes, I agree something is broken somewhere—but where?  I don't see how this can be a user configuration issue as this problem was occurring on a virgin install of openSUSE 11.4 (plus system updates); I haven't changed any audio settings.

Since the problem occurs only with knotify4, perhaps this bug's product can be changed back to that.  I'm happy to provide whatever further diagnostics are necessary to discover the cause.
Comment 8 Myriam Schweingruber 2011-09-18 19:27:53 UTC
Reassigning back to kdelibs, see the comments by the Phonon developer.
Comment 9 Enrico 2011-10-01 08:53:38 UTC
I have the same issue with kde 4.7.1. I can play stereo output just fine, but when I try to play 5.1 sound, all programs I tested return with "device busy". After killing knotify4 everything works.
Comment 10 Darren West 2012-01-16 20:59:59 UTC
I think I'm seeing this same issue on 4.7.3
knotify4 shows up with fuser or lsof against the pcm device and never terminates itself.  

In my case it is affecting applications trying to use OSS (like java sound), as the /dev/dsp device is locked.
Comment 11 Nicklas B 2012-03-04 11:56:43 UTC
In my case it means that I cannot start Jack, and I have read about others having the same problem. The workaround(finding out what is blocking and killing it) is far too complicated for the common user. This basically means that there is no workaround, which should give this bug some priority.
Comment 12 Myriam Schweingruber 2012-03-04 12:39:13 UTC
Could you please test with KDE 4.8 or 4.8.1 which is to be released next week?
Comment 13 Tristan Miller 2012-03-04 13:08:56 UTC
I can't upgrade at the moment, but maybe one of the other commentors experiencing this problem can test with KDE 4.8.
Comment 14 Andrea Scarpino 2012-03-04 13:57:15 UTC
On Arch, we got a bug report from an user using KDE 4.8.
https://bugs.archlinux.org/task/28319

On Tuesday we'll update our packages to 4.8.1.
Comment 15 Andrew Crouthamel 2018-09-22 02:00:50 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 16 Tristan Miller 2018-09-22 02:36:20 UTC
No longer reproducible for me with Plasma 5.12.6.  (But then again, maybe that's because Plasma doesn't use knotify any more?)
Comment 17 Andrew Crouthamel 2018-09-22 02:40:33 UTC
Ok, I'll close this out then. Thank you for the update!