[HOWTO] Nvidia GT4xx Fermi HDMI sound
Here are some instructions for getting HDMI audio to work on Ubuntu Lucid when using a Nvidia GT4xx card.

First add the required package repositories and install the drivers:
sudo add-apt-repository ppa:ubuntu-audio-dev/ppa
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates

sudo apt-get update

sudo apt-get install nvidia-current linux-alsa-driver-modules-$(uname -r)

Now you have all the required drivers, but you still need to manually set the probe mask of the snd_hda_intel driver. That is the "tricky part". Start your X-Server (audio only works when X is running) by i.e. starting XBMC and switch back to a Linux console or SSH session. Change to the directory /proc/asound and examine all "card?" directories for eld-files:

# cd /proc/asound

# find . -name 'eld*'

Now you have to check which eld-file corresponds to your monitor. Just display the content of each eld file and check if you can find any monitor information. I'm using a Samsung TV, so my eld-file looks like that:

# cat card1/eld#3.0

monitor_present         1
eld_valid               1
monitor_name            SAMSUNG
connection_type         HDMI
eld_version             [0x2] CEA-861D or below
edid_version            [0x3] CEA-861-B, C or D
manufacture_id          0x2d4c
product_id              0x669
port_id                 0x40000
support_hdcp            0
support_ai              0
audio_sync_delay        0
speakers                [0x1] FL/FR
sad_count               1
sad0_coding_type        [0x1] LPCM
sad0_channels           2
sad0_rates              [0xe0] 44100 48000 88200
sad0_bits               [0xe0000] 16 20 24

When you found the eld file which contains your monitor information, you have to translate the number of the eld file into a probe mask for the snd_hda_intel module. The eld file which contained my monitor information was "eld#3.0" so my eld-number is "3.0". Now use the translation map below to find the correct probe-mask for your device:
  • 0.0 => 0x101
  • 1.0 => 0x102
  • 2.0 => 0x104
  • 3.0 => 0x108

As you can see, I have to use the probe-mask 0x108 as my eld-file-number is 3.0. Now you can reload the snd_hda_intel module with the correct module parameters. Of course you have to use your probe_mask for this:

# sudo rmmod snd_hda_intel
# sudo modprobe snd_hda_intel enable_msi=0 probe_mask=0x108

Restart XBMC and sound should be working now, but you may have to set the correct sound device in the XBMC audio hardware settings and you might also have to unmute the sound device using alsamixer. For me passthrough and normal mode are both working with this setup.

If sound works for you too, you have to add your module-settings to the system startup files, otherwise your settings won't survive a reboot.

echo "options snd-hda-intel enable_msi=0 probe_mask=0x108" | sudo tee /etc/modprobe.d/nvidia-hdmi.conf

Don't forget to adjust your probe_mask in the example above.



The above method of specifying a probe_mask will disable all your other sound devices. If you still need your other onboard sound devices, you have to patch libasound2 yourself with this patch. Here is a very short guide on how I did it:

$ sudo apt-get install build-essential fakeroot dpkg-dev
$ mkdir build
$ cd build
$ sudo apt-get source libasound2
$ sudo apt-get build-dep libasound2

## now download the patch above and save it as nvidia_hdmi.patch
## edit the file and cut all header lines up to, but not including the line which starts with diff

$ cd alsa-lib-1.0.22
$ patch -p1 < ../nvidia_hdmi.patch
$ dpkg-buildpackage -rfakeroot -b
$ cd ..
$ dpkg -i lib32asound2_1.0.22-0ubuntu7_amd64.deb
$ dpkg -i libasound2_1.0.22-0ubuntu7_amd64.deb

Now you can delete your /etc/modprobe.d/nvidia-hdmi.conf file and reload the snd_hda_intel driver. You will now be able to use all sound devices. Don't forget to unmute the Nvidia devices in alsamixer. Also you might have to create a custom asoundrc as you will now have multiple Nvidia HDMI devices and XBMC might use the wrong one.
Thanks, this post finally made me understand the modprobe stuff!

I also found this good explantion about ALSA and NVidia.

You can actually set masks for different cards independently of each other:

Logout Mark Read Team Forum Stats Members Help
[HOWTO] Nvidia GT4xx Fermi HDMI sound0
This forum uses Lukasz Tkacz MyBB addons.