Linux [SOLVED] HDMI audio works on PC, but not through XBMC
#1
As stated in the title, XBMC is the only application that is struggling to send audio out through the HDMI port. I've followed the guidance on http://wiki.xbmc.org/index.php?title=HOW...,_or_GT240 ...which seems like the perfect reference, but I have not had success with it. Another poster (http://forum.xbmc.org/showthread.php?tid=133371) had a similar problem, but experimenting with the advice that worked there did not help. Any suggestions as to what I should try next?

Per the how-to on requesting assistance:
1. Linux distro is Ubuntu 12.04 Precise Pangolin 64-bit
2. XBMC Eden was installed fresh via PPA (System Info reads as "XBMC 11.0 Git:Unknown [Compiled April 2012]")
3. My NVidia GT240 is responsible for HDMI audio out; driver is 'nvidia-current' proprietary
4. Complete log file here: http://xbmclogs.com/show.php?id=3329
5. What I believe to be the relevant lines from the log file:
Code:
12:12:28 T:140673399387904   ERROR: Initialize - failed to open custom device plug:'hdmi:CARD=NVidia,DEV=7' (error:No such file or directory), retry with default hdmi:CARD=NVidia,DEV=7
12:12:28 T:140673399387904   ERROR: Initialize - pcm_open_lconf, alsa error: -2 - No such file or directory
12:12:28 T:140673399387904   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
12:12:28 T:140673399387904   DEBUG: RemoveActiveDevice - Removing device 2
12:12:28 T:140673399387904   ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
12:12:28 T:140673399387904   DEBUG: RemoveActiveDevice - Removing device 1
12:12:28 T:140673399387904   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
12:12:28 T:140673399387904   DEBUG: RemoveActiveDevice - Removing device 0
12:12:28 T:140673399387904   DEBUG: CNullDirectSound::Initialize - Channels: 6 - SampleRate: 48000 - SampleBit: 16 - Resample false - IsMusic false - IsPassthrough 0 - audioDevice: hdmi:CARD=NVidia,DEV=7
12:12:28 T:140673399387904   DEBUG: CDVDPlayerAudio:: synctype set to 0: clock feedback
12:12:28 T:140673399387904   DEBUG: CDVDPlayerAudio:: Discontinuity - was:212134.763000, should be:64000.000000, error:-148134.763000
6. aplay -L produces the following results:
Code:
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=Intel
    HDA Intel, ALC889A Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    Front speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
    HDA Intel, ALC889A Digital
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    Direct sample mixing device
dmix:CARD=Intel,DEV=1
    HDA Intel, ALC889A Digital
    Direct sample mixing device
dsnoop:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    Direct sample snooping device
dsnoop:CARD=Intel,DEV=1
    HDA Intel, ALC889A Digital
    Direct sample snooping device
hw:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    Direct hardware device without any conversions
hw:CARD=Intel,DEV=1
    HDA Intel, ALC889A Digital
    Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
    HDA Intel, ALC889A Analog
    Hardware device with all software conversions
plughw:CARD=Intel,DEV=1
    HDA Intel, ALC889A Digital
    Hardware device with all software conversions
sysdefault:CARD=Audio
    USB Audio, USB Audio
    Default Audio Device
front:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Front speakers
surround40:CARD=Audio,DEV=0
    USB Audio, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Audio,DEV=0
    USB Audio, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audio,DEV=0
    USB Audio, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audio,DEV=0
    USB Audio, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audio,DEV=0
    USB Audio, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audio,DEV=0
    USB Audio, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Direct sample mixing device
dsnoop:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Direct sample snooping device
hw:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    HDMI Audio Output
dmix:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Direct sample snooping device
hw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=9
    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
