You are not logged in.

#1 2010-08-06 00:12:41

sprince09
Member
From: USA
Registered: 2010-05-27
Posts: 8

HOW TO: HDMI Audio Output for Zotac Media Box with nVidia ION :)

I've been fighting with my recently purchased Zotac mini-PC for about 2 months now trying to get the HDMI audio output to work. I tried extensive modifications of /etc/asound.conf, different versions of ALSA, and even OSS without success. I've finally succeeded using ALSA and GNOME.

First I installed ALSA according to the Arch wiki.

Next I verified that ALSA detected my sound card(s):

 cat /proc/asound/cards 
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfe9fc000 irq 28
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfcf7c000 irq 18

Next I checked which sound card had the HDMI jack:

aplay -l
**** 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 7: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

From these two commands, I concluded that I have 2 sound cards (important later on) and that my HDMI sound card was card 1 (NVidia) and that it had 4 possible devices (3,7,8, and 9). To determine which device must be used, I ran the following command for each device (for example, to test card X and device Y, use' plughw:X,Y'):

aplay /usr/share/sounds/alsa/Front_Center.wav -D plughw:1,7
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

I tried each device and got the best sound from device 7 (8 and 9 also worked, device 3 gave static...).

Now, since I had 2 sound cards, I needed to change the default ALSA device. My default ALSA device was card 0 (the Intel card), which wasn't plugged in, so I needed to change the default card to be card 1 (the HDMI card). After reading the ALSA FAQ, I found that modifying /usr/share/alsa.conf should work, though modifying /etc/asound.conf should have also worked. For whatever reason, I couldn't get my modifications to /etc/asound.conf to work, so I edited /usr/share/alsa/alsa.conf. In the  "# defaults" section I replaced the following:

defaults.ctl.card NVidia
defaults.pcm.card NVidia
defaults.pcm.device 7

I opted to use the key NVidia rather than the card number (1) since I've read in numerous places that the card index can change unexpectedly after a reboot/update. The key can be checked with cat /proc/asound/cards as shown above.

After this, I reloaded ALSA (/etc/rc.d/alsa restart) and verified that the sound worked through the default channel:

aplay /usr/share/sounds/alsa/Front_Center.wav -D default
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

Finally, I rebooted, chose the HDA NVidia (ALSA Mixer) option from gnome-volume-control, and loaded a movie in gnome-mplayer. I was pleased to hear crystal clear sound with functioning volume control smile

I Hope this helps someone else, I found it very hard to piece together how to diagnose and resolve this problem. Here are some of the resources I found useful:

Arch Wiki ALSA Page
ALSA FAQ for how to change default sound card
ALSA FAQ
XBMC Troubleshooting for ION HDMI

Offline

#2 2010-08-06 00:20:30

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: HOW TO: HDMI Audio Output for Zotac Media Box with nVidia ION :)

Glad you got it working, but howtos should be added to the wiki, not to the forums smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2011-04-22 16:54:17

fredvej
Member
Registered: 2010-08-18
Posts: 3

Re: HOW TO: HDMI Audio Output for Zotac Media Box with nVidia ION :)

Thank you very much sprince09, your post helped me a lot  :-)

There's only one premise missing: install the propietary nVidia driver first.

Offline

#4 2012-01-21 23:41:06

knedlyk
Member
From: L'viv, Ukraine
Registered: 2009-04-14
Posts: 163
Website

Re: HOW TO: HDMI Audio Output for Zotac Media Box with nVidia ION :)

@sprince09 Can you hear sound through HDMI when you run aplay /usr/share/sounds/alsa/Front_Center.wav -D plughw:1,7 ?

(8 and 9 also worked, device 3 gave static...)

- what does it mean? How do you know that they are working?
What options do you have for snd_hda_intel in /etc/modprobe.d/ ?  Can you play the following:

mplayer -ao alsa:device=hw=1,7 file.wav

?
BTW, can you hear sound form video files in xine? If yes, can you post your ~/.xine/config ?

Last edited by knedlyk (2012-01-21 23:41:57)

Offline

Board footer

Powered by FluxBB