XBMC 通过音频和脉冲

使用XBMC时,有两个音频设置。一个是用于立体声音频,另一个是用于透传音频(如果我启用AC3和/或DTS,则会使用透传):

enter image description here

根据以下的Ubuntu音频设置,如果我启用Dolby Digital或DTS,那么当我播放任何带有这些类型流的媒体时声音就无法工作。然而,立体声流仍然可以正常工作。

enter image description here

如果将Ubuntu的音频设置更改为内置音频输出,并启用Dolby/DTS,则具有这些流的媒体将正常工作,但立体声则不行。

这对我来说是有道理的,因为如果我通过Ubuntu选择了CM8738,则XBMC无法访问它,因为脉冲正在使用它。而如果我将Ubuntu音频设置为内置,则不再使用连接到扬声器的声音设备,但CM8738可以用于从XBMC进行传递/AC3/DTS。

当然,我希望两者同时工作(无需通过Ubuntu或接收器上的输入更改设备)。我希望将DTS或AC3直接传递给我的接收器以处理这些流,但仍然希望在XBMC内部和外部工作时保留立体声。我是否要求太多?还是可以实现这个目标?

以下是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
3个回答

我至少已经能够通过以下设置中的2个来实现。在XBMC中,立体声音频和直通都可以正常工作,而无需卸载pulse。然而,我仍然需要从Ubuntu声音设置中选择不同的音频输出(例如:内部音频)。
~/.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
     }
}

然后在XBMC中:

enter image description here

注意:灰色的“自定义直通设备”意味着该选项未被使用。只有在将“直通输出设备”设置为“自定义”时才会被使用。


卸载pulseaudio并使用ALSA代替对我有帮助(在12.10上,但也适用于12.04)。
sudo apt-get purge pulseaudio gstreamer0.10-pulseaudio
sudo apt-get autoremove

sudo apt-get install alsa-base alsa-tools alsa-tools-gui alsa-utils alsa-oss linux-`sound-base alsamixergui`
sudo apt-get install esound esound-clients esound-common libesd-alsa0 gnome-alsamixer

确保在Ubuntu声音设置中选择数字输出(S/PDIF),并在XBMC中选择iec958(ALSA)作为通过输出设备。