[PATCH] Global AV delay support via advancedsettings.xml

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
DDDamian Offline
Team-XBMC Developer
Posts: 3,030
Joined: Sep 2011
Reputation: 254
Location: Canada
Post: #76
Hmmmm... these are very worthwile observations. Can you guys pls continue to post your findings as to whether this seems to be just a DTS issue?

System: XBMC HTPC with HDMI WASAPI & AudioEngine - Denon AVR-3808CI - Denon DVD-5900 Universal Player - Denon DCM-27 CD-Changer
- Sony BDP-S580 Blu-Ray - X-Box 360 - Android tablet wireless remote - 7.1 Streem/Axiom/Velodyne Surround System
If I have been able to help feel free to add to my reputation +/- below - thanks!
find quote
negge Offline
Team-Kodi Member
Posts: 2,350
Joined: Dec 2010
Reputation: 25
Location: Finland
Post: #77
I just tried playing a file with DD audio and one with DTS. Looking at the logs this is the only interesting piece I found:

Code:
19:26:16 T:2833431408   DEBUG: CDVDPlayerAudio:: synctype set to 0: clock feedback
19:26:16 T:2833431408   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_RESYNC(32000.000000, 1)
19:26:16 T:2833431408   DEBUG: CDVDPlayerAudio:: Discontinuity - was:152.902000, should be:0.000000, error:-152.902000

This happens on both files.

Edit: Here's (http://pastebin.com/raw.php?i=DrcQgvHr) a full partial log from when first playing a file with DD5.1 audio (which doesn't seem to lag, although I'm honestly not 100% certain) and a movie with DTS sound which IIRC lags.
(This post was last modified: 2012-02-19 19:40 by negge.)
find quote
sebj Offline
Senior Member
Posts: 184
Joined: Nov 2008
Reputation: 0
Post: #78
Interesting info.

Great to see movement in this area.

My sync problems, however are codec agnostic.Confused

Every single 23.976 file has to have audio corrected, be it dts,acs or mono aac.

The patch works flawlessly in my setup.
find quote
negge Offline
Team-Kodi Member
Posts: 2,350
Joined: Dec 2010
Reputation: 25
Location: Finland
Post: #79
In my case it seems the "discontinuity" value from the logs is the amount I need to delay the audio by. Of course it's practically impossible to be sure of that since nobody can hear a 1ms lag, but I usually set my delay to somewhere between 150 and 200 depending on source.
find quote
DDDamian Offline
Team-XBMC Developer
Posts: 3,030
Joined: Sep 2011
Reputation: 254
Location: Canada
Post: #80
It's not unusual to see one Global Sync at the start of playback as well.

System: XBMC HTPC with HDMI WASAPI & AudioEngine - Denon AVR-3808CI - Denon DVD-5900 Universal Player - Denon DCM-27 CD-Changer
- Sony BDP-S580 Blu-Ray - X-Box 360 - Android tablet wireless remote - 7.1 Streem/Axiom/Velodyne Surround System
If I have been able to help feel free to add to my reputation +/- below - thanks!
find quote
negge Offline
Team-Kodi Member
Posts: 2,350
Joined: Dec 2010
Reputation: 25
Location: Finland
Post: #81
@DDDamian: have you seen this thread: http://forum.xbmc.org/showthread.php?tid=82896? I wonder if there's something similar going on. I guess I could try remuxing a file that lags to see if it makes it any better.
find quote
DDDamian Offline
Team-XBMC Developer
Posts: 3,030
Joined: Sep 2011
Reputation: 254
Location: Canada
Post: #82
Hi negge - I do know some of the background to it, and the issues with the time stamps. It's part of the joy of so many rippers/muxers/recoders being out there that it's hit and miss as to whether the sync frames are correct.

If you have the patience to try remuxing some problematic files, please do. The more info on what works/what doesn't the better!

