Skip to content

Commit

Permalink
New advancedsettings option 'disableDXVAdiscretedecoder'
Browse files Browse the repository at this point in the history
Workaround for Nvidia stuttering on 4K HDR playback (some models)
  • Loading branch information
thexai committed Jun 17, 2020
1 parent b65326f commit 6184185
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,18 @@ bool CContext::CreateContext()
ComPtr<ID3D11DeviceContext> pD3DDeviceContext;
m_sharingAllowed = DX::DeviceResources::Get()->DoesTextureSharingWork();

// Workaround for Nvidia stuttering on 4K HDR playback
// Some tests/feedback on Windows 10 2004 / NV driver 446.14
// Not needed: GTX 1650, GTX 1060, ...
// Needed: RTX 2080 Ti, ...
if (m_sharingAllowed &&
CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_disableDXVAdiscreteDecoding)
{
m_sharingAllowed = false;
CLog::LogF(LOGWARNING, "disabled discrete d3d11va device for decoding due advancedsettings "
"option 'disableDXVAdiscretedecoder'.");
}

if (m_sharingAllowed)
{
CLog::LogF(LOGWARNING, "creating discrete d3d11va device for decoding.");
Expand Down
3 changes: 3 additions & 0 deletions xbmc/settings/AdvancedSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ void CAdvancedSettings::Initialize()
m_stereoscopicregex_tab = "[-. _]h?tab[-. _]";

m_allowUseSeparateDeviceForDecoding = false;
m_disableDXVAdiscreteDecoding = false;

m_videoAssFixedWorks = false;

Expand Down Expand Up @@ -696,6 +697,8 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file)
m_DXVACheckCompatibilityPresent = XMLUtils::GetBoolean(pElement,"checkdxvacompatibility", m_DXVACheckCompatibility);

XMLUtils::GetBoolean(pElement, "allowdiscretedecoder", m_allowUseSeparateDeviceForDecoding);
XMLUtils::GetBoolean(pElement, "disableDXVAdiscretedecoder", m_disableDXVAdiscreteDecoding);

//0 = disable fps detect, 1 = only detect on timestamps with uniform spacing, 2 detect on all timestamps
XMLUtils::GetInt(pElement, "fpsdetect", m_videoFpsDetect, 0, 2);
XMLUtils::GetFloat(pElement, "maxtempo", m_maxTempo, 1.5, 2.1);
Expand Down
1 change: 1 addition & 0 deletions xbmc/settings/AdvancedSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
std::string m_stereoscopicregex_tab;

bool m_allowUseSeparateDeviceForDecoding;
bool m_disableDXVAdiscreteDecoding;

/*!< @brief position behavior of ass subtitles when setting "subtitle position on screen" set to "fixed"
True to show at the fixed position set in video calibration
Expand Down

0 comments on commit 6184185

Please sign in to comment.