Monday, July 25, 2011

nVidia EVGA g210 card: HDMI audio and sync-to-vblank in lucid

To get the HDMI audio to work on this g210 video card in Ubuntu Lucid (10.04), I first had to add this PPA and install updated alsa modules:
add-apt-repository ppa:team-iquik/alsa
add-apt-repository ppa:ubuntu-audio-dev/ppa
apt-get update
apt-get upgrade
apt-get install linux-alsa-driver-modules-$(uname -r) --force-yes

Then I had to set the module options correctly for my card:
$ more /etc/modprobe.d/sound.conf 
options snd-hda-intel enable_msi=0 probe_mask=0xffff,0xfff2

Once I did all that, I saw a single HDMI audio output:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: VT1828S Analog [VT1828S Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: VT1828S Digital [VT1828S Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 2: VT1828S HP [VT1828S HP]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And could test it:
speaker-test -c2 -twav -Dplughw:1,3

(Before I got the module options correct, I saw several HDMI audio outputs, and none of them would work.)

To get it to work with flash (for things like youtube), I had to create an /etc/asound.conf:
$ more /etc/asound.conf 
pcm.!default hdmi:NVidia
pcm:iec958 hdmi:NVidia

Then audio worked all the way. One annoyance is that the module hangs for ~5s when loading, so it increases my boot time.

Now that I could hear the youtube videos, I just had to get rid of the annoying tearing artifacts by telling the graphics to sync to the vertical blank interval. To do that, I enabled "Sync to VBlank" in "X Server XVideo Settings" and "OpenGL Settings", then installed compizconfig-settings-manager, ran "ccsm" and enabled it under General... General... Display Settings.

No comments: