Win Frame skips due to rising "vsyncoff-value"
#1
Hi,

My System:
- intel i7 6700K
- ASUS Strix GTX 1060
- 2x8 GB RAM
- Windows 7 x64
- KODI 17.1 Krypton
Screens:
- Samsung SyncMaster 2243EW
- LG 55EG910V

Problem:
Frame skips during playback on my OLED TV, especialy when I connect it to the hdmi port of my graphics card. Executing "playerdebug" (per default Ctrl+Shift+o) I can see the value for "vsyncoff" rising. When it reaches about 42, wich happens every 3 minutes, it will reset to zero again and cause a frame skip.
Connecting it to the hdmi port of my mainboard and using the igpu of my cpu, that value decreases slower and will reach -42 every 25 minutes causing a frame skip.
In comparison I installed LibreElec on an USB stick and ran my test files with 25, 24 and 23.976 fps (1080p/h264 mkv) with my TV connected to the mainboard. 24 and 25 fps files would remain at a constant value in a span of about 0.4 causing no frame skip at all. With the 23.976 fps file that value increases very slowly so it would have taken hours before a frame skip would happen.
I tried all that also on my desktop screen, which is connected via DVI to my graphics card, and the vsyncoff value always remaind constantly at zero causing no frame skips.

So is this value an indicator that my TV can't properly handle video over hdmi? But why is the LibreElec OS then so much better running? If it were a driver issue, why does my Samsung desktop screen show no frame skips at all?
Can someone enlighten me?

Edit:
Debug log - https://pastebin.com/3prM7Stm
Reply
#2
Provide a debug log, and others may show more interest in your issue.

Instructions in my signature. Use Basic method... and remember to Enable debugging mode, restart and replicate the problem.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
I think the reason this happens is due to the frequency difference between the graphics chip's output and the TV panel.
Not all graphics cards output the same framerate on 24p material -- hence the difference between the nvidia and the intel.
Exact framerate of a film should be (24*1000/1001=) 23.97602397602398. Some cards do closer to that than others. TV's also.
As you can imagine, smaller frequency difference between card/TV means larger time gap between frame skips.
But this also depends on software/drivers, hence the difference between kodi on windows and libreelec.
You can tweak nvidia to a closer framerate though with custom resolution function on its windows drivers.
Also if you don't use passthrough you can enable Sync playback to display in kodi and all will be synced. Just make sure you are at True fullscreen mode for that, for some reason it doesn't work ok with Fullscreen Window and nvidia.

About the monitor, no idea, probably it only refreshes at 60hz, so if kodi outputs at 23.976 it should perform 3:2 pulldown or something that kodi isn't aware of.
Reply
#4
(2017-05-23, 00:32)host505 Wrote: Exact framerate of a film should be (24*1000/1001=) 23.97602397602398. Some cards do closer to that than others. TV's also.
As you can imagine, smaller frequency difference between card/TV means larger time gap between frame skips.

That's understandable but why does it also happen with 24p and 25p files? These should be rather easy to put out at the correct frame rate.

So here is a debug log of an event I described:

https://pastebin.com/3prM7Stm

Don't mind the cpu usage. I have an encode running in the background but I can asure you, the problem is there in idle mode too. Here I got two frame skips even before vsyncoff reached 41.1 which might be shown in this entry:
14:14:37.876 T:4976 DEBUG: CVideoPlayerVideo::CalcDropRequirement - hurry: 1

The frame skip at 41.1, right before I pressed the stop button at 14:15:03.700, doesn't show anything though.
Reply
#5
Quote:That's understandable but why does it also happen with 24p and 25p files?
Because of the audio-video playback technology. Audio is being played back by an audio device which has its own clock. Video is being played back with a video device which has its own clock. Both of these clocks don´t run perfectly. When using e.g. a refresh rate of your GPU of 50Hz, actually it may output 49.9998Hz or 50.0012Hz. And your audio device set at 48kHz may output 48.001kHz. Master clock is the audio clock, the video clock is referenced to it. The difference of the two clocks can be represented with your shown Vsync value. The Vsync is measured and when video and audio clock would be perfect, this value would be stable. Clocks being not perfect, this value drifts away (which is normally the case). When using different devices like in your case, the difference of the clocks is different (video clock of the mainboard GPU chip is running with a different speed than the clock of your discrete GPU).
Workaround is using custom resolutions which take into account both clocks (video and audio clock). Example (extreme values, far away from typical real life values, but to understand): video clock running 2% too fast, audio clock running 5% too slow. This would mean: video clock speed has to be lowered by 7% (you can´t change audio clock).
That´s the principle. How to achieve that is shown in this guide when using madVR and MPC HC. You could also get to the needed numbers with Kodi when understanding the logic behind the problem, watching your vsyncoffset value long enough and do some calculations on your own.
So if you really want to solve the problem, you´ll have to read about it, understand it, do some calculations, work with other software tools. I have done all of that and now have perfect custom resolutions without frame drops/repeats, but I´ll warn you: There´s some time to invest and it is a little bit tricky. More a kind of nerdy/freaky thing. If you are prepared for that, follow the given link for the guide.
Other workarounds are: using Kodi DSPlayer with madVR´s smoothmotion option or find a way to make Reclock to work (I don´t use that and don´t know if you can get it to work with Kodi).
Reply
#6
I already tried the Kodi DSPlayer with madVR once and though it doesn't show me a frame skip or VsyncOff count, I could clearly see the frame skips after watching the video long enough.

The advice to check the option "sync playback to display refresh rate" in addition and it seems to work. VsyncOff value doesn't change more than 0.5 up and down again but is steady around that value. No frame skips anymore. Problem is: Kodi 17.1 won't allow audio passthrough with that option enabled, so I get no DTS or for possible future upgrades no DTSHD and TrueHD.
Reply
#7
Switched back to Kodi Jarvis 16.1 using the IGPU of my core i7 instead of my gtx 1060. "PlayerDebug" doesn't work, so I can't tell anything about the VsyncOff-value but so far after over half an hour of 23.976 fps playback still no frame skip according to "CodecInfo". Using the gtx 1060 I get my frame skips again every 3 minutes, so I know I can't use that at all no matter the Kodi version. The i7 with latest drivers seems to run perfectly only in Jarvis 16.1. So my guess is there is a major driver incompatibility with intel since Kodi 17 and an even larger one with nvidia throughout all Kodi versions I tested jet.
Reply
#8
Seems that windows 7 was the problem all along. Or rather the fact that the KODI programers didn't pay enough attention to its display drivers as they obviously did with windows 10. After I was forced to reinstall my OS from scratch I chose to upgrade to windows 10 and tested KODI 17.3. VsyncOff-value still rises but only by the value of 1.0 per 15 minutes, which makes a frame skip during playback very unlikely to happen. I used the igpu of my i7 but haven't tested my gtx 1060 yet. Finally I have the answer to what was bugging me for so long.
Reply
#9
are audio/video clocks more stable in devices like Nvidia Shield TV?
Reply

Logout Mark Read Team Forum Stats Members Help
Frame skips due to rising "vsyncoff-value"0