Ubuntu – XBMC Passthrough Audio and Pulse

12.04soundxbmc

With XBMC, there are two audio settings. One is for for stereo audio, and the other is for passthrough audio (If I were to enable AC3 and or DTS then passthrough would be used):

enter image description here

With the following ubuntu audio settings, if I enable Dolby Digital or DTS then sound does not work when I play any media with those types of streams. However, stereo streams will still work:

enter image description here

If change the Ubuntu audio settings to Built-in Audio for output, and enable Dolby/DTS then media with those streams will work, but then stereo does not.

This makes sense to me because if I have my CM8738 selected via Ubuntu then XBMC couldn't access it because pulse has it in use. The flip side where I set Ubuntu audio to Built-in I am no longer using the sound device hooped up to my speakers, but then CM8738 is freed up for passthrough/AC3/DTS from XBMC.

What I would like, is of course, for both to work at the same time (without having to change device via Ubuntu or inputs on my receiver). I want to pass DTS or AC3 directly to my receiver for those streams, but still have stereo within XBMC and outside of XBMC to work. Am I asking for too much? Or can this be done?

For reference here is the output of aplay -l:

**** List of PLAYBACK Hardware Devices ****
card 0: CMI8768 [C-Media CMI8768], device 0: CMI8738-MC8 [C-Media PCI DAC/ADC]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CMI8768 [C-Media CMI8768], device 1: CMI8738-MC8 [C-Media PCI 2nd DAC]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CMI8768 [C-Media CMI8768], device 2: CMI8738-MC8 [C-Media PCI IEC958]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Intel [HDA Intel], device 1: ALC888 Digital [ALC888 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Best Answer

I have at least been able to get 2 out of 3 with the following set up. Both Stereo audio and passthrough work within XBMC without having to uninstall pulse. I still however have to select a different audio output from the ubuntu sound settings (i.e. internal audio):

In ~/.asoundrc:

# ALSA library configuration file

# Include settings that are under the control of asoundconf(1).
# (To disable these settings, comment out this line.)
</home/kbrandt/.asoundrc.asoundconf>
pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,2"
        period_time 0
        period_size 1024
        buffer_size 8192
        #periods 128
        #rate 44100
        rate 48000
     }
     bindings {
        0 0
        1 1
     }
}

Then in XBMC:

enter image description here

note: The greyed out "Custom Passthrough Device" means that the option is not in use. It only is in use if "Passthrough output device" is set to "Custom"

Related Question