I erroneously tried several fixes to address the sound problems I have had with Ubuntu since version 8.04. I even tried removing Pulseaudio, but the underlying issue of poor configuration of Pulseaudio by the Ubuntu team caused sound to continue to be a problem. My efforts were trying to get sound to work all the time in Flash, specifically so that Hulu.com and Flash games would play sound. From what I have learned from my reading, removing Pulseaudio is not at all what you want to do, you just need to make some minor configuration changes to your systems sound settings. The following configuration changes have worked for me on a Dell Dimension 8400 desktop. They may not fix your problem or problems that are not related to Flash sound. But my understanding is that performing these steps will give you a properly configured Pulseaudio setup for a 9.04 Ubuntu system. I am assuming you already have Flash installed.
1. Backup and then delete your previous configuration files:
$ mkdir ~/pulse-backup && cp -r ~/.pulse ~/.asound* /etc/asound.conf /etc/pulse -t ~/pulse-backup/
$ sudo rm -r ~/.pulse ~/.asound* /etc/asound.confDo not worry if some of the files come back with messages about not existing.
2. Ensure you have the necessary PulseAudio libraries and configuration utilities installed:
$ sudo apt-get install libasound2-plugins padevchooser libsdl1.2debian-pulseaudio
3. Ensure "libflashsupport" library is not installed:
$ sudo apt-get remove --purge libflashsupport flashplugin-nonfree-extrasoundThis library is unneeded and causes instability in Firefox.
4. Open System/Preferences/Sound. In the Devices section, ensure that all "Sound playback" options are set to Autodetect. Set the "Sound capture" item to "ALSA", or the appropriate hardware definition. Close the application when you're finished.
Choosing PulseAudio for sound capture may result in crashes, so you are advised to choose the "direct" ALSA device instead.
5. Open the PulseAudio Volume Control application ("pavucontrol", or you can launch "Applications/Sound & Video/PulseAudio Device Chooser" and select Volume Control from this applet's menu). In the Output Devices section you will see a listing of the playback devices available on your system. Right-click on the entry that you desire to be made the default playback device on your system and enable the "Default" checkmark. Similarly, navigate to Input Devices, then right-click on the device you wish to set as your default input device (microphone), and ensure the "Default" setting is checked. Close the application when you're finished.
If you are greeted with the error "Connection failed: Connection refused", manually launch PulseAudio before opening the PulseAudio Volume Control application:
$ pulseaudio & pavucontrol
6. Logging out is sufficient, but rebooting will make absolutely sure you are back in business with your new settings.
Since making these changes I have tested the computer waking from sleep and restarts, all situations where my sound used to stop working. The sound has been solid within Flash.