2023-07-27, 07:13
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
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