XBMC PulseAudio passthrough support (including Nvidia) is available

  Thread Rating:
  • 3 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Forsaken Offline
Junior Member
Posts: 27
Joined: Jan 2010
Reputation: 0
Post: #191
cbxbiker61 Wrote:I just checked in code to deal with this problem in my xbmc repo. This entails adding a maxpassthroughbandwidth option to xbmc advanced settings.

You can now limit the bandwidth of high-def streams so that you'll be able to play the dts-core when your hardware doesn't support the high bandwidth requirement of dts-hd.

In ~/.xbmc/userdata add the maxpassthroughbandwidth to limit bandwidth to suitable rate for your system.

768000 is the default setting
Values to try: 48000, 192000 and 192001

48000 should always work, but will alway limit you to dts-core. 192000 and 192001 (they are equivalent in bandwidth by have different channel/frequency mappings) may work and will pass-through dts-hd. There are some dts-hd videos that will exceed this bandwidth and cause distortion.

[/CODE]

Ok I will give it a try tonight but afaik my hw should support it, it's a core i3 (not sandy bridge the previous one).
find quote
sjongele Online
Junior Member
Posts: 30
Joined: Nov 2011
Reputation: 0
Post: #192
cbxbiker61 Wrote:Did you try with straight Alsa? If it behaves the same between the PulseAudio code and the Alsa code, I can't think of anything in the audio code that could be causing it. If PulseAudio pass-through doesn't work and Alsa does, then there could be a rate calculation that may be the issue.

I have tried the following:
* Dharma: OK
* pre-Eden: OK
* your pre-Eden, ALSA: not OK
* your pre-Eden, Pulse: not OK

I don't where it is, but as the "default" pre-Eden works correctly, I would assume there is a relation to AudioFilter. Hope you can find it; I'm using your pre-Eden as default media center Big Grin
find quote
Forsaken Offline
Junior Member
Posts: 27
Joined: Jan 2010
Reputation: 0
Post: #193
Both 192000 and 192001 worked fine with movies I tried that gave no sound before.

Edit: Ok so I used the wrong xbmc build, now I don't get audio with 192001 but with 192000 I get audio and the receiver says DTS-MA.
(This post was last modified: 2011-12-08 20:21 by Forsaken.)
find quote
megakha Offline
Junior Member
Posts: 3
Joined: Nov 2011
Reputation: 0
Post: #194
cbxbiker61 Wrote:Yes, music is taking a different path than video in the xbmc code. I'm pretty sure that the music path never attempts to use pass-through. That would be the reason why IsPassthrough is always false for music. I haven't looked at that for quite a while ...well now I have. Here's the relevant bit in PAPlayer.cpp.

Code:
/* Open the device */
    m_pAudioDecoder[num] = CAudioRendererFactory::Create(
      m_pCallback         , //pCallback
      m_channelCount [num], //iChannels
      m_channelMap   [num], //channelMap
      m_sampleRate   [num], //uiSamplesPerSec
      m_bitsPerSample[num], //uiBitsPerSample
      false               , //bResample
      true                , //bIsMusic
      false                 //bPassthrough
    );

I don't have much in the way of multi-channel encoded music.

I have played around with the code, it seems that PAPlayer changes the data itself, and sends stereo only to passthrough. I have changed settings to use DVDAudio player for music, It helped - now I am getting passthrough, but most of DTS tracks are not recognized correctly (hence, not played) although PAPlayer did play 2 channels from it before. aplay plays DTS correctly
find quote
cbxbiker61 Offline
Senior Member
Posts: 148
Joined: Nov 2010
Reputation: 1
Post: #195
sjongele Wrote:I have tried the following:
* Dharma: OK
* pre-Eden: OK
* your pre-Eden, ALSA: not OK
* your pre-Eden, Pulse: not OK

I don't where it is, but as the "default" pre-Eden works correctly, I would assume there is a relation to AudioFilter. Hope you can find it; I'm using your pre-Eden as default media center Big Grin

I actually don't think it's AudioFilter, but more the fact that pass-through is being handled just a bit differently than non-pass-through.

