libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.29k stars 1.83k forks source link

Poor performance/framerate when running on Steam Link #4950

Open benwbooth opened 7 years ago

benwbooth commented 7 years ago

Description

I am running RetroArch on Windows 10, streaming to the Steam Link connected to my TV. I am not running RetroArch directly on the steam link. My Samsung TV is set to "game mode". My video card is a NVidia GTX 770. I have GeForce experience installed and the steam link overlay reports the encoding as "Steam D3D10 NV12 + NVENC H264".

When running any cores, especially 2D systems on the Steam Link, I am seeing what appears to be a very poor framerate. For example, I have tried running RetroArch on the Steam Link using the nestopia core to play a 2D sidescrolling game, e.g. Legacy of the Wizard. When scrolling occurs it appears as if the game is running at ~20fps, even though both RetroArch and the steam link performance overlay report a consistent ~60fps. Any sidescrolling game feels very laggy and choppy, to the point of being unplayable.

I have tried other emulators, such as Nestopia directly, playing the same games, which look great and scroll smoothly. So this appears to be a bad interaction between RetroArch and the way the Steam Link captures video.

I have tried using different drivers, e.g. SDL, vulkan, gl, D3D. I have also tried tweaking the framerate settings, the vsync settings, the GPU sync settings, with no improvement.

My best guess is that there is some synchronization issue between RetroArch and the steam link's streaming capture, so that frames are being skipped.

Expected behavior

For games to have smooth scrolling like other emulators.

Actual behavior

Sidescrolling games on steam link display very choppy scrolling.

Steps to reproduce the bug

  1. Add RetroArch as a non-steam game in Steam
  2. Start RetroArch from the steam link
  3. Choose any 2D sidescrolling game with any core

Bisect Results

I don't know when it started

Version/Commit

Environment information

andres-asm commented 7 years ago

This seems more like a GPU driver issue than our fault. On nvidia control panel, go control go to 3d settings, and add a profile for retroarch like this

image

What's likely happening is that the GPU is detecting it as a low demanding game and throttling down.

benwbooth commented 7 years ago

Thanks for the reply! Unfortunately, setting the power management mode in the nvidia settings didn't fix the problem. I don't think it's solely a GPU driver issue since the game runs smoothly when I play it directly on my PC. It's only when I play over the steam link that the framerate seems to drop. I tried fiddling with some of the other settings in the nvidia control panel (vsync, etc.) but none of them fixed the problem.

benwbooth commented 7 years ago

Actually, I just tested RetroArch using the vulkan backend, and the problem is fixed! I get smooth framerates now. I've tried the vulkan backend before, and it didn't help. I'm wondering if there was a NVidia driver update that fixed streaming under vulkan.

The gl backend still has this issue though.

andres-asm commented 7 years ago

I don't own a steam link, but I can try with gamestream

Nargash commented 7 years ago

To add another case of this, I'm experiencing very similar symptoms but I'm using an AMD 7950 on the 17.4.4 driver. The FPS (both that reported by the Steam Link's performance graph and the counter in Retroarch itself) is consistently around 30 fps when using the GL video driver. When running on the host PC, the FPS is 60+.

I've already taken some other steps to ensure it isn't the network that is the bottleneck, and in fact other Steam games like Portal 2 give much better performance over Steam in-home streaming than Retroarch with the GL driver!