#17879 new Bugs

Hardware accelerated playback is choppy unless an overlay/osd is shown (Windows, Nvidia, Intel, ...)

Reported by: popy Owned by: FernetMenta
Priority: 4 - Normal
Component: Video playback (inc. audio in video and codecs) Version: 18.0 "Leia" Alpha1
Severity: Normal Keywords: kodi dxva stutter osd foreground
Cc: afedchin Blocked By:
Blocking: Platform: Windows

Description (last modified by popy)

A few Users have issues with kodi v18 leia alpha up to the newest build with choppy dxva playback. This just happens when NO OSD is in foreground, then the skipped frames counts (but we dont see it because also CTRL-SHIFT-O OSD fixes the issue). So here is a summary:

  • DXVA on
  • Occured on NUC i3 (Intel HD4000 graphics) & MSI nvidia 1030 GPU
  • Windows 10 x64 1709
  • Other options (sync with display, refreshrate change, fullscreen windowed, ...) does not fix the issue
  • dropped frames count is increased very fast

When any OSD is in foreground (player debug ctrl-shift-o, play controls, or any other) the issue is gone and playback is smooth!

As a workaround i have disabled DXVA and the issue is also gone.

Here is a forum thread with logs: https://forum.kodi.tv/showthread.php?tid=330599

I am here to help debug.

pOpY

Attachments (6)

kodi_logs_dxva_stutter.zip (58.8 KB) - added by popy at 2018-05-19T10:50:13+01:00.
kodi logs dxva stutter
kodi_dxva_crashlog_testbuild_21_05_2018.zip (522.5 KB) - added by popy at 2018-05-21T15:34:57+01:00.
Crash log with may 21 testbuild
kodi_logs.zip (820.1 KB) - added by popy at 2018-05-22T19:42:10+01:00.
logs intel vs nvidia
kodi_nvidia_397.64_no crash but green black pink picture.zip (42.2 KB) - added by popy at 2018-05-22T20:37:01+01:00.
Nvidia 397.64 black, green and pink blinking picture
kodi_logs_tb_23_05_2018.zip (91.2 KB) - added by popy at 2018-05-23T20:31:11+01:00.
Kodi Logs of Testbuild 23.05.2018
logs_24_05_2018.zip (1.3 MB) - added by popy at 2018-05-25T20:30:56+01:00.
Logs 24.05.2018

Change History (34)

Changed at 2018-05-19T10:50:13+01:00 by popy

kodi logs dxva stutter

comment:1 Changed at 2018-05-21T06:45:44+01:00 by FernetMenta

  • Cc afedchin added
  • Platform changed from All to Windows

comment:2 Changed at 2018-05-21T06:51:16+01:00 by FernetMenta

@afedchin, you removed the old workaround with this change: https://github.com/xbmc/xbmc/pull/13709

Can this be the reason why this old issue shows up again?

comment:3 Changed at 2018-05-21T06:56:03+01:00 by afedchin

Yes, It can, but why we don't see any records in the logs about why VP is propping frames?

comment:4 Changed at 2018-05-21T07:03:30+01:00 by FernetMenta

Late frames dropped by rendermanager are not logged, they are indicated as "skip:" on PlayerInfo screen. Dropped frames by player are logged with component logging for video.

comment:5 Changed at 2018-05-21T07:59:59+01:00 by popy

This sounds very reasonable. I also have tested about five different builds back to alpha 1,no one fixed the issue. Can you please provide a test Build which includes the mentioned workaround?

Thx

comment:6 Changed at 2018-05-21T14:35:49+01:00 by afedchin

please try this build http://mirrors.kodi.tv/test-builds/windows/win64/KodiSetup-20180521-8d477147-cppwinrt-x64.exe

NOTE: If it isn't available, please wait, it may take some time for upload to mirrors.

comment:7 Changed at 2018-05-21T15:06:59+01:00 by popy

  • Description modified (diff)

Changed at 2018-05-21T15:34:57+01:00 by popy

Crash log with may 21 testbuild

comment:8 Changed at 2018-05-21T15:35:27+01:00 by popy