After looking at the code a bit, I'm thinking the problem lies with the way that DVDNAV_NAV_PACKET's are being handled. You'll notice DVDNAV_NAV_PACKET DISCONTINUITY messages in your log. I think that code needs to be improved. You'll find the interesting code in DVDInputStreamNavigator.cpp:ProcessBlock:line 461+ and DVDPlayer.cpp:OnDVDNavResult:line 3185+. It actually looks like in OnDVDNavResult someone had planned to flush it out a bit more. I don't think it's handling the timestamp changes properly when starting a new VOB.

I'm focused on true-hd support so I don't have time to look at this at the moment.
find quote
sjongele Online
Junior Member
Posts: 30
Joined: Nov 2011
Reputation: 0
Post: #196
cbxbiker61 Wrote:I actually don't think it's AudioFilter, but more the fact that pass-through is being handled just a bit differently than non-pass-through.

After looking at the code a bit, I'm thinking the problem lies with the way that DVDNAV_NAV_PACKET's are being handled. You'll notice DVDNAV_NAV_PACKET DISCONTINUITY messages in your log. I think that code needs to be improved. You'll find the interesting code in DVDInputStreamNavigator.cpp:ProcessBlock:line 461+ and DVDPlayer.cpp:OnDVDNavResult:line 3185+. It actually looks like in OnDVDNavResult someone had planned to flush it out a bit more. I don't think it's handling the timestamp changes properly when starting a new VOB.

I'm focused on true-hd support so I don't have time to look at this at the moment.

You might be right, but I can't follow the logic yet; Dharma and pre-Eden also support passthrough for DTS and DD (PassthroughFFmpeg) and work correctly with these DVDs.

The logs seem tell me the "normal" pre-Eden corrects along the way (CalcFrameRate?).

pre-Eden with AudioFilter:
Quote:18:53:18 T:140301531572096 DEBUG: GL: Requested render method: 2
18:53:18 T:140301531572096 DEBUG: GL: BaseYUV2RGBGLSLShader: defines:
#define XBMC_texture_rectangle 0
#define XBMC_texture_rectangle_hack 0
#define XBMC_STRETCH 0
#define XBMC_YV12
18:53:18 T:140301531572096 NOTICE: GL: Selecting Single Pass YUV 2 RGB shader
18:53:18 T:140301531572096 DEBUG: GL: Vertex Shader compilation log:
18:53:18 T:140301531572096 DEBUG: GL: Vertex Shader compiled successfully
18:53:18 T:140301531572096 DEBUG: GL: Pixel Shader compilation log:
18:53:18 T:140301531572096 DEBUG: GL: Fragment Shader compiled successfully
18:53:18 T:140301531572096 NOTICE: GL: NPOT texture support detected
18:53:18 T:140301531572096 NOTICE: GL: Using GL_ARB_pixel_buffer_object
18:53:18 T:140300945192704 DEBUG: CDVDPlayer::HandleMessages - player started 2
18:53:18 T:140301216810752 DEBUG: CDVDPlayerAudio:: Discontinuity - was:1615614.731209, should be:1898435.110155, error:282820.378946
... After this point a lot of Discontinuity...

