Bug 84000 - Improve precision of the VCL Timer on Windows
Summary: Improve precision of the VCL Timer on Windows
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.3.0.2 rc
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.4.0
Keywords:
Depends on:
Blocks: 81107
  Show dependency treegraph
 
Reported: 2014-09-17 14:24 UTC by Michael Meeks
Modified: 2014-09-25 20:00 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2014-09-17 14:24:53 UTC
Impress rendering appears to be rate-limited by the VCL main-loop at 65 fps.
Comment 1 Michael Meeks 2014-09-17 14:27:29 UTC
bool OGLPlayer::create( const OUString& rURL )
{
...
    // Set timer
    m_aTimer.SetTimeout(10);
    m_aTimer.SetTimeoutHdl(LINK(this,OGLPlayer,TimerHandler));
    return true;
}

is the proximate call site; 10ms ...
Comment 2 Jan Holesovsky 2014-09-17 16:18:14 UTC
The LibreOffice Timer implementation uses the Windows native Timer API.  As it turns out, this cannot be set to anything lower than 10ms:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms644906%28v=vs.85%29.aspx

see "If uElapse is less than USER_TIMER_MINIMUM (0x0000000A), the timeout is set to USER_TIMER_MINIMUM."

Even then, it is not exact 10ms, normally like 15.6ms, see:

http://stackoverflow.com/questions/24602202/changing-settimer-resolution-on-windows

And really; 1000 / 15.6 = 64.10, exactly the FPS we are seeing ;-)

I'm about to implement the LibreOffice's Timer using the Windows Multimedia Timers that have higher precision; or at least when the timeout value is (let's say) <50ms or so.
Comment 3 Commit Notification 2014-09-19 17:33:25 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6b2cd65b8370ff8a2be2e4effa59139cd0f5a7b5

Related fdo#84000: Improve framerate of the models.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Jan Holesovsky 2014-09-19 17:53:53 UTC
Implementing the high-precision timers for LibreOffice on Windows is a major change, so I have pushed it to gerrit to get some feedback:

https://gerrit.libreoffice.org/11552

If there are no problems, I'll merge it to master on Tuesday latest.
Comment 5 Commit Notification 2014-09-23 20:32:34 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=211b3192f05c4120fa2dd0e23988e74bdd310830

fdo#84000: Reimplement the Windows WinSalTimer using Timer Queues.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2014-09-23 20:32:47 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=da21f7da44dc577a08ea3bc210083dc8decf18bc

fdo#84000 - unwind recursive timer issues.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Michael Meeks 2014-09-23 20:35:47 UTC
Patches pushed to master with a slight tweak from me (of no doubt dubious wisdom, but it makes the timer-based word-counting on large documents work again on Windows ;-).
Comment 8 Commit Notification 2014-09-25 15:41:50 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d998a6ae3afab1ea51c72843d8400cf5c1eca35c

fdo#84000 - unit test timers / main-loop bits.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2014-09-25 20:00:57 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d68ce6e173502e1b1ce214503f41729a8502cd92

fdo#84000: Sort out problems with short timeouts & long callbacks.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.