It's known that HDA-Audio based codecs are the worst audio problems in Linux World since Soundblaster native driver (back to 1996, I've suffered a lot to configure this little bastard).
After trying a lot of configurations and even trying use OSS4 (worst than OSS native kernel driver, don't use it unless you really need it), the solution is weirdo and simple.
If you have a VIA based codec card like this one:
[email protected]:~$ cat /proc/asound/card0/codec#0 | grep Codec
Codec: VIA ID 4397
You have two ways of solution.
1) Using generic model
New alsa-drivers have a lot of fixes to Intel-HDA codecs, not all are working perfect (but better solutions will come with time). If you have a brand new and updated distribution (until today 30/Aug/2011), you need to specify the model of your board in /etc/modprobe.d/alsa-base.conf, in this case, generic:
# Intel-HDA module options
options snd-hda-intel probe_mask=1 model=generic
2) Simple, last stand: Blacklisting
If the first method doesn't work or you're using an old alsa drivers, you MUST blacklist the via codec. Ssounds strange, but it works. Add this line in your /etc/modprobe.d/blacklist.conf (or whatever place that your distro hide this configuration):
# Disable VIA Codec
Reboot, and everything will works.
(Updated the post because alsa fixed this old bug, and I want this information to be accurate).