"normal" pre-Eden does:
Quote:20:08:12 T:140185186596736 DEBUG: GL: Requested render method: 2
20:08:12 T:140185186596736 DEBUG: GL: BaseYUV2RGBGLSLShader: defines:
#define XBMC_texture_rectangle 0
#define XBMC_texture_rectangle_hack 0
#define XBMC_STRETCH 0
#define XBMC_YV12
20:08:12 T:140185186596736 NOTICE: GL: Selecting Single Pass YUV 2 RGB shader
20:08:12 T:140185186596736 DEBUG: GL: Vertex Shader compilation log:
20:08:12 T:140185186596736 DEBUG: GL: Vertex Shader compiled successfully
20:08:12 T:140185186596736 DEBUG: GL: Pixel Shader compilation log:
20:08:12 T:140185186596736 DEBUG: GL: Fragment Shader compiled successfully
20:08:12 T:140185186596736 NOTICE: GL: NPOT texture support detected
20:08:12 T:140185186596736 NOTICE: GL: Using GL_ARB_pixel_buffer_object
20:08:12 T:140184620316416 DEBUG: CDVDPlayer::HandleMessages - player started 2
20:08:14 T:140184579897088 DEBUG: CPullupCorrection: detected pattern of length 1: 20000.00, frameduration: 20000.000000
20:08:15 T:140184579897088 DEBUG: CalcFrameRate framerate was:25.000000 calculated:50.000000
20:08:15 T:140184579897088 NOTICE: fps: 50.000000, pwidth: 720, pheight: 576, dwidth: 720, dheight: 405
20:08:15 T:140184579897088 DEBUG: OutputPicture - change configuration. 720x576. framerate: 50.00. format: YV12
20:08:15 T:140184579897088 NOTICE: Display resolution ADJUST : default: 1920x1080 @ 50.00Hz (14) (weight: 0.000)
20:08:16 T:140185186596736 NOTICE: Using GL_TEXTURE_2D
20:08:16 T:140185186596736 DEBUG: GL: Requested render method: 2
20:08:16 T:140185186596736 DEBUG: GL: BaseYUV2RGBGLSLShader: defines:
#define XBMC_texture_rectangle 0
#define XBMC_texture_rectangle_hack 0
#define XBMC_STRETCH 0
#define XBMC_YV12
20:08:16 T:140185186596736 NOTICE: GL: Selecting Single Pass YUV 2 RGB shader
20:08:16 T:140185186596736 DEBUG: GL: Vertex Shader compilation log:
20:08:16 T:140185186596736 DEBUG: GL: Vertex Shader compiled successfully
20:08:16 T:140185186596736 DEBUG: GL: Pixel Shader compilation log:
20:08:16 T:140185186596736 DEBUG: GL: Fragment Shader compiled successfully
20:08:16 T:140185186596736 NOTICE: GL: NPOT texture support detected
20:08:16 T:140185186596736 NOTICE: GL: Using GL_ARB_pixel_buffer_object
find quote
alexb38 Offline
Junior Member
Posts: 44
Joined: Nov 2010
Reputation: 0
Location: France
Post: #197
Not sure if it's the right topic, but I updated pulseaudio and xbmc-pvr on my setup to the latests git versions today and now I got pulseaudio passthrough working perfectly.

Now we just need to set the two audio parameters to "Defaults (pulseaudio)", check DTS and AC3 passthrough and it works.

I can now launch chromium and see a flash video and then go back to xbmc without messing with settings and still have great 5.1 sound on my films (btw I made a small script to launch an openbox session and a browser directly from xbmc, as I have xbmc running as a window manager. If anyone's interested I can make a tutorial).

Thanks to the developpers!
find quote
elite1967 Offline
Senior Member
Posts: 165
Joined: Apr 2010
Reputation: 0
Post: #198
alexb38 Wrote:Not sure if it's the right topic, but I updated pulseaudio and xbmc-pvr on my setup to the latests git versions today and now I got pulseaudio passthrough working perfectly.

Now we just need to set the two audio parameters to "Defaults (pulseaudio)", check DTS and AC3 passthrough and it works.

I can now launch chromium and see a flash video and then go back to xbmc without messing with settings and still have great 5.1 sound on my films (btw I made a small script to launch an openbox session and a browser directly from xbmc, as I have xbmc running as a window manager. If anyone's interested I can make a tutorial).

Thanks to the developpers!

Hi,
excellent!

Is the DTS-HD and True-HD passthrough working for you?
find quote
alexb38 Offline
Junior Member
Posts: 44
Joined: Nov 2010
Reputation: 0
Location: France
Post: #199
That I can't tell, my amplifier is quite old and doesn't have HDMI inputs.
On my setup the passthrough goes to the optical output.
find quote
kingmob Offline
Junior Member
Posts: 35
Joined: Dec 2008
Reputation: 0
Post: #200
To be honest, your instructions are very vague. I'm sure they make sense to you, but I'm stumped. Would you consider explaining it to me and changing the startpost somewhat. Just to give you an idea, I'm not exactly a newbie Wink

First some questions regarding why.
- Can you elaborate why I need to patch pulseaudio, shouldn't the latest pulseuadio already contain passthrough support?
- why is ac3filter necessary, what does it do?
- why is xbmc patched, to support this ac3filter?
I ask this since somehow a simple concept like passthrough appears to have been elevated everywhere on the internet to rocket science. I honestly do not understand why it is not working on my machine right now. As far as I know it should be working fine with the latest pulseaudio?

Next the how:
- how do i apply your patch to the pulseaudio code?

Hope I don't sound too stupid, but I read the whole topic, several manuals regarding pulseaudio and alsa, have managed to get passthrough working by accident here and there and I still don't have the slightest clue Big Grin
find quote
Post Reply