Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
gst-plugins-bad
gst-plugins-bad
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,011
    • Issues 1,011
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 199
    • Merge Requests 199
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gst-plugins-badgst-plugins-bad
  • Issues
  • #553

Closed
Open
Opened Apr 30, 2017 by Bugzilla Migration User@bugzilla-migration

directsound: increase thread priority read/write to avoid stutter and glitches

Submitted by Dustin Spicuzza

Link to original bug (#781998)

Description

Since forever [1], when using GStreamer on Windows if there's enough load on the system (or various other things), playback will stutter. Other media players on Windows (for example, Windows Media Player (WMP)) don't exhibit these issues.

An easy way to reproduce this issue is by running Windows in a VM, and doing things like rapidly moving around windows that change frequently (like Process Explorer). The experiment I did today was running gst-play (msys2 gst 1.10.4) and WMP, and comparing their performance under load.

  • It's very easy to get gst-play to stutter, even under very light load
  • It's much more difficult to get WMP to stutter, even under heavy load

A brief examination of the processes themselves with Process Explorer reveals that the thread priorites in WMP are significantly higher than the thread priorities in the gst-play process.

More digging reveals that there's a Windows API [2] for telling the system that you're doing important multimedia processing. I theorize that if GStreamer calls the relevant APIs when doing processing (AvSetMmThreadCharacteristics followed by AvRevertMmThreadCharacteristics), then the performance will become similar to WMP.

I note that Clementine has a hack to set realtime priority for OSX [3] by setting thread priority when a GstTask is detected to start. Perhaps this is a good place to do this? If not, where?

I'm very very interested in getting rid of this stutter issue on Windows, and would be willing to implement/test something if someone will give me some pointers on the best place to implement it.

I note that the Clementine audio player also has a open bug report for this issue as well [4].

[1] https://github.com/exaile/exaile/issues/76
[2] https://msdn.microsoft.com/en-us/library/ms684247(VS.85).aspx
[3] https://github.com/clementine-player/Clementine/commit/df21da786e74a504adbdbd74d9d7c7577c6e52ed
[4] https://github.com/clementine-player/clementine/issues/2570

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: gstreamer/gst-plugins-bad#553