XBMC PulseAudio passthrough support (including Nvidia) is available

  Thread Rating:
  • 3 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
cbxbiker61 Offline
Senior Member
Posts: 150
Joined: Nov 2010
Reputation: 1
Post: #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.
(This post was last modified: 2011-11-26 10:39 by cbxbiker61.)
find quote
shadow Offline
Senior Member
Posts: 131
Joined: Jan 2011
Reputation: 0
Post: #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.
find quote
cbxbiker61 Offline
Senior Member
Posts: 150
Joined: Nov 2010
Reputation: 1
Post: #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.
find quote
cbxbiker61 Offline
Senior Member
Posts: 150
Joined: Nov 2010
Reputation: 1
Post: #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.
find quote
shadow Offline
Senior Member
Posts: 131
Joined: Jan 2011
Reputation: 0
Post: #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)
(This post was last modified: 2011-03-15 00:52 by shadow.)
find quote
cbxbiker61 Offline
Senior Member
Posts: 150
Joined: Nov 2010
Reputation: 1
Post: #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.
find quote
shadow Offline
Senior Member
Posts: 131
Joined: Jan 2011
Reputation: 0
Post: #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
find quote
cbxbiker61 Offline
Senior Member
Posts: 150
Joined: Nov 2010
Reputation: 1
Post: #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.
find quote
shadow Offline
Senior Member
Posts: 131
Joined: Jan 2011
Reputation: 0
Post: #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.
find quote
topfs2 Offline
Team-XBMC Developer
Posts: 3,852
Joined: Dec 2007
Reputation: 8
Post: #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: badge.gif]

"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#."
find quote
Post Reply