HOW-TO:Setup audio over HDMI on nVidia GeForce/nForce controller

All the information described below, taken from XBMC and Ubuntu forum


 * This method works pretty well with the default installation of ALSA v1.0.22 (as of Ubuntu 10.04, lucid). There is no need to upgrade ALSA with the alsa-upgrade script.
 * This guide configures ALSA, you should remove pulseaudio first.

First, check which ALSA playback devices you have, you can use this command:

You should see something like this: xbmc@htpc:~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: NVidia [HDA NVidia], device 1: ALC1200 Digital [ALC1200 Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI] Subdevices: 0/1 Subdevice #0: subdevice #0 The device is specified as hw:(card),(device). The sample above shows device 3 is labeled "NVIDIA HDMI"; we are gonna use that and it would be called hw:0,3.

Before continuing, run then make sure "S/PDIF 1" is not set to MM (Mute). If it is, press M to unmute that channel. ''This was enough to make the sound work on my card. --Sim175 01:37, 5 August 2011 (UTC)''

Create the file "/etc/asound.conf", which configures the ALSA library for the user.

The ttable section entries match sound channels (eg front left, centre, sub woofer) to speakers. You may find that you need to change the entries above if you find that your speakers are not playing the right channels afterwards. In particular you may need to change 2.4 to 2.2 and 4.2 to 4.4, as well as 3.5 to 3.3 and 5.3 to 3.5

Next, add the following lines to the end of the "/etc/modprobe.d/alsa-base.conf" file: The commands below should do the job:

Now change to "/usr/share/alsa/cards" and replace the default HDA-Intel.conf with the one at pastebin. Don't forget to make a backup copy of the original one before proceeding, in case you need it in future. The command set below should do the job (you will have do this as "root"):

As mentioned earlier, things will only work if there is a ".asoundrc" file in users' home directory; in this case the user is xbmc. So fire up a terminal and create one with the following (assuming the HDMI device is specified as hw:0,3, change it to suit your configuration): Make sure that master volume and default PCM devices are not muted.

This is the time to reboot the system to make changes take the effect. When you log back in, you can test the speakers with "speaker-test" command like this: The output should be something like the following. Although if you get a "Playback open error: -16,Device or resource busy" message, go back into XBMC and double check your sound, it may already be working through HDMI ;-) xbmc@htpc:~$ speaker-test -D hdmi -c6 -r19200 -FS32_LE speaker-test 1.0.23 Playback device is hdmi Stream parameters are 19200Hz, S32_LE, 6 channels Using 16 octaves of pink noise Rate set to 19200Hz (requested 19200Hz) Buffer size range from 6 to 544 Period size range from 3 to 273 Using max buffer size 544 Periods = 4 was set period_size = 108 was set buffer_size = 544 0 - Front Left  4 - Centre  1 - Front Right  3 - Rear Right  2 - Rear Left  5 - LFE

It appeared to be important that "Audio Settings" in the XBMC needs to be modified as well. Go to "Settings > System > Audio" and make the entries like the picture below.

You may notice that the mp3 playback is faster than that usual. If that happens put these in the advancedsettings.xml and should fix the problem.

If everything goes well, by now you are listening to the audio over HDMI. If you have sound, but find sounds are not coming out of the correct speakers, check the ttable entry mappings in ./.asoundrc Enjoy!!