Audio over HDMI - NVidia
#16
Okay, I went to bed and tried again after a few hours of sleep <grin>.

Similar to a poster above, once I changed "PLUGHW" to lowercase "plughw", the error message went away and I started to get some nasty screeching through the TV speakers. At least we're moving in the right direction. I then switched "Audio output" in xbmc's "Audio - settings" from "HDMI" to "Analog" and lo and behold, I could hear the movie's soundtrack! I don't understand since the only cable I'm using is the HDMI cable. Why wouldn't "HDMI" work? And what is the difference between the two settings, HDMI vs. Analog?

At least I have sound though, yeah!

Thanks to Rubbernuts and others for posting their helpful advice.
Reply
#17
The HDMI setting implies digital audio. If your TV/receiver doesn't support the digital audio codec being used, then you'll either get screeching or no sound at all. Many TVs don't support anything other than analog since they would just be downmixing it to stereo.
HTPC 1 - Zotac ZBOX ID80U | 4GB RAM | 64GB SSD | Openelec | Confluence
HTPC 2 - Zotac ZBOX ID41U | 4GB RAM | 60GB SSD | Openelec | Confluence
Server - unRAID Server | 3 x 2TB WD Green HDD, 1TB WD Black HDD (Cache) | Sabnzbd | CouchPotato | Sickbeard
Reply
#18
Great post. I had similar problems and loved how clear this was and yes, this should be on the wiki. I never could figure out "aplay -l" (lower case L - Duh) So I just used alsamixer to see what my sound card used.

barronius-
I had the same thing happen (having to switch it it analog) in Eden but in the beta versions I kept it on HDMIHuh I still don't know why it work in earlier version.

digitalb0y -
+1 :-)
Reply
#19
Your explanation makes sense, Plaguester. But in my case, it is going from the xbmc computer to a Denon receiver (via HDMI) which supports the various audio codecs and then from there to the TV.
Reply
#20
Quote:Your explanation makes sense, Plaguester. But in my case, it is going from the xbmc computer to a Denon receiver (via HDMI) which supports the various audio codecs and then from there to the TV.

