No sound in Ubuntu except at log in

I installed Ubuntu 12.04 a month ago and am using it till now. I failed to notice that all this time there was no sound at all while running Ubuntu, even while playing a game in Wine. The weird thing is that only the startup sound comes when I log in (Indian/African drum tone), then comes the utter silence.

I tested both Digital Output (S/PDIF) and the speakers in the sound settings but can hear nothing.

Any help?


After searching, I have found a simple answer. Just execute

killall pulseaudio

Your speakers should work fine now. To ensure this, test the sound stack in System Settings > Sound > Test Sound (Speaker test, Not Digital Output (S/PDIF) test)


Sometimes the problem is that alsa somehow got muted. Open a terminal and type:

alsamixer

AlsaMixer

and disable Auto-Mute Mode. The mute can be toggled with the M key.


Try

killall pulseaudio

and go to System SettingsSoundOutput tab → ConnectorAnalog Output

This solved it for me.


killall pulseaudio wasn't working for me. My issue was that I was not in the sound group.

Run

gpasswd -a yourusername audio

Then do

killall pulseaudio

That worked for me.