# The Ubuntu Forum Community > Ubuntu Official Flavours Support > Multimedia Software > [ubuntu] HOWTO: Ubuntu 10.10 Nvidia hdmi audio

## tjones00

Although this information is present in this forum in bits and pieces a new nvidia hdmi audio thread pops up every couple days. 

So for simplicity sake here's my attempt and a very simple howto instead of editing re-editing and reposting old information.

First make sure you have nvidia proprietary drivers installed. hdmi audio does not work with nouveau/opensource. Open a terminal. Applications -> Accessories ->Terminal.

Now type:



```
cat /proc/driver/nvidia/version
```

You should see something like this.


```
NVRM version: NVIDIA UNIX x86 Kernel Module  260.19.06  Mon Sep 13 06:35:06 PDT 2010
GCC version:  gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
```

If not go install the nvidia proprietary driver via System -> Administration -> Additional Drivers.




*NVIDIA HDMI AUDIO Ubuntu 10.10*

Begin by reading this (it's ok if you don't understand it but you should be aware of this post): http://www.nvnews.net/vbulletin/show...20&postcount=7

*Step 1)* To start confirm that your system can see your nvidia hdmi audio card. Type aplay -l in a terminal. You should see something like this.



```
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 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: 0/1
  Subdevice #0: subdevice #0
```

If you do not see a nvidia sound device you need to upgrade to a properly patched alsa 1.0.23 or 2.6.35+ kernel. For the fact that it is often not required nowdays I'll leave that out of this howto. Follow this link to upgrade alsa https://wiki.ubuntu.com/Audio/Instal...aDriverModules


*Step 2)* Confirm which device is responsible for hdmi audio.

Open a terminal and type:



```
grep eld_valid /proc/asound/NVidia/eld*
```

You'll see an output like this:



```
/proc/asound/NVidia/eld#0.0:eld_valid        0
/proc/asound/NVidia/eld#1.0:eld_valid        0
/proc/asound/NVidia/eld#2.0:eld_valid        0
/proc/asound/NVidia/eld#3.0:eld_valid        1
```

The line that returns eld_valid 1 is the device responsible for hdmi audio on your nvidia card and has recognized that there is a connection. 

If you don't receive a 1 for one of the devices you need to return to  Step 1) and ensure you have a properly patched alsa 1.0.23 or 2.6.35+  kernel. This may also be the fault of the system not acquiring EDID data  from your hdmi connection. Inability to acquire an EDID will also  result in resolution issues so you should move onto resolving this issue  before setting up hdmi audio. You can confirm your system has acquired  an EDID from the connection by checking your /var/log/Xorg.0.log file.

*UPDATE:* http://http.download.nvidia.com/XFre...dmi-audio.html
According to the above:




> 13.5. Verify Your ELD Is Valid
> To validate that the ALSA driver is aware of your monitor, check the eld files. Recall that older chipsets (ION and earlier) dont support ELD reporting, and hence the ELD files will not exist. In this case, ALSA always assumes that all audio features are available


Therefore if you don't receive any eld information you may just have an older card that doesn't support reporting. You will then have to manually test each device with aplay to determine which device is responsible for audio.

eg. 


```
aplay -D plughw:NVidia,3 /usr/share/sounds/alsa/Front_Center.wav
aplay -D plughw:NVidia,7 /usr/share/sounds/alsa/Front_Center.wav
aplay -D plughw:NVidia,8 /usr/share/sounds/alsa/Front_Center.wav
aplay -D plughw:NVidia,9 /usr/share/sounds/alsa/Front_Center.wav
```

*Step 3)* Use a probemask to enable the proper codec for hdmi:NVidia.

eld#0.0=device 3       probe_mask=0x101
eld#1.0=device 7       probe_mask=0x102
eld#2.0=device 8       probe_mask=0x104
eld#3.0=device 9       probe_mask=0x108

Edit or create a /etc/modprobe.d/sound.conf file. Type the following in a terminal:



```
gksudo gedit /etc/modprobe.d/sound.conf
```

add the proper options snd-hda-intel probe_mask line to this file (this example uses device 9)



```
options snd-hda-intel probe_mask=0x108
```

Save the file and update the initramfs to make sure this change will be used upon reboot.



```
sudo update-initramfs -u
```

*

UPDATE: see this post for more information on probe_masks.
http://ubuntuforums.org/showpost.php...8&postcount=21


Step 4)* Edit your pulseaudio default.pa file. **Note if you do not have pulseaudio installed just add pcm.!default hdmi:NVidia to your /etc/asound.conf file remove any .asoundrc file and reboot as in this post http://ubuntuforums.org/showpost.php...2&postcount=11

If you have pulseaudio installed continue with the following edit.



```
gksudo gedit /etc/pulse/default.pa
```

Find the static alsa sink line:



```
### Load audio drivers statically (it's probably better to not load
### these drivers manually, but instead use module-hal-detect --
### see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
```

Add load-module module-alsa-sink device=hdmi:NVidia to the end of the section:



```
### Load audio drivers statically (it's probably better to not load
### these drivers manually, but instead use module-hal-detect --
### see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
load-module module-alsa-sink device=hdmi:NVidia
```

Remove any local pulseaudio/alsa settings to ensure this new default.pa systemwide setting will be used. Type the following in a terminal.



```
rm -r ~/.pulse ~/.asound* ~/.pulse-cookie
```

*

Step 5)* Reboot the computer and you should now be able to use the standard hdmi audio connection or the hdmi device via hdmi:NVidia. 

If not try unmuting the device in alsamixer then test it again.



```
alsamixer
```

MM denotes muted 00 is unmuted, m is the toggle, f6 to switch cards.

To test the probemask after the reboot do the following:



```
aplay -Dhdmi:NVidia /usr/share/sounds/alsa/Front_Center.wav
```

If you receive audio with the aplay command but not at your desktop your pulseaudio or local settings are probably incorrect.



If you have problems with this probemask method you will have to resort to editing default.pa and possibly asound.conf listing the explicit card# and device # for your hdmi audio eg. hw:1,9 or hw:NVidia,9

If anybody sees something wrong with this process let me know and I'll correct it asap.

----------


## swapnil_bhartiya

I tried your howto and now no devices shown in Sound Preferences. Please suggest.

----------


## tjones00

These forums have been having issues today.

To test the probemask directly do the following. First run alsamixer and make sure the device is unmuted. Then type this in a terminal.



```
aplay -Dhdmi:NVidia /usr/share/sounds/alsa/Front_Center.wav
```

If that works the probemask is good and it's just pulseaudio settings. These should have been auto repopulated after the wipeout but to make sure do the following.



```
gksudo gedit /etc/asound.conf
```

add



```
pcm.pulse {
    type pulse
}
ctl.pulse {
    type pulse
}
pcm.!default {
    type pulse
}
ctl.!default {
    type pulse
}
```

Then reboot.

If you still don't see any devices try killing and relaunching pulseaudio.



```
sudo killall pulseaudio

sudo pulseaudio -D
```

If aplay -Dhdmi:NVidia didn't work the then the nvidia suggested probemask is most likely incompatible with your card.

Do the following.

1) Remove the /etc/modeprobe.d/sound.conf file you created or remove the probemask line if you just added it to the file and update initramfs again.

2) Edit the the default.pa file replacing hdmi:NVidia with an explict plughw: call to your card,device eg if the card was 1 and the device 9 plughw:1,9.

load-module module-alsa-sink device=plughw:1,9

You can keep the asound.conf pointing to pulse.

If that still doesn't work then you'll most likely have to use a hw: definition in default.pa and setup the asound.conf to work properly with your card with the dmix/hw setup people have been using. It's an ok method but not as dynamic as hdmi:NVidia or plughw:*,* would be for people with different setups.

Pretty much all the stuff in the last half of this post that was originally posted 6 months ago and is just a mess.
http://ubuntuforums.org/showpost.php...45&postcount=8

----------


## tjones00

multipost forum error nothing to see here.

----------


## tjones00

multipost forum error nothing to see here.

----------


## tjones00

multipost forum error nothing to see here.

----------


## tjones00

multipost forum error nothing to see here.

----------


## tjones00

multipost forum error nothing to see here.

----------


## tjones00

multipost forum error nothing to see here.

----------


## gomike

So I am stuck at step 4

I have no "pulseaudio default.pa" file.

OK I figured out I had to install pulseaudio and finally got it working.

----------


## BicyclerBoy

You are welcome..glad to have been able to help.
I'm sure we took the long way round...

Maybe the syntax was not right..maybe speaker-test has some problem with this sound device because of some driver problem.

speaker-test -Dplug:spdif -c2 -r 48000

If you setup your ubuntu install with the /home folder mounted in a separate partition you can minimise the damage/loss of re-installs/distro-upgrades.

I doubt you have done the install any harm..
You could just un-install the natty kernel then remove the kernel ppa.
You could need to re-run
sudo update-initramfs -u
although the kernel scripts should do this.

(or to update all kernel images in GRUB
sudo update-initramfs -d all -u  )

----------


## MrCorleone87

Hey man, I have this problem with HDMI audio and I tried to follow your guide but I'm stuck at step 2. Basically I did update ALSA here https://wiki.ubuntu.com/Audio/Instal...aDriverModules as you advised but then after typing grep eld_valid /proc/asound/NVidia/eld* in terminal all of my eld_valid are still 0. So I went to http://http.download.nvidia.com/XFre...dmi-audio.html and I've read the whole thing but I don't really get most of it as I'am pretty new to the Linux Community. So what could I do now? Is there a chance for a newbie like me to get this thing working? I'd be really really happy if this could be fixed because except for the sound problem I totally love Ubuntu.By the way I run the OS on Toshiba Satellite A660 Laptop Thanks in advance for any help!

----------


## BicyclerBoy