plughw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
Reply
#2
I'm on a similar setup (12.04 64-bit, Eden, but with a fanless G210 card) and trying to get bitstream audio to work, so I'll be interested to see where responses lead. (In fact, I finally joined this forum just to post this.) Actually, to be clear, I'm not sure whether you're getting any audio output over HDMI at all, or if you're focusing on bitstream like I am. Surround audio over HDMI (non-bitstream) works for me (if this helps anyone struggling to get any audio output), just had to select the HDMI output device in Ubuntu's sound preferences (didn't even need to mess with the more in-depth pulse audio config stuff) and select 5.1 surround over HDMI, and in XBMC's sound settings tell it to be Analog and produce 5.1. Basically causing XBMC to decode the audio itself and, in a way, send it out over general system audio which is being piped by Ubuntu/Pulseaudio over HDMI. My attempts to get bistream so far have either resulted in "failed to initialize audio device" or, when using hdmi:CARD=NVidia, the receiver reacting by taking away its graph of what speakers it will output to (something I've never seen it do before), and of course there being no audio, though no error message from XBMC either.

Looking at the output you pasted, I find myself asking why you were trying hdmi:CARD=NVidia,DEV=7 when, according to aplay -l, it only states that hdmi:CARD=NVidia,DEV=0 through hdmi:CARD=NVidia,DEV=3 exist. Also, the first link you referred to said to use just hdmi:CARD=NVidia so I wonder if that means you had a specific reason to add the DEV=7.
Reply
#3
The line for a custom audio device should come from "aplay -L" (hdmi:CARD=Nvidia,DEV=0-3). If you end up trying the "plughw:X,Y" or "hw:X,Y" entries, the X and Y values come from "aplay -l".

Did you have desktop audio before going through that guide on the wiki? A full Ubuntu install should just require you to select the HDMI profile in the sound settings.

Also explain your speaker setup (PC > Receiver > Speakers, PC > TV, etc...) and post a screenshot of your audio settings in XBMC.
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
#4
(2012-06-08, 00:09)yoda-sama Wrote: Looking at the output you pasted, I find myself asking why you were trying hdmi:CARD=NVidia,DEV=7 when, according to aplay -l, it only states that hdmi:CARD=NVidia,DEV=0 through hdmi:CARD=NVidia,DEV=3 exist. Also, the first link you referred to said to use just hdmi:CARD=NVidia so I wonder if that means you had a specific reason to add the DEV=7.

Thanks for pointing out something I had missed!

Unfortunately, I struggle to comprehend the aplay -L output. I have little notion of how to apply the information contained within, which is one of the many reasons why I struggle to troubleshoot this stuff. As for why I tried dev 7, it's because that worked on this hardware when I was running Natty Narwhale.

I can confirm that trying DEV=3 does not produce audio, either, but at least this time it did not give me the 'failed to initialize audio device' error I normally see. Seems like progress of a sort.

Reply
#5
(2012-06-08, 01:23)Plaguester Wrote: The line for a custom audio device should come from "aplay -L" (hdmi:CARD=Nvidia,DEV=0-3). If you end up trying the "plughw:X,Y" or "hw:X,Y" entries, the X and Y values come from "aplay -l".

Did you have desktop audio before going through that guide on the wiki? A full Ubuntu install should just require you to select the HDMI profile in the sound settings.

Also explain your speaker setup (PC > Receiver > Speakers, PC > TV, etc...) and post a screenshot of your audio settings in XBMC.

Thanks for taking the time to work through this with me!

Why is my NVidia card showing up as devices 3, 7, 8, and 9? I've tried plughw:0,3 and hw:0,3 without any sound; are those not the numbers I'm supposed to be using? How do I know?

I did, in fact, have audio working through the PC before trying any troubleshooting. In fact, it *was* working through XBMC until earlier this week when it suddenly stopped. Moron that I am, I started fiddling with the settings before making note of what they were at the moment I discovered that they were not working. Sad

Speaker-wise, I'm just running an HDMI cable from my NVidia card to the TV set directly. Stereo speakers only.
I don't know how to post images here, but I can tell you the settings:
Audio Output = HDMI
Speaker Configuration = 2.0
Boost Volume Level on Downmix = yes
- Dolby Digital [AC3] Capable Receiver = no
- DTS Capable Receiver = no
Audio Output Device = custom
Custom Audio Device = plughw:0,3
Passthrough Output Device = custom
Custom Passthrough Device = plughw:0,3
Reply
#6
Many TVs don't support digital audio (except for passing it over optical). Even if yours says it does, try these settings (not like digital vs. analog is going to matter with low-end TV speakers):

Audio output = Analog
Speaker Configuration = 2.0
Boost Volume Level on Downmix = Yes
Audio Output Device = hdmi (ALSA)

If that doesn't work, use
Audio Output Device = custom
Custom Audio Device = hdmi:CARD=NVidia,DEV=0

Keep changing the number at the end from 0, 1, 2, 3 until it works.
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
#7
Big Grin 
Brilliant! Setting the Audio Output Device to 'hdmi (ALSA)' did not do the trick, but progressing through the device numbers as you suggest seems to have fixed the problem! My current (working) Custom Audio Device = hdmi:CARD=NVidia,DEV=1.

Thanks so much for the help! And just in time, too; my daughter is home sick today and could use a little time-shifted TV programming to distract her from her misery.

(2012-06-08, 07:03)Plaguester Wrote: Many TVs don't support digital audio (except for passing it over optical). Even if yours says it does, try these settings (not like digital vs. analog is going to matter with low-end TV speakers):

Audio output = Analog
Speaker Configuration = 2.0
Boost Volume Level on Downmix = Yes
Audio Output Device = hdmi (ALSA)

If that doesn't work, use
Audio Output Device = custom
Custom Audio Device = hdmi:CARD=NVidia,DEV=0

Keep changing the number at the end from 0, 1, 2, 3 until it works.

Reply
#8
Glad that worked for you, though on my setup, I get general audio out over HDMI simply with "analog" and audio output device as "default (pulseaudio)" (and ubuntu sound preferences set to HDMI, of course).

As far as my digital passthrough issue, I'm still stumped. I've tried setting audio output device and passthrough on custom "hdmi:CARD=NVidia", and then went on to try all manner of audio output device options... The best I get is on "hdmi:CARD=NVidia" or "hdmi:CARD=NVidia,DEV=3" on passthrough device and the like or, I think, hdmi(alsa) (maybe pulse...) on audio output device, where when I try to play something with DTS or DD, XBMC does not complain, yet my receiver changes to show that it doesn't have a signal (blanks the little chart it has on the screen of which speakers will be active). Is my video card or XBMC trying but not correctly outputting bitstream audio, have I not yet found the right way to command passthrough audio, or is it some sort of receiver issue? And yes, I double checked alsamixer to ensure the nvidia card's spdif were not muted.

Once I get this sorted out I can finally move away from VGA output to my HD projector (and analog surround into the receiver), plus I'll then be able to ceiling mount it since I'll cut the inputs down to just one (long) HDMI cable.
Reply
#9
Post the output of the following:
Code:
# shows the audio device
lspci | grep -i audio

# alsa information
aplay -L

If you know the model of your mainboard, that could help as well.
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
#10
Sorry for the delay, not on this test projector computer replacment box AND online much yet, though I constantly feel I'm much closer to switching to it and all digital out...

As for what you requested...

Motherboard: ASUS M4A785-M, though with that classically cheap MSI G210 card from Newegg for video/audio out instead.

OS: Ubuntu 12.04 64-bit, multiple desktop environments, up to and including the ever Ubuntu common Unity.

$ lspci | grep -i audio
00:14.2 Audio device: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia (Intel HDA)
01:00.1 Audio device: NVIDIA Corporation High Definition Audio Controller (rev a1)


$ aplay -L
default
Playback/recording through the PulseAudio sound server
sysdefault:CARD=SB
HDA ATI SB, VT1708S Analog
Default Audio Device
front:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
Front speakers
surround40:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=SB,DEV=0
HDA ATI SB, VT1708S Digital
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
Direct sample mixing device
dmix:CARD=SB,DEV=1
HDA ATI SB, VT1708S Digital
Direct sample mixing device
dmix:CARD=SB,DEV=2
HDA ATI SB, VT1708S HP
Direct sample mixing device
dsnoop:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
Direct sample snooping device
dsnoop:CARD=SB,DEV=1
HDA ATI SB, VT1708S Digital
Direct sample snooping device
dsnoop:CARD=SB,DEV=2
HDA ATI SB, VT1708S HP
Direct sample snooping device
hw:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
Direct hardware device without any conversions
hw:CARD=SB,DEV=1
HDA ATI SB, VT1708S Digital
Direct hardware device without any conversions
hw:CARD=SB,DEV=2
HDA ATI SB, VT1708S HP
Direct hardware device without any conversions
plughw:CARD=SB,DEV=0
HDA ATI SB, VT1708S Analog
Hardware device with all software conversions
plughw:CARD=SB,DEV=1
HDA ATI SB, VT1708S Digital
Hardware device with all software conversions
plughw:CARD=SB,DEV=2
HDA ATI SB, VT1708S HP
Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
HDMI Audio Output
dmix:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct sample mixing device
dmix:CARD=NVidia,DEV=7
HDA NVidia, HDMI 0
Direct sample mixing device
dmix:CARD=NVidia,DEV=8
HDA NVidia, HDMI 0
Direct sample mixing device
dmix:CARD=NVidia,DEV=9
HDA NVidia, HDMI 0
Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
HDA NVidia, HDMI 0
Direct sample snooping device
dsnoop:CARD=NVidia,DEV=8
HDA NVidia, HDMI 0
Direct sample snooping device
dsnoop:CARD=NVidia,DEV=9
HDA NVidia, HDMI 0
Direct sample snooping device
hw:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
HDA NVidia, HDMI 0
Direct hardware device without any conversions
hw:CARD=NVidia,DEV=8
HDA NVidia, HDMI 0
Direct hardware device without any conversions
hw:CARD=NVidia,DEV=9
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
plughw:CARD=NVidia,DEV=7
HDA NVidia, HDMI 0
Hardware device with all software conversions
plughw:CARD=NVidia,DEV=8
HDA NVidia, HDMI 0
Hardware device with all software conversions
plughw:CARD=NVidia,DEV=9
HDA NVidia, HDMI 0
Hardware device with all software conversions
Reply
#11
Does aplay -l show The NVidia device as card 1 rather than card 0? If so, try disabling the onboard sound in the BIOS, then using the following settings in XBMC:

Audio Type: HDMI
Speaker Config: Your speaker config
DTS and AC3: Yes
Audio Device: (if this is already working for music and whatnot over HDMI, don't change it)
Passthrough Audio Device: custom
Custom Passthrough Device: hdmi:CARD=NVidia,DEV=0

If that doesn't work, change the "0" to 1, 2, and 3 until it does. If none of them work, you could try the direct-to-hardware devices: hw:CARD=NVidia,DEV=3, hw:CARD=NVidia,DEV=7, hw:CARD=NVidia,DEV=8, or hw:CARD=NVidia,DEV=9.
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
#12
Just to give an update, I never got this to work properly. I tried every combination, I'll have to assume the fault lies elsewhere than just with XBMC, perhaps my receiver is not accepting the bitstreaming over hdmi, who knows. I've decided I'll be happy enough with it as surround "analog" over hdmi, since my main need was to get everything going over a single cable so I can ceiling mount the projector.

If anyone finds themselves in this position, this guide seemed pretty thorough, and got me about as close as I've gotten yet to digital passthrough, though the end result for me was screeching sounds and the video running at over twice the correct framerate, for reasons unknown to me... http://imadethisdesign.blogspot.com/2012...whdmi.html

For now, I'm on to my next new big problem. On two 64-bit 12.04 computers in a row playback of DVD file has been unusably jerky, while HD files have been perfectly fine... Who knows... This worked without issue for me on older versions, not sure why it would break now...
Reply
#13
Check volume levels and that the channels are not muted (using alsamixer).
I ditched HDMI audio long ago; using optical output only.
Reply
#14
i have a related issue - i have hdmi video and audio when using VLC player in XBMC desktop but not through Media center.
even using the same audio settings in VLC as in Media Center.
Reply
#15
Optical isn't really an option in this case as my receiver needs an update to allow for assignable inputs and it doesn't have usb, so it needs to be done digitally over optical out from a burned audio/firmware CD... so yeah...

Vidro3, when you say Media Center, are you talking about Windows stuff
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] HDMI audio works on PC, but not through XBMC0