Compiling my own ALSA drivers and/or running the first giant terminal command here only succeeded in making my soundcard totally invisible to Ubuntu.
Here's how I fixed it:
First, run the command to reset to Ubuntu stock defaults:
sudo aptitude --purge reinstall linux-sound-base alsa-base alsa-utils linux-image-`uname -r` linux-backports-modules-`uname -r` libasound2
I added the following line to /etc/modprobe.d/blacklist.conf:
This is because one of the pieces of sound hardware being detected was the HDMI out on my ATI Radeon HD 5770. It wasn't listed as the first sound device, but something about this was making sound so buggy that nothing even showed up in the device list when I typed With that, I was able to get rudimentary sound functionality as long as I had the following at the end of my /etc/modprobe.d/alsa-base.conf file:
But I like to be able to switch between headphones and main speakers just by plugging or unplugging my headphones. That feature isn't supported by the model "generic" so I changed that line to the following:
options snd-hda-intel model=generic
I had thought I had tried these steps before, but I think I had a hard time getting it to work because I would try more than one change at once. If you're troubleshooting your sound, totally shut down your system and start it back up after every modification you make.
options snd-hda-intel model=auto