Occasionally on my Ubuntu machine the sound/audio somehow stops working, and although most of the time this can be fixed by closing and then restarting the audio programme (or any other service that occupies the audio driver) you’re running. However on odd occasions the audio still fails to work and you might have to reboot the OS in order to get the audio/sound back which is rather irritating.
Here is a quick way of restarting/restoring your audio/sound without rebooting your Ubuntu system, try using the following command:
sudo /etc/init.d/alsa-utils restart
This should restart your ALSA (Advanced Linux Sound Architecture) driver instantly. However, sometimes certain programmes still keep holding on the audio driver even after your restart ALSA. Try the following command:
lsof | grep pcm
to find out the list of open files and close (kill -9) those processes that are still holding the sound driver.