Kodi Community Forum

Full Version: Refresh rate not changing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

Starting new thread as audio stutter not relevant in the WASAPI thread. Using the 2/2/22 WASAPI build from the first page there.

I've fixed the audio stutter I had by selecting non-windowed full screen, but the refresh rate is now not changing.

4K@60Hz output for GUI. [email protected] is whitelisted. Refresh rate change start/stop with 1.5s delay selected.

Logs (debug) - https://paste.kodi.tv/egilohubih.kodi

What am I doing wrong??
Thanks
Andy
According log posted refresh rate is changing fine:

2022-02-03 09:53:57.653 T:4592     INFO <general>: [WHITELIST] Searching the whitelist for: width: 3840, height: 2160, fps: 23.976, 3D: false
2022-02-03 09:53:57.653 T:4592    DEBUG <general>: [WHITELIST] Searching for an exact resolution with an exact refresh rate
2022-02-03 09:53:57.653 T:4592    DEBUG <general>: [WHITELIST] Matched an exact resolution with an exact refresh rate Generic PnP Monitor #1: 3840x2160 @ 23.98Hz (105)
2022-02-03 09:53:57.654 T:4592     INFO <general>: Display resolution ADJUST : Generic PnP Monitor #1: 3840x2160 @ 23.98Hz (105) (weight: 0.000)
2022-02-03 09:53:57.668 T:12252   DEBUG <general>: CWinSystemWin32::SetFullScreen: (true fullscreen) with size 3840x2160, refresh 23.976023
2022-02-03 09:53:57.668 T:12252   DEBUG <general>: DX::DeviceResources::ReleaseBackBuffer: release buffers.
2022-02-03 09:53:57.668 T:12252   DEBUG <general>: CWinSystemWin32::AdjustWindow: adjusting window if required.
2022-02-03 09:53:57.669 T:12252   DEBUG <general>: DX::DeviceResources::SetFullScreen: switching from (3840 x 2160) to fullscreen (3840 x 2160)
2022-02-03 09:53:57.669 T:12252   DEBUG <general>: DX::DeviceResources::SetFullScreen: changing display mode to [email protected]
Looking at both the on screen fps in debug mode and the info screen from the AVR it is still 4K60. I'll try and take some screenshots.

2022-02-03 09:53:57.653 T:4592     INFO <general>: [WHITELIST] Searching the whitelist for: width: 3840, height: 2160, fps: 23.976, 3D: false
2022-02-03 09:53:57.653 T:4592    DEBUG <general>: [WHITELIST] Searching for an exact resolution with an exact refresh rate
2022-02-03 09:53:57.653 T:4592    DEBUG <general>: [WHITELIST] Matched an exact resolution with an exact refresh rate Generic PnP Monitor #1: 3840x2160 @ 23.98Hz (105)
2022-02-03 09:53:57.654 T:4592     INFO <general>: Display resolution ADJUST : Generic PnP Monitor #1: 3840x2160 @ 23.98Hz (105) (weight: 0.000)
2022-02-03 09:53:57.668 T:12252   DEBUG <general>: CWinSystemWin32::SetFullScreen: (true fullscreen) with size 3840x2160, refresh 23.976023
2022-02-03 09:53:57.668 T:12252   DEBUG <general>: DX:Big GrineviceResources::ReleaseBackBuffer: release buffers.
2022-02-03 09:53:57.668 T:12252   DEBUG <general>: CWinSystemWin32::AdjustWindow: adjusting window if required.
2022-02-03 09:53:57.669 T:12252   DEBUG <general>: DX:Big GrineviceResources::SetFullScreen: switching from (3840 x 2160) to fullscreen (3840 x 2160)
2022-02-03 09:53:57.669 T:12252   DEBUG <general>: DX:Big GrineviceResources::SetFullScreen: changing display mode to [email protected]
2022-02-03 09:53:57.669 T:12252   DEBUG <general>: DX:Big GrineviceResources::SetFullScreen: fixup fullscreen mode before switching resolution
2022-02-03 09:53:57.669 T:12252   DEBUG <general>: DX:Big GrineviceResources::SetFullScreen: switching to fullscreen
2022-02-03 09:53:57.669 T:12252   DEBUG <general>: DX:Big GrineviceResources::ResizeBuffers: resize buffers.
2022-02-03 09:53:57.669 T:12252   DEBUG <general>: CWinSystemWin32DX::FixRefreshRateIfNecessary: refreshRate: 60.0000, desired: 23.9760, deviation: 0.60040, fixRequired: no, 1

