Kodi Community Forum
XBMC PulseAudio passthrough support (including Nvidia) is available - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: XBMC PulseAudio passthrough support (including Nvidia) is available (/showthread.php?tid=96316)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


- sjongele - 2011-12-09

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.cppTonguerocessBlock: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



- alexb38 - 2011-12-14

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!


- koko1967k - 2011-12-15

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?


- alexb38 - 2011-12-15

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.


- kingmob - 2011-12-15

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


- cbxbiker61 - 2011-12-15

kingmob Wrote: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

It really sounds to me like you might be better off waiting for "official" support. Sorry, but this thread wasn't really intended to be a training manual. It is a development thread.


- cbxbiker61 - 2011-12-15

alexb38 Wrote: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.

Optical spdif will do "basic" pass-through, meaning the lower bandwidth stuff. The higher bandwidth stuff like dts-hd and true-hd will require hdmi.


- alexb38 - 2011-12-15

@kingmob: I don't know who you are talking to, but look at my post just above (#197), I didn't use ac3filter nor patches and it works Wink

There was a commit 2 days ago from elepus to support pulseaudio passthrough in XBMC.

So now you just need to update XBMC and pulseaudio to their latests git versions (do you know how to do that ?) and set the two audio parameters in XBMC to "defaults (pulseaudio)". Then it should work automatically as wished.


- alexb38 - 2011-12-15

cbxbiker61 Wrote:Optical spdif will do "basic" pass-through, meaning the lower bandwidth stuff. The higher bandwidth stuff like dts-hd and true-hd will require hdmi.

Yes I know, that's why I said that I can't tell if DTS/DD HD works Wink. I'll buy a new amplifier in a few weeks though.


- sjongele - 2011-12-15

alexb38 Wrote:Yes I know, that's why I said that I can't tell if DTS/DD HD works Wink. I'll buy a new amplifier in a few weeks though.

When you buy a new receiver you will quickly find out the value of cbxbiker61's work. Passthrough for DTS/DD already worked (at least using Alsa) in Dharma. cbxbiker61 is bringing us support of HD formats: this does not work with Dharma or pre-Eden, even with PulseAudio passthrough support.


- ffreak - 2011-12-15

Did I miss something, is DD TrueHD already working?


- cbxbiker61 - 2011-12-16

ffreak Wrote:Did I miss something, is DD TrueHD already working?

No, not working yet. The groundwork is in place to make it work. True-hd is quite a mess to parse (and there's very little good documentation for it).


- koko1967k - 2011-12-17

Hi,
i am trying to build PulseAudio 1.1 according to the first post, but cannot get through the JSON dependency and other dependencies.

Using Ubuntu 11.04 64-bit server.

Also, the pulseaudio.org site is down, so cannot get info from there.Huh

1) JSON
I am using the following commands to build the JSON library:
i. $ git clone https://github.com/json-c/json-c.git
ii. $ cd json-c
iii. $ sh autogen.sh
iv. $ ./configure
v. $ make
vi. $ sudo make install

2) for all the other dependencies I used:
$ apt-get build-dep pulseaudio

During the ./configure process everything is ok, but during the make process I get the following errors:
Code:
CC     libpulse_la-format.lo
In file included from /usr/local/include/json/json_util.h:15:0,
                 from /usr/local/include/json/json.h:23,
                 from pulse/format.c:28:
/usr/local/include/json/json_object.h:276:56: error: expected ')' before 'i'
/usr/local/include/json/json_object.h:283:58: error: expected ')' before 'i'
/usr/local/include/json/json_object.h:299:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'json_object_get_int'
/usr/local/include/json/json_object.h:310:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'json_object_get_int64'
In file included from /usr/local/include/json/json.h:23:0,
                 from pulse/format.c:28:
/usr/local/include/json/json_util.h:26:46: error: expected declaration specifiers or '...' before 'int64_t'
pulse/format.c: In function 'pa_format_info_get_prop_int':
pulse/format.c:319:5: warning: implicit declaration of function 'json_object_get_int' [-Wimplicit-function-declaration]
pulse/format.c: In function 'pa_format_info_set_prop_int':
pulse/format.c:356:5: warning: implicit declaration of function 'json_object_new_int' [-Wimplicit-function-declaration]
pulse/format.c:356:7: warning: assignment makes pointer from integer without a cast
pulse/format.c: In function 'pa_format_info_set_prop_int_array':
pulse/format.c:373:9: warning: passing argument 2 of 'json_object_array_add' makes pointer from integer without a cast
/usr/local/include/json/json_object.h:217:12: note: expected 'struct json_object *' but argument is of type 'int'
pulse/format.c: In function 'pa_format_info_set_prop_int_range':
pulse/format.c:388:5: warning: passing argument 3 of 'json_object_object_add' makes pointer from integer without a cast
/usr/local/include/json/json_object.h:133:13: note: expected 'struct json_object *' but argument is of type 'int'
pulse/format.c:389:5: warning: passing argument 3 of 'json_object_object_add' makes pointer from integer without a cast
/usr/local/include/json/json_object.h:133:13: note: expected 'struct json_object *' but argument is of type 'int'
make[3]: *** [libpulse_la-format.lo] Error 1
make[3]: Leaving directory `/home/xbmc/source/pulseaudio-1.1/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/xbmc/source/pulseaudio-1.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/xbmc/source/pulseaudio-1.1'
make: *** [all] Error 2

What am I missing?

thanks


- cbxbiker61 - 2011-12-18

I use the Debian source for jsonc.

http://ftp.debian.org/debian/pool/main/j/json-c/json-c_0.9.orig.tar.gz

http://ftp.debian.org/debian/pool/main/j/json-c/json-c_0.9-1.debian.tar.gz

Untar the .orig.tar.gz archive first then untar the .debian.tar.gz over the top of that.


- koko1967k - 2011-12-18

cbxbiker61 Wrote:I use the Debian source for jsonc.

http://ftp.debian.org/debian/pool/main/j/json-c/json-c_0.9.orig.tar.gz

http://ftp.debian.org/debian/pool/main/j/json-c/json-c_0.9-1.debian.tar.gz

Untar the .orig.tar.gz archive first then untar the .debian.tar.gz over the top of that.

Hi cbxbiker61,
Thanks for your excellent work!!

I will try your source.

Could it be that the reason I have some errors is because I am using Ubuntu 64 bit? Or it shouldn't matter?