Is there another way to restart the sound system if pulseaudio/ALSA don't work?

I was listening to music, and my sound suddenly went dead in all my applications. I'm using Ubuntu 12.04, which uses pulseaudio, so I tried sudo /etc/init.d/pulseaudio restart, but nothing happened. According to lsof | grep pcm, nothing is using the soundcard at the moment, although I'm not entirely sure if my source for that command is applicable.

Is there a way another way to restart Ubuntu 12.04's sound system from the command line without rebooting the system?


Solution 1:

I've used pulseaudio -k && sudo alsa force-reload a couple of times, and it worked well. The first part kills pulseaudio, the second reloads ALSA. You don't need to restart pulseaudio, because it auto-restarts.

Solution 2:

What I do when my sound doesn't work is

killall pulseaudio

and then I press Alt + F2 and type in pulseaudio. It usually works for me.

Solution 3:

Just for completeness, in newer Ubuntus versions that use systemd, I used this and it worked well:

systemctl --user restart pulseaudio

Solution 4:

In my case there were nasty messages in kern.log / dmesg:

sound hdaudioC0D2: HDMI: invalid ELD buf size -1

The solution was simply to suspend and resume the machine!

$ sudo pm-suspend