The fixRequired line seems to correspond with this code:

void CWinSystemWin32DX::FixRefreshRateIfNecessary(const D3D10DDIARG_CREATERESOURCE* pResource) const
{
  if (pResource && pResource->pPrimaryDesc)
  {
    float refreshRate = RATIONAL_TO_FLOAT(pResource->pPrimaryDesc->ModeDesc.RefreshRate);
    if (refreshRate > 10.0f && refreshRate < 300.0f)
    {
      // interlaced
      if (pResource->pPrimaryDesc->ModeDesc.ScanlineOrdering > DXGI_DDI_MODE_SCANLINE_ORDER_PROGRESSIVE)
        refreshRate /= 2;

      uint32_t refreshNum, refreshDen;
      DX::GetRefreshRatio(static_cast<uint32_t>(floor(m_fRefreshRate)), &refreshNum, &refreshDen);
      float diff = fabs(refreshRate - static_cast<float>(refreshNum) / static_cast<float>(refreshDen)) / refreshRate;
      CLog::LogF(LOGDEBUG,
                 "refreshRate: {:0.4f}, desired: {:0.4f}, deviation: {:.5f}, fixRequired: {}, {}",
                 refreshRate, m_fRefreshRate, diff, (diff > 0.0005 && diff < 0.1) ? "yes" : "no",
                 pResource->pPrimaryDesc->Flags);
      if (diff > 0.0005 && diff < 0.1)
      {
        pResource->pPrimaryDesc->ModeDesc.RefreshRate.Numerator = refreshNum;
        pResource->pPrimaryDesc->ModeDesc.RefreshRate.Denominator = refreshDen;
        if (pResource->pPrimaryDesc->ModeDesc.ScanlineOrdering > DXGI_DDI_MODE_SCANLINE_ORDER_PROGRESSIVE)
          pResource->pPrimaryDesc->ModeDesc.RefreshRate.Numerator *= 2;
        CLog::LogF(LOGDEBUG, "refreshRate fix applied -> {:0.3f}",
                   RATIONAL_TO_FLOAT(pResource->pPrimaryDesc->ModeDesc.RefreshRate));
      }
    }
  }
}

I think I understand what it does - find the refresh rate as a fraction and compare to the existing one (ignoring a small difference as sometimes 60Hz is reported as say 60.06Hz) - but I can't see why there is an upper limit and the diff here prevents the code running.

BUT when I change diff < 0.1 to diff <1 the code runs but the refresh rate on the screen still does not change!

Thanks for looking
Andy
New debug log - https://paste.kodi.tv/cufinoxoto.kodi - that corresponds with screenshot - https://ibb.co/4YL6fcm

Thanks
Andy
I don't have time to look at this right now but before thinking that there is a bug in the code (that absolutely no one else has reported), the logical thing is to think that it is a problem in your Kodi settings / setup.

Why don't you try a clean install?

without advancedsettings

What it is?
xml:

 <video>
   <latency>
     <delay>200</delay>
   </latency>
 </video>

And you better use regular Kodi master or Matrix as the build you are using tries to solve a problem you don't have as it only affects systems with Intel HDMI audio.
Don't worry. I'm sure I'll figure it out. Please close this thread.
PS - tried with vanilla build and it still happens. The setting above is to do with a global audio sync offset. (I have tried with and without).