SPDIF AC3 and DTS passthrough - how to define the device in XBMC
#1
Hi all,

I've got a Ubuntu Gutsy system running with XBMC now, everything is working really fine. I also have an xbox with the original XBMC on it which has been my media system for a long while.

Just one thing is missing, that is AC3/DTS over SPDIF to my receiver. If I use mplayer this works well when using
mplayer -ao alsa:device=hw=0,2 -ac hwac3

Does anyone know what the equivalent definition for the "Passthrough Output Device" would be in the XBMC audio hardware configuration? I've tried hw:0,2 as well as several others, but so far no luck.

The soundcard is from NVidia, it's a CK804. aplay -l gives

**** List of PLAYBACK Hardware Devices ****
card 0: CK804 [NVidia CK804], device 0: Intel ICH [NVidia CK804]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: CK804 [NVidia CK804], device 2: Intel ICH - IEC958 [NVidia CK804 - IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0

but there is no listing of the iec958 or any spdif device when using aplay -L.
Reply
#2
I have an NV board with gutsy also (630i) and my aplay -L does show the IEC958, which is what I use in XBMC. Did you try simply inputting "iec958" in XBMC?

default:CARD=NVidia
HDA NVidia, ALC883 Analog
Default Audio Device
front:CARD=NVidia,DEV=0
HDA NVidia, ALC883 Analog
Front speakers
surround40:CARD=NVidia,DEV=0
HDA NVidia, ALC883 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
HDA NVidia, ALC883 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
HDA NVidia, ALC883 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
HDA NVidia, ALC883 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
HDA NVidia, ALC883 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=NVidia,DEV=0
HDA NVidia, ALC883 Digital
IEC958 (S/PDIF) Digital Audio Output
null
Discard all samples (playback) or generate zero samples (capture)
Reply
#3
Hi, thanks for the quick reply!

Yeah I tried "iec958" as an input. But I guess the problem might be that it's not listed in the aplay -L list. Here's what I get:

default:CARD=CK804
NVidia CK804, NVidia CK804
Default Audio Device
front:CARD=CK804,DEV=0
NVidia CK804, NVidia CK804
Front speakers
surround40:CARD=CK804,DEV=0
NVidia CK804, NVidia CK804
4.0 Surround output to Front and Rear speakers
surround41:CARD=CK804,DEV=0
NVidia CK804, NVidia CK804
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CK804,DEV=0
NVidia CK804, NVidia CK804
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CK804,DEV=0
NVidia CK804, NVidia CK804
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=UART
MPU-401 UART
Default Audio Device

Maybe XBMC does rely on the device being in this list... Maybe there is some ALSA config not set up properly, I've tried some .asoundrc experiments too, but haven't been able to get it to show up..
Reply
#4
FWIW, when I was using an optical output on my previous board I simply set XBMC to analog and it appeared to pass audio right on out. Not sure about AC3\DTS but I did seem to get surround on some samples. In theory it ought to just shove the bits out the port to be decoded by the receiver right?
Reply
#5
Yeah that part works well. I can playback anything, but on the receiver end it's all being received in 2 channel stereo. So all the surround I can get is using dolby pro logic instead of the real AC3 or DTS signals.
Reply
#6
I've been using a hacked up config since before XBMC-linux had Digital support, and I decided to try and clean it up last weekend. My aplay -L didn't show iec958 unless I got rid of the asound.conf I was using, but I was never able to get both AC3/DTS passthough and stereo over SPDIF unless I was using my asound.conf. In the end, I decided it's nasty, but it works, so I'm leaving it like it is.

The important parts for me seem to be the following:
In my asound.conf:
Code:
pcm.!iec958 {
        type plug
        slave {
                pcm "hw:0,1"
                format S32_LE
        }
}

When I run XBMC:
Code:
XBMC_HOME=/home/herg/bin/XBMC SDL_AUDIODRIVER=ALSA /home/herg/bin/XBMC/XboxMediaCenter

I'm now aware that the SDL_AUDIODRIVER=ALSA is incorrect and does not set the audiodriver to ALSA. That would require SDL_AUDIODRIVER=alsa. The lower case version, however, makes things not work. I think what's happening is that the uppercase version prevents SDL audio from working (I get no navigation sounds), but the SDL audio is what causes problems with my in-movie audio.
Reply
#7
Hey,

I thought I'd chime in because I've spent the last day or so trying to get both 2-ch PCM and Multi-channel to play through spdif passthrough, and this thread has been helpful. I finally got everything working with the following asound.conf.

Code:
# M-Audio Revolution 7.1 has no 'spdif' alias in 'aplay -L'
# I'm guessing cards that have one defined won't need this.
pcm.!spdif {
        type hw
        card 0
        device 1
}

# Sets default playback to 'spdif'.              
pcm.!default{
        type plug
        slave {
                pcm "spdif"                                    
                rate 48000      
                format S32_LE   # ice1724 cards can only use this format
        }
}

I run xbmc with the command:

Code:
XBMC_HOME=/home/crynar/XBMC/BUILD/ SDL_AUDIODRIVER=null /home/crynar/XBMC/BUILD/XboxMediaCenter

In the 'Audio Hardware' section of the settings, I changed both 'Audio Output Device' and 'Passthrough Output Device' to 'default'.

I still can't get navigation sounds to work, but Movies and Music are all playing properly. I have no idea if 'null' is a proper option for SDL_AUDIODRIVER, but it seemed less confusing than 'ALSA' which according to herg was just forcing xbmc to not use an SDL audio driver anyways.

Hope this helps someone as your guys' posts helped me. If anyone gets navigations sounds working as well as both multi-channel and 2-channel audio, I'd be interested in how you did it.

Thanks
Reply
#8
Hey all,

I'm running Ubuntu Gutsy on a Mac mini, and I for the life of me can't get AC3 passthrough to work at all. PCM audio seems to come through digital out just fine, but all I get when I play an AC3 enabled movie is noise...

I've tried the various asound.conf/.asoundrc configs in this thread and others, and also played around with the XBMC passthrough device GUI option, (e.g. I've tried default, iec958, iec958 with the additional hex code parameters, etc.) and XBMC startup parameters (ALSA, null, etc.)... all with no success.

