Audio over HDMI with a GT210/220
From OCAU Wiki
Before this can work you will need to have at least the nVidia 190 series proprietary drivers installed. This can be done through the Synaptic Package Manager in System > Administration > Synaptic Package Manager.
You will need to compile a patched version of ALSA 188.8.131.52 from source with updated drivers. An easy way to do this is with the ALSA Upgrade Script.
The script is found at the bottom of that post so you will need an account to the ubuntuforums to download it.
1) Download the script and save it somewhere (I recommend the /home/<username> directory)
2) cd /home/<username>
3) tar xvf AlsaUpgrade-184.108.40.206-2.tar
4) sudo ./AlsaUpgrade-220.127.116.11-2.sh -d (to initialise the script and download all the updates)
5) sudo ./AlsaUpgrade-18.104.22.168-2.sh -s (to download the latest snapshots of the alsa-drivers package)
6) If you have a GT210 or GT240 proceed to "Compiling and Installing ALSA". GT220 owners will need to apply a seperate patch
The GT220 Patch
If you use a GT220, the latest snapshots get you most of the way there. For whatever reason, the driver does not include the PCI IDs for the GT220. To add them download this small patch to /home/<username> as alsa_nvidia_gt220.patch and apply it by entering
sudo patch -p1 -d /home/<username>/Alsa-22.214.171.124/alsa-driver-126.96.36.199/sound < ~/alsa_nvidia_gt220.patch patching file pci/hda/patch_nvhdmi.c
Then proceed to "Compiling and Installing ALSA"
The Original Patch
If the driver snapshot fails, you will want the original drivers package for ALSA 188.8.131.52. Re-run the -d step before applying the original patch.
Download the original patch to /home/<username> and name it alsa_nvidia.patch.
sudo patch -p1 -d /home/<username>/Alsa-184.108.40.206/alsa-driver-220.127.116.11/sound < ~/alsa_nvidia.patch patching file pci/hda/patch_nvhdmi.c
Compiling and Installing ALSA
sudo ./AlsaUpgrade-18.104.22.168-2.sh -c sudo ./AlsaUpgrade-22.214.171.124-2.sh -i
This is where the xbmc wiki and forums merge.
Open up a terminal and enter alsamixer. Press F6 to change sound card to HDA nVidia. You should see 4 SPDIF outputs! Unmute all of them by pressing m on each one. Exit alsamixer and type in aplay -l. You should see something similar to this depending on how many sound devices you have.
**** List of PLAYBACK Hardware Devices **** card 0: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: Intel [HDA Intel], device 1: ALC888 Digital [ALC888 Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 4: NVIDIA HDMI [NVIDIA HDMI] Subdevices :1/1 Subdevices #0: subdevice #0
Now edit /etc/modprobe.d/sound.conf file and add this line
options snd-hda-intel probe_mask=0xffff,0xfff2
if aplay -l shows Nvidia HDMI as Card 0 you'll have to use this line:
options snd-hda-intel probe_mask=0xfff2
or for card 2:
options snd-hda-intel probe_mask=0xffff,0xffff,0xfff2
Reboot the machine again and your HDMI audio should work. You can test it with this command in a terminal.
aplay -D plughw:1,3 /usr/share/sounds/alsa/Noise.wav
where 1,3 stands for card,device as shown in aplay -l
Now, open up mythtv and in the frontend go to Setup > General > Audio System > Audio output device. There is a list of options, one with with 'ALSA: plughw:0,3' in it so select that and change it to 'ALSA: plughw:1,3' (where 1,3 stands for card,device as shown in aplay -l). Save the settings and enjoy!