Points to note:
The HDMI audio ELD entries are generated from handshake/bi-directional comms between the video driver & the HDMI receiver (TV/monitor/AVR/HT-amp).
This may or may not be PlugNPlay (real time updated).

This means:
- receiver must be turned on
- receiver must be connected by HDMI
- nvidia X server must be running with active X screen
- alsa driver compatible with video driver

So you should make sure the X server starts/loads after the HDMI is powered up.

----------


## Tinnum

Could I have a bit of guidance please? - I am a raw nubie and have been struggling to get HDMI audio through an Asus ION5T motherboard. I can follow (just) this guidance until Step 3. My question is "Why use the probe mask for "0x108"? Is it because it is the fourth 'eld' result and it was the fourth device listed which was responsible for HDMI audio?. I had the "1" alongside the second line down when I confirmed which device was responsible for HDMI audio.

(Incidentally, when I load _alsamixer_ I can see the HDMI card but cannot alter the configuartion other than to change the spdif from mute to unmute.)  Please help - in desperation........

----------


## BicyclerBoy

That bit mask is wrong..you should read further...
The mask should be <= 0x0F  (15 decimal)

A value of 0x08 (0%1000) would hide all but the 4th device.
I don't think the mask is really needed, it just hides the unusable devices.

Have you tried using speaker-test ?
You should read the nVidia hdmi audio document ?

----------


## Tinnum

Thanks so much for the quick response!! A voice in the darkness...
I have tried the speaker test without any success.

Also thanks for the advice about the Nvidea audio document....Is it on the Nvidea site or somewhere on this forum please (or are those the criteria for a search)/??

----------


## BicyclerBoy

What speaker-test cmd opts did you try ?

speaker-test -c 2 -r 48000 -D hw:1,9

Post #16 has the http URL to the nVidia HDMI doc.

The snd-hda-intel probemask has to allow for any mobo soundcard...
So if your nvidia hdmi audio is the 2nd soundcard then the probemask should look like
options snd-hda-intel probe_mask=-1,0x8 
if you what to hide hdmi logical codec IDs 0, 1 & 2.

Try
aplay -D hw:1,9 /usr/share/sounds/Front_Center.wav
(assuming hdmi is 2nd soundcard in aplay -l)

----------


## Tinnum

Many thanks for your effort . Will try and report back.
(used your recommended speaker test and although it seems to be generating a sound signal,no HDMI sound. I have analogue sound through my front ear phones)

----------


## BicyclerBoy

You had better post your 
aplay -l

maybe your hdmi devices appear as the 1st card.
change the 1 --> 0

----------


## Tinnum

Many thanks. I am afraid the Nvidea link was a bit beyond my comprehension!

This is what I got from sudo aplay -Lpulse
    Playback/recording through the PulseAudio sound server
front:CARD=Intel,DEV=0
    HDA Intel, ALC887 Analog
    Front speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, ALC887 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, ALC887 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, ALC887 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, ALC887 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, ALC887 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
    HDA Intel, ALC887 Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, NVIDIA HDMI
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, NVIDIA HDMI
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, NVIDIA HDMI
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, NVIDIA HDMI
    HDMI Audio Output


Does that tell you anything...my brain is fried....
MANY THANKS IN ANTICIPATION

----------


## Tinnum

