If the sound played after you login on Ubuntu 11.10 Oneiric Ocelot stops for no reason, then try this solution which may help you fix this issue:
Open the terminal and run this command:
sudo cp /usr/share/sounds/ubuntu/stereo/* /usr/share/sounds/
Reboot now your system and see if the sound is restored after you login. If you have no sound at all in your system, you may check this tutorial.