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)



- RavenNL - 2012-02-12

Awesome work, but will this be integrated into xbmc eden final?


- twilight - 2012-02-12

I'm getting a "Audio Device Failed to Initialize" error when trying to play DTS-HD(MA), even though both my devices are supporting it (Win 7 Pro x64, Nvidia GT520, Onkyo TX-NR 905).

My XBMC settings are as described in post 1, using the newest driver for the graphics card.

Any hot tips why that might be?


Awesome work btw! Smile


Edit: Just got it working - using the newest nvidia beta driver did the trick! Smile


- steelman1991 - 2012-02-12

DanielaE Wrote:It's more a matter of correctly modeling reality rather than fallback, to be precise. Wink The background is the HDMI transport protocol which carries either exactly one IEC 60958 audio stream in its multiplex, or four of them. This relates to a 2-channel or a 8-channel sample structure at the interface level. The true number of output channels in a given audio stream is determined by out-of-band 'valid' flags in case of LPCM or in-band signaling in case of the various encoded formats according to IEC 61937.
DanielaE - looks like you nailed it this time - thanks great work - all the TrueHD titles that exhibited stuttering and audio sync, are now rock solid and playback perfectly

Excellent work and thanks also to DDDamian for compiling - and including the Audio Delay patch.


- T800 - 2012-02-12

Thanks for all the work put into this!

XBMC feels complete to me now.

No more external players! Big Grin


- reta - 2012-02-12

I opened up a mkv container I had earlier with non-hd audio and merged it into a new mkv with a dtsma track. This time I can go in to the audio screen in xbmc during playback and see that it's hd audio that's being played, but on my reciever it still just says DTS.

If I change "receiver gets other DTS formats" to "decoded (LPCM)" my receiver display show PCM, so I'm assuming something's wrong and it doesn't get the hd audio format from xbmc for some reason, can anybody help me out? Thanks in advance!

edit: nvm, solved it. Even though my receiver supports it, changing "receiver supports" from DTS-HD High Resolution Audio to DTS-HD Master Audio made it work. Thanks a lot for this patch!


- bluray - 2012-02-12

reta Wrote:edit: I'm assuming I don't need the w7 codec pack and the shark007 thingie that bluray mentioned somewhere, since that's for external players and this patch makes hd audio playback possible in xbmc itself, right?
W7 codec pack and Shark007 are mainly for W7MCE. For XBMC, you can simply update your GPU latest driver from here- AMD driver or Nvidia driver. Make sure that you select the proper HDMI audio output and configure speaker to "stereo" in W7 control panel, and then select the same audio output in XBMC. If your GPU and AVR supports bitstreaming, the latest "XBMC Beta 3 + HD-Audio + Global AV Delay" should bitstreaming DTS-HD/TrueHD. If you don't feel comfortable with MakeMKV file, you can try ripping it with AnyDVD HD to ISO or BD folder or copy/paste M2TS file to your local storage. You'll have 14 days trials from Slysoft with no string attach.

All you have left to do is enjoy the show! Smile


- bluray - 2012-02-12

T800 Wrote:No more external players! Big Grin
I still need it for most blu-rays to enjoy the original blu-ray menus, previews, chapters, etc and 3d once in a while. For blu-rays that I want to playback with External Player, I simply named it "title_ext.iso" and use this protocol "<rule filename=".*_ext.iso*" protocols="*_ext.iso*" player="ext_Player"/>". The rest of my blu-rays still can playback using the latest XBMC patches.

The latest XBMC patches and external player "TMT5" are excellent combination for XBMC! Smile


- fezster - 2012-02-12

I have a TrueHD mkv file made with mkvmerge which had a slight sync issue (few hundred ms), but can confirm the latest build seems to have resolved it.

Thanks very much and great work!


- DDDamian - 2012-02-12

DanielaE Wrote:It's more a matter of correctly modeling reality rather than fallback, to be precise. Wink The background is the HDMI transport protocol which carries either exactly one IEC 60958 audio stream in its multiplex, or four of them. This relates to a 2-channel or a 8-channel sample structure at the interface level. The true number of output channels in a given audio stream is determined by out-of-band 'valid' flags in case of LPCM or in-band signaling in case of the various encoded formats according to IEC 61937.

@Daniela - quite correct - was forgetting that's in the muxer code, not the actual output being forced. Sounds like more folks are ringing back with good results on TrueHD sync. A fantastic piece of work - and it will have a postive impact on AE as these timing issues are not resolved there. Very appreciative of your work!


- voip-ninja - 2012-02-12

RavenNL Wrote:Awesome work, but will this be integrated into xbmc eden final?

No.


- DanielaE - 2012-02-12

A small reminder to avoid confusion: currently, there seem to be two different builds floating around in the interwebs. One created by DDDamian with a slightly different feature set (don't know the exact details) and the one created by me with the feature set as decribed in the very first post. The download link mentioned at the bottom of that post refers to my build, not DDDamian's. So nobody should be confused if one is expecting DDDamian's build and is getting mine instead (or vice versa) !


- voip-ninja - 2012-02-12

Damian's build has a timing fix for HD audio which prevents it from getting out of sync and dropping frames, which I believe DanielaE, you have also now fixed.

Damian's build also has the needed patch so that the advancedsettings.xml file can be set for global AV audio delay which fixes the ~125-200ms audio lip sync problem in 24P content.


- DDDamian - 2012-02-12

That's basically correct voip-ninja. About the only other difference is mine includes some speed optimizations that will be more noticeable with some of the advanced skins and on slower systems.


- DanielaE - 2012-02-12

Do you happen to have a branch on GitHub or elsewhere with your additions for others like me to learn from?


- DDDamian - 2012-02-12

DanielaE Wrote:Do you happen to have a branch on GitHub or elsewhere with your additions for others like me to learn from?

I am on github at https://github.com/DDDamian but it's just AE code there now - I'll create a branch to push this build to today or tomorrow.

I had a look at implementing the event-driven code in your build but so much has been structurally changed in the AE API that it's probably not worth doing especially as what you've done seems stable enough to not waste time re-doing - certainly runs great on my rig and several others who've done testing. Much of the code in the various output sinks has been moved up a layer to keep whatever's possible platform-agnostic. A good side-effect of that is keeping GUI sounds possible even though one sets Exclusive mode as the preferred WASAPI method. The streams are mixed at a higher-level so the sink just see's it as one stream. I usually turn them off as I don't want cute sounds at 110db lol but many do like them on, and that's possible with the AE implementation.

Another thing implemented in AE is the 24bit flac output which is nice for more audio-oriented peeps like me Big Grin Haven't looked in Eden at whether 24-bit data is simply truncated or properly dithered, but I know in AE dithering has been added on any down-sampling which makes a big improvement in distortion.

Your work on the audio-packet durations during muxing is something that needs to get pushed upstream to AE as the biggest single issue with that code right now is with the DVDPlayer implementation losing sync and re-initializing, which shows as discontinuities in the output.

I think you've done a fantastic job in making the hi-def formats playable in XBMC with a minimum of code changes to the current master. The downside is going to be the platform-specific nature of it. But getting your changes to the ffmpeg code and DVDPlayer codec parsing/muxing into AE will fix issues there on an all-platform basis. That alone is a huge contribution, and would undoubtably help in getting it into the master branch.

I've let gnif know of some of what you've accomplished here and where there's improvements which would benefit AE and aren't currently part of it, notably those in the paragraph above.

The devs have previously noted that it either goes in for all platforms or doesn't go in at all, so getting the benefits of your work into AE (and it's an area of AE that does need work) would be the best way to get this into master for Frodo and perhaps before via nightlies.