Win Extend Windows no-copy DXVA decoding to older hardware - Testing Requested
#1
Description

Kodi has a zero-copy path for dxva decoding, but it is currently activated only for Intel and the most recent nVidia and AMD gpus because of what seemed to be synchronization problems with previous generations of hardware / drivers.

Better synchronization of dxva decoding was implemented in PR https://github.com/xbmc/xbmc/pull/23542 (not merged yet) to fix issue https://github.com/xbmc/xbmc/issues/23518 for recent AMD gpu.
Maybe that synchronization code will also enable older gpus to use the more efficient zero-copy path (lower memory and gpu usage), maybe with smoother playback.
...or it could make things worse. The team members do not have many combinations of hardware, and your testing and feedback are requested to help fine-tune the new code activation conditions before merging.

The test builds below enable the zero-copy path with sync for the following hw/sw combinations.
Hardware: various AMD and nVidia GPUs are the most important to try, with feature level 11_0 minimum and latest drivers. Adapters with feature level 12_0 have a better chance of success.
Intel drivers have included a sync mechanism for years and don't need this new code, but it doesn't hurt to try.
OS: minimum Windows 10 Creators Update (v1703 released in April 2017) - though Windows 10 22H2 or 11 22H2 is best

Pay attention to playback smoothness, no flash/wrong picture when skipping, no visual problems for still-picture DVD menus (see issue https://forum.kodi.tv/showthread.php?tid=358755)

4k HDR videos played in SDR with tonemapping will stress the gpu the most, but it's not the only thing to try. Different codec / render method / scaler / deinterlacer / open the OSD / w/o refresh rate switch, sync playback to display... are all valid tests

To confirm the activation of the test feature, look for the messages "device for decoding created on adapter XXXXXX", "DXVA2 shared decoder surfaces is supported" and "fence synchronization activated." in the log.
The messages level is "info", no need to activate the debug log.

There are two slightly different implementations and test builds, "cpuwait" and "gpuwait". The latter is better in theory. If you want to try only one, go with the "gpuwait" build.

x64 test build links:
gpuwait https://mirrors.kodi.tv/test-builds/wind...sh-x64.exe
cpuwait https://mirrors.kodi.tv/test-builds/wind...it-x64.exe

The builds are based on the current v21 alpha code, so backup your user data or run in portable mode to avoid messing with your normal v20 installation.

When reporting your findings, please include OS version, GPU, drivers version, screen resolution and which test build was used. We're interested in the good and the bad, using v21 alpha 2 as reference.

----------------------------------------------------------------------------------------------------------------------------

Here are my own test results:
- Windows 10 22H2, AMD Ryzen 5600G, 4k HDR screen: normal smooth playback (maybe even slighly improved, with no partial or missing frames noticed after playing a few movies), no problem with skipping, no dvd still-picture menu issues, no difference between cpuwait and gpuwait.Slightly better
- Windows 10 22H2, Intel 13th generation 4k HDR screen: smooth playback, no problem with skipping, no dvd still-picture menu issues, with cpuwait a small hiccup a fraction of a second after a skip. no hiccup with gpuwait.
and there would be no need to report this one:
- Windows 10 22H2, Intel 4th generation: does not support support separate device for decoding and the change does not apply
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#2
I'm in for this one... x64 test build links:
gpuwait https://mirrors.kodi.tv/test-builds/wind...sh-x64.exe
will leave you more information as I've had time, but so-far it boots and acts normally.
Played out a 3 hours 4K 10bit and 4K 8 bit no issues...
tried my damnedest with most formats to crash
and tried to overload the gfx engine and it all worked.

Win 10 1001945 build 19045 x64bit i7 12 gigs of ram Nvidia 1060 6gigs mem Game Ready Driver  531.79 05/02/2023 res 1080p on an old LG display through HDMI Onkyo TX-SR333 5.1 AVR

This in the short run appears to be the fix for my issue. Will keep this thread updated if there are changes.

Another day passing with this build at 100% functionality.
Reply
#3
Thanks, that's great news!

Good but unexpected result for your crash issue though.

In the meantime another team member tested on AMD RX550 with bad results (corrupted picture).
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#4
(2023-07-29, 03:19)CrystalP Wrote: Good but unexpected result for your crash issue
I guess I was too quick on the draw here... watching a 4K 8bit h265, 70% into the movie...preceded by a few seconds of weird audio and Kodi exits, no resume point. So the issue still resides, nothing other to report. I see an update in the gfx software, will draw on that for the next report.

After switching GFX drivers to an older international version, the card stabilized, excuse my panic.
Reply
#5
Windows 10 Pro 22H2 (I updated just to test this version), Ryzen 5 3600, RTX 3070, drivers 536.67 (latest as of today).

So far I have not seen glitches or anything. There's just a hick-up when seeking ahead, like the player is dropping or repeating a single frame.

I still think, I told you this privately, that an OSD similar to madVR's, where one could check frames dropped/repeated in realtime would be crucial to reach perfectly smooth plaback. The way things are now, one can simply report a non-perfect smoothness but without anything to display for it.
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply
#6
One thing at a time!

Was the hiccup with the cpuwait or the gpuwait version?

I noticed something like that with latest intel gpu and the cpuwait version (pause of a few ms, a few ms after seek completes).
The activity of Kodi during seek looks like a mess in the performance profiler, there is likely room to improve. But one thing at a time!
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#7
@ashlar can you please provide the requested details? I'd like to merge the change or adjust if things are worse than alpha 2.
A short clip of the seek glitch would help understand, if possible. Windows Game Bar capture worked pretty well for me for such things.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#8
(2023-08-04, 15:34)CrystalP Wrote: @ashlar can you please provide the requested details? I'd like to merge the change or adjust if things are worse than alpha 2.
A short clip of the seek glitch would help understand, if possible. Windows Game Bar capture worked pretty well for me for such things.
Sorry for not getting back to you earlier.

When I referred to a hiccup I was talking about something on the order of a single frame being repeated and dropped. I think it's quite normal. If you don't consider it normal and would like to "fix" it, I was using the gpuwait version (the one you recommended if one could try a single version).
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply
#9
OK thanks, I'll go ahead with the merge.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
Extend Windows no-copy DXVA decoding to older hardware - Testing Requested0