2011-08-02 Problem with too many accesses to sound devices in new KDE. Now using KDE4 (4.6.3) in Gentoo, on the desktop computer. Tried the 'new' linux-3.0.0 kernel, and tried also the linux-2.6.37 which still seems the last that is stable and gives good performance on my computers (several later ones have quickly locked a server under heavy NFS load; 3.0.0 on the desktop seemed very slow under disk load). This desktop computer has typically 4 or 5 people all logged in on separate virtual consoles; only one is in at a time unless there's VNC being used, as there's only one physical display. The soundcard, onboard, is # lspci | grep -i -e audio -e sound 00:05.0 Audio device: nVidia Corporation MCP61 High Definition Audio (rev a2) 02:00.1 Audio device: nVidia Corporation High Definition Audio Controller (rev a1) The usual "alsaconf" coluserand in the newly compiled system declared that "No supported PnP or PCI card found", although with a kernel and config that had worked fine in the two-year-old system. Sound was anyway available, and a website with the advice that one doesn't need the details in the /etc/modprobe.d/alsa.conf file nowadays anyway. But sound was soon /not/ available, after a few logins and videos and so on. We know this card/driver doesn't support multiple access, so we're used to closing flash-browsers and so on before leaving the computer. This was something else hogging the soundcards. When the troubles happened, neither alsa nor oss could be accessed. E.g. mplayer: ..... ========================================================================== Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders AUDIO: 48000 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->192000) Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis) ========================================================================== [AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or resource busy [AO_ALSA] alsa-lib: pcm_dmix.c:985:(snd_pcm_dmix_open) unable to create IPC semaphore [AO_ALSA] Playback open error: Permission denied [AO SDL] Samplerate: 48000Hz Channels: Stereo Format s16le [AO_ALSA] alsa-lib: pcm_dmix.c:985:(snd_pcm_dmix_open) unable to create IPC semaphore [AO SDL] Unable to open audio: No available audio device [AO_ALSA] alsa-lib: pcm_dmix.c:985:(snd_pcm_dmix_open) unable to create IPC semaphore [AO_ALSA] alsa-lib: pcm_dmix.c:985:(snd_pcm_dmix_open) unable to create IPC semaphore AL lib: alsa.c:488: Could not open playback device 'default': Permission denied AL lib: oss.c:173: Could not open /dev/dsp: Device or resource busy [OpenAL] could not open device DVB card number must be between 1 and 4 AO: [null] 48000Hz 2ch s16le (2 bytes per sample) Then, a modest example of sound-related processes would be: root@box ~ # lsof | grep -e sound -e snd lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /space/user/.gvfs Output information may be incomplete. knotify4 11119 luser mem REG 8,3 855368 817304 /usr/lib64/libasound.so.2.0.0 kded4 13340 user mem REG 8,3 855368 817304 /usr/lib64/libasound.so.2.0.0 kded4 13340 user 25u CHR 116,8 0t0 441 /dev/snd/controlC0 kded4 13340 user 26u CHR 116,17 0t0 1791 /dev/snd/controlC1 knotify4 13365 user mem REG 8,3 855368 817304 /usr/lib64/libasound.so.2.0.0 knotify4 13365 user mem CHR 116,5 424 /dev/snd/pcmC0D0p knotify4 13365 user 9r REG 8,3 41337 864403 /usr/share/sounds/KDE-Sys-Warning.ogg knotify4 13365 user 18r CHR 116,2 0t0 1708 /dev/snd/timer knotify4 13365 user 19u CHR 116,5 0t0 424 /dev/snd/pcmC0D0p kmix 13433 user mem REG 8,3 855368 817304 /usr/lib64/libasound.so.2.0.0 kmix 13433 user 12u CHR 116,8 0t0 441 /dev/snd/controlC0 kmix 13433 user 18u CHR 116,17 0t0 1791 /dev/snd/controlC1 kded4 16431 luser mem REG 8,3 855368 817304 /usr/lib64/libasound.so.2.0.0 kded4 16431 luser 25u CHR 116,8 0t0 441 /dev/snd/controlC0 kded4 16431 luser 26u CHR 116,17 0t0 1791 /dev/snd/controlC1 knotify4 16454 luser mem REG 8,3 855368 817304 /usr/lib64/libasound.so.2.0.0 knotify4 16454 luser mem CHR 116,12 1770 /dev/snd/pcmC1D3p knotify4 16454 luser 18u CHR 116,17 0t0 1791 /dev/snd/controlC1 knotify4 16454 luser 19u CHR 116,12 0t0 1770 /dev/snd/pcmC1D3p knotify4 16454 luser 20r REG 8,3 154528 864496 /usr/share/sounds/KDE-Sys-Log-In-Short.ogg kmix 16509 luser mem REG 8,3 855368 817304 /usr/lib64/libasound.so.2.0.0 kmix 16509 luser 12u CHR 116,8 0t0 441 /dev/snd/controlC0 kmix 16509 luser 18u CHR 116,17 0t0 1791 /dev/snd/controlC1 and the crude method of killing all is, # lsof | grep -e sound -e snd | awk '{ print $2 }' | xargs kill which resulted in working sound but also partially non-working sessions from killing kded4 ... Killing just the knotify4 processes that were apparently trying to play ogg files turned out to be sufficient. All "system" sounds were then turned off in KDE's control centre, for all users. Common Appearance and Behaviour; Application and System Notifications; Manage Notifications then "no audio output" for "Player Settings". When there still appeared to be some problem (didn't bother with reboots to test thoroughly...) the annoying knotify4 binary, which also was drinking 100% CPU sometimes for some users, was moved and an empty shell script put in its place. Everything seems to work better without it!