Archive:Set up HDMI audio on GeForce GT210, GT220, or GT240: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Paoleary
(Clean up the PulseAudio bits.)
>Paoleary
Line 25: Line 25:
Where there is a single "<tt>0xffff,</tt>" for each card that appears before the nVidia device in <tt>`aplay -l'</tt>.  In the example, the nVidia device is Card 1.
Where there is a single "<tt>0xffff,</tt>" for each card that appears before the nVidia device in <tt>`aplay -l'</tt>.  In the example, the nVidia device is Card 1.


=== Alternative method ===
=== If that doesn't work... ===
if probe_mask doesn't work for you (it didn't for me, one boot my GT220 came up first instead of second, but next reboot it came up second without me touching the probe_mask parameter, you can try this (which works reliably for me):
if probe_mask doesn't work for you (it didn't for me, one boot my GT220 came up first instead of second, but next reboot it came up second without me touching the probe_mask parameter, you can try this (which works reliably for me):


Line 37: Line 37:


I have to make a <b>BIG NOTE</b> that I don't have another Nvidia sound card on the motherboard, and that's why the above works for me. It won't work if you have an integrated nvidia sound AND a GT220.
I have to make a <b>BIG NOTE</b> that I don't have another Nvidia sound card on the motherboard, and that's why the above works for me. It won't work if you have an integrated nvidia sound AND a GT220.
If multiple nVidia devices still show up with the recommended probe_mask, you may need to adjust it.  More information about selecting the correct parameters for this option can be found in [http://www.kernel.org/pub/linux/kernel/people/tiwai/docs/HD-Audio.html#_codec_probing_problem Takashi Iwai's documentation for the High-Definition Audio drivers].


== PulseAudio Configuration ==
== PulseAudio Configuration ==

Revision as of 00:46, 4 March 2010

Before You Begin/Notes

This guide assumes that you have a GeForce G210, GT220, or GT240 card, are using a reasonably up-to-date system, and that you have at least the nVidia 190 series proprietary drivers installed.

Note that this is a work in progress and there are still significant limitations to the current method. The GT240, while it becomes recognized, may not work (please post feedback here!). Channel mapping is known to be incorrect. In videos, audio may occasionally drop with corresponding video stutter.

Getting ALSA

You will need to compile a patched version of ALSA 1.0.22.1 from source. An easy way to do this is with the ALSA Upgrade Script. Alternatively, you can download the sources from the ALSA Project. If using the upgrade script, only complete the first (-d) step. If using downloaded sources, this how-to assumes that you've unpacked them to /usr/src/Alsa-1.0.22.1/.

Patching ALSA

First, download the patch. This how-to assumes that the patch is in your home directory and is named alsa_nvidia.patch. This patch modifies patch_nvhdmi.c so it recognizes the G210, GT220, and GT240. Apply the patch by entering:

$ sudo patch -p1 -d /usr/src/Alsa-1.0.22.1/alsa-driver-1.0.22.1/sound < ~/alsa_nvidia.patch
patching file pci/hda/patch_nvhdmi.c
$

Compiling and Installing ALSA

If using the upgrade script, run the -c and -i steps now (hint for the adventurous: make the -c step faster on multicore systems). Otherwise, follow the standard ALSA configure, make, and install process, but do not reboot.

Setting Module Options

$ sudo cat - >> /etc/modprobe.d/sound.conf <<EOF
> options snd-hda-intel enable_msi=0 probe_mask=0xffff,0xfff2
> EOF
$ 

Where there is a single "0xffff," for each card that appears before the nVidia device in `aplay -l'. In the example, the nVidia device is Card 1.

If that doesn't work...

if probe_mask doesn't work for you (it didn't for me, one boot my GT220 came up first instead of second, but next reboot it came up second without me touching the probe_mask parameter, you can try this (which works reliably for me):

options snd-hda-intel enable_msi=0 index=-2

or

options snd-hda-intel enable_msi=0 index=1

The first one tells snd-hda-intel "don't grab index 0", while the second one says "grab index 1" (so even if you disable your on-board card, your GT220 is still going to be hw:1,7)

I have to make a BIG NOTE that I don't have another Nvidia sound card on the motherboard, and that's why the above works for me. It won't work if you have an integrated nvidia sound AND a GT220.

If multiple nVidia devices still show up with the recommended probe_mask, you may need to adjust it. More information about selecting the correct parameters for this option can be found in Takashi Iwai's documentation for the High-Definition Audio drivers.

PulseAudio Configuration

If using PulseAudio, add the following line to /etc/pulse/default.pa:

load-module module-alsa-sink device=hw:1,3

Where 1,3 is card#,device# for the nVidia HDMI output given by aplay -l.

Finishing Installation

Now, reboot your system. Using `alsamixer', select your nVidia card (select it from the F6 menu, or use the -c option) and unmute the S/PDIF output (press "m"; the box should change from "MM" to "OO".) Enjoy!