home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Watch / Listen Media
watch/edit Videos
Audio sync problems when screen set to 24 Hz
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="tourettes" data-source="post: 508308" data-attributes="member: 10858"><p>I'm still wondering why it seems to plague only 24fps files. About the clock inaccuracy, we could wake up (say 5 ms early) and then use some busy looping to sleep the rest of the time to reach the target. This is actually used in many game engines to get the exact position. Also with Vista we can use the Multimedia Scheduler to boost the priority (it will quarantee pretty good timing, much better than with XP).</p><p></p><p><strong>update:</strong> The timer code is at least a little bit buggy on current SVN version (not sure if it has any big enough inaccuraties that would trigger any side effects, but here is something that I have been using while implementing the improved syncing. Maybe it would be worth to test if it reduces the dropped frames you are seeing (I see zero late frames on my own testing with PAL material).</p><p></p><p>[code]</p><p>static CCritSec lock; // lock for timer initialization (multiple threads are using the timer during startup)</p><p></p><p>static LONGLONG GetCurrentTimestamp()</p><p>{</p><p> LONGLONG ticks100ns;</p><p> {</p><p> CAutoLock lock(&lock);</p><p> if( !g_bTimerInitializer ) </p><p> {</p><p> g_bQPCAvail = QueryPerformanceFrequency( &g_liQPCFreq );</p><p> Log("GetCurrentTimestamp(): Performance timer available: %d", g_bQPCAvail);</p><p> g_bTimerInitializer = true;</p><p> }</p><p> }</p><p></p><p> if( g_bQPCAvail ) </p><p> {</p><p> // [url]http://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx[/url]</p><p> // Use always the same CPU core (no clue if it actually makes any difference...)</p><p> DWORD_PTR oldmask = SetThreadAffinityMask(::GetCurrentThread(), 0);</p><p></p><p> QueryPerformanceCounter ((LARGE_INTEGER*)&ticks100ns);</p><p> ticks100ns = LONGLONG((double(ticks100ns) * 10000000) / double(g_liQPCFreq.QuadPart) + 0.5);</p><p> </p><p> SetThreadAffinityMask(::GetCurrentThread(), oldmask);</p><p> }</p><p> else </p><p> {</p><p> // to milliseconds to microseconds</p><p> ticks100ns = GetTickCount() * 10000; </p><p> }</p><p></p><p> return ticks100ns;</p><p>}</p><p>[/code]</p></blockquote><p></p>
[QUOTE="tourettes, post: 508308, member: 10858"] I'm still wondering why it seems to plague only 24fps files. About the clock inaccuracy, we could wake up (say 5 ms early) and then use some busy looping to sleep the rest of the time to reach the target. This is actually used in many game engines to get the exact position. Also with Vista we can use the Multimedia Scheduler to boost the priority (it will quarantee pretty good timing, much better than with XP). [b]update:[/b] The timer code is at least a little bit buggy on current SVN version (not sure if it has any big enough inaccuraties that would trigger any side effects, but here is something that I have been using while implementing the improved syncing. Maybe it would be worth to test if it reduces the dropped frames you are seeing (I see zero late frames on my own testing with PAL material). [code] static CCritSec lock; // lock for timer initialization (multiple threads are using the timer during startup) static LONGLONG GetCurrentTimestamp() { LONGLONG ticks100ns; { CAutoLock lock(&lock); if( !g_bTimerInitializer ) { g_bQPCAvail = QueryPerformanceFrequency( &g_liQPCFreq ); Log("GetCurrentTimestamp(): Performance timer available: %d", g_bQPCAvail); g_bTimerInitializer = true; } } if( g_bQPCAvail ) { // [url]http://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx[/url] // Use always the same CPU core (no clue if it actually makes any difference...) DWORD_PTR oldmask = SetThreadAffinityMask(::GetCurrentThread(), 0); QueryPerformanceCounter ((LARGE_INTEGER*)&ticks100ns); ticks100ns = LONGLONG((double(ticks100ns) * 10000000) / double(g_liQPCFreq.QuadPart) + 0.5); SetThreadAffinityMask(::GetCurrentThread(), oldmask); } else { // to milliseconds to microseconds ticks100ns = GetTickCount() * 10000; } return ticks100ns; } [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Watch / Listen Media
watch/edit Videos
Audio sync problems when screen set to 24 Hz
Contact us
RSS
Top
Bottom