• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 18
XBMC PulseAudio passthrough support (including Nvidia) is available
#1
Hey,

After I got a wonderful Onkyo/Polk Audio surround system I just had to have DTS/AC3 passthrough working. So I spent two weeks writing code getting it to happen. It's working great. I fixed a bug or two in XBMC's pulseaudio implementation on the way.

In the process I ported Ac3Filter to Linux (and renamed it AudioFilter, so as not to confuse the two (I changed too many interfaces and improved it's performance). Anyway AudioFilter has become my primary audio library with regard to passthrough support.

Download/build/install in order.

Build PulseAudio 1.1 with patch located at http://forum.xbmc.org/showthread.php?p=9...post938511.

wget http://freedesktop.org/software/pulseaud...1.1.tar.gz
apply patch mentioned above
follow directions in readme

git clone git://github.com/cbxbiker61/audiofilter.git
follow directions in readme
git clone git://github.com/cbxbiker61/xbmc.git
follow directions in readme
Configure xbmc with "Digital Surround 7.1 (HDMI)" selected in System Settings/Audio as passthrough device.
Reply
#2
Any chance this supports DTS-HD MA and TrueHD? (I have a-lot of Blu-Ray backups)

So far I can only passthrough them in a rudimentary way (put them through ffmpeg then play with aplay) but that is more just to see my receiver say it is getting the formats since it loses video.

But seeing my receiver saw 7.1ch DTS-HD MA was nice.
Reply
#3
shadow Wrote:Any chance this supports DTS-HD MA and TrueHD? (I have a-lot of Blu-Ray backups)

But seeing my receiver saw 7.1ch DTS-HD MA was nice.

I'm currently working on dts-hd format support. My first step is going to be to passthrough the dts-5.1 core. Then if I can get proper doc for the dts-hd format I'll try to pass that through as well. FFmpeg doesn't seem to grok dts-hd very well either, it's too slow and causes stutters.

It'll probably be a week or so before I can handle dts-hd streams in AudioFilter.
Reply
#4
shadow Wrote:Any chance this supports DTS-HD MA and TrueHD? (I have a-lot of Blu-Ray backups)

So far I can only passthrough them in a rudimentary way (put them through ffmpeg then play with aplay) but that is more just to see my receiver say it is getting the formats since it loses video.

But seeing my receiver saw 7.1ch DTS-HD MA was nice.

What is the ffmpeg command you are using to mux the dts-hd file? I would like to analyze what it's doing with the the hd portion of the stream.

I'm playing dts-hd mkv's now (I'm stripping off the hd portion currently). I updated AudioFilter and the Xbmc AudioFilter patch. For some reason Xbmc doesn't like the dts timestamps in the dts-hd stream made with MakeMkv. I added a patch for Xbmc which fixes (works around) this.
Reply
#5
Here is a copy and paste from my email with the dev behind HD Audio passthrough in ffmpeg
Apparently it requires setting the rate to 4x the actual.

----

All other than DTS-HD :
ffmpeg -i inputfile -f spdif -acodec copy output.spdif

For DTS-HD (e.g.), to get more than the core you need:
ffmpeg -i inputfile -f spdif -dtshd_rate 768000 -acodec copy output.spdif
(768000 makes output suitable to be played back as 8 channel 192kHz)
Reply
#6
shadow Wrote:Here is a copy and paste from my email with the dev behind HD Audio passthrough in ffmpeg
Apparently it requires setting the rate to 4x the actual.

----

All other than DTS-HD :
ffmpeg -i inputfile -f spdif -acodec copy output.spdif

For DTS-HD (e.g.), to get more than the core you need:
ffmpeg -i inputfile -f spdif -dtshd_rate 768000 -acodec copy output.spdif
(768000 makes output suitable to be played back as 8 channel 192kHz)

I'm using ffmpeg svn from 20110311 it doesn't like the dtshd_rate option. They must've changed something.
Reply
#7
Here is what I am using if you wanted to try rolling back for a test.


FFmpeg version git-391a132, Copyright © 2000-2011 the FFmpeg developers
built on Mar 5 2011 23:47:38 with gcc 4.5.2
configuration:
libavutil 50. 39. 0 / 50. 39. 0
libavcodec 52.113. 2 / 52.113. 2
libavformat 52.102. 0 / 52.102. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1. 76. 0 / 1. 76. 0
libswscale 0. 12. 0 / 0. 12. 0


Also not when I played the files with aplay using the following command, even if I was only doing a DTS-HD MA 5,1 I still had to use -c8 (receiver reported only 5.1) when I tried -c6 I only got static (and the receiver reported 5.1 Linear PCM)

aplay -D hdmi:CARD=NVidia,DEV=3,AES0=6 -c8 -fs16_le -r192000 output.spdif
Reply
#8
shadow Wrote:Here is what I am using if you wanted to try rolling back for a test.


FFmpeg version git-391a132, Copyright © 2000-2011 the FFmpeg developers
built on Mar 5 2011 23:47:38 with gcc 4.5.2
configuration:
libavutil 50. 39. 0 / 50. 39. 0
libavcodec 52.113. 2 / 52.113. 2
libavformat 52.102. 0 / 52.102. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1. 76. 0 / 1. 76. 0
libswscale 0. 12. 0 / 0. 12. 0


Also not when I played the files with aplay using the following command, even if I was only doing a DTS-HD MA 5,1 I still had to use -c8 (receiver reported only 5.1) when I tried -c6 I only got static (and the receiver reported 5.1 Linear PCM)

aplay -D hdmi:CARD=NVidia,DEV=3,AES0=6 -c8 -fs16_le -r192000 output.spdif

I think the problem is that I was using svn. Usually when the change source controls they delete the old repository and put a README in there to let you know about the new repository. Should be good to go now that I've rebuild the git version.
Reply
#9
If you didn't know about moving to git, I doubt you are going to know this since it just happened but it looks like due to fighting the ffmpeg is getting branched with most devs going to the new one. So you may have to start watching http://www.libav.org for updates that affect you.

I hope it doesn't turn into a problem where some features are one version and some in the other.


Source: ffmpeg-devel mailing list which I just skimmed so may not have the clearest understanding of what is happening.
Reply
#10
I haven't reviewed the patches but so they don't fall into the void and under our radar (which is easy on the forum!) could you please fork our repo, patch it and send a pull request. Alternatively, but we prefer the first way, you can simply start a trac ticket with the patches.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#11
topfs2 Wrote:I haven't reviewed the patches but so they don't fall into the void and under our radar (which is easy on the forum!) could you please fork our repo, patch it and send a pull request. Alternatively, but we prefer the first way, you can simply start a trac ticket with the patches.

Yeah, that sounds like a plan. PulseAudio has just recently created a branch to work out their long term pass-through support. I'll be testing against that branch as soon as I can. Not sure when Pulse will be ready to roll in their "new" pass-through code. Probably be a while, and then I'll be ready to submit "official" patches.

In the meantime, I'll be analyzing the dts-hd support. It is nice though that blu-ray rips with dts-hd will play today with the code as it stands.
Reply
#12
OK, I've tested dts-hd passthrough with pulse and I've got the test working. Now it's just a matter of coding up a proper solution. Probably 4 to 5 days. Then I'll test with the pulseaudio passthrough branch and see if they've added a couple of features I want/need.
Reply
#13
Yeah, if it can't be used in pulse which is found in our target distros I'd say its probably better to wait, we don't generally want to keep that type of development code in our mainline but a fork on github is the way to go about it I would say, that way other pulseaudio bleeding edge users can use your fork if they wish. When they merge in their branch and distros start having (or they will have it until our next release is going in) you can submit a pull request and we will pull it in if we want.

Awesome to see that the pulseaudio fellows finally are working on this, it has been such a pain that they haven't had support for this already.

Also, you might want to check out gnif's AE branch, this will be merged into mainline hopefully before eden so it might make sense if you target that with your patches. It is still in somewhat of a flux but most of the interfaces ought to be stable now.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#14
cbxbiker61 make sure you put a link to your repo when you make it. I will be trying it.
Reply
#15
Isn't this duplicating the work being done in the AudioEngine branch? Or do I not understand what you're talking about (Always possible Smile)?
Living Room: ASUS Chromebox / OpeneElec 5 / Kodi 14.2
Bedroom: Amazon FireTV Stick / Kodi 14.2
Home Office: Amazon FireTV Stick / Kodi 14.2
Windows Server: Intel Core i3-2100T / 8GB Ram / 48TB / MySQL / StableBit DrivePool on Server 2012 R2 Standard
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 18

Logout Mark Read Team Forum Stats Members Help
XBMC PulseAudio passthrough support (including Nvidia) is available3