RetroArch icon indicating copy to clipboard operation
RetroArch copied to clipboard

DISPMANX - triple buffer disable likely cause of extreme slowdown

Open dukesilverfan opened this issue 9 years ago • 6 comments

Description

Removal of triple buffer in dispmanx driver is believe to be causing severe slowdowns on RPI across all cores when retroarch.cfg video_driver is set to 'dispmanx'.

Expected behavior

Dispmanx is the preferred video driver for reducing input lag compared to the default gl as shown by testing user brunnis performed. As of the release of RetroPie 4.1, use of dispmanx as the video driver worked perfectly and reduced input lag by one frame across all cores. No slowdown or screen stutter was experienced due to using dispmanx compared to the default video driver gl.

Actual behavior

In the RetroPie 4.2 build, the commit https://github.com/libretro/RetroArch/commit/0b75671c21ec1e891779031b6435ad18debe3e60 is believed to have caused the severe slowdown across all cores on RPI. For example, The Lost Levels on lr-snes98x2010 is unplayable with extreme slowdown and screen stutter. This is verified in other cores such as lr-nestopia and others.

Steps to reproduce the bug

  1. Clean install of RetroPie 4.1 on a Raspberry Pi 3

  2. Change video_driver to 'dispmanx'

  3. All cores work great, no slowdown caused by video driver

  4. Clean install of RetroPie 4.2 on same Raspberry Pi 3

  5. Change video_driver to 'dispmanx'

  6. All cores are choppy, some unplayable. The Lost Levels on lr-snes98x2010 is a great showcase of this.

Bisect Results

This occurred sometime between Nov. 5, 2016 and Mar. 20, 2017, most likely with commit https://github.com/libretro/RetroArch/commit/0b75671c21ec1e891779031b6435ad18debe3e60 on Feb 12, 2017.

Version/Commit

https://github.com/libretro/RetroArch/commit/0b75671c21ec1e891779031b6435ad18debe3e60

Environment information

  • OS: Retropie 4.2

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

dukesilverfan avatar Mar 26 '17 01:03 dukesilverfan

Any chance you could try reverting that commit and re-build to see if that indeed resolves it?

hizzlekizzle avatar Mar 26 '17 02:03 hizzlekizzle

I am new to Git, so I will have to research how to do that on my Pi, but as soon as I learn, I will do that and report back.

dukesilverfan avatar Mar 26 '17 02:03 dukesilverfan

Looks like it reverts cleanly, so you'll just need to do:

git clone https://github.com/libretro/RetroArch.git
cd RetroArch
git revert 0b75671

and then build as normal.

hizzlekizzle avatar Mar 26 '17 02:03 hizzlekizzle

From a quick look, vc_dispmanx_update_submit_sync() might be causing this.

If we assume a refresh rate of e.g. 60Hz, then the interval between frames is around 16ms. Under the assumption that the calls to dispmanx_surface_update() are equally distributed in this interval, then submit_sync() blocks for 8ms on average. Which is quite a lot.

ghost avatar Mar 27 '17 16:03 ghost

seems to work fine following https://github.com/libretro/RetroArch/pull/4862

won't be in retropie as that builds 1.5.0, but retropie seems to have its own solution.

dankcushions avatar Apr 29 '17 11:04 dankcushions

This seems to be a fixed issue so I am going to close it.

orbea avatar Dec 26 '18 02:12 orbea