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)



- DanielaE - 2012-02-15

disco277 Wrote:... and I'm still confused as to what the consensus is for the best package, DanielA or DDaimians.

There are no reasons to despair! Damian stated it clearly in post #277:

DDDamian Wrote:XBMC Beta 3 + HD-Audio + Global AV Delay
Taken today from master plus DanielaE's HD audio patch + a11599's timing correction and global AV delay, compiled with installer. You might find it a little zippier too Cool

EDIT: Updated link to latest of DanielaE's patches - improves TrueHD sync and fixes spash screen to reflect HD-Audio version.

Or:
  1. XBMC Eden Beta 3: authored by XBMC team [GitHub: xbmc/xbmc]
  2. HD audio: authored by DanielaE (that's me) [GitHub: DanielaE/xbmc]
  3. Global AV Delay: authored by a11599 (Istvan) [GitHub: a11599/xbmc]
  4. Settings, splash: authored by DDDamian (Damian) [Github: to be published]
Both builds have 1 and 2, Damians build has 3 and 4 on top of it. Now the choice is your's. Smile


- Dullie - 2012-02-15

I tested TrueHD track of The Dark Knight and every ten minutes or so I am losing audio and I get this annoying loud static noise, its like my Denon 3808CI AVR is receiving a different signal. So I stop the movie and play again and everything is back to normal ten minutes later it happens again. I am using nVidia GTX 460, and DDDamian build however I am not using the AV delay advanced settings combo. Anyone else experience this?


- eskro - 2012-02-15

outstanding work!!

thank you DanielaE and DDDamian!!


- disco277 - 2012-02-15

Thanks for clarifying Dani!


- DDDamian - 2012-02-15

mrhyde1969 Wrote:Since using this version when I pull up OSD I see that something else is being displayed 'ae',which is measured in 'ms' This seems to steadily go up that by the end of a 2hr film its showing as 11.1ms. Can anyone explain what this is please?

What you are seeing is the accumulated audio "error" or time-sync loss. Depending on hardware/settings this may accumulate quickly and reset as XBMC keeps the sync. I'm pretty sure based on what you report that you had "Adjust display refresh to match video" enabled - and if you're sure that the value didn't reset often during your watching then you can be happy that your 520gt is keeping quite close to the actual video rate Big Grin

Dullie Wrote:I tested TrueHD track of The Dark Knight and every ten minutes or so I am losing audio and I get this annoying loud static noise, its like my Denon 3808CI AVR is receiving a different signal. So I stop the movie and play again and everything is back to normal ten minutes later it happens again. I am using nVidia GTX 460, and DDDamian build however I am not using the AV delay advanced settings combo. Anyone else experience this?

This is the dreaded sync loss discussed earlier. Make sure your nVidia drivers (including the HDMI audio driver) are the very latest. I believe the nVidia controls allow for some tweaks to the 23.976hz refresh rate that AMD/ATI doesn't, but you'll have to research this. Tune that. Unfortunately the Global AV Delay won't help you here, but the driver update/tweak may help. If not you have to either replace the card, wait for a better solution or try unchecking the TrueHD passthrough and decode to LPCM for TrueHD. This is not such a bad thing (still lossless) unless it's a 24bit TrueHD track. See earlier posts for the whole 16bit/24bit thing.


- DDDamian - 2012-02-15

eskro Wrote:outstanding work!! thank you DanielaE and DDDamian!!

It's Daniela's work of genius - all I can say is how impressed I am at how "surgically" she managed to make this bit of magic happen, and having the talent and *ahem* balls to just roll up her sleeves and do it. Brilliant!


- DanielaE - 2012-02-15

And I am pleasantly honoured by your outstanding patience and perseverance guiding people through the pitfalls because of these myriads of hardware and driver combinations - I certainly appreciate that! Nod


- mrhyde1969 - 2012-02-15

[quote=DDDamian]What you are seeing is the accumulated audio "error" or time-sync loss. Depending on hardware/settings this may accumulate quickly and reset as XBMC keeps the sync. I'm pretty sure based on what you report that you had "Adjust display refresh to match video" enabled - and if you're sure that the value didn't reset often during your watching then you can be happy that your 520gt is keeping quite close to the actual video rate Big Grin



Hi thanks for that. I dont have Adjust display refresh rate enabled,infact all video settings are standard.I only have "verticle blank sync" enabled


- DDDamian - 2012-02-15

mrhyde1969 Wrote:Hi thanks for that. I dont have Adjust display refresh rate enabled,infact all video settings are standard.I only have "verticle blank sync" enabled

Then you are getting very fine sync indeed if that was 24p video! All good Big Grin


- DDDamian - 2012-02-15

DanielaE Wrote:And I am pleasantly honoured by your outstanding patience and perseverance guiding people through the pitfalls because of these myriads of hardware and driver combinations - I certainly appreciate that! Nod

Judging by the "custom speakers" in your sig we both enjoy good audio Big Grin


- voip-ninja - 2012-02-16

okay here is the log output from the true-hd audio drop; also i am using the advanced settings that was provided earlier that does the lip sync fix. i have refresh to display set to on, match framerate to source set to on with audio resample as the clocking method. fullscreen window instead of true fullscreen ON.

Code:
19:26:53 T:1792  NOTICE: Creating audio thread
19:26:53 T:1792  NOTICE: Opening Subtitle stream: 2 source: 256
19:26:53 T:1792   DEBUG: FactoryCodec - Overlay: FFmpeg Subtitle Decoder - Opening
19:26:53 T:1388   DEBUG: Thread CDVDPlayerAudio start, auto delete: 0
19:26:53 T:1388  NOTICE: running thread: CDVDPlayerAudio::Process()
19:26:53 T:1792   DEBUG: FactoryCodec - Overlay: FFmpeg Subtitle Decoder - Opened
19:26:53 T:1792   DEBUG: CEdl::ReadEditDecisionLists - Checking for edit decision lists (EDL) on local drive or remote share for: smb://BOGART/Movies/Kung Fu Panda 2/Kung Fu Panda 2.mkv
19:26:53 T:1792   DEBUG: CDVDPlayer::SetCaching - caching state 2
19:26:53 T:1388    INFO: CDVDAudioCodecPassthroughFFmpeg::SyncMLP - Dolby TrueHD stream detected (48000Hz)
19:26:53 T:2404   DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE
19:26:53 T:2404    INFO: CDVDPlayerVideo - Stillframe left, switching to normal playback
19:26:53 T:1388   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_RESYNC(7000.000000, 1)
19:26:53 T:1388  NOTICE: Creating audio device with codec id: 86063, channels: 8, sample rate: 192000, pass-through
19:26:53 T:1792   DEBUG: CDVDPlayer::CheckPlayerInit - dropping packet type:2 dts:42000.000000 to get to start point at 83000.000000
19:26:53 T:1388   DEBUG: CWin32WASAPI::Initialize: endpoint device PanasonicTV0 (Intel(R) Display Audio)
19:26:53 T:1388   DEBUG: CAudioContext::SetActiveDevice - SetActiveDevice from 2 to 0
19:26:53 T:1388   DEBUG: CAudioContext::RemoveActiveDevice - Removing device 2
19:26:53 T:1388   DEBUG: CGUIAudioManager::DeInitialize
19:26:53 T:2404   DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_RESYNC(83000.000000, 0)
19:26:53 T:2404  NOTICE:  fps: 23.976024, pwidth: 1920, pheight: 1080, dwidth: 1920, dheight: 1080
19:26:53 T:2404   DEBUG: CDVDPlayerVideo::OutputPicture - change configuration. 1920x1080. framerate: 23.98. format: YV12
19:26:53 T:2404  NOTICE: Display resolution ADJUST : 1920x1080 @ 23.98 - Full Screen (39) (weight: 0.000)
19:26:53 T:2404   DEBUG: CWinRenderer::SelectRenderMethod: Requested render method: 0
19:26:53 T:2404   DEBUG: CWinShader::LoadEffect - loading shader special://xbmc/system/shaders/testshader.fx
19:26:53 T:2208   DEBUG: CGUIInfoManager::SetCurrentMovie(smb://BOGART/Movies/Kung Fu Panda 2/Kung Fu Panda 2.mkv)
19:26:53 T:2208   DEBUG: CVideoDatabase::GetMovieId (smb://BOGART/Movies/Kung Fu Panda 2/Kung Fu Panda 2.mkv), query = select idMovie from movie where idFile=131
19:26:53 T:2208   DEBUG: CVideoDatabase::LoadVideoInfo, got movie info!
19:26:53 T:2208   DEBUG:   Title = Kung Fu Panda 2
19:26:53 T:2208   DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc
19:26:53 T:2208   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPlay
19:26:53 T:1388   DEBUG: CWin32WASAPI::Initialize: Packet Size = 30720. Avg Bytes Per Second = 3072000.
19:26:53 T:1388   DEBUG: CWin32WASAPI::Initialize - Channels: 8 - SampleRate: 192000 - SampleBit: 16 - Resample false - IsMusic false - IsPassthrough 5 - audioDevice: PanasonicTV0 (Intel(R) Display Audio)
19:26:53 T:1388   DEBUG: CDVDPlayerAudio:: synctype set to 0: clock feedback
19:26:53 T:2404   DEBUG: CWinRenderer::SelectRenderMethod: Selected render method 1: Pixel Shaders
19:26:53 T:2404   DEBUG: CVideoReferenceClock: Clock speed 100.100000%
19:26:53 T:2208   DEBUG: created video buffer 0
19:26:53 T:2208   DEBUG: created video buffer 1
19:26:53 T:2208   DEBUG: CWinShader::LoadEffect - loading shader special://xbmc/system/shaders/yuv2rgb_d3d.fx
19:26:53 T:2208   DEBUG: Activating window ID: 12005
19:26:53 T:2208   DEBUG: ------ Window Deinit (MyVideoNav.xml) ------
19:26:53 T:1792   DEBUG: CDVDPlayer::HandleMessages - player started 1
19:26:53 T:2208   DEBUG: CAnnouncementManager - Announcement: OnPause from xbmc
19:26:53 T:2208   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPause
19:26:53 T:2208   DEBUG: CDVDPlayer::SetGlobalAVDelay: Global AV delay applied and set to -125 msec
19:26:53 T:2208   DEBUG: CWinSystemWin32::SetFullScreen (true fullscreen) on screen 0 with size 1920x1080, refresh 23.976023
19:26:53 T:3964   DEBUG: Thread CDelayedMessage start, auto delete: 1
19:26:53 T:2208   DEBUG: ------ Window Init (VideoFullScreen.xml) ------
19:26:53 T:2208    INFO: Loading skin file: VideoFullScreen.xml
19:26:53 T:2208   DEBUG: ------ Window Init (Pointer.xml) ------
19:26:53 T:2208   DEBUG: ------ Window Init (DialogSeekBar.xml) ------
19:26:53 T:2208   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
19:26:53 T:1792   DEBUG: CDVDPlayer::HandleMessages - player started 2
19:26:55 T:3964   DEBUG: Thread CDelayedMessage 3964 terminating (autodelete)
19:26:55 T:1388   DEBUG: CDVDPlayerAudio:: synctype set to 1: skip/duplicate
19:26:55 T:1388   DEBUG: CDVDPlayerAudio:: Discontinuity - was:7000.000000, should be:2.318348, error:-6997.681652
19:26:55 T:2208   DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc
19:26:55 T:2208   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPlay
19:26:55 T:2120   DEBUG: CVideoReferenceClock: Displaymode changed
19:26:55 T:2120   DEBUG: CVideoReferenceClock: Cleaning up Direct3d
19:26:55 T:2120   DEBUG: CVideoReferenceClock: Setting up Direct3d
19:26:55 T:2120   DEBUG: CVideoReferenceClock: detected refreshrate: 23 hertz, assuming 24 hertz
19:26:55 T:2404   DEBUG: CVideoReferenceClock: Clock speed 100.100000%
19:26:55 T:2208   DEBUG: ------ Window Deinit (DialogSeekBar.xml) ------
19:26:56 T:1388   DEBUG: CDVDPlayerAudio:: Duplicating packet of 20.00 ms duration
19:27:00 T:2208   DEBUG: ------ Window Deinit (Pointer.xml) ------
19:27:00 T:2404   DEBUG: CPullupCorrection: detected pattern of length 1: 41708.33, frameduration: 41708.333333
19:27:06 T:2208   DEBUG: SDLKeyboard: scancode: 18, sym: 006f, unicode: 006f, modifier: 0



- DDDamian - 2012-02-16

Yep, you lost sync alright. BTW, resample is the same as drop/dupe when bitstreaming. You can't "resample" without decoding.

Is it still happening if you run true fullscreen as discussed? (Not fullscreen window mode)?

If so, for now anyways you may have to decide whether you prefer a video frame drop, audio frame drop or decoding so you can resample.

Or get an ATI Laugh


- voip-ninja - 2012-02-16

I am running true fullscreen mode. What I don't understand is why I don't have this problem with any other audio format. Thanks for taking a look.


- bluray - 2012-02-16

voip-ninja Wrote:I am running true fullscreen mode. What I don't understand is why I don't have this problem with any other audio format. Thanks for taking a look.
As I said very often, Intel made great CPU but they are behind AMD/Nvidia on GPU. They should have bought Nvidia when they had a chance. Maybe, it's time to spend $35 on HD6450. You'll have more time to enjoy the movie! Smile


- DDDamian - 2012-02-16

voip-ninja Wrote:I am running true fullscreen mode. What I don't understand is why I don't have this problem with any other audio format. Thanks for taking a look.

NP - there's quite a few things that could cause this from a bad bit in the data to a buffer under-run to a background service starting up. Won't be easy to eliminate 100% on all hardware thus the suggestions.