Kodi Community Forum

Full Version: hdmi pass through DTS and AC3 Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have searced through this forum and others and I cannot find a definitive guide on how to get DTS and AC3 to pass through to my Receiver.

When using Mplayer with following config file if the audio stream is AC3 or DTS my receiver will auto switch to that mode:
Code:
ao=alsa:device=hw=0.7
afm=hwdts,hwac3,
nolirc=yes

My hdmi card is an Nvidia GeForce 210 Silent. To get any kind of digital audio to my receiver my XBMC have to be the following:
Audio Output: HDMI
Speaker Configuration: 5.1
Boost Volume level on downmix: off
Dolby Digital (AC3) capable receiver: off
DTS capable receiver: off
Audio output device: Custom > Blank
Passthrough output device: HDA NVidia - hdmi - 7 (ALSA)

But this digital audio configuration only enables "MCH PCM 5.1" on my Onkyo receiver which I assume is "Multi-Channel 5.1 Pulse Code Modulation"

What is odd is when I enable either "Dolby Digital" or "DTS" capable receivers I get no audio and error "failed to
ALSA version is 1.0.25
XBMC version 11.0

I also tried this section "Default audio over HDMI"> http://wiki.xbmc.org/index.php?title=HOW...u/HOW-TO_4
I get the same results with "Dolby Digital" or "DTS" enabled no audio and error "failed to initialize audio device" or just MCH 5.1 PCM

I'm sure true AC3 and DTS is possible please help. here is my various hard ware info:
aplay -l
Code:
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

aplay -L
Code:
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
hdmi_formatted
hdmi_complete
default
    Playback/recording through the PulseAudio sound server
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

My local .mplayer/config to use pass through AC3 and DTS
Code:
# Write your default config options here!
ao=alsa:device=hw=0.7
afm=hwdts,hwac3,
nolirc=yes

Thanks in advance!
Do you have a /etc/asound.conf or ~/.asoundrc file? If so, post it.

Try the following XBMC settings:

Audio Output Type: HDMI
Speaker Config: 5.1
Dolby Digital and DTS: Yes
Audio Device: Custom
Custom: hdmi:CARD=NVidia,DEV=1
Passthrough Audio Device: Custom
Custom: hdmi:CARD=NVidia,DEV=1

Then test out multiple media files (music with MP3, video with AC3 and DTS). If you still get no sound, change the number at the end to 0, 2, or 3 (notice that the custom line is copied from the aplay -L output, I started with 1 because of your working mplayer config).
Thanks for your help. I tried all the various settings from aplay -L

What is interesting is the card is definitely "hdmi:CARD=NVidia,DEV=1" but when I have the following set with "Dolby Digital and DTS" set to Yes Or No I get NO sound.
Audio Device: Custom Custom: hdmi:CARD=NVidia,DEV=1

What is also interesting is I found that if I have the following set with the above blank and I'm playing a file with "Dolby Digital" and "Dolby Digital is set to Yes I get the error "failed to initialize audio device".
Passthrough Audio Device: Custom
Custom: hdmi:CARD=NVidia,DEV=1

Same is true if I play a "DTS" File and DTS is set to Yes I get the error "failed to initialize audio device".

Currently I don't have a /etc/asound.conf or ~/.asoundrc file created. Should I for this to work?

BTW I'm on Ubuntu 12.04. Thanks Again.
BTW this produces expected sound:
rjenkins@videoserver:~$ speaker-test -D hdmi:0,1 -c 6

speaker-test 1.0.25

Playback device is hdmi:0,1
Stream parameters are 48000Hz, S16_LE, 6 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 5440
Period size range from 32 to 2720
Using max buffer size 5440
Periods = 4
was set period_size = 1088
was set buffer_size = 5440
0 - Front Left
4 - Center
1 - Front Right
3 - Rear Right
2 - Rear Left
5 - LFE
Time per period = 17.848033
You may need to remove PulseAudio to get passthrough to work. Only the bleeding edge versions of it support passthrough at all.
Curious question if anyone knows how MythTV does pass through audio. It works just fine triggering my Audio Receiver to Dolby Digital or DTS. Its nice but I prefer XBMC.

Here is my /etc/asound.conf:
Code:
# Jon B's ASound.Conf file for HDMI Audio on MythTV
# HDMI configuration with volume control for MythTV
# For ALSA 1.0.19  - 1/31/2009

# Instructions for use
# 1) Find your hmdi hardware Card Number and Device Number.  Open a terminal and do:  
#    aplay -L
#    That will list all of the hardware audio devices.  Look for the one labeled HDMI.
#    Note what Card Number and Device Number it lists (they seem to be card 0,
#    device 3 but your system may be different).
# 2) Edit the pcm.hdmi_hw device defined here to set your Card Number and Device Number.
# 3) Put this file in either /etc/asound.conf or in your home directory as .asoundrc.
#    sudo cp jons_asound.conf /etc/asound.conf
#      or
#    sudo cp jons_asound.conf $HOME/.asound.conf
# 4) Exit mythfrontend.  Then restart the sound system:
#    sudo /etc/init.d/alsa-utils restart
# 5) Start mythfrontend and go to the audio setup screen
#    "Utilities / Setup"  then "Setup" then "General" then "Next" until you
#    get to the Audio tab.
# 6) Fill in the info - it's case sensitive:
#    Audio output device: ALSA:hdmi_complete     <--- note you have to type in this field
#    Passthrough output devide: Default
#     ... Stereo... ... Passive...
#    Mixer Device: ALSA:default
#    Mixer controls: hdmi_volume                 <--- type in this field
# 7) Work your way back to Watch TV and give it a try.

pcm.hdmi_hw {
  type hw
  card 0     #  <-----  Put your card number here
  device 7   #  <-----  Put your device number here
}

pcm.hdmi_formatted {
  type plug
  slave {
    pcm hdmi_hw
    rate 48000
    channels 2
  }
}

pcm.hdmi_complete {
  type softvol
  slave.pcm hdmi_formatted
  control.name hdmi_volume
  control.card 0
}

pcm.!default hdmi_complete