Kodi Community Forum
[WINDOWS][PATCH]Bitstream output of HD audio formats - 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: [WINDOWS][PATCH]Bitstream output of HD audio formats (/showthread.php?tid=121877)



- T800 - 2012-02-06

PatrickBateman Wrote:Wow,

Been busy in here Smile What a great little patch, just curious before I try it out, when xbmc decodes to PCM does it out put lossless. eg if I have a truehd/dtsma or a dts 96/24 (or above) will it leave the bitrate, sample rate, and audio etc comleptly intact or does it still down sample the 24bit audio to 16bit audio, as I'm sure I remember reading somewhere that it only out puts 16bit audio?

If not, I think I'll give this new version a little tinker this evening.

Thanks Daniela for the patch and looking forward to a full AE build release soon going by the amount of activity in both these threads Smile

Standard XBMC decodes TrueHD to PCM it isn't new to this patch. This patch also doesn't decode DTS-HD MA to PCM, it will only decode the DTS core.

I set TrueHD to PCM (meaning I disabled this patch for TrueHD) just to have the audio in sync.


- PatrickBateman - 2012-02-06

T800 Wrote:Standard XBMC decodes TrueHD to PCM it isn't new to this patch. This patch also doesn't decode DTS-HD MA to PCM, it will only decode the DTS core.

I set TrueHD to PCM (meaning I disabled this patch for TrueHD) just to have the audio in sync.

Cheers,

I'll have a tinker with it tonight...
I had a quick peep at it after my post and noticed that there is an option for "receiver gets other DTS formats" - "lpcm" or "reduced core".

If I set "receiver supports dts 96/24" does this mean that xbmc will bitstream all DTS tracks up to 96/24 and then decode the core of everything else above that (MA etc) to lpcm?...

And... If set "receiver gets other DTS formats" to "reduced core" and leave "reciever supports DTS 96/24" does that mean it will bitstream all up to 96/24 and then bitstream the core of all audio over 96/24 (DTSMA/HR ETC)

(my reason for asking these is I have 4/5 HTPCs (only 2 which are the same) and the one I'm testing on will be my ion which only supports multi channel audio 7.1 via lpcm, DTS 96/24, DTS, DTS-ES, DD and DD+ etc but not truehd/ma/hr.

My other AMD box does but the ion doesn't so just getting a heads up before I have to reconfigure all these boxes independently lol Eek


- T800 - 2012-02-06

PatrickBateman Wrote:Cheers,

I'll have a tinker with it tonight...
I had a quick peep at it after my post and noticed that there is an option for "receiver gets other DTS formats" - "lpcm" or "reduced core".

If I set "receiver supports dts 96/24" does this mean that xbmc will bitstream all DTS tracks up to 96/24 and then decode the core of everything else above that (MA etc) to lpcm?...

And... If set "receiver gets other DTS formats" to "reduced core" and leave "reciever supports DTS 96/24" does that mean it will bitstream all up to 96/24 and then bitstream the core of all audio over 96/24 (DTSMA/HR ETC)

That is how I understand it.


- PatrickBateman - 2012-02-06

T800 Wrote:That is how I understand it.

Thanks,

Just saves me a huge amount of time testing all the boxes over and over, now I can just set to the correct specs and be done with it.

Appreciate the quick response Nod


- ashlar - 2012-02-06

Considering the delay in Eden... is there any chance for this to be included?


- bluray - 2012-02-06

T800 Wrote:tsMuxer will remove any unwanted audio/subs from a m2ts file. I remove all non-english audio and subs and mux to .ts. so the file is a tiny bit smaller than m2ts..
+1, I do this with TsMuxer all the times because I hate any subtitle/audio other than English and DTS-HD/TrueHD....

It's a cool software, and it doesn't take very time and effort either...

TsMuxer


- Voyager - 2012-02-06

ashlar Wrote:Considering the delay in Eden... is there any chance for this to be included?

I'm excited about this too. However I'm afraid it's not going to happen, as it's a Windows-only patch.Sad


- bluray - 2012-02-06

Voyager-xbmc Wrote:I'm excited about this too. However I'm afraid it's not going to happen, as it's a Windows-only patch.Sad
I believe that there is more Windows users than other users combine. Including HD audio options for Windows users is a good place to start...! Smile


- T800 - 2012-02-06

I'm sure there will be builds of final eden with this patch so it doesn't really matter if it doesn't make it.


- fezster - 2012-02-06

How does this patch deal with multichannel FLAC files ? Ive tried using the wasapi audio output, but my multich flac files are still being output as 2 ch LPCM (Im presuming because my windows mixer is set to 2ch). Whilst I could change it to 7 channels, this still means that some of my channels will be silent if my flac files are anything but 7 channels.

The audioengine build had an "exclusive" mode which (I believe) bypasses the windows mixer. Any way to achieve the same here ?

Thanks - and absolutely brilliant patch. Completely unexpected.


- ashlar - 2012-02-06

Voyager-xbmc Wrote:I'm excited about this too. However I'm afraid it's not going to happen, as it's a Windows-only patch.Sad
Well... so was VDPAU decoding, if I'm not mistaken.

Edit: in any case, mine is just a question. I don't particularly care for HD bistreaming. DTS full bitrate has been deemed perceptually transparent in pretty much all tests. And I judge my amp by the quality of the current it outputs, not by the lights I manage to turn on. Smile


- DDDamian - 2012-02-06

Wow - a flurry is right! Just to address a few items I read through in no particular order, maybe as a primer:

Testing this without the bitstreaming aspects is a bit of a moot point. XBMC already decodes TrueHD to PCM at 16bit. This patch is for straight passthrough of TrueHD and >core-DTS. There is no decoding of DTS-MA to PCM, only the core DTS.

TrueHD *can* run up to 24/192 8-channel. In reality it seldom has this amount of information in it.

In either case there are still limitations of 16bits in the base ffmpeg code and further along.

WASAPI is not the same as the audio driver. Windows users have two choices regardless of their driver - WASAPI and DirectSound. DirectSound handles Windows mixing/resampling. When you talk to DirectSound it tells you what sample rate it is running at, as set in your audio settings, and it remixes everything to that forrmat. When you talk to WASAPI you tell it what to output, and skip the resampling. If this doesn't match your Windows settings you override them. You are negotiating with the audio driver for the best format it can handle, ideally your source format. This can be to the exclusion of all other apps seeking audio output (Exclusive mode) or at a compromise format (Shared mode).

The purest audio output is going to be in WASAPI exclsive mode - you bypass the Windows mixer and any resampling/mixing. Most modern audio hardware will handle the source format whether it's 2ch 16/44.1 or 8ch 24/192. While in this mode no other system sounds can play - only XBMC streams.

Even in this mode there are two choices - timed or event-driven. In timed mode the app has to present new data before the buffer runs dry using delays. In event-driven mode Windows calls you back to let you know it needs new data.

With this patch there are still the 16-bit limitations and timed polling, which AE does improve upon, but obviously is still a WIP.

Hope the little primer helps!


- T800 - 2012-02-06

ashlar Wrote:Well... so was VDPAU decoding, if I'm not mistaken.

Edit: in any case, mine is just a question. I don't particularly care for HD bistreaming. DTS full bitrate has been deemed perceptually transparent in pretty much all tests. And I judge my amp by the quality of the current it outputs, not by the lights I manage to turn on. Smile

DTS-HD MA is better than standard DTS, even if just on paper.
I can't even see my amp so the lights don't do much for me.

If it's possible to have better, I will gladly use it. Nod


- fezster - 2012-02-06

DDDamian Wrote:WASAPI is not the same as the audio driver. Windows users have two choices regardless of their driver - WASAPI and DirectSound. DirectSound handles Windows mixing/resampling. When you talk to DirectSound it tells you what sample rate it is running at, as set in your audio settings, and it remixes everything to that forrmat. When you talk to WASAPI you tell it what to output, and skip the resampling. If this doesn't match your Windows settings you override them. You are negotiating with the audio driver for the best format it can handle, ideally your source format. This can be to the exclusion of all other apps seeking audio output (Exclusive mode) or at a compromise format (Shared mode).

The purest audio output is going to be in WASAPI exclsive mode - you bypass the Windows mixer and any resampling/mixing. Most modern audio hardware will handle the source format whether it's 2ch 16/44.1 or 8ch 24/192. While in this mode no other system sounds can play - only XBMC streams.

Even in this mode there are two choices - timed or event-driven. In timed mode the app has to present new data before the buffer runs dry using delays. In event-driven mode Windows calls you back to let you know it needs new data.

With this patch there are still the 16-bit limitations and timed polling, which AE does improve upon, but obviously is still a WIP.

Hope the little primer helps!

Thanks for the primer, and sorry if this is answered in the above - but how does this patch (combined with WASAPI audio output) deal with multichannel flac files ? As said above, I am getting 2 ch output on a multichannel audio file (confirmed by bringing up the codec info during playback). Am I doing something wrong ?


- bluray - 2012-02-06

ashlar Wrote:Well... so was VDPAU decoding, if I'm not mistaken.

Edit: in any case, mine is just a question. I don't particularly care for HD bistreaming. DTS full bitrate has been deemed perceptually transparent in pretty much all tests. And I judge my amp by the quality of the current it outputs, not by the lights I manage to turn on. Smile
Actually, DTS-HD and TrueHD users are careless about the blue/green/red light it display. We just want XBMC to bitstream it properly so our expensive AVR can do its job.

This patches and AE are not about DTS vs DTS-HD, because it is discussed to death everywhere on the net. Of course, there is no difference between PCM and losslessly compressed versions of the same PCM original. If it is done right, it's PCM = DTS-HD = TrueHD. Studios want to use the extra space for more extras, tracks, etc., and lossless codecs make it possible with no loss in quality.

Here is my take on DTS-HD/TrueHD:
When I move to another house- I can either transport my blu-ray discs just the way it is (stacks in several racks) which may be bulky or I can pile all of it neatly in a single box (less bulky and more convenient and save space in my truck), and drive over there and then put it back together again - either way when I'm done the blu-ray discs will be in the rack exactly the same as at the old home. Smile