Skip to content

Recording (Windows): raise the timer resolution and register capture threads with MMCSS #921

Closed

Description

@EtienneLescot

Part of #920 (rank 1). Effort S, risk low.

Problem

  • No Windows helper raises the timer resolution, registers with MMCSS or sets a thread priority. Every wait lands on the default 15.625 ms tick.
  • Affected waits: the video writer's sleep_until (main.cpp), the WASAPI poll (wasapi_loopback_capture.cpp, 5 ms asked), the audio mixer (audio_sample_utils.cpp), cursor-sampler.cpp.
  • Measured on a real take (recording-1790792371876):

Proposal

  • timeBeginPeriod(1) for the life of the recording (and timeEndPeriod on exit) in wgc-capture and cursor-sampler.
  • Opt the process out of power throttling (SetProcessInformation(ProcessPowerThrottling)), since Windows 11 can ignore the timer request of a throttled process. High-resolution waitable timers (CREATE_WAITABLE_TIMER_HIGH_RESOLUTION) are the alternative.
  • Register the capture, mixer and writer threads with MMCSS (AvSetMmThreadCharacteristicsW, "Capture" / "Pro Audio").

Verify

  • Same 60 s take before and after: webcam interval histogram (>95 % at 33 ms ±2, duplicates <2 %), cursor at 30 Hz ±1, [pacing] frames/elapsed ≥ 59.5 at 60 fps.
  • Repeat with the app window minimized.

Activity

  1. added a commit that references this issue on Sep 30, 2026
    e943004
  2. added
    status: fixed in mainWork is merged into main but may not be in a downloadable release yet.
    status: pending releaseMerged change is waiting for a packaged desktop release.
    on Sep 30, 2026
  3. added this to the Next Release milestone on Sep 30, 2026
  4. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    Fixed by #927 and merged into main.

    This change is assigned to the Next Release release milestone and is not necessarily available in the latest downloadable desktop release yet. It is currently marked as status: pending release until a packaged release containing it is published.

  5. EtienneLescot commented on Sep 30, 2026

    @EtienneLescot
    CollaboratorAuthor

    Moved into v2.0.0 as part of the pre-release cut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststatus: fixed in mainWork is merged into main but may not be in a downloadable release yet.status: pending releaseMerged change is waiting for a packaged desktop release.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions