[CentOS] No sound over HDMI using nvidia graphics card

Wed Jan 18 15:21:59 UTC 2012
Lars Hecking <lhecking at users.sourceforge.net>

 Apologies for hijacking this thread, but I have posted here before and
 received not a single response. This is on CentOS5.

  http://lists.centos.org/pipermail/centos/2011-November/119707.html

 Other than the OP, I don't want HDMI sound, but the builtin sound device is
 not working. In a nutshell, a machine with this sound configuration

# lspci |grep -i aud
00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
02:00.1 Audio device: nVidia Corporation GF108 High Definition Audio Controller (rev a1)
# 

 does not play any sound, whereas this otherwise identical one works

00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller

 In the non-working case, /etc/modprobe.conf has

alias snd-card-1 snd-hda-intel
options snd-card-1 index=1
options snd-hda-intel index=1
remove snd-hda-intel { /usr/sbin/alsactl store 1 >/dev/null 2>&1 || : ; }; /sbin
/modprobe -r --ignore-remove snd-hda-intel

 and on the working machine,

options snd-hda-intel index=0
remove snd-hda-intel { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-hda-intel

 The non-working config has /dev/audio1, which plays horribly distorted sound
 (cat file >/dev/audio1). The working config has /dev/audio, which works fine.

 The BIOS only has an option to enable sound, when I disable it, the snd*
 modules don't get loaded and volume prefs etc. don't work (kinda logical).

 I presume the problem is that there is no driver for the nvidia sound
 device, yet it is configured as card 0 (default). Again, in the non-working
 case I have

# cat /proc/asound/cards 
 1 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf7ffc000 irq 169
# 

 and in the working case, I have

# cat /proc/asound/cards 
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf7ffc000 irq 82
# 

 Any ideas how I can get sound working on this machine?

 (It works very well under CentOS6, btw., PA let's me choose either device
  and the speaker tests are successful.)