2010-10-22, 14:43
You should check CXBMCRenderManager::WaitPresentTime, it takes the clock speed into account when calculating the error, so sync will only drift on a discontinuity or if the fps of the videofile is reported wrong.
bobo1on1 Wrote:You should check CXBMCRenderManager::WaitPresentTime, it takes the clock speed into account when calculating the error, so sync will only drift on a discontinuity or if the fps of the videofile is reported wrong.
bobo1on1 Wrote:If no discontinuities are happening, that means the fps for the file is reported incorrectly, and changing the refreshrate won't fix that.
129 int fps = g_VideoReferenceClock.GetRefreshRate();
...
139 double frametime = g_VideoReferenceClock.GetSpeed() / fps;
140
141 //the videoreferenceclock updates its clock on every vertical blank
142 //we want every frame's presenttime to end up in the middle of two vblanks
143 //if CDVDPlayerAudio is the master clock, we add a correction to the presenttime
144 if (ismaster)
139 double frametime = g_VideoReferenceClock.GetSpeed() / fps;
140
141 //the videoreferenceclock updates its clock on every vertical blank
142 //we want every frame's presenttime to end up in the middle of two vblanks
143 //if CDVDPlayerAudio is the master clock, we add a correction to the presenttime
144 if (ismaster)
145 presenttime += m_presentcorr * frametime;
146
147 double clock = CDVDClock::WaitAbsoluteClock(presenttime * DVD_TIME_BASE) / DVD_TIME_BASE;
148 double target = 0.5;
149 double error = ( clock - presenttime ) / frametime - target;
150
151 m_presenterr = error;
152
153 // correct error so it targets the closest vblank
154 error = wrap(error, 0.0 - target, 1.0 - target);
Option "Coolbits" "1"
Quote: Option "Coolbits" "1"
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x1; PowerMizerDefault=0x1; PowerMizerDefaultAC=0x1; PowerMizerHardLevel=0x1 PowerMizerHardLevelAC=0x1;"
Quote:nvidia-settings -a [gpu:0]/GPU2DClockFreqs=500,700
The valid values for 'GPU2DClockFreqs' are in the ranges 33 - 270, 33 - 162
(inclusive).
'GPU2DClockFreqs' can use the following target types: X Screen, GPU.
bobo1on1 Wrote:XBMC can be considered 3D.
bobo1on1 Wrote:In CDVDPlayerVideo::CalcFrameRate, check if there's a difference between framerate and m_fFrameRate, when frameduration != DVD_NOPTS_VALUE, if there is, try lowering MAXFRAMERATEDIFF.
"framerate was:%f calculated: %f"
TheSwissKnife Wrote:This can't be the case since I never get any of the debug messages.Not necessarily, there can be a small difference between the reported fps and the calculated one, otherwise it would constantly recalculate it.
Code:"framerate was:%f calculated: %f"
Quote:I am looking at the code now with Linux build (trunk) and I don't get the "sync" value drift that I get with Windows but I am happy to continue using this for understanding purposes for now. In my linux case with the refresh rate I am currently using my avgerror value converges down to -0.000003197 and stays exactly there. I know this value is small but I was wondering what it represents - is it just the unaccounted time taken to execute instructions eg in CDVDClock::WaitAbsoluteCLock?