I’m in the process of converting my home server in to a CentOS SMB server and XBMC combination box. In the process, though, I ran in to a problem where PulseAudio would recognise the HDMI audio capabilities of the video card (after installing the Nvidia binary drivers), but wouldn’t output any sound. After a lot of digging and swearing, I finally fixed it by doing the following:
As a normal user, open a Terminal window and enter alsamixer. Press F6 and then unmute all of the audio channels (do so by selecting them with the arrow keys, and then pressing ‘m’. When done, press ESC to exit.
After this, su - to assume root, and then type aplay -l to get a list of your audio devices. In my case, I’ve disabled the onboard audio, so the only devices are the Nvidia ones. The output will look something like this:
root@wormwood ~]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
Note that while there are four devices, the first one (which Pulseaudio selects by default) doesn’t do anything. To get this to work, we need to tell it to use the second device (#7). This isn’t horribly easy. If you have another sound card, note the device numbers listed for it above – you’ll need them in a minute.
Finally we can tell Pulseaudio to actually use the correct devices. Still as root, open up /etc/pulse/default.pa and find these lines:
### Automatically load driver modules depending on the hardware available
#.ifexists module-udev-detect.so
#load-module module-udev-detect
#.else
### Alternatively use the static hardware detection module (for systems that
### lack udev support)
#load-module module-detect
#.endif
Now, comment them all out as I have done above. This prevents Pulseaudio from trying to be smart. Now, scroll to the end of the file and add the following line (if you have more than one audio device, you will need to add it multiple times with the correct card and device numbers that you gathered from aplay above):
load-module module-alsa-sink device=hw:0,7
Now simply do a killall pulseaudio and try to play something. You should have audio output over HDMI now!
Edit: Just a bit of follow-up if you’re having trouble with the sound muting after every reboot. As root, enter the following in a shell:
touch /etc/asound.state
chmod 777 /etc/asound.state
Now, as a standard user, follow the instructions above to unmute the Nvidia device channels via alsamixer. Once you’ve confirmed sound is working again, from a shell (still not as root!) type:
alsactl store
Now go back as root and:
chmod 644 /etc/asound.state
When you reboot, you shouldn’t have to unmute through alsamixer anymore.




