-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call timeEndPeriod(1) when playback is stopped/paused on Windows #3421
Comments
I don't feel particularly inclined to do anything about this. Although I wonder if we need the timer resolution at all. @rossy opinions? |
it seems windows increases timer resolution to 0.5ms while playing video using mpv, mpc-hc or vlc windows 10 AU |
Well, the timer resolution still affects the granularity of Sleep() on Windows 7 and 8.1, where the default granularity is 15.625ms. I haven't tested on 10 yet. On the other hand, timer resolution doesn't affect the granularity of QueryPerformanceCounter() and I don't think it affects when the WASAPI thread is woken by the audio subsystem or when the VO thread is woken up after VSync. It's hard to test this stuff though. There's a Java app running in the background on my PC right now that is pinning the timer frequency to 1ms. @sda89ha9 That's strange. mpv never requests a timer frequency of 0.5ms itself, but it does activate some MMCSS profiles and apparently they can change the timer frequency, though they are not guaranteed to change it in Windows 7 and up (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms684247.aspx) It could also be an audio or video driver that's making the request, which would explain why mpv, MPC-HC and VLC are affected. I can't repro on my computer (also, all the MMCSS profiles on my computer have "Clock Rate" set to 1ms.) |
mpv(lachs0r) --no-audio = timer interval: 1.001 ms |
I only see 2 places that indirectly call
The latter one seems like it could be a problem if it sleeps as much as 16ms, though. But what's more important is that the timer precision of Potentially we could stuff timeBeginPeriod/timeEndPeriod in the same place we call the MMCSS API, but not sure if we should even care. |
Have you tried running CS 1.6 via WINE on Linux? |
How about using CSGO? Have you tried to use this Windows compatibility mode setting? |
What does this have to do with mpv? |
I'd wager a guess.. nothing. |
@haasn To be honest no :O do you think thats posible on ryzen architecture? And if that was the case, what would be the process to run cs 1.6? what are the requirements ? Thank you. |
Because i'm tiring of have bad performance in games such counter strike 1.6 I don't know what i'm doing wrong, if something related to AMD bios in ryzen? all options seems to be in Auto, and i really don't know anything about AMD BIOS , i always use intel before, and.... to be honest in Google there is not such information that covered the whole bios in AMD or ryzen... |
Try compiling mpv from source with latest ffmpeg, pretty sure it'll fix your issues. |
But remember to compile mpv with |
It seems like mpv suffers from the problem documented in:
https://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
timeBeginPeriod(1)
gets called inmp_raw_time_init()
on startup buttimeEndPeriod(1)
never gets called - not even when playback is stopped/paused.I think a better scheme is to remove
timeBeginPeriod(1)
frommp_raw_time_init
and add 2 more functions which get called when a stream starts playing and when a stream ends playing which gets forwarded totime(Begin|End)Period
on Windows.The text was updated successfully, but these errors were encountered: