No sound in Ubuntu except at log in
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
and disable Auto-Mute Mode. The mute can be toggled with the M key.
Try
killall pulseaudio
and go to System Settings → Sound → Output tab → Connector → Analog Output
This solved it for me.