Version: (using KDE 4.2.0) Compiler: gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12) OS: Linux Installed from: Ubuntu Packages After starting KDE I experienced a lot of strange behaviour, including: 1) Searching in the Kickoff menu causes plasma to hang 2) Clicking the "Service Manager" icon in system settings would hang 3) Sometimes using an Alt+something shortcut, like Alt+F2, would cause the Alt key to become "stuck". Any further actions after releasing the Alt key would occur as if the Alt key were still pressed - for example dragging inside a window would move it (as Alt+drag does). I narrowed the problem down to kded, as killing kded4 and restarting it would solve all of the above for a little while. I attached gdb to kded4 while the problems were occuring and got a backtrace. It was blocking in the pulse audio event loop. Important stack frames are (I had to write them down - couldn't copy+paste): __kernel_vsyscall() poll() pa_mainloop_poll pa_mainloop_iterate pa_mainloop_run PhononServer::findDevices PhononServer KPluginFactory::createInstance ... It looked like the Phonon kded plugin was entering the pulse audio event loop and never exiting. I did a little digging and discovered that phononserver.cpp was not checking the return code of pa_context_connect, and going ahead and starting the event loop even if it couldn't connect to the pulse server. The context state callback that it waits for was then never occuring, and it would never exit the event loop. I'm attaching a patch which solves the issue for me. It's against SVN trunk as of Feb 3rd.
Created attachment 30936 [details] Check the return code of pa_context_connect This patch fixes the problem for me
Are there any comments on this? If not I'd like to commit it.
David, the patch looks good. The pulseaudio docs and examples don't really tell that you have to do this, but I'm pretty sure that the patch is right (I once tried to get help about this hang on #pulseaudio but they didn't have an idea). Please commit to trunk and KDE 4.2 branch.
Thanks Matthias! I've committed to trunk and the KDE 4.2 branch.