Difference between revisions of "NVidia GT220 HDMI sound"

From LinuxMCE
Jump to: navigation, search
(Passthrough actually works after a moment of inspiration)
(Brought up to date for Ubuntu 10.10 and latest tests at Dianemo HQ)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
== Summary ==
 
== Summary ==
The nVidia GT220 (together with the other GT2xx cards) no longer has a S/PDIF input plug on it. Instead, it comes with a built-in sound card that isn't supported by ALSA yet.
+
The nVidia GT220 (together with the other GT2xx cards) no longer has a S/PDIF input plug on it. Instead, it comes with a built-in sound card. The driver snd-hda-intel drives the sound chip embedded on these cards.
  
There's a patch, which works find so far, but it's a bit hacky and I don't see any traces of it in ALSA's SVN. [[User:Uplink|Uplink]] 21:50, 18 February 2010 (CET)
+
There is some support since ALSA 1.0.22.
  
 
== Status ==
 
== Status ==
<b>Experimental</b>
+
<b>Sometimes it works, sometimes it doesn't</b>
  
The people at XMBC have a page in that Wiki which points to a [http://wiki.xbmc.org/index.php?title=HOW-TO_set_up_HDMI_audio_on_nVidia_GeForce_G210,_GT220,_or_GT240 patch that makes sound work through the HDMI connector of the GT220 and GT240].
+
* Sometimes it works:
 +
** GT220 on motherboard Gigabyte GA-MA78GM-S2H
 +
* Sometimes it doesn't:
 +
** GT220 on motherboard Asus P7M-F WS
  
* PCM sound: <b>WORKS</b>
+
In both cases, the same two GT220 cards were used:  
* Passthrough for AC3 and DTS: <b>WORKS</b>
+
* Asus model ENGT220/DI/1GD2(LP)/V2
* GT240s have some issues with PCM (not confirmed, as I only have a GT220)
+
* Asus model ENGT220/G/DI/1GD2(LP)/A &lt;GA&gt;
 +
Both worked in the first case, none worked in the second case (no codecs found).
  
The patch from the XBMC wiki creates four sound devices for some reason (3, 7, 8, 9), but only one of them plays any sound: device 7. You need to unmute it with alsamixer.
+
== How to use ==
  
== The hacky part ==
+
=== Ubuntu 10.04 ===
Because the "hdmi" device is no longer valid with a GT220, I took the liberty of making the following changes, in order to maintain maximum software compatibility:
+
Information needed
  
* File: /etc/modprobe.d/gt220.conf
+
=== Ubuntu 10.10 ===
options snd-hda-intel enable_msi=0 index=1
+
You don't need to do any hacks anymore. It either works or it doesn't.
  
* File: /etc/asound.conf (add this to your existing file)
+
The device name will be "hdmi:$cardNumber", where $cardNumber is the corresponding card number from the /proc/asound/cards file.
pcm.!hdmi {
+
        @args [ AES0 AES1 AES2 AES3 ]
+
        @args.AES0 {
+
                type integer
+
                # consumer, not-copyright, emphasis-none, mode=0
+
                default 0x04
+
        }
+
        @args.AES1 {
+
                type integer
+
                # original, PCM coder
+
                default 0x82
+
        }
+
        @args.AES2 {
+
                type integer
+
                # source and channel
+
                default 0x00
+
        }
+
        @args.AES3 {
+
                type integer
+
                # fs=48000Hz, clock accuracy=1000ppm
+
                default 0x02
+
        }
+
        type hooks
+
        slave.pcm {
+
                type hw
+
                card 1
+
                device 7
+
        }
+
        hooks.0 {
+
                type ctl_elems
+
                hook_args [
+
                {
+
                        name "IEC958 Playback Default"
+
                        lock true
+
                        preserve true
+
                        value [ $AES0 $AES1 $AES2 $AES3 ]
+
                }
+
                {
+
                        name "IEC958 Playback Switch"
+
                        lock true
+
                        preserve true
+
                        value true
+
                }
+
                ]
+
        }
+
}
+
  
I took my inspiration from these files: /usr/share/alsa/pcm/hdmi.conf and /usr/share/alsa/cards/HDA-Intel.conf
+
For passthrough in Xine:
  
Notice that because of parameter "index=1" for snd-hda-intel, the card will always have index 1, even if you disable or remove your real sound card (either on-board or removing it from its PCI slot) so asound.conf doesn't need to track it.
+
audio.device.alsa_passthrough_device:hdmi:CARD=$cardNumber,AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
 +
audio.output.speaker_arrangement:Pass Through
  
Also notice that if your real sound card is driven by snd-hda-intel you may get unexpected results and you are expected to update this wiki page if you find a solution.
+
where $cardNumber is the card number from /proc/asound/cards as explained above.
 
+
== How this affects LinuxMCE ==
+
No changes needed in any of DCE applications. You select "HDMI" in the AVWizard as you'd normally do and LinuxMCE wouldn't really care that the "hdmi" pcm has been altered, as it works exactly the same through the "asym_hdmi" pcm as it ever did.
+
 
+
Some code may be needed to detect the GT220 and make the modifications accordinly.
+

Latest revision as of 20:47, 22 February 2011

Summary

The nVidia GT220 (together with the other GT2xx cards) no longer has a S/PDIF input plug on it. Instead, it comes with a built-in sound card. The driver snd-hda-intel drives the sound chip embedded on these cards.

There is some support since ALSA 1.0.22.

Status

Sometimes it works, sometimes it doesn't

  • Sometimes it works:
    • GT220 on motherboard Gigabyte GA-MA78GM-S2H
  • Sometimes it doesn't:
    • GT220 on motherboard Asus P7M-F WS

In both cases, the same two GT220 cards were used:

  • Asus model ENGT220/DI/1GD2(LP)/V2
  • Asus model ENGT220/G/DI/1GD2(LP)/A <GA>

Both worked in the first case, none worked in the second case (no codecs found).

How to use

Ubuntu 10.04

Information needed

Ubuntu 10.10

You don't need to do any hacks anymore. It either works or it doesn't.

The device name will be "hdmi:$cardNumber", where $cardNumber is the corresponding card number from the /proc/asound/cards file.

For passthrough in Xine:

audio.device.alsa_passthrough_device:hdmi:CARD=$cardNumber,AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
audio.output.speaker_arrangement:Pass Through

where $cardNumber is the card number from /proc/asound/cards as explained above.