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


- kingmob - 2012-01-04

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

Thx for the info, luckily I know how to use git, although since I do not program anymore, I am somewhat confused why it is suddenly so popular Tongue


- alexb38 - 2012-01-10

Hi, ok kingmob Wink

I've received my new amp a few days ago (onkyo 509) and I've got a little problem with XBMC and pulseaudio.

The pass-through doesn't work for me because the audio driver for my motherboard has 3 HDMI outputs (hw:0,3 / hw:0,7 / hw:0,8) and XBMC (or pulseaudio) tries to use the first one (0,3) whereas it's the second which works (0,7).

I also had no stereo sound at first but after forcing pulseaudio to hw:0,7 it worked :
Code:
in /etc/pulse/default.pa, added this :
load-module module-alsa-sink device=hw:0,7

Though I don't know how to do it for the pass-through. I tried some things into the custom audio pass-through setting in XBMC but it didn't help.

The optical pass-through works well, but it doesn't support DTS/DD HD and I don't have enough optical inputs on my amp.

I'm using Gentoo, kernel 3.2.0 and "recent" (one week or so) xbmc-pvr and pulseaudio git versions. I'll try to update them, perhaps it will help.

Output of alsa-info.sh :
http://www.alsa-project.org/db/?f=ab66c488e2e488d122463ba3005bc3e344ad258c

I've got weird errors with HDMI pass-through activated (and no sound) :
Code:
21:45:55 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2104287581,363000, should be:2104274256,404615, error:-13324,958385
21:45:55 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2112977000,000000, curr:2112949000,000000, diff:-28000,000000
21:45:58 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2115142000,000000, curr:2115115000,000000, diff:-27000,000000
21:45:58 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2107280978,169615, should be:2107268780,948269, error:-12197,221347
21:45:59 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2116123000,000000, curr:2116075000,000000, diff:-48000,000000
21:45:59 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2116913000,000000, curr:2116875000,000000, diff:-38000,000000
21:46:00 T:139719841462016   DEBUG: CPullupCorrection: detected pattern of length 1: 41666,67, frameduration: 41666,666667
21:46:01 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2118139000,000000, curr:2118123000,000000, diff:-16000,000000
21:46:01 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2110276269,378269, should be:2110289402,820059, error:13133,441790
21:46:01 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2118961000,000000, curr:2118955000,000000, diff:-6000,000000
21:46:02 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2111292739,257059, should be:2111278183,383927, error:-14555,873132
21:46:02 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2119793000,000000, curr:2119744000,000000, diff:-49000,000000
21:46:03 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2112280644,865927, should be:2112256174,765502, error:-24470,100425
21:46:04 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2113257830,944502, should be:2113291558,437200, error:33727,492698
21:46:04 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2121841000,000000, curr:2121835000,000000, diff:-6000,000000
21:46:05 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2114294776,477200, should be:2114310047,997603, error:15271,520403
21:46:05 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2122587000,000000, curr:2122581000,000000, diff:-6000,000000
21:46:06 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2115312349,650603, should be:2115300674,565113, error:-11675,085491
21:46:07 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2116303301,436113, should be:2116267409,091729, error:-35892,344384
21:46:07 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2124518000,000000, curr:2124459000,000000, diff:-59000,000000
21:46:08 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2125894000,000000, curr:2125835000,000000, diff:-59000,000000
21:46:09 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2126417000,000000, curr:2126379000,000000, diff:-38000,000000
21:46:09 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2118272569,268729, should be:2118301425,037628, error:28855,768899
21:46:10 T:139719833069312   DEBUG: CDVDPlayerAudio:: Discontinuity - was:2119303720,623628, should be:2119317138,275569, error:13417,651942
21:46:10 T:139719493326592 WARNING: CDVDPlayer::CheckContinuity - wrapback of stream:1, prev:2127814000,000000, curr:2127755000,000000, diff:-59000,000000

So, anyone knows how to force "hw:0,7" in HDMI pass-through ?

Thanks,


- alexb38 - 2012-01-10

Well, I tried without pulseaudio (changed /etc/asound.conf to use hw:0,7 instead of pulse) and everything works in XBMC (I can manage to not use pulseaudio for now, that's not a problem). But it looks like that DTS-HD MA is downmixed to simple DTS 5.1 Sad. Is there no support at all for DTS-HD MA bitstream pass-through in XBMC ? (FYI I've just updated xbmc-pvr and pulseaudio to their latests git versions)


- cbxbiker61 - 2012-01-11

alexb38 Wrote:Well, I tried without pulseaudio (changed /etc/asound.conf to use hw:0,7 instead of pulse) and everything works in XBMC (I can manage to not use pulseaudio for now, that's not a problem). But it looks like that DTS-HD MA is downmixed to simple DTS 5.1 Sad. Is there no support at all for DTS-HD MA bitstream pass-through in XBMC ? (FYI I've just updated xbmc-pvr and pulseaudio to their latests git versions)

The support is there if you use my git repo. The main repo isn't quite up to par with my version.


- alexb38 - 2012-01-11

Right, ok then. So I have to chose between PVR and DTS-HD, hard choice ^^

I guess we still need to install audiofilter ? and when using pulseaudio git, do we still need to apply the patch ?

Thanks for your work anyway Smile


- cbxbiker61 - 2012-01-11

alexb38 Wrote:Right, ok then. So I have to chose between PVR and DTS-HD, hard choice ^^