System: XBMC HTPC with HDMI WASAPI & AudioEngine - Denon AVR-3808CI - Denon DVD-5900 Universal Player - Denon DCM-27 CD-Changer
- Sony BDP-S580 Blu-Ray - X-Box 360 - Android tablet wireless remote - 7.1 Streem/Axiom/Velodyne Surround System
If I have been able to help feel free to add to my reputation +/- below - thanks!
find quote
Hack_kid Offline
Fan
Posts: 646
Joined: Jan 2007
Reputation: 4
Post: #83
dude its all files, trust me i have spend 100s of hours beating my head against the wall on this one, save the brain cells (and your walls) no other apps do it (some might on files thatactually do have a timestamp problem but not to the consisitanty of xbmc this patch totally fixes it it just has a small bug about clearing its settings from memory so if you use it for anything other then 250ms 24htz oos bug its pointless but.... hey it works
find quote
sebj Offline
Senior Member
Posts: 184
Joined: Nov 2008
Reputation: 0
Post: #84
https://github.com/xbmc/xbmc/pull/713

New patch?

Tried to apply this :

https://github.com/xbmc/xbmc/pull/713.patch


got a compile error
Quote: APPLY PATCH: packages/mediacenter/xbmc/patches/xbmc-1fef727-002-av-delay.patch
patching file xbmc/cores/VideoRenderers/RenderManager.cpp
patching file xbmc/cores/VideoRenderers/RenderManager.h
patching file xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Hunk #1 succeeded at 1110 (offset -3 lines).
patching file xbmc/settings/AdvancedSettings.cpp
Hunk #1 succeeded at 534 (offset -1 lines).
Hunk #2 succeeded at 1087 (offset -3 lines).
patching file xbmc/settings/AdvancedSettings.h
Hunk #3 succeeded at 313 (offset -1 lines).
patching file xbmc/cores/VideoRenderers/RenderManager.cpp
patching file xbmc/cores/VideoRenderers/RenderManager.h
patching file xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Hunk #1 succeeded at 1110 (offset -3 lines).
patching file xbmc/settings/AdvancedSettings.cpp
Hunk #1 succeeded at 535 (offset -1 lines).
Hunk #2 succeeded at 1090 (offset -3 lines).
patching file xbmc/settings/AdvancedSettings.h
Hunk #3 succeeded at 314 (offset -1 lines).
patching file xbmc/cores/VideoRenderers/RenderManager.cpp
patching file xbmc/settings/AdvancedSettings.cpp
Hunk #1 succeeded at 534 (offset -1 lines).
patching file xbmc/video/windows/GUIWindowFullScreen.cpp
patching file xbmc/cores/VideoRenderers/RenderManager.cpp
patching file xbmc/cores/VideoRenderers/RenderManager.h
patching file xbmc/cores/dvdplayer/DVDPlayer.cpp
Hunk #1 succeeded at 2424 (offset -9 lines).
patching file xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
patching file xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Hunk #1 succeeded at 1110 (offset -3 lines).
patching file xbmc/settings/AdvancedSettings.cpp
Hunk #1 succeeded at 370 (offset -1 lines).
Hunk #2 succeeded at 575 (offset -1 lines).
Hunk #3 succeeded at 1091 (offset -3 lines).
patching file xbmc/video/windows/GUIWindowFullScreen.cpp
patching file xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
patching file xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Hunk #1 succeeded at 1108 (offset -3 lines).
patching file xbmc/cores/VideoRenderers/RenderManager.cpp
patching file xbmc/cores/VideoRenderers/RenderManager.h
patching file xbmc/cores/dvdplayer/DVDPlayer.cpp
Hunk #1 succeeded at 2424 (offset -9 lines).
patching file xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Hunk #1 succeeded at 1108 (offset -3 lines).
patching file xbmc/settings/AdvancedSettings.cpp
Hunk #1 succeeded at 370 (offset -1 lines).
Hunk #2 FAILED at 540.
Hunk #3 succeeded at 1047 (offset -3 lines).
1 out of 3 hunks FAILED -- saving rejects to file xbmc/settings/AdvancedSettings.cpp.rej
patching file xbmc/settings/AdvancedSettings.h
Hunk #3 succeeded at 314 (offset -1 lines).
make: *** [release] Error 1
(This post was last modified: 2012-02-23 07:48 by sebj.)
find quote
a11599 Offline
Team-Kodi Member
Posts: 305
Joined: Sep 2010
Reputation: 3
Location: Budapest, Hungary
Post: #85
Try this one, this is a single patch of all the commits in that pull: http://pastebin.com/rxjDVyL3. Or you can also get this single diff here: https://github.com/xbmc/xbmc/pull/713.diff

Also make sure to change your advancedsettings as described in the pull before testing. No new functionality in this patch, just a refactor. But it is always nice to have test reports.

My patches (source code) :: Windows installer builds
These builds are unofficial! If you find a bug, make sure it is also present in a recent official build and you can reproduce it before filing a ticket.
(This post was last modified: 2012-02-23 08:07 by a11599.)
find quote
sebj Offline
Senior Member
Posts: 184
Joined: Nov 2008
Reputation: 0
Post: #86
Ok, I'll test this, but it's still not compiling for either :

I'm using the patches in openelec and it's prerty easy I have to drop this in a file and it compiles, butit chokes.

Trying to applythis directly on 1fef727 xbmc beta 3 main

Anyways, adding .diff rather than .patch to the url gives this :

APPLY PATCH: packages/mediacenter/xbmc/patches/xbmc-1fef727-002-av-delay.patch
patching file xbmc/cores/VideoRenderers/RenderManager.cpp
patching file xbmc/cores/VideoRenderers/RenderManager.h
patching file xbmc/cores/dvdplayer/DVDPlayer.cpp
Hunk #1 succeeded at 2424 (offset -9 lines).
patching file xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Hunk #1 succeeded at 1108 (offset -3 lines).
patching file xbmc/settings/AdvancedSettings.cpp
Hunk #1 FAILED at 540.
Hunk #2 succeeded at 1046 (offset -3 lines).
1 out of 2 hunks FAILED -- saving rejects to file xbmc/settings/AdvancedSettings.cpp.rej
patching file xbmc/settings/AdvancedSettings.h
Hunk #3 succeeded at 313 (offset -1 lines).
make: *** [release] Error 1
find quote
a11599 Offline
Team-Kodi Member
Posts: 305
Joined: Sep 2010
Reputation: 3
Location: Budapest, Hungary
Post: #87
Something in mainline is conflicting with the diff. Maybe something was changed in between that does not allow the patch to be applied directly to current master. You can just insert the rejected part manually.

My patches (source code) :: Windows installer builds
These builds are unofficial! If you find a bug, make sure it is also present in a recent official build and you can reproduce it before filing a ticket.
find quote
sebj Offline
Senior Member
Posts: 184
Joined: Nov 2008
Reputation: 0
Post: #88
You can't just insert the rejected part manually as far as I know it unpacks the source just runs the patches and aborts.

It's actually pretty slick and they've done a cool job of programming the build process.

Is your branch that different from master?
find quote
negge Offline
Team-Kodi Member
Posts: 2,350
Joined: Dec 2010
Reputation: 25
Location: Finland
Post: #89
I did some testing the other day but I haven't found anything by looking at the logs as to what is causing the delay on some files and not on some others. I also tried remuxing a video that was known to have issues with the newest mkvmerge but it had no effect.

What someone should try:

1. Find a video clip that has delay issues.
2. Try any of the following:

* remux with different options in mkvmerge
* remuxing to a different container (like AVI)
* playing file without hardware acceleration (to rule out whether it's e.g. a VDPAU-specific issue)
* anything

There must be something that is causing this aside from the refresh rate change as I have a few videos which do not have any issues even though they play at 24fps.
(This post was last modified: 2012-02-24 12:36 by negge.)
find quote
sebj Offline
Senior Member
Posts: 184
Joined: Nov 2008
Reputation: 0
Thumbs Up   
Post: #90
https://github.com/xbmc/xbmc/pull/713#is...nt-4162815

Quote:elupus merged commit 9a60f0c into xbmc:master from a11599:audiodelay 6 minutes ago

Does this mean the feature has now hit eden? Laugh
find quote
Post Reply