Good. Run through these (some of them you've probably already done, but I prefer to give the list in a complete fashion for future googlers):

  1. Temporarily remove any changes that you made to /etc/asound.conf or ~/.asoundrc by renaming the file to something else.
  2. If "aplay -l" indicates that your NVidia HDMI device is on card 1, rather than card 0, disable the onboard sound in the BIOS.
  3. Unmute all "S/PDIF", PCM, "IEC958", or digital entries in alsamixer ("MM" is muted, "00" is on; 'm' toggles it).
  4. If you disabled the onboard sound in step 2, run "aplay -l" again and see if it looks different than before.
  5. Run "aplay -L" (yes, upper case L) and see if you have a clear listing for an HDMI out ("hdmi:blahblah"). Run "speaker-test -D plug:hdmi" (Ctrl-C quits). If you hear sound, skip the next step.
  6. Run "speaker-test -D plughw:0,X" where X is the device number until you hear noise (Ctrl-C quits). Note the device number that worked.
  7. In XBMC > Settings > System > Audio Output, set "Audio Output Type" to "HDMI"; "Speaker Configuration" to your setup; "DTS Capable Receiver" to "On" if and only if your receiver can handle it; Ditto for Dolby Digital.
  8. For "Audio Output Device" and "Passthrough Audio Device", start with the simplest device (probably something like "HDMI (ALSA)"). Play a file with DTS or AC3 audio. If that doesn't work, try the one that looks like "NVidia - HDMI - X" (where X is your device number). If that doesn't work, try "custom" and type in "plughw:0,X". Some hardware could also be reported as "IEC958". My receiver reports the switch to "Dolby Digital" as soon as the file begins playing.
HTPC 1 - Zotac ZBOX ID80U | 4GB RAM | 64GB SSD | Openelec | Confluence
HTPC 2 - Zotac ZBOX ID41U | 4GB RAM | 60GB SSD | Openelec | Confluence
Server - unRAID Server | 3 x 2TB WD Green HDD, 1TB WD Black HDD (Cache) | Sabnzbd | CouchPotato | Sickbeard
Reply
#21
Hey Guys.
I also got the Zotac ZBox but I use the S/PDIF to pass the sound to my Receiver and the HDMI Cable goes to the projector. Anyway, what is my configuration in that case, probably not "plughw:1,3". Maybe some of you knows before I get home and try it out. Thanx in advance.
Reply
#22
Hey Guys.
This is how it worked for me to have sound:
For having sound at all I just used the following settings that should work for everyone I guess:
Custom settings for audio output and paththrough with this entry: plug:both
After installation of the XBMC Audiomixer plugin there was no more sound.
By default it muted the sound. So I changed that in the settings of the plugin.

I use a zotac ZBox ID34BD
Hope this helps Cheers!
Reply
#23
(2012-04-01, 19:42)Rubbernuts Wrote: Hi faulknerm,

Hopefully this helps out anyone working with HDMI sound. I read your problem and realized that I myself spent a bunch of time trying to figure out how to get HDMI sound working and even though everyone on this forums is helpful, sometimes they took some shortcuts that got me mixed up.

Hopefully you find this explanation to be of help!

I also have an NVidia output, and I found that the easiest way for me to get the HDMI output sound to work was not to use any of the preset sound settings and instead use a custom mapping to the hardware.

For those of you who are booting directly into XBMC with your new computer and using the confluence skin, click the power button from within the skin and EXIT the software. This will take you to a login screen that allows you to choose which environment you want to be in.

XBMC is the XBMC only software. It takes you directly into the XBMC environment.
XBMCBuntu is the desktop where you can get into the guts of the system, browse the web and interface using a terminal session.

**NOTE** - Keep in mind that the last one you log into, will be the one that your system powers into. Once you are done with XBMCBuntu simply log out and log back in with the XBMC environment selected. From that point on you will always boot into XBMC directly. (Great for guys with wives who don't want to know this is a computer at all!!)

Now that you have logged out of XBMC and are logged into XBMCBuntu you want to run a terminal window.

Click Start -> System Tools -> Click on one of the terminals

Now you are in a terminal window. We want to check some settings now regarding your machine and to do that you must type:

aplay -l

(lowercase L)

You should get an output something like this:

**** List of PLAYBACK Hardware Devices ****

card 0: Intel [HDA Intel], device 0, ALC662 rev1 Analog [ALC662 rev1 Analog]
Subdevices: 1/1
Subdevices #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0

Take note of the HDMI card #1. That is your output for HDMI. The first card is your PCM, not what your looking for.

In this string of info you care about the information in quotes:
card "1": NVidia [HDA NVidia], device "3": HDMI 0 [HDMI 0]

This is what we are going to use when we manually map the information inside XBMC. But first, we have to make sure that your audio in your HDMI is not muted. I have read several posts in these forums about ensuring that your HDMI is not muted, but no one takes the time to really specify where you find this information. To find this, you must run another command in your terminal.

type in : alsamixer

You will get a window pop up with some information regarding your default card. This is an important thing to note, as your computer probably has more than one sound card. In my example above, my HDA Intel is my default card.

Up top in this window, you will see Card: Chip: View: Item: in order. At this point press F5 for ALL.

This opens up both the playback and capture channels on this card.
A muted card is denoted with a "MM" below the bar graph of your volume level.
An unmuted card is denoted with a numerical value such as "00".

At this point make sure that none are muted, and now take note of the F6 option!!! Select sound card.

Press F6: and you will be prompted with a selection window. In my example i have device 0 "HDA Intel" and device 1 "HDA NVidia". Select the second option and you will now see that you probably only have one option. This option is probably the 'S/PDIF' and it most likely will have a 'MM'. I just installed Eden 11 yesterday on a fresh install and mine was muted out of the box. Good chance yours is as well.

Once you have completed this press ESC to exit and take you back to your terminal window.

Now, rather than logging out of XBMCBuntu, just launch XBMC from within this desktop and lets make some changes to your Audio output.

Once XBMC launches get into your audio settings by:
Settings -> System -> Audio Output

Audio output = HDMI
Speaker Configuration = 2.0 (2.0 because I am using a TV. Change this to your setup EG. 5.1. Also note here that if you improperly set this to 5.1 and your using a TV, you will probably only hear background noise from your show if it is encoded with dolby digital)
Boost Level on Downmix = yes
AC3 Capable = No (No for me as Im on a TV, yours probably will be yes)
DTS Capable = No (Again I am going straight to a TV)

Here's where the real meat and potatoes is:

Since we found out the information earlier on aplay -l and found:
card "1": NVidia [HDA NVidia], device "3": HDMI 0 [HDMI 0]

Audio Ouput Device = Custom
custom audio device = PLUGHW:1,3 (Where 1 and 3 come from the quotes)
Passthrough output device = custom
Custom passthrough device = PLUGHW:1,3 (Again 1&3 came from the quotes)

Now there are other posts that can explain how to create your own script and do a bunch of other fancy things based on the frequency of your audio (MP3/2CH, 44.1kHz CD, 48 kHz HDMI) but I am betting that you are just like me and want to get it working. You will revisit this at a later date if you decide this isn't enough.

At this point, you can relaunch XBMC and try a playback from one of your video files.

Congrats. At this point you probably have it all up and running and your happy as a clam!

Hopefully you find my first post of value. I have been leeching info off this forum for about a month, and I felt that I am finally at a level of understanding to give back to the community.

Thanks everyone for your support and excellent work on Eden.

--Rubbernuts

Oh my god I spent so many hours last night getting my sound to work and wishing I had seen this sooner.

Hopefully it'll help me in my case. For some reason I can't get sound through XBMC but there's sound in the browser over HDMI. Problem with that is that I actually want to use my on-board sound and not the HDMI one.
Reply
#24
Many thanks for this post!

Got my Zotac ZBOX ID80 last Friday incl. 4Gb RAM and 64GB SSD so I could finaly have a dedidated system instead of my XBMC installation on my Macbook.

Downloaded XBMCbuntu and installed like a charm, but.... no sound!
Read many posts (not always clear in explanation), re-installed different versions including OpenElec (didn't work at all) but without success.

Tried the very well described procedure from this post, hoping for the best.... But still no sound :-(
OK: PLUGHW:1,3 has to be plughw:1,3
And it works!!

Next challenge: getting subtitles to work....

For anyone interested in the ID80 and maybe some information that could help others;
4 GB RAM isn't necesary when running only XBMC, but the costs for RAM is not that high.
A HDD (or SSD) is not necesary also when connecting to a NAS (like I do).
Although I installed a SSD, it is increasing the systems temperature....
The ID80 has a fan which you can hear in silent scenes...
During first installation it could not connect using wired network, but wireless showed available networkt immediatly and connection was no problem at all
WiFi looks sufficient for movies (From NAS to ID80)
After installation the wired network can be connected also (works)
For installation and configuration of the ID80 it's easier to use a mouse and keyboard
I noticed that after installation to the SSD, the ID80 would no longer boot from USB (not even when forced from BIOS)
Removal of SSD did the trick: ID80 booted from USB again. Placed the SSD back and booted again: now able to install SSD all over from the USB drive.
Used unetbootin (just Google and download it) to create the USB stick to boot from (installing XBMCbuntu on the stick with unetbootin)
The remote of the ID80 does work, but not with all functions. I prefer to use the Ipad "constellation" app as remote

Reply
#25
Omg thanks for that. So much of time wasted - and it would have been a whole lot more if not for the above. To reiterate: make sure you use 'plughw' and not 'PLUGHW'. Also make sure to unmute the S/PDIF (even though, to me, I wouldn't have thought this would be necessary).
Reply
#26
I tried working through your guide and did successfully get sound to come out of the tv (no receiver). This was accomplished by following the directions in this thread and setting Audio output->Analog and Audio output device-> custom (plughw:0,3) in xbmc.

However, the sound is just static, pops, and clicks. This is the case when I try to play music/videos/dvd in xbmc, when I use aplay -D plughw:0,3 welcome.wav AND when I use aplay -D plughw:0,0 welcome.wav to play through the computer speakers (for debugging purposes only). For completeness, the result is the same when I set the Audio output->hdmi and make the Passthrough audio output device be the same as the Audio output device. What is going on?

Here's all the debugging info that I can identify as relevant:

for a variety of reasons, i had to upgrade my kernel to a version from precise, but other than that, the system is fully updated xbmcbuntu.
Code:
uname -a
Linux xenserver 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux

Code:
lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 11.10 - XBMCbuntu
Release:    11.10
Codename:    oneiric

Code:
lspci -k
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
    Subsystem: Elitegroup Computer Systems Device 3190
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd-hda-intel

Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: VT1705 Analog [VT1705 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: VT1705 Digital [VT1705 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: VT1705 HP [VT1705 HP]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code:
cat /proc/asound/card0/codec#0 |grep Codec
Codec: VIA VT1705

Code:
cat /proc/asound/card0/codec#3 |grep Codec
Codec: Intel CougarPoint HDMI

Code:
cat /proc/asound/card0/eld#3.0
monitor_present        1
eld_valid        1
monitor_name        TX-42F430S
connection_type        HDMI
eld_version        [0x2] CEA-861D or below
edid_version        [0x3] CEA-861-B, C or D
manufacture_id        0x855c
product_id        0x13f8
port_id            0x0
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] 32000 44100 48000
sad0_bits        [0xe0000] 16 20 24

My suspicion is that I need to edit /etc/modprobe.d/alsa-base.conf and give some option to the snd-hda-intel module, but I have no clue what the option would be or how to figure out what it is. I would really appreciate someone giving me some suggestions of things to try.
Reply
#27
@Rubbernuts curiously PLUGHW does not work (notice the capitals) but plughw works just fine ^^

for my foxconn netbox it's 0,3

one thing that still bothers me: stereo output from aac or mp3 with e.g. 44.1khz plays for ca. 1 minute, then shortly breaks up (HDMI re-connect), plays for ca. 1min and then again re-connects.... this only happens for low-khz stereo output e.g. mp3 files or some videos (DD and DTS absolutely fine)

tried nearly everything apart from reinstalling... any ideas?
OpenElec Standalone --> Asus Chromebox 'Panther' --> Onkyo TX-NR709 --> Sony 55" X85C Android TV (also with Kodi!)
Asus Chromebox EZ Script
Kodi on Sony Bravia Android TVs
Reply
#28
Running the speaker test helped me find it.

(2012-04-15, 19:51)Plaguester Wrote:
Quote:Your explanation makes sense, Plaguester. But in my case, it is going from the xbmc computer to a Denon receiver (via HDMI) which supports the various audio codecs and then from there to the TV.

Good. Run through these (some of them you've probably already done, but I prefer to give the list in a complete fashion for future googlers):

  1. Temporarily remove any changes that you made to /etc/asound.conf or ~/.asoundrc by renaming the file to something else.
  2. If "aplay -l" indicates that your NVidia HDMI device is on card 1, rather than card 0, disable the onboard sound in the BIOS.
  3. Unmute all "S/PDIF", PCM, "IEC958", or digital entries in alsamixer ("MM" is muted, "00" is on; 'm' toggles it).
  4. If you disabled the onboard sound in step 2, run "aplay -l" again and see if it looks different than before.
  5. Run "aplay -L" (yes, upper case L) and see if you have a clear listing for an HDMI out ("hdmi:blahblah"). Run "speaker-test -D plug:hdmi" (Ctrl-C quits). If you hear sound, skip the next step.
  6. Run "speaker-test -D plughw:0,X" where X is the device number until you hear noise (Ctrl-C quits). Note the device number that worked.
  7. In XBMC > Settings > System > Audio Output, set "Audio Output Type" to "HDMI"; "Speaker Configuration" to your setup; "DTS Capable Receiver" to "On" if and only if your receiver can handle it; Ditto for Dolby Digital.
  8. For "Audio Output Device" and "Passthrough Audio Device", start with the simplest device (probably something like "HDMI (ALSA)"). Play a file with DTS or AC3 audio. If that doesn't work, try the one that looks like "NVidia - HDMI - X" (where X is your device number). If that doesn't work, try "custom" and type in "plughw:0,X". Some hardware could also be reported as "IEC958". My receiver reports the switch to "Dolby Digital" as soon as the file begins playing.

Reply
#29
So I've done step-for-step what rubbernuts has suggested here and still no dice. I do the speaker test thing and it works. I hear menu clicks in XBMC. As soon as i try to play a movie, however, I get the error initializing audio device. I feel like I'm taking crazy pills Sad

I should also mention i'm running a pc with intel integrated 3000 graphics and using hdmi. everything everywhere works fine except audio in movies through xbmc.
Reply
#30
so ive followed the thread, and successfully got the instructons to work previously.now however i cant get aplay to work

OpenElec2:~ $ aplay -l
aplay: device_list:268: no soundcards found...
OpenElec2:~ $ aplay -l
aplay: device_list:268: no soundcards found...
OpenElec2:~ $ cat /proc/asound/card0/eld#3.0
cat: can't open '/proc/asound/card0/eld#3.0': No such file or directory
OpenElec2:~ $ cat /proc/asound/cards
0 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0xfae78000 irq 21
OpenElec2:~ $ aplay-l
-sh: aplay-l: not found
OpenElec2:~ $ aplay -l
aplay: device_list:268: no soundcards found...
OpenElec2:~ $ ls -ld /proc/asound/card* | grep ^d
dr-xr-xr-x 2 root root 0 Jan 30 20:00 /proc/asound/card0
OpenElec2:~ $ aplay ?
ALSA lib /home/stephan/projects/openelec-3.2/build.OpenELEC-ION.x86_64-3.2.4/als a-lib-1.0.27.2/src/confmisc.c:768Sadparse_card) cannot find card '0'
ALSA lib /home/stephan/projects/openelec-3.2/build.OpenELEC-ION.x86_64-3.2.4/als a-lib-1.0.27.2/src/conf.c:4248Sad_snd_config_evaluate) function snd_func_card_dri ver returned error: No such file or directory
ALSA lib /home/stephan/projects/openelec-3.2/build.OpenELEC-ION.x86_64-3.2.4/als a-lib-1.0.27.2/src/confmisc.c:392Sadsnd_func_concat) error evaluating strings
ALSA lib /home/stephan/projects/openelec-3.2/build.OpenELEC-ION.x86_64-3.2.4/als a-lib-1.0.27.2/src/conf.c:4248Sad_snd_config_evaluate) function snd_func_concat r eturned error: No such file or directory
ALSA lib /home/stephan/projects/openelec-3.2/build.OpenELEC-ION.x86_64-3.2.4/als a-lib-1.0.27.2/src/confmisc.c:1251Sadsnd_func_refer) error evaluating name
ALSA lib /home/stephan/projects/openelec-3.2/build.OpenELEC-ION.x86_64-3.2.4/als a-lib-1.0.27.2/src/conf.c:4248Sad_snd_config_evaluate) function snd_func_refer re turned error: No such file or directory
ALSA lib /home/stephan/projects/openelec-3.2/build.OpenELEC-ION.x86_64-3.2.4/als a-lib-1.0.27.2/src/conf.c:4727Sadsnd_config_expand) Evaluate error: No such file or directory
ALSA lib /home/stephan/projects/openelec-3.2/build.OpenELEC-ION.x86_64-3.2.4/als a-lib-1.0.27.2/src/pcm/pcm.c:2239Sadsnd_pcm_open_noupdate) Unknown PCM default
aplay: main:722: audio open error: No such file or directory
OpenElec2:~ $ alsa
-sh: alsa: not found
OpenElec2:~ $ alsamixer
-sh: alsamixer: not found
OpenElec2:~ $ alsamixer


any ideas? ive tried on 2 different installs of XBMC Frodo
Reply

Logout Mark Read Team Forum Stats Members Help
Audio over HDMI - NVidia3