I guess we still need to install audiofilter ? and when using pulseaudio git, do we still need to apply the patch ?

Thanks for your work anyway Smile

Audiofilter is necessary.

Yes, the pulseaudio patch will be necessary even with pulseaudio git (until pulseaudio comes up with an appropriately elegant solution to the problem).


- eternalsword - 2012-01-12

Looks like merging with upstream has become more difficult with the addition of their preliminary pulse passthrough support. Right now I'm just overwriting any merges to the AudioRenderers directory with the ones from your repo and then correcting a couple of function calls that use their EEncoded in place of the boolean that your fork uses. Is that the best way to go about things at this point?

By the way, I made a fork at https://github.com/eternalsword/xbmc. The master branch is just your master branch merged with upstream in the way I described. delta branch includes some changes I've made on top. Take a look if you want.

I'm eagerly awaiting your work on dolby truehd. Let me know if you need help testing/debugging.


- koko1967k - 2012-01-12

cbxbiker61 Wrote:The support is there if you use my git repo. The main repo isn't quite up to par with my version.

Hi cbxbiker61,
You did an excellent job!!

I managed to get the AudioFilter working without pulse, and only with ALSA.
Now I have:
- DTS-HD MA working
- TrueHD coming as PCM Surround

Few questions:
Do you have plans to merge the latest eden git (beta 1 I think) with your xbmc code?

Also, is it correct to have TrueHD coming out as PCM Surround?

Finally, in TrueHD only, I have a mismatch in the speakers: side speakers should be rear speakers. Tested with TrueHD file: hd_dolby_truehd_channel_check_lossless.m2ts


thanks again for your excellent work!


- eternalsword - 2012-01-12

TrueHD doesn't have support yet, so it is being encoded to PCM on the fly by the ffmpeg backend. If there is a speaker mismatch, it is in the way ffmpeg handles it. Once cbxbiker61 is finished adding TrueHD support, that will be moot. ffmpeg may also have fixed this issue upstream as the version used internally by xbmc is quite old. If you are on linux, you can try building with an external ffmpeg by using the --enable-external-ffmpeg configuration flag and see if that works better for you.


- koko1967k - 2012-01-13

eternalsword Wrote:TrueHD doesn't have support yet, so it is being encoded to PCM on the fly by the ffmpeg backend. If there is a speaker mismatch, it is in the way ffmpeg handles it. Once cbxbiker61 is finished adding TrueHD support, that will be moot. ffmpeg may also have fixed this issue upstream as the version used internally by xbmc is quite old. If you are on linux, you can try building with an external ffmpeg by using the --with-external-ffmpeg configuration flag and see if that works better for you.

Hi eternalsword,
Thanks for the tip.
In order to build with the new ffmpeg, what is the syntax in the ./configure command?
I assume I will have to download the new ffmpeg and then point its location in the command, right?
Can you help me with the syntax?

Thanks,

EDIT: I tried adding the --with-external-ffmpeg flag, but I get:
Code:
configure: WARNING: unrecognized options: --with-external-ffmpeg

Any idea why?


- cbxbiker61 - 2012-01-13

elite1967 Wrote:Hi eternalsword,
Thanks for the tip.
In order to build with the new ffmpeg, what is the syntax in the ./configure command?
I assume I will have to download the new ffmpeg and then point its location in the command, right?
Can you help me with the syntax?

Thanks,

EDIT: I tried adding the --with-external-ffmpeg flag, but I get:
Code:
configure: WARNING: unrecognized options: --with-external-ffmpeg

Any idea why?

use --enable-external-libraries
BTW ./configure --help | less


- eternalsword - 2012-01-14

my bad. it is --enable-external-ffmpeg

previous post has been edited to avoid confusion.

the configure script should automatically detect ffmpeg if it is in a sane location.


Eden beta - koko1967k - 2012-01-22

@cbxbiker61:
Hi,
I have been now using your version for a month.
No problems at all. (a part from the truehd issue rear-side channels mismatch).

Are you planning to merge your git with the latest version (beta 2) of the master?


- cbxbiker61 - 2012-01-23

elite1967 Wrote:@cbxbiker61:
Hi,
I have been now using your version for a month.
No problems at all. (a part from the truehd issue rear-side channels mismatch).

Are you planning to merge your git with the latest version (beta 2) of the master?

Yeah, it's on the agenda. I've been busy doing some work on my CuBox (porting my distro to it). Cubox can run Xbmc and that's ultimately what I'm going to be using for a couple (maybe more if it works out well) of my Xbmc boxes. It's also going to be interesting to see If I can get pass-through working on the CuBox adequately. So anyway within a couple of weeks my main projects (CuBox/Xbmc/pass-through) are going to come together and that's when I plan to update my code to work well with the new xbmc head.


- koko1967k - 2012-01-23

cbxbiker61 Wrote:Yeah, it's on the agenda. I've been busy doing some work on my CuBox (porting my distro to it). Cubox can run Xbmc and that's ultimately what I'm going to be using for a couple (maybe more if it works out well) of my Xbmc boxes. It's also going to be interesting to see If I can get pass-through working on the CuBox adequately. So anyway within a couple of weeks my main projects (CuBox/Xbmc/pass-through) are going to come together and that's when I plan to update my code to work well with the new xbmc head.

Excellent news.
Looking forward to it.