Jerky playback Dharma B2 and SVN /Ion

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
bobo1on1 Offline
cheapass Team-XBMC Developer
Posts: 2,758
Joined: Dec 2008
Reputation: 22
Post: #31
If you turn on sync playback to display, you can see a sync and an error value when you press 'o' during playback, you want that sync value to remain stable.

However if you get a constantly drifting a/v sync without sync playback to display, then there's either a problem with the file you're playing or the soundcard is running at a slightly different speed than the system clock.
find quote
TheSwissKnife Offline
Fan
Posts: 325
Joined: Sep 2010
Reputation: 17
Post: #32
bobo1on1 Wrote:If you turn on sync playback to display, you can see a sync and an error value when you press 'o' during playback, you want that sync value to remain stable.

However if you get a constantly drifting a/v sync without sync playback to display, then there's either a problem with the file you're playing or the soundcard is running at a slightly different speed than the system clock.

ok...so

1. with "sync to display" the "a/v" and "sync" drift represent a difference between vsync rate and audio clock.
2. without "sync to display" the "a/v" drift represents a difference between system clock and audio clock.

The "sync" value is a percentage of a frame time I assume. The error value I have no idea about.

The audio clock adjust method to compensate for any discrepancy in either case should give the least quality reduction in audio. Can you please confirm that this should work with passthrough - at least within some limited range of discrepancy between the appropriate clocks.

It seems for now that I need to set "sync to display" and keep adjusting the refreshrate until I find the one that keeps the same "sync" value for as long as possible. Currently I have this at a drift of 1% per 5mins (for 23.976).

EDIT: but note that I have trouble with the vblanks "missed" value increasing forever at (3-10per sec), especially when pressing the movie info button
find quote
bobo1on1 Offline
cheapass Team-XBMC Developer
Posts: 2,758
Joined: Dec 2008
Reputation: 22
Post: #33
Don't worry about the missed vblanks, it automatically compensates for them.
It does indicate that your system could be under high cpu/gpu load.
(This post was last modified: 2010-10-04 17:16 by bobo1on1.)
find quote
TheSwissKnife Offline
Fan
Posts: 325
Joined: Sep 2010
Reputation: 17
Post: #34
bobo1on1 Wrote:Don't worry about the missed vblanks, it automatically compensates for them.
It does indicate that your system could be under high cpu/gpu load.

Well it is certainly not under high CPU load, and the GPU figures look low too. The card can handle much much higher frame rates and bitrates than I am using at present that it for sure. Perhaps something to do with the return path to overlay the info, and the PCI x1 lane being used?
find quote
bobo1on1 Offline
cheapass Team-XBMC Developer
Posts: 2,758
Joined: Dec 2008
Reputation: 22
Post: #35
That's possible.
find quote
TheSwissKnife Offline
Fan
Posts: 325
Joined: Sep 2010
Reputation: 17
Post: #36
I may buy a card for further testing in a different machine to isolate the cause of this.

Thanks for your help.

Could you please reply on the issue of passthrough though. I want to be sure whe using passthrough which modes of compensation are possible (As your comment prior has me worried that none will work).
find quote
bobo1on1 Offline
cheapass Team-XBMC Developer
Posts: 2,758
Joined: Dec 2008
Reputation: 22
Post: #37
You can use audio clock or drop/dupe, but if the refreshrate differs too much from the video fps, you get jerks with audio clock and audio distortion with drop/dupe.
find quote
TheSwissKnife Offline
Fan
Posts: 325
Joined: Sep 2010
Reputation: 17
Post: #38
jerks in audio or video?
find quote
bobo1on1 Offline
cheapass Team-XBMC Developer
Posts: 2,758
Joined: Dec 2008
Reputation: 22
Post: #39
Video.
find quote
TheSwissKnife Offline
Fan
Posts: 325
Joined: Sep 2010
Reputation: 17
Post: #40
Assuming I can get a close match then issue becomes what does xbmc choose as its video/audio offset each time a movie is played. It seems every time I play I get a different starting sync value - which I assume implies a different offset between the two. This would mean up to 40ms swing in audio sync that would have to be adjusted manually each time movie is played. Am I wrong?
find quote
bobo1on1 Offline
cheapass Team-XBMC Developer
Posts: 2,758
Joined: Dec 2008
Reputation: 22
Post: #41
Well the a/v sync in the codec info isn't entirely correct, dvdplayer does a good job of keeping things in sync, you don't have to look at that value every time and manually adjust the sync.
find quote
TheSwissKnife Offline
Fan
Posts: 325
Joined: Sep 2010
Reputation: 17
Post: #42
Well I have been trying to use this method now for a few hours and I am not getting anywhere. If I adjust the refresh rate of the card across 23.974->23.986Hz over many small iterations I always see the sync value drift downwards (ie -1 every period). At the 23.974 end I see the audio discontinuity appear as +10ms and at the 23.986 end I see this as -10ms. It seems though that adjusting the refresh rate also adjusts the audio clock (because they are the same card - hdmi), and thus does not really get me anywhere in this "sync to display mode". In this way all I am really doing I guess is trying to get source file frame rate to match the refresh rate - though it is not clear how to see this from anything xbmc presents in "o" code info panel. I am not sure that the measurerefreshrate settting in advancedsettings.xml is doing much to help though I can see it parses successfully.

I have not given up yet but I can see now why some people return to their settop boxes (PCH etc).
find quote
TheSwissKnife Offline
Fan
Posts: 325
Joined: Sep 2010
Reputation: 17
Post: #43
I assume this is used to get an accurate value to build the clock's scale? Any idea how I know this "measurerefreshrate" setting is working eg what message in the log file?

Currently no matter what refresh rate I tweak to, I seem to see in the log file that it thinks it is 23.976023 Hz.
find quote
bobo1on1 Offline
cheapass Team-XBMC Developer
Posts: 2,758
Joined: Dec 2008
Reputation: 22
Post: #44
Measurerefreshrate is only useful if windows doesn't report the refreshrate correctly, and it will always round the measurement to the nearest integer, the adjustment of the clock speed based on video fps will cancel that out, so if your refreshrate is 23.976 hertz, xbmc will round that to 24, then on 23.976 fps video it will speed up the clock by 0.1%, so on every vblank interval the clock is updated by 1/24 * 1.001 second, which happens to be equal to 1/23.976 second.

Also, measuring the refreshrate is not very accurate because it doesn't measure for very long.
find quote
TheSwissKnife Offline
Fan
Posts: 325
Joined: Sep 2010
Reputation: 17
Post: #45
Oh so the measurerefreshrate is not going to help me. I have now gathered that the "sync" value is now based on the 24Hz mode as it likes to drift by 1ms every 40'ish seconds - and after a complete cycle of 100% it does not necessarily update the clock. This makes the value not at all useful in trying to fine tune the refresh rate. In addition it is not very intuitive (just like seeing the .1% adjust value), given that we are dealing here with 23.976 material. This should really be documented somewhere as it would save people the pain I have been through.

I am now close to getting a refreshrate that completely eliminates the audio correction debug lines (at least for my test case file [m2ts h.264 dd5.1, duration 105mins - copy from bluray]). Will post my results if there is interest.
find quote
Post Reply