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
(→‎Setting Module Options: Format the options in the table as monospaced.)
>Paoleary
Line 6: Line 6:


== Patching ALSA ==
== Patching ALSA ==
The latest snapshots of ALSA packaged by Takashi Iwai include an updated version of the driver patch originally suggested here.  It is recommended that you use try this snapshot first.
The latest snapshots of ALSA packaged by Takashi Iwai include an updated version of the drivers from Wei Ni of nVidia.  It is recommended that you use try this snapshot first.


If using the upgrade script, execute the <tt>-s</tt> step to download the snapshot to the sources directory.  Otherwise, you can download the latest alsa-driver snapshot from [http://ftp.kernel.org/pub/linux/kernel/people/tiwai/alsa/alsa-driver/ Takashi Iwai's FTP].
If using the upgrade script, execute the <tt>-s</tt> step to download the snapshot to the sources directory.  Otherwise, you can download the latest alsa-driver snapshot from [http://ftp.kernel.org/pub/linux/kernel/people/tiwai/alsa/alsa-driver/ Takashi Iwai's FTP].

Revision as of 22:08, 6 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.

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

The latest snapshots of ALSA packaged by Takashi Iwai include an updated version of the drivers from Wei Ni of nVidia. It is recommended that you use try this snapshot first.

If using the upgrade script, execute the -s step to download the snapshot to the sources directory. Otherwise, you can download the latest alsa-driver snapshot from Takashi Iwai's FTP.

If you have a G210 or GT240, proceed to "Compiling and Installing ALSA," below. GT220 owners, read on.

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 your home directory as alsa_nvidia_gt220.patch and apply it by entering:

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

Then proceed to "Compiling and Installing ALSA," below.

The Original Patch

If the driver snapshot fails, the old proven method is based on ALSA 1.0.22.1. You will want the original drivers package. If using the upgrade script, re-run the -d step before doing the below; otherwise, replace the snapshot driver sources with the original ALSA 1.0.22.1 driver sources.

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

You will need to set options in /etc/modprobe.d/sound.conf depending on your card. The general format is:

options snd-hda-intel OPTIONS

The snapshot driver seems to work sufficiently differently than the leaked driver that the original patch is based on that the module options may change. Please list your card and working module options below, along with the working device(s).


nVidia GPU Manufacturer/Model Options Best/working device
G210 MSI N210 MD512H enable_msi=0 7 (stereo works)

Once you've set your module options, proceed to "PulseAudio Configuration" (if applicable) or "Finishing Configuration".

Original 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!