• 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
  • 20
Jerky playback Dharma B2 and SVN /Ion
I would expect the averaging to take care of that though.
You could interpolate the time in CVideoReferenceClock::GetTime by using the difference between the last vblank time and the system time, but since there is jitter in the vblank signal that might not be a very good solution, I'd would rather see that CDVDPlayerAudio can handle the clock jitter.
Reply
bobo1on1 Wrote:I would expect the averaging to take care of that though.

Not quite - after a discontinuity occurs the Discontinuity function goes and calls the g_VideoReferenceClock.GetTime() to reset the startclock (m_startClock) which may well have ticked forward a video frame duration since the discontinuity error was detected yet only a tiny time may have elapsed. It will then apply the discontinuity to m_iDisc and thereafter everything has a good chance to be out by much larger than a video frame time.
Reply
Ah right, nice catch, I'll look into that.
Reply
I am finding other problems while analysing what might be a better method.

The DVDClock.SetSpeed setting of m_startClock from DVDPlayer thread appears to conflict with the audio thread as it spots a discontinuity upon resume from pause. Also it seems the expression used in SetSpeed to adjust based on the playback speed seems like it might need some casting - I am not sure until I can rule out other threads corrupting the data - but the results are certainly bogus and when I casted they seemed better.

EDIT: I have now added a break statement in CDVDClock:: Discontinuity CLOCK_DISC_NORMAL case if m_pauseClock is set. I could be wrong but it seems to help with un-pausing.

EDIT2: I have subsequently adjusted the HandleSyncError() calls to Discontinuity() by passing the negated error value as the delay parameter, and changing Discontinuity() function so that is does not first set m_startClock to the reference clock GetTime() - though it still adjusts by the delay parameter as before. Finally I change GetClock() to not include m_iDisc in its result. Hey presto I am now moving the start clock position by the averaged error value rather than moving it to the current reference time when a discontinuity occurs. This appears to work well so far - but I will test more thoroughly. I will then attempt to tweak GetClock to provide values in between reference clock ticks to completely remove the frame duration related swings which should make averaging super accurate and tracking the drift very easy...
Reply
I'd like to see some patches for this so I can play along too Smile
Reply
This patch reasonably interpolates between vblanks: http://pastebin.ubuntu.com/526409/
Reply
bobo1on1 Wrote:This patch reasonably interpolates between vblanks: http://pastebin.ubuntu.com/526409/

Oh you have chosen to have the video reference clock interpolate. I kind of liked having that clock tick in line with video frames, and would prefer to see only the DVDClock do that - do you have reason for your choice.

BTW, I have video reference now ticking extremely close to perfectly without using fineadjust from video pts timestamps - a further tiny tweak from my previous fine tuning patch. It now drifts around 1 nanosecond every 2 minutes, so essentially it should never be the cause of a video frame drop/dup.
Reply
davilla Wrote:I'd like to see some patches for this so I can play along too Smile

Well not being a developer I am not geared up yet for proper code control and diff management...I have tons of debug lines added throughout to help me understand. I am a proper rookie! However, once I have a reasonably complete set of adjustments I will apply to a fresh trunk copy and try to generate the diffs. I am happy you are interested and will endeavour to pass on what I have done.
Reply
TheSwissKnife Wrote:Oh you have chosen to have the video reference clock interpolate. I kind of liked having that clock tick in line with video frames, and would prefer to see only the DVDClock do that - do you have reason for your choice.

How can you interpolate from DVDClock when you don't know what to interpolate between.

TheSwissKnife Wrote:Well not being a developer I am not geared up yet for proper code control and diff management...I have tons of debug lines added throughout to help me understand. I am a proper rookie! However, once I have a reasonably complete set of adjustments I will apply to a fresh trunk copy and try to generate the diffs. I am happy you are interested and will endeavour to pass on what I have done.
You should use git, it gives you a local repo to commit to.
Reply
bobo1on1 Wrote:This patch reasonably interpolates between vblanks: http://pastebin.ubuntu.com/526409/

Also I don't think it is correct to the include the frequency components. They are surely only for adjustments based on using the RefreshRate value. The vBlankTimes actually do tick quite close to system time to I would think to just use the diff but cap it at a max of exactly 1 period so the clock can never go backwards.
Reply
bobo1on1 Wrote:How can you interpolate from DVDClock when you don't know what to interpolate between.

I was going to use the same solution (m_vblankTime) but access it from DVDClock.


Quote:You should use git, it gives you a local repo to commit to.

Thanks for the tip...another learning curve I guess...
Reply
No, you have to adjust for the clock speed.
I guess you could add a method to CVideoReferenceClock to return vblank time or the interpolated time.
Reply
bobo1on1 Wrote:No, you have to adjust for the clock speed.

Well I don't see that - my ticks are currently every 41.702ms (system clock time) for 23.976p ie speed = 1.001. Are you sure?

Quote:I guess you could add a method to CVideoReferenceClock to return vblank time or the interpolated time.

Yes
Reply
TheSwissKnife Wrote:Well I don't see that - my ticks are currently every 41.702ms for 23.976p ie speed = 1.001. Are you sure?
What if you have a refreshrate of 25 hertz, and increase the clock speed by 4.27%, same tick increase, but it happens every 40 ms.
Reply
TheSwissKnife Wrote:Well not being a developer I am not geared up yet for proper code control and diff management...I have tons of debug lines added throughout to help me understand. I am a proper rookie! However, once I have a reasonably complete set of adjustments I will apply to a fresh trunk copy and try to generate the diffs. I am happy you are interested and will endeavour to pass on what I have done.

if you are doing svn co's, then svn diff will give the diffs from the version you have checked out and the local changes. svn diff > my.patch
Reply
  • 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
  • 20

Logout Mark Read Team Forum Stats Members Help
Jerky playback Dharma B2 and SVN /Ion0