Ubuntu – Pulseaudio keeps getting killed in Oneiric

11.10pulseaudio

Since I upgraded to Ubuntu 11.10 (oneiric), my pulseaudio tends to crash a few times a day, if I'm listening to music on YouTube. It restarts automatically (as long as I'm using a Unity session — it doesn't auto-restart if I use GNOME, apparently), but forgets the volume setting (speaker icon shows 'Mute'), which is how I know it crashed. Also I need to reload the browser tab with youtube to make it play sound again.

I'm trying to debug this. When I use a GNOME Shell session instead of Unity, pulseaudio dies and doesn't autorestart. I have to restart it manually in a terminal. (Also, my volume icon disappears and volume keys stop reacting. Even after I restart PA manually.)

This is how I noticed that PA wasn't just crashing — it was getting killed by a signal (SIGKILL).

EDIT: evidence for this: LANGUAGE=C pulseaudio -vv dies with a message "Nutraukta (Killed)", which ignores my request (LANGUAGE=C) to use English, so I assume it comes from bash and not pulseaudio itself. And $? is equal to 137, which is 128 (killed by a signal) + 9 (SIGKILL).

I haven't figured out a pattern yet. This doesn't happen always — sometimes I play maybe 10 songs on YouTube and then PA gets killed as I try to watch the 11th. Sometimes it gets killed after a long period of inactivity. Sometimes it gets killed on resume.

Any ideas how I might track who is killing my PA? I intend to file a bug about this, once I figure out what is happening and which program is responsible.

UPDATE: people in #pulseaudio on irc.freenode.net say it could be a bug in the alsa driver that makes pulseaudio keep rewinding the stream, eating the CPU in a realtime thread, which then gets killed by the kernel for exceeding cputime limits. I'm still trying to reproduce this with verbose pulseaudio debugging enabled.

ANOTHER UPDATE: I've reproduced the issue a few times, once under strace, once with pulseaudio -vvvv. There's nothing suspicious (to me) in any of the logs just before the SIGKILL arrives.

Best Answer