I should mention that I have the same issue with mplayer (-ao alsa:driver=iec958, -afw hwac3), so I'm fairly certain it's an issue with my general alsa config and not something necessiarly tied to XBMC. Anybody out there with a Mac mini?

Julian
Reply
#9
crynar Wrote:
Code:
# M-Audio Revolution 7.1 has no 'spdif' alias in 'aplay -L'
# I'm guessing cards that have one defined won't need this.
pcm.!spdif {
        type hw
        card 0
        device 1
}

# Sets default playback to 'spdif'.              
pcm.!default{
        type plug
        slave {
                pcm "spdif"                                    
                rate 48000      
                format S32_LE   # ice1724 cards can only use this format
        }
}

I've had the "too fast video no sound" problem with my Revolution71 and have been trying for 5+ hours with everything I've found on different forums.
I can't say how thankful I am when it suddenly worked flawlessly after trying your settings. THANKS!
Reply
#10
I have an Nvidia onboard 7.1 ch sound... all i had to do was set both the
"Audio Output Device" and the "Passthrough Output Device" to "iec958"

Still no navigation sounds though
Reply
#11
NOT AN ISSUE ANYMORE
-------------------------------------------------------
crynar Wrote:Hey,

I run xbmc with the command:

Code:
XBMC_HOME=/home/crynar/XBMC/BUILD/ SDL_AUDIODRIVER=null /home/crynar/XBMC/BUILD/XboxMediaCenter

Where do I edit this?

And when I try to start a song, it never actually plays, just freezes at 0:00-x:xx. However digital output works with passthrough on all videos

SVN 15613
Linux Mint up-to-date 08-10-03 based on Ubuntu Hardy
Reply
#12
deleted
Reply
#13
I had set my audio to default (Not iec958 had problems with that) on both entries in the audio setup. I also have a problem listening to my MP3's using the default PAPlayer, so right click on the songs and select dvdplayer and it works fine (I think that is how it is done). I would like to set it (DVDPlayer) as the default, but can't find anywhere to change the default audio player to somehting else than PAPlayer. All sounds work in that configuration including navigation.

XBMC under hardy is really stable right now. I have been having no problems with watching video's (Other than some jerky motion in full screen due to my proscessor, see config below), but miss some of the scripts that are available with the Xbox version.

ASUS p5pE-VM
Evga Geforce 6200 with 256MB On board Ram
Corsair 1GB Ram (No need for more, system is very efficient)
Celeron 2.8Ghz single core (Changing to Intel E2200 2.2 Ghz Dual core today to fix jerky motion/prosessor useage)
Turtle beach 5.1 spidf sound card
Netgear M1a1 Wireless
Onboard 10/100/1000 wired
HDD's, 1 80GB WD IDE system, 3 320GB IDE WD, 2 750GB Sata
Reply
#14
According to developers it isn't possible to change default player. One should instead focus on getting paplayer working.

So right now I'm struggling with the same problem as you are.

LOG:

19:08:14 T:3068368736 M: 61509632 INFO: PAP Player: Playing musicdb://2/3/2/5.mp3
19:08:14 T:3068368736 M: 61509632 ERROR: CreateStream - pcm_open, alsa error: Device or resource busy


Removed everything connected with pulseaudio as advised, but still nothing.
Reply
#15
Found a fix, finally!

Copied my working /etc/asound.conf fil to /etc/asound.conf.bak. And now everything works like a charm!
Reply

Logout Mark Read Team Forum Stats Members Help
SPDIF AC3 and DTS passthrough - how to define the device in XBMC0