Ubuntu 9.10, Kernel 2.6.31-15.
XBMC 9.11 Beta1.
ALSA v1.0.20.
PulseAudio 1:0.9.19-0ubuntu4.
Nvidia MCP7A Audio.
I've managed to get multichannel pass-through audio, stereo output, and even menu sounds working (although with a few bugs here and there.) Here is how I did it, hopefully it will help someone else:
I'm outputting audio through the optical connection to my receiver.
XBMC > System > System > Audio Output:
Code:
Audio output: Digital
-Dolby Digital (AC3) capable receiver.....(X)
-DTS Capable Receiver........................(X)
Audio output device: Custom
Custom audio device: "plughw:0,1" (without quotes)
Pass-through output device: Custom
Custom pass-through device: "plughw:0,1" (without quotes)
Downmix multichannel audio to stereo.............(_)
Those settings did not work ("Failed to initialize audio device" messages) until I launched XBMC with the following script. This script kills PulseAudio just before starting XBMC:
Code:
#!/bin/bash
# Test to see if XBMC is running first
if ps -ef|grep -v grep|grep -i xbmc.bin
then
# Do nothing
echo "XBMC already Running!"
else
# Startup XBMC
ps aux|grep -v grep|grep -i pulseaudio|awk '{print $2}'| xargs kill -9
xbmc
fi
exit
This kills PulseAudio just long enough for XBMC to start and for the XBMC audio settings to take effect. Now the buggy part begins: PulseAudio will auto-restart a few seconds after XBMC launches, so there will be a few seconds before menu sounds return.
The second bug occurs when launching a stereo (2.0) audio stream. The *first* time any 2.0 audio stream is launched, it will give the familiar "Failed to initialize audio device" error. Simply stop whatever you were trying to play, give it a second, and restart it. All 2.0 audio will work from then on. (IDK why this happens, but it does, and it's stupid. Damn you PulseAudio.)
For reference, here are my
aplay -l and
aplay -L outputs:
Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC1200 Digital [ALC1200 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
Code:
aplay -L
front:CARD=NVidia,DEV=0
HDA NVidia, ALC1200 Analog
Front speakers
surround40:CARD=NVidia,DEV=0
HDA NVidia, ALC1200 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
HDA NVidia, ALC1200 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
HDA NVidia, ALC1200 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
HDA NVidia, ALC1200 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
HDA NVidia, ALC1200 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=NVidia,DEV=0
HDA NVidia, ALC1200 Digital
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
HDA NVidia, NVIDIA HDMI
HDMI Audio Output
null
Discard all samples (playback) or generate zero samples (capture)
pulse
Playback/recording through the PulseAudio sound server
Your "plughw:X,X" values will change depending on sound-card, and desired audio output device.
Hope this helps someone!