...And here is aplay -l**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC887 Analog [ALC887 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC887 Digital [ALC887 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 0/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

----------


## BicyclerBoy

So your HDMI is the 2nd soundcard (Card 1)
The mobo ALC887 is card 0.

To clarify...
speaker-test -c 2 -r 48000 -D hw:1,9

this produces no sound from anywhere ?

You are running the nVidia driver (X server) & the gnome desktop is active on a monitor.

----------


## Tinnum

Not a peep.....
I am running x server  and gnome is active on desktop.

----------


## BicyclerBoy

alsamixer -c _1

_check unmuted..
Probably need to go back to the step by step process of checks..
Have you checked the ELD /proc/asound/cardx/...
cat /proc/asound/card1/codec#3

It is possible your audio output could be on codec#0, 1, 2 (logical codec#)

----------


## Tinnum

Yep - unmuted on all 4 s/pdif channels.
Incidently I did not use the mask-probe as you thought it was probably unnecessary.
This is the last stage I got to:
$ grep eld_valid /proc/asound/NVidia/eld*
/proc/asound/NVidia/eld#0.0:eld_valid        0
/proc/asound/NVidia/eld#1.0:eld_valid        1
/proc/asound/NVidia/eld#2.0:eld_valid        0
/proc/asound/NVidia/eld#3.0:eld_valid        0
anthony@AntsLinux:~$

----------


## BicyclerBoy

cat /proc/asound/card1/codec#1


The probe mask just gets in the way by hiding the devices before you are sure which one to use..

speaker-test -c 2 -r 48000 -D hw:1,7

if the above works then your probe_mask = -1,0x2

Getting the right probe_mask will allow pulseaudio to work with HDMI device.
This is just a work-around...one day it may not be necessary.
If you don't use pulse then it does not matter as much.
As alsa will only allow (2) audio output streams per GPU, using different HDMI socket (if you have them) tricky; the probe_mask can expose only the (2) you might want to/can use...

----------


## Tinnum

Well an am bursting with joy!!! I am getting "white noise"  out to the speakers!!! Is that what I should have got?? Believe me after all this time even  white noise is music!!
Is there anything else I have to do now to get proper audio please?

----------


## BicyclerBoy

It's Pink 1/f noise .

If you want to use pulse-audio (a good idea)

The nvidia HDMI doc..
13.9.1. Adding Extra Outputs To PulseAudio
/etc/pulse/default.pa
Only add one..& you need this one.
load-module module-alsa-sink device=hw:1,7


If you have more than 1 HDMI output sockets AND you use a different output then you will then need to determine the exact codec#n that works &  edit the above pulse audio file.
Just use the same socket connector...

----------


## Tinnum

I only have one HDMI output  - 
If I am understadnign you correctly I need to enter "load-module module-alsa-sink device=hw:1,7" into a terminal??
I did and got "command not found" - or am I being too simplistic??  Sorry this learning curve is almost vertical....

----------


## BicyclerBoy

You should take the time & read the section of the nvidia doc..13.9.1

gksudo gedit /etc/pulse/default.pa

& add this in that file (at the end)...


```
load-module module-alsa-sink device=hw:1,7
```

logout/login..
Gnome sound preferences should then show (2) HDMI devices..select the second device as default output...
The app
pavucontrol
is much nicer than gnome sound prefs..

----------


## Tinnum

I cannot thank you enough for your patience! I am going to take a break now but will let you know the outcome and recommend you for a sainthood.......many thks

----------


## Tinnum

Hi Again.
I have followed your instructions (i believe) to the letter but still get no sound. The Gnome speaker icon is now showing "---".
This is now my aplay -l.

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC887 Analog [ALC887 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC887 Digital [ALC887 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




Any clues as to what I have done wrong please??

----------


## BicyclerBoy

Did you use an modprobe option probe_mask ?
You do not need to & it could be better not to use one..

I understand the probe_mask could be used to allow pulse audio to work without requiring the editing of pulse config files..

But you have edited the pulse file default.pa & added "load-module module-alsa-sink device=hw:1,7" ???

Note that with Ubuntu you need to run this after any changes to modprobe.d/*.conf options.

[sudo] update-initramfs -u


But before you do anything.......
try the

----------


## Tinnum

Synopsis of what I did


*Steps 1 & 2* were almost exactly like your example


*Step 3*
I typed into a terminal:

gksudo gedit /etc/modprobe.d/sound.conf 

an empty box opened up and I typed  in
options snd-hda-intel probe_mask=-1,0x2 
and saved. 
Then ran 
 sudo update-ininramfs -u *

Step 4
* I typed in terminal gksudo gedit /etc/pulse/default.pa added    load-module module-alsa-sink device=hdmi:NVidia in position  advised. Saved and closed *
Next Step*
I then ran  gksudo gedit /etc/pulse/default.pa and at the end typed in load-module module-alsa-sink device=hw:1,7 then re-booted.................

----------


## BicyclerBoy

When did I ever say to add
load-module module-alsa-sink device=hdmi:NVidia


We want pulse audio working..

The confusion stems from this..
The physical codec ids are not fixed. They are allocated as exposed.
If the probe mask is used it changes the codec physical id needed in the default.pa file
Alsa only sees the codecs exposed by probe_mask.

For example (I believe):
logical[0,1,2,3] ==physical*[3,7,8,9]==mask value[1,2,4,8] but only if mask =0xf.
(the meaning of logical & physical is completely wrong/swapped)
1.
probe_mask value -1, 0x2
expose card1 pin codec #7 only to alsa.
one codec logical 1 == physical #3  device=hw1:3
alsa reports hw:1,3 but it connects to real logical 1 output.
2.
probe_mask value -1, -1
alsa will report first 2 codecs of each card.
card1 codec logical 0 == physical #3 device=hw1:3
card1 codec logical 1 == physical #7 device=hw1:7

3. complex ex
probe_mask -1,0x6
alsa will report logical 1 & 2
card1 codec logical 1 & 2 ==physical #3 & #7 device=hw1:3 & hw1:7

Therefore change your probe_mask to -1,-1

Speaking as a electronics h/w engineer The confusion is not helped by the complete stupid mixing up the meaning of logical & physical ids.

----------


## Tinnum

Sorry, I was confusing your advise by the guide put out by TJONES00.

Will try again  - really appreciate your help!!

----------


## Tinnum

.Thank you  thank you - sound nearly took my head off......I have sooo much to learn. You have been brilliant. Not quite sure what the problem was but will endeavor to find out. Thanks again!

----------


## BicyclerBoy

Glad it is working.

In the pulse default.pa file:
You can not have (2) "load module-alsa-sink" lines in the file because pulse always loads hw1:3 & alsa only allows max number =2.
So (2) entries == 3 alsa devices (bad) & pulse will fail.
The mask value 0x2 would have forced you to use a different hw1:3.

This thread has evolved as more h/w & info has become available.
There have also been alsa updates..
There are multiple solutions possible (linux in general) but incompatible.

All this means there is a moving target & you have to read the whole thread in context.
But I'm not sure the context can be understood unless you were following from the start.

Reading thru' the whole thread again has given me a headache..

----------


## TxRx

This is THE guide that resolves it every time for me. If I've tinkered about with other guides it screws up. If I flatten my install of 10.10 and go through this lot, it's perfect. 

Many thanks!!!

 :KDE Star:  :KDE Star:  :KDE Star:  :KDE Star:

----------


## soft_kitten

Thank you so much for your guide! Your instructions were both easy to follow and seemed to have accomplished the task. I did the steps except for "Remove any local pulseaudio/alsa settings" and "test the probemask after the reboot do the following" and after a reboot I got glorious sound from my monitor's speakers.

But it did remove my motherboard-supplied sound from the sound options. Oh well, good enough anyways.

----------


## sir4taye

It worked for me on my new Natty Narwhal 11.04 x64 install with onboard nvidia turned off in bios, but a geforce 210 512 installed. 

Natty Narwhal NVidia Geforce 11.04 hdmi Audio sound Working now!!!!

----------


## windscryer

Running 11.04 with a GT240. Followed this thread through from beginning, never found success, and managed to completely jack up my settings to the point where typing in 



```
grep eld_valid /proc/asound/NVidia/eld*
```

gave me only one entry and it had a 0 for the end value.

Went back and UNdid everything I'd done and am now back to square one.

I currently can get sound when I do



```
aplay -D plughw:NVidia,9 /usr/share/sounds/alsa/Front_Center.wav
```

(I tried it because that is the device listed by 



```
grep eld_valid /proc/asound/NVidia/eld*
```

.)

but testing my speakers in the sound preferences GUI gets me nothing, nor does running any sound-producing program.

So now that I'm once again effectively at step 3 of the OP's tutorial, does anyone have any suggestions for possible fixes?

Don't know if it's needed, but just in case my aplay -l is:



```
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
  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
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
```

Thanks in advance for anyone who can help me untangle this issue!

----------


## BicyclerBoy

gksudo gedit /etc/pulse/default.pa

& add this in that file (at the end)...
Make sure there is only one line with module-alsa-sink.


```
     load-module module-alsa-sink device=hw:1,9
```

logout/login..
Gnome sound preferences should then show (2) HDMI devices..select the second device as default output...
This is because pulse-audio enumerates the first alsa device exposed (hw1,3).
This behaviour can be changed by using the probe mask value.

----------


## windscryer

> gksudo gedit /etc/pulse/default.pa
> 
> & add this in that file (at the end)...
> Make sure there is only one line with module-alsa-sink.
> 
> 
> ```
>      load-module module-alsa-sink device=hw:1,9
> ```
> ...


Thanks for the reply! Sorry it took me a day to get back here.

Okay, I have the two devices showing in my preferences, but picking the second (under the Output tab, the Hardware tab still only lists one device) still doesn't give me sound except through specific commands in terminal. I also double-checked and everything is unmuted in alsamixer. Is there anything else I can tweak?

Actually...

When you say there should only be one line with module-alsa-sink, are you including



```
### Load audio drivers statically (it's probably better to not load
### these drivers manually, but instead use module-udev-detect --
### see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
```

that fourth line there? It was in the file to begin with.

----------


## BicyclerBoy

The lines starting with "#" are commented out.

That entry in pulse/default.pa can get you running with system wide audio over HDMI.

With HDMI turned on & plugged in & X server running. ( *no* AVR HT amp)

cat /proc/asound/card1/codec#3
(this is hw:1,9 codec)

cat /proc/asound/card1/eld#3.0
(ELD EDID data from display or receiver)

dmesg | grep HDMI
(hot plug detection events etc)

It is possible that hw:1,9 is not the correct output..

----------


## windscryer

It was my understanding that adding that line to the pulse/default.pa would help (from the original tutorial) and yet it doesn't seem to be enough. (Unless I messed something else up along the way in my efforts to do/undo things. *sigh*)



```
 cat /proc/asound/card1/codec#3
Codec: Nvidia GPU 0d HDMI/DP
Address: 3
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x10de000d
Subsystem Id: 0x10de0101
Revision Id: 0x100100
No Modem Function Group found
Default PCM:
    rates [0x0]:
    bits [0x0]:
    formats [0x0]:
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
GPIO: io=0, o=0, i=0, unsolicited=0, wake=0
Node 0x04 [Audio Output] wcaps 0x72b1: 8-Channels Digital Stripe CP
  Control: name="IEC958 Playback Con Mask", index=3, device=0
  Control: name="IEC958 Playback Pro Mask", index=3, device=0
  Control: name="IEC958 Playback Default", index=3, device=0
  Control: name="IEC958 Playback Switch", index=3, device=0
  Device: name="HDMI 0", type="HDMI", device=9
  Converter: stream=5, channel=0
  Digital: Enabled
  Digital category: 0x0
  PCM:
    rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
    bits [0xe]: 16 20 24
    formats [0x5]: PCM AC3
  Unsolicited: tag=00, enabled=0
Node 0x05 [Pin Complex] wcaps 0x407381: 8-Channels Digital CP
  Pincap 0x09000094: OUT Detect HBR HDMI DP
  Pin Default 0x18560010: [Jack] Digital Out at Int HDMI
    Conn = Digital, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=05, enabled=1
  Connection: 1
     0x04
```



```
 cat /proc/asound/card1/eld#3.0
monitor_present        1
eld_valid        1
monitor_name        LD-3255VX   
connection_type        HDMI
eld_version        [0x2] CEA-861D or below
edid_version        [0x3] CEA-861-B, C or D
manufacture_id        0x855c
product_id        0x17f2
port_id            0x40000
support_hdcp        0
support_ai        0
audio_sync_delay    0
speakers        [0x1] FL/FR
sad_count        1
sad0_coding_type    [0x1] LPCM
sad0_channels        2
sad0_rates        [0xe0] 44100 48000 88200
sad0_bits        [0xe0000] 16 20 24
```



```
 dmesg | grep HDMI
[   16.074786] HDMI hot plug event: Pin=5 Presence_Detect=1 ELD_Valid=0
[   16.094525] HDMI hot plug event: Pin=5 Presence_Detect=1 ELD_Valid=1
[   16.892019] HDMI: detected monitor LD-3255VX    at connection type HDMI
[   16.892043] HDMI: available speakers: FL/FR
[   16.892050] HDMI: supports coding type LPCM: channels = 2, rates = 44100 48000 88200, bits = 16 20 24
[   17.668117] HDMI: detected monitor LD-3255VX    at connection type HDMI
[   17.668121] HDMI: available speakers: FL/FR
[   17.668125] HDMI: supports coding type LPCM: channels = 2, rates = 44100 48000 88200, bits = 16 20 24
```

hw:1,9 is the only one I can get sound from in any way shape or form, even if it's only through a specific terminal command. Unless there's some way for me to override that?

----------


## BicyclerBoy

The load-module module-alsa-sink device=hw:1,9 entry  should force pulse-audio to enumerate the default hw:1,3 & the extra hw1,9.
Then you should be able to pick the 2nd HDMI device in pavucontrol.
This should then be the default output system wide.

If this refuses to work then maybe we have to use the probe_mask to only expose the logical codec #3 currently reported by alsa as hw:1,9 device.
probe_mask=-1,0x8
You would then delete the load module module-alsa-sink device entry. Then only one HDMI device listed by pulseaudio would be logical pin codec#3 & this will now be reported by alsa as hw:1,3.

Many programs let you output direct ..VLC, mplayer, Clementine etc.. 

Your HDMI receiver (display or TV) supports 2 ch PCM at 44K1, 48K & 88K2Hz.
speaker-test -c 2 -r 48000 -D hw:1,9

----------


## windscryer

> The load-module module-alsa-sink device=hw:1,9 entry  should force pulse-audio to enumerate the default hw:1,3 & the extra hw1,9.
> Then you should be able to pick the 2nd HDMI device in pavucontrol.
> This should then be the default output system wide.


I had to download pavucontrol, but my sound now works (YAY! \o/). However, I have to open pavucontrol and select the HDMI output for each program individually, so I'm thinking I still didn't set it to system default somehow. Is there a button or option somewhere in pavucontrol that lets me pick one as the permanent default?

----------


## BicyclerBoy

pavucontrol tab configuration profiles should do this...

Make the "other" audio devices OFF and set the working HDMI device to digital stereo.

pavucontrol should do much the same things as gnome sound preferences tool but with more options.

----------


## windscryer

> pavucontrol tab configuration profiles should do this...
> 
> Make the "other" audio devices OFF and set the working HDMI device to digital stereo.
> 
> pavucontrol should do much the same things as gnome sound preferences tool but with more options.


Ah! I found it and it does indeed work now exactly as it should. (And, yes, I do feel more than a little dumb for not seeing that the first time.  :Embarassed: )

Thank you so much for all your help and your patience with me!

----------


## BicyclerBoy

You're welcome..We only filled one page of posts, when it gets to 10 pages there's trouble.

----------


## windscryer

LOL At that point, I'd probably just give up on sound on this compy and watch my movies on my lappy. Good thing it didn't come to that!  :Smile:

----------


## mitanc

Dear all you experts,

I just got myself a Lenovo Q150 as a HTPC. Sound works just fine under gnome and in XBMC, but for the life of me I cannot get AC3 pass thru to work in XBMC. 

I hear menu clicks and non AC3 video is fine. 

I am running 11.04 with Nvidia proprietary driver installed from additionL drivers tab in ubuntu. 

I have tried setting the custom setting to plughw:1,9 but that gives me an audio cannot be initialized in XBMC. 

I have tried NVidia,9 and hw:1,9 but none of these work as well. 

Any tips on how to proceed? Like I said works fine for everything else, just can't get AC3 pass thru.

----------


## James-

I wanted to thank you! I'm currently running arch linux, but boils down to the same thing: alsa & pulse
When I tried the probe_mask and rebooted, my NVIDIA were not listed(running two dual core GPU (x295 and x590)) so I reverted and only modified:

/etc/pulse/default.pa

to include:



> load-module module-alsa-sink device=hw3,9


removed the local configs:



> rm -r ~/.pulse ~/.asound* ~/.pulse-cookie


and remade the ram disk file:



> sudo mkinitpcio -p linux


and works flawlessly  :Very Happy: 
I did have to change the selected device in pavucontrol and unmute the SPDIF channels on the alsamixer

----------


## mbaxter89

I ran steps 1-4 and it dint work and made my hard ware dis aper. so i started working backwords undoing every thing one step at a time. when I got to step 3  and rebooted with option snd-hda-intel probe_mask=0x102 and it worked great.

Ubuntu 11.04 NVidia GTS 450


sudo bash
cd /etc/modprobe.d/
gedit sound.conf
options snd-hda-intel probe_mask=0x10(*) (*=step 2)
update-initramfs -u
(Restart)

----------


## BicyclerBoy

Note: that probe_mask is effectively 0x02.

You are not to use numbers > 0x0f

The probe_mask of 0x02 exposes 2nd HDMI codec maybe hw:0,7.
You must not have onboard/chipset audio.

----------


## noe005

> I ran steps 1-4 and it dint work and made my hard ware dis aper. so i started working backwords undoing every thing one step at a time. when I got to step 3  and rebooted with option snd-hda-intel probe_mask=0x102 and it worked great.
> 
> Ubuntu 11.04 NVidia GTS 450
> 
> 
> sudo bash
> cd /etc/modprobe.d/
> gedit sound.conf
> options snd-hda-intel probe_mask=0x10(*) (*=step 2)
> ...


Great Help that worked for with a GTX 550ti. Thanks again.

----------


## Balyrion

I have gone through the thread and I have a problem I have not seen listed. Ultimately the problem is that with my current configuration, running Mythbuntu 11.10, I only get audio from HD videos inside MythTV, anything that was not 720p or better provides no audio output. I can get sound using speaker-test and aplay from the command line. Also of interest is addressing the hardware via hdmi:NVidia does not work from the command line I have to use either hw:0,3 or plughw:NVidia,3, etc. I have applied what I believe to be the proper probe_mask and that made no difference. Also of interest is if I add the device to an asound.conf file everything breaks, aplay throws errors, no sound, etc. Here is the current configuration:


```
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
```



```
aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
dmix:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample snooping device
hw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
```



```
ls -l /proc/asound/card0/
total 0
-r--r--r-- 1 root root 0 2011-12-09 06:43 codec#0
-rw-r--r-- 1 root root 0 2011-12-09 06:43 eld#0.0
-rw-r--r-- 1 root root 0 2011-12-09 06:43 eld#0.1
```



```
cat /proc/asound/card0/eld#0.1 
monitor_present         1
eld_valid               1
monitor_name            SAMSUNG
     
connection_type         HDMI
eld_version             [0x2] CEA-861D or below
edid_version            [0x3] CEA-861-B, C or D
manufacture_id          0x2d4c
product_id              0x3ea
port_id                 0x20000
support_hdcp            0
support_ai              0
audio_sync_delay        0
speakers                [0x4f] FL/FR LFE FC RL/RR RLC/RRC
sad_count               4
sad0_coding_type        [0x1] LPCM
sad0_channels           2
sad0_rates              [0x6e0] 44100 48000 88200 176400 192000
sad0_bits               [0xe0000] 16 20 24
sad1_coding_type        [0x1] LPCM
sad1_channels           8
sad1_rates              [0x6e0] 44100 48000 88200 176400 192000
sad1_bits               [0xe0000] 16 20 24
sad2_coding_type        [0x2] AC-3
sad2_channels           6
sad2_rates              [0xe0] 44100 48000 88200
sad2_max_bitrate        640000
sad3_coding_type        [0x7] DTS
sad3_channels           6
sad3_rates              [0xe0] 44100 48000 88200
sad3_max_bitrate        1536000
```



```
cat /etc/modprobe.d/sound.conf 
options snd-hda-intel probe_mask=-1,0x1
```

At this point I am stumped as to why it only works for HD streams. If anyone has any ideas I would love to hear it.

----------


## BicyclerBoy

Your probe_mask is doing nothing because it is configured for 2 soundcards where HDMI is card1 (2nd soundcard).
You are masking 'on' the first codec of card1 & all codecs on card0.

The alsa/pulse in 11.10 has made the use of probe_mask redundant..
Pulse audio now enumerates all hdmi sub-devices not just the first with max=2.

I would have thought that GT220 would have sub-devices 3,7,8,9..

Your ELD file for hw:0,3 should be:
eld#0.0

The eld#0.1 could be a secondary ELD for another device on same HDMI cable ?

Can you try:
speaker-test -c 2 -r 48000 -D hw:0,3
speaker-test -c 6 -r 48000 -D hw:0,3
dmesg | grep HDMI

What do you mean by HD videos/recordings ?
DTS-MA or Dolby-TrueHD
or just AC3/DTS ??
The only HD audio formats in the ELD are multi-channel (>2) LPCM 192KHz.

Do you not get any audio from stereo AAC/mpeg2/mp3 ?

----------


## Balyrion

Well probe masking is pointless anyway since there is only one codec. This is a GT520 BTW. I pasted in eld#0.1 because eld#0.0 is essentially empty:


```
cat /proc/asound/card0/eld#0.0 
monitor_present         0
eld_valid               0
```

I did figure out what was wrong which was the upgrade stripped out the restricted extras repo and that broke my ability to play avi files but HD mkv files were unaffected for whatever reason. Also pulseaudio was seemingly only partially installed (the server itself appeared to be missing although there were components and references to it in the filesystem). I think last night I had just been working on it for too long and was too tired, thanks for the help. One thing of interest, today I tried installing the dev hda-intel-dkms deb package to see if the daily build of alsa would help any of the problems. It actually introduces a new one for me which is I have 2 SPDIF outputs in alsamixer and sound breaks again. At this point I am happy everything works and do not want to even start playing with it, but I imagine at some point in the future this will crop up again.




> Your probe_mask is doing nothing because it is configured for 2 soundcards where HDMI is card1 (2nd soundcard).
> You are masking 'on' the first codec of card1 & all codecs on card0.
> 
> The alsa/pulse in 11.10 has made the use of probe_mask redundant..
> Pulse audio now enumerates all hdmi sub-devices not just the first with max=2.
> 
> I would have thought that GT220 would have sub-devices 3,7,8,9..
> 
> Your ELD file for hw:0,3 should be:
> ...

----------


## BicyclerBoy

The GT520 does have one codec but 2 converters that feed as many HDMI outputs as wired via pin widget muxes..

Therefore:
eld#0.0 --> physical stream 3 (same 1 codec)
eld#0.1 --> physical stream 7 (same 1 codec)

Not sure how probe_mask value will effect single-codec/multi-stream h/w but this is another good reason *not* to use probe_mask when debugging.

Your eld file suggests that you should have alsa physical stream ID hw:0,7 & that is your correct connection..

The nVidia HDMI audio readme (updated Sept 2011) states that for GT520:
linux kernel 3.1-rc1 and later. 

Also need nVidia proprietary video driver 275 &/or later.

----------


## opg

None of this worked for me in XBMCbuntu (XBMC Live based on Lubuntu). For my solution see: http://forum.xbmc.org/showthread.php...025#pid1069025

----------


## Tikhon03

When 11.10 was released I lost audio.  I found a temporary solution that worked for a while, but after an update the audio was killed again.   I waited for a while, hoping it would be fixed in a future update.  I tried a couple more suggested fixes, and still nothing.  So now I have tried your HowTo. Here is what I am getting so far:



```
NVRM version: NVIDIA UNIX x86 Kernel Module  295.40  Thu Apr  5 21:28:09 PDT 2012
GCC version:  gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
```



```
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  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
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
```



```
/proc/asound/NVidia/eld#0.0:eld_valid           0
/proc/asound/NVidia/eld#1.0:eld_valid           0
/proc/asound/NVidia/eld#2.0:eld_valid           0
/proc/asound/NVidia/eld#3.0:eld_valid           0
```

OK, so then I tried upgrading the alsa driver modules, and it wouldn't do it because I have a pae kernel.  So what would you suggest?

----------


## zhanglini

> ```
> aplay -D plughw:1,7 /usr/share/sounds/Front_Center.wav
> ```
> 
> Then using 
> 
> ```
> gksu gedit /etc/pulse/default.pa
> ```
> ...


Thank you!  this worked for me!

----------


## tonezone

I know this thread has long grown cold, but a similar issue with 13.04 brought me here, and the solutions in this thread did not resolve the issue. I found the solution in another thread. The 3.8 kernel has some sort of problem with the audio and the solution is to use the script in this github repository to use the latest version of the mainline kernel:
https://github.com/GM-Script-Writer-...Kernel-Updater

----------


## lisati

> I know this thread has long grown cold, but a similar issue with 13.04 brought me here, and the solutions in this thread did not resolve the issue. I found the solution in another thread. The 3.8 kernel has some sort of problem with the audio and the solution is to use the script in this github repository to use the latest version of the mainline kernel:
> https://github.com/GM-Script-Writer-...Kernel-Updater


Things change between releases. It might be best to start a new thread.

----------