thx for the testbuild. Sadly when i'll activate DXVA and start playback of an movie kodi just shows black/green bars and crashing right away. It doesnt matter how ill set the options:

  • change refersh rate
  • Sync playback with display

When dxva2 is on it crashes. Please find attached the debug log of an crash and the stack trace.

Log: https://trac.kodi.tv/attachment/ticket/17879/kodi_dxva_crashlog_testbuild_21_05_2018.zip

pOpY

comment:9 Changed at 2018-05-21T18:38:19+01:00 by afedchin

can you try on intel?

comment:10 Changed at 2018-05-22T19:41:46+01:00 by popy

Sorry for the delay, finally here are my results. I have tested the following:

  • same settings for all four tests (change refreshrate: start/stop, sync to display: off and dxva2 on). I have nothing changed on my config during these tests.
  • all on the same machine (i3-3225 with Intel® HD-Grafik 4000 and dedicated Gforce 1030)
  • debug log enabled in advancedsettings.xml with loglevel 1 (to hide the osd, because otherwise, the issue does'nt come up)
  • started kodi, waited a few seconds and start playing always the same movie
  • exited kodi

Please find attached the log files, and here are the results to every specific log:

Intel HD 4000

  • kodi_git_28_04_2018_intel_5sec_stutter_then smooth.log
    • tested on git 28.04.2018 build on the intel
    • it stutters ~5seconds (same dropped frames as always on nvidia)
    • then stutter is gone and video runs smooth
  • kodi_tb_21_05_2018_intel_smooth from the beginning.log
    • tested on testbuild 21.05.2018 on the intel
    • it runs smooth from second one AND NO CRASH (like it is on nvidia)

Nvidia 1030

  • kodi_git_28_04_2018_nvidia_no crash but stutter unless osd.log
    • tested on git 28.04.2018 build on the nvidia
    • it stutters all the time unless any OSD is in foreground (dropped frames counts on CTRL-SHIFT-O)
  • kodi_tb_21_05_2018_nvidia_crash.log
    • tested on testbuild 21.05.2018 on the nvidia
    • it crashes right after start of the video with black, green bars.

Hope this helps to identify the issue. pOpY

Changed at 2018-05-22T19:42:10+01:00 by popy

logs intel vs nvidia

comment:11 Changed at 2018-05-22T19:52:09+01:00 by afedchin

Thanks. The issue is known. a proper fix doesn't work on nvidia and crashes somewhere inside nvidia GPU driver (nvwgf2umx). Your crash dump confirms this. Do you have the latest nvidia drivers installed?

comment:12 Changed at 2018-05-22T19:58:06+01:00 by popy

Currently running 390.65, will upgrade and test again your testbuild.

comment:13 Changed at 2018-05-22T20:35:28+01:00 by popy

With 397.64 kodi/driver doesn't crash but I'll get a black, green, pink badly blinking picture.

Attached the debug log.

Changed at 2018-05-22T20:37:01+01:00 by popy

Nvidia 397.64 black, green and pink blinking picture

comment:14 Changed at 2018-05-23T10:48:26+01:00 by afedchin

please test the following build http://mirrors.kodi.tv/test-builds/windows/win64/KodiSetup-20180523-ecf1c103-cppwinrt-x64.exe

NOTE: If it isn't available, please wait, it may take some time for upload to mirrors.

Last edited at 2018-05-23T11:12:18+01:00 by afedchin (previous) (diff)

comment:15 Changed at 2018-05-23T20:30:40+01:00 by popy

Good news, crash is gone and also dropped frames @ 50hz is gone (regardless the normal 23,98 played @ 50 Hz stutter).

And sadly now the bad news, when i'll activate "change refresh rate" (to get rid of the 23,98 Hz played @ 50 hz stutter), kodi switches to 23,98 Hz and the dropped frames unless osd are back :-( Also tried a 3 sec delay after the change of the refresh rate with no luck. Attached please find the logs.

Also i'll have a weird issue with the new kodi resoltion/refreshrate feature. I have set special resolutions in nvidia control panel because of too much overscan of my old lg tv. kodi is setting always the resolution to the wrong one. but ill thinks thats another story of an new commit :-)

Hope you can solve the dropped frames after "change of refresh rate" issue.

Changed at 2018-05-23T20:31:11+01:00 by popy

Kodi Logs of Testbuild 23.05.2018

comment:17 Changed at 2018-05-24T11:49:02+01:00 by popy

thx a lot, already seen that revert. Is there a test build which ill can try at the evening until the next nightly is build?

comment:18 Changed at 2018-05-24T13:17:22+01:00 by afedchin

try the next nightly.

comment:19 Changed at 2018-05-25T16:47:47+01:00 by popy

ok here are my test results with todays build "KodiSetup-20180524-b367089b-master-x64.exe":

  • dxva seems to be working correctly when playing 23,98 hz material @ 50 hz refreshrate with no change but sync on -> see log "[email protected]_refresh rate change off_dxva on_vsync on_and smooth playback.log"
  • but the stutter (droppec frames) is here when playing same 23,98hz material with refreshrate change to @ 23,98 and vsync off -> see log "[email protected]_refresh rate change on_dxva on_vsync off_and stutter playback.log"

Hope this helps to identify the issue, it seems that something went wrong (maybe timing on presenting the images) when a refresh rate change is before. Also tried to set a delay after changing refreshrate with no success. Have set it to 3 seconds, i can clearly see that kodi is changing refresh rate (confirmed with NVIDIA control panel) then it pauses 3 seconds and start playing, but sadly with stutter.

Is it possible to implement some debug regarding timing and i'll test again?

Last edited at 2018-05-25T16:48:11+01:00 by popy (previous) (diff)

comment:20 Changed at 2018-05-25T17:11:32+01:00 by FernetMenta

how do you switch vsync off?

comment:21 Changed at 2018-05-25T17:56:20+01:00 by popy

Sorry for not being clear, with vsync I'll meant the option -> settings -> player -> video -> sync video with display (= play 24hz material with 104% speed @50 hz)

Changed at 2018-05-25T20:30:56+01:00 by popy

Logs 24.05.2018

comment:22 Changed at 2018-05-25T20:31:26+01:00 by popy

Sorry for the delay, here are the logs of my last test: https://trac.kodi.tv/attachment/ticket/17879/logs_24_05_2018.zip

comment:23 Changed at 2018-05-26T10:47:57+01:00 by beeswax

edit: I retract this report of an improvement, I was testing on my monitor which displays everything at 60Hz at all times and on that, it's fine. As soon as I switch to my TV and as a result, to refresh rate switching, the problem is still the same.

The NUCs run mostly OK as long as one of the debugging OSDs is present. With the OSDs off, they stutter just as much as before.

Last edited at 2018-05-26T15:01:55+01:00 by beeswax (previous) (diff)

comment:24 Changed at 2018-05-26T18:22:26+01:00 by popy

Exact same for me. Maybe we should try the way @afedchin was on, the new implementation (which works good on Intel) but not on nvidia.

And debug it, I am here to help. (sadly my windows api dxva knowledge is not good)

comment:25 Changed at 2018-06-22T12:03:28+01:00 by popy

Hey guys, any news on this. Dxva in combination with change display refresh rate is currently broken with nvidia cards.

I am here to test.

thanks a lot, pOpY

comment:26 Changed at 2018-06-22T14:11:53+01:00 by afedchin

fix https://github.com/xbmc/xbmc/pull/14094

please try tomorrow's nightly build

comment:27 Changed at 2018-06-22T16:34:39+01:00 by popy

Will try it next Wednesday because my clients are thousands km away.

Will report back soon.

Nice rework!

comment:28 Changed at 2018-06-28T08:01:11+01:00 by popy

Also for me its not completly fixed in "KodiSetup-20180626-0910789a-master-x64.exe", but way better, thx a lot @"afedchin" !!!! When running the tv @50hz and watching content with 50hz (with DVBViewer PVR addon) there are some drops (sync to display off). After enabling sync to display the drops are completly gone.

But i had two crashes when enabling "change refresh rate" and starting an 24p movie. Kodi switches framerate of tv to 23,976 hz but then kodi crashes. Not all the time and sadly not reproduceable with debug log enabled.

I just have an log with debug  disabled: https://paste.ubuntu.com/p/XxXSmcGbvs/

pOpY

Note: See TracTickets for